diff --git a/dbPort/.classpath b/dbPort/.classpath new file mode 100644 index 0000000000..cf387e1f55 --- /dev/null +++ b/dbPort/.classpath @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/dbPort/.project b/dbPort/.project new file mode 100644 index 0000000000..2e63ebe2c8 --- /dev/null +++ b/dbPort/.project @@ -0,0 +1,20 @@ + + + dbPort + + + jboss + looks + tools + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/dbPort/ADempiere.launch b/dbPort/ADempiere.launch new file mode 100644 index 0000000000..0bf38285c1 --- /dev/null +++ b/dbPort/ADempiere.launch @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dbPort/GenerateModel.launch b/dbPort/GenerateModel.launch new file mode 100644 index 0000000000..75afa8d2d7 --- /dev/null +++ b/dbPort/GenerateModel.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/dbPort/RUN_build.bat b/dbPort/RUN_build.bat new file mode 100644 index 0000000000..5a18c1005b --- /dev/null +++ b/dbPort/RUN_build.bat @@ -0,0 +1,19 @@ +@Title Build dbPort +@Rem $Header: /cvsroot/adempiere/dbPort/RUN_build.bat,v 1.10 2005/09/16 00:49:04 jjanke Exp $ + +@CALL ..\utils_dev\myDevEnv.bat +@IF NOT %ADEMPIERE_ENV%==Y GOTO NOBUILD + +@echo Cleanup ... +@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main clean + +@echo Building ... +@"%JAVA_HOME%\bin\java" -Dant.home="." %ANT_PROPERTIES% org.apache.tools.ant.Main dist + +@Echo Done ... +@sleep 60 +@exit + +:NOBUILD +@Echo Check myDevEnv.bat (copy from myDevEnvTemplate.bat) +@Pause \ No newline at end of file diff --git a/dbPort/RUN_build.sh b/dbPort/RUN_build.sh new file mode 100644 index 0000000000..5f80633c60 --- /dev/null +++ b/dbPort/RUN_build.sh @@ -0,0 +1,18 @@ +# Module compiling script +# Ported from Windows script Marek Mosiewicz + + +SAVED_DIR=`pwd` #save current dir +cd `dirname $0`/../utils_dev #change dir to place where script resides - doesn not work with sym links +UTILS_DEV=`pwd` #this is adempiere source +cd $SAVED_DIR #back to the saved directory + +. $UTILS_DEV/myDevEnv.sh #call environment +echo done +if [ ! $ADEMPIERE_ENV==Y ] ; then + echo "Can't set developemeent environemnt - check myDevEnv.sh" + exit 1 +fi + +echo running Ant +$JAVA_HOME/bin/java -Dant.home="." $ANT_PROPERTIES org.apache.tools.ant.Main diff --git a/dbPort/build.xml b/dbPort/build.xml new file mode 100644 index 0000000000..94d9954118 --- /dev/null +++ b/dbPort/build.xml @@ -0,0 +1,102 @@ + + + + + + + + + This buildfile is used to build the dbPort subproject within + the Adempiere project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dbPort/dbPort.html b/dbPort/dbPort.html new file mode 100644 index 0000000000..5a0f4d264a --- /dev/null +++ b/dbPort/dbPort.html @@ -0,0 +1,33 @@ + + + +JBuilder Project dbPort.jpx + + +

Project dbPort Notes

+
+ + + + +
Title: + + +
Author: + + +
Company: + + +
Description: + + +

+

Things to do...

+
    + +
  1. First +
  2. Second +
+ + diff --git a/dbPort/documentation.bat b/dbPort/documentation.bat new file mode 100644 index 0000000000..659c934f80 --- /dev/null +++ b/dbPort/documentation.bat @@ -0,0 +1,5 @@ +@Rem API Documentation for Base + +call ..\doc\documentation.bat src doc -private + +@pause \ No newline at end of file diff --git a/dbPort/packages.txt b/dbPort/packages.txt new file mode 100644 index 0000000000..0efb2bb2e7 --- /dev/null +++ b/dbPort/packages.txt @@ -0,0 +1,2 @@ +org.compiere.db +org.compiere.dbPort \ No newline at end of file diff --git a/dbPort/src/org/adempiere/util/GenerateModelJPA.java b/dbPort/src/org/adempiere/util/GenerateModelJPA.java new file mode 100755 index 0000000000..6b5f0b04f6 --- /dev/null +++ b/dbPort/src/org/adempiere/util/GenerateModelJPA.java @@ -0,0 +1,834 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 Adempiere Fundation. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * or via info@adempiere.org or http://www.adempiere.org/license.html * + * Enterprise: e-Evolution,SC + * Contributor: Victor Perez Juarez + *****************************************************************************/ +package org.adempiere.util; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.util.logging.*; +import org.compiere.*; +import org.compiere.util.*; + +/** + * Generate Model Classes extending PO. + * Base class for CMP interface - will be extended to create byte code directly + * + * @author Jorg Janke + * @version $Id: GenerateModel.java,v 1.5 2006/07/30 00:54:36 jjanke Exp $ + */ +public class GenerateModelJPA +{ + /** + * Generate PO Class + * @param AD_Table_ID table id + * @param directory directory with \ or / at the end. + * @param packageName package name + */ + public GenerateModelJPA (int AD_Table_ID, String directory, String packageName) + { + // create column access methods + StringBuffer mandatory = new StringBuffer(); + StringBuffer sb = createColumns(AD_Table_ID, mandatory); + // add header stuff + String tableName = createHeader(AD_Table_ID, sb, mandatory, packageName); + // Save it + writeToFile (sb, directory + tableName + ".java"); + } // GenerateModel + + /** File Header */ + public static final String COPY = + "/******************************************************************************\n" + +" * Product: Adempiere ERP & CRM Smart Business Solution *\n" + +" * Copyright (C) 1999-2006 Adempiere Fundation. All Rights Reserved. *\n" + +" * This program is free software; you can redistribute it and/or modify it *\n" + +" * under the terms version 2 of the GNU General Public License as published *\n" + +" * by the Free Software Foundation. This program is distributed in the hope *\n" + +" * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *\n" + +" * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *\n" + +" * See the GNU General Public License for more details. *\n" + +" * You should have received a copy of the GNU General Public License along *\n" + +" * with this program; if not, write to the Free Software Foundation, Inc., *\n" + //+" * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *\n" + //+" * For the text or an alternative of this public license, you may reach us *\n" + +" * or via info@adempiere.org or http://www.adempiere.org/license.html *\n" + +" * Enterprise: e-Evolution,SC www.e-evolution.com *\n" + +" * Contributor: Victor Perez Juarez *\n" + +" *****************************************************************************/\n"; + + /** Generated on */ + private Timestamp s_run = new Timestamp(System.currentTimeMillis()); + + /** Logger */ + private static CLogger log = CLogger.getCLogger (GenerateModelJPA.class); + + /** + * Add Header info to buffer + * @param AD_Table_ID table + * @param sb buffer + * @param mandatory init call for mandatory columns + * @param packageName package name + * @return class name + */ + private String createHeader (int AD_Table_ID, StringBuffer sb, StringBuffer mandatory, String packageName) + { + String tableName = ""; + int accessLevel = 0; + String sql = "SELECT TableName, AccessLevel FROM AD_Table WHERE AD_Table_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Table_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + tableName = rs.getString(1); + accessLevel = rs.getInt(2); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + if (tableName == null) + throw new RuntimeException ("TableName not found for ID=" + AD_Table_ID); + // + String accessLevelInfo = accessLevel + " "; + if (accessLevel >= 4 ) + accessLevelInfo += "- System "; + if (accessLevel == 2 || accessLevel == 3 || accessLevel == 6 || accessLevel == 7) + accessLevelInfo += "- Client "; + if (accessLevel == 1 || accessLevel == 3 || accessLevel == 5 || accessLevel == 7) + accessLevelInfo += "- Org "; + + String keyColumn = tableName + "_ID"; + //String className = "X_" + tableName; + String className = "" + tableName; + // + StringBuffer start = new StringBuffer () + .append (COPY) + .append ("package " + packageName + ";\n" + + "/** Generated Model JPA - DO NOT CHANGE */\n"); + if (!packageName.equals("org.adempiere.model")) + start.append("import org.adempiere.model.*;"); + start.append("import java.util.*;" + + "import java.sql.*;" + + "import java.math.*;" + + "import javax.persistence.*;" + + "import org.compiere.util.*;" + + "import org.adempiere.util.*;" + // Class + + "/** Generated Model for ").append(tableName).append("\n" + + " * @author Victor Perez (generated) \n" + + " * @version ").append(Adempiere.MAIN_VERSION).append(" - ").append(s_run).append(" */\n" + + " @Entity" + + "@Table(name=\""+ tableName +"\")" + + "public class ").append(className).append(" extends PO" + + " implements java.io.Serializable " + + "{" + // Standard Constructor + + "/** Standard Constructor\n@param ctx context\n@param " + + keyColumn + " id\n@param trxName transaction\n*/\n" + + "public ").append(className).append(" (Properties ctx, int ").append(keyColumn) + .append(", String trxName)" + + "{" + + "super (ctx, ").append(keyColumn).append(", trxName);" + + "/** if (").append(keyColumn).append(" == 0)" + + "{").append(mandatory).append("} */\n" + + "}" // Constructor End + // Short Constructor +// + "/** Short Constructor */\n" +// + "public ").append(className).append(" (Properties ctx, int ").append(keyColumn).append(")" +// + "{" +// + "this (ctx, ").append(keyColumn).append(", null);" +// + "}" // Constructor End + + // Load Constructor + + "/** Load Constructor \n@param ctx context\n@param rs result set \n@param trxName transaction\n*/\n" + + "public ").append(className).append(" (Properties ctx, ResultSet rs, String trxName)" + + "{" + + "super (ctx, rs, trxName);" + + "}" // Load Constructor End + // + + "/** AD_Table_ID=").append(AD_Table_ID).append(" */\n" + + "public static final int Table_ID=").append(AD_Table_ID).append(";\n" + // + + "/** TableName=").append(tableName).append(" */\n" + + "public static final String Table_Name=\"").append(tableName).append("\";\n" + + "protected static KeyNamePair Model = new KeyNamePair(").append(AD_Table_ID).append(",\"").append(tableName).append("\");\n" + // + + "protected BigDecimal accessLevel = new BigDecimal(").append(accessLevel).append(");" + + "/** AccessLevel\n@return ").append(accessLevelInfo).append("\n*/\n" + + "protected int get_AccessLevel()" + + "{" + + "return accessLevel.intValue();" + + "}" + // + + "/** Load Meta Data\n@param ctx context\n@return PO Info\n*/\n" + + "protected POInfo initPO (Properties ctx)" + + "{" + + "POInfo poi = POInfo.getPOInfo (ctx, Table_ID);" + + "return poi;" + + "}" // initPO + // + + "/** Info\n@return info\n*/\n" + + "public String toString()" + + "{" + + "StringBuffer sb = new StringBuffer (\"").append(className).append("[\")" + + ".append(get_ID()).append(\"]\");" + + "return sb.toString();" + + "}"); + + StringBuffer end = new StringBuffer ("}"); + // + sb.insert(0, start); + sb.append(end); + + return className; + } // createHeader + + + /** + * Create Column access methods + * @param AD_Table_ID table + * @param mandatory init call for mandatory columns + * @return set/get method + */ + private StringBuffer createColumns (int AD_Table_ID, StringBuffer mandatory) + { + StringBuffer sb = new StringBuffer(); + String sql = "SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory," // 1..3 + + " c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, " // 4..7 + + " c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, " // 8..12 + + " c.Name, c.Description, c.ColumnSQL, c.IsEncrypted " + + "FROM AD_Column c " + + "WHERE c.AD_Table_ID=?" + + " AND c.IsActive='Y'" + + " AND c.ColumnName <> 'AD_Client_ID'" + + " AND c.ColumnName <> 'AD_Org_ID'" + + " AND c.ColumnName <> 'IsActive'" + + " AND c.ColumnName NOT LIKE 'Created%'" + + " AND c.ColumnName NOT LIKE 'Updated%' " + + "ORDER BY c.ColumnName"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Table_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String columnName = rs.getString(1); + boolean isUpdateable = "Y".equals(rs.getString(2)); + boolean isMandatory = "Y".equals(rs.getString(3)); + int displayType = rs.getInt(4); + int AD_Reference_Value_ID = rs.getInt(5); + String defaultValue = rs.getString(6); + int seqNo = rs.getInt(7); + int fieldLength = rs.getInt(8); + String ValueMin = rs.getString(9); + String ValueMax = rs.getString(10); + String VFormat = rs.getString(11); + String Callout = rs.getString(12); + String Name = rs.getString(13); + String Description = rs.getString(14); + String ColumnSQL = rs.getString(15); + boolean virtualColumn = ColumnSQL != null && ColumnSQL.length() > 0; + boolean IsEncrypted = "Y".equals(rs.getString(16)); + // + sb.append("@Column(name=\"" + Name+"\") "); + sb.append(createColumnMethods (mandatory, + columnName, isUpdateable, isMandatory, + displayType, AD_Reference_Value_ID, fieldLength, + defaultValue, ValueMin, ValueMax, VFormat, + Callout, Name, Description, virtualColumn, IsEncrypted)); + // + if (seqNo == 1) + sb.append(createKeyNamePair(columnName, displayType)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return sb; + } // createColumns + + /** + * Create set/get methods for column + * @param mandatory init call for mandatory columns + * @param columnName column name + * @param isUpdateable updateable + * @param isMandatory mandatory + * @param displayType display type + * @param AD_Reference_ID validation reference + * @param fieldLength int + * @param defaultValue default value + * @param ValueMin String + * @param ValueMax String + * @param VFormat String + * @param Callout String + * @param Name String + * @param Description String + * @param virtualColumn virtual column + * @param IsEncrypted stored encrypted + @return set/get method + */ + private String createColumnMethods (StringBuffer mandatory, + String columnName, boolean isUpdateable, boolean isMandatory, + int displayType, int AD_Reference_ID, int fieldLength, + String defaultValue, String ValueMin, String ValueMax, String VFormat, + String Callout, String Name, String Description, + boolean virtualColumn, boolean IsEncrypted) + { + // Clazz + Class clazz = DisplayType.getClass(displayType, true); + if (defaultValue == null) + defaultValue = ""; + if (DisplayType.isLOB(displayType)) // No length check for LOBs + fieldLength = 0; + + // Handle Posted + if (columnName.equalsIgnoreCase("Posted") + || columnName.equalsIgnoreCase("Processed") + || columnName.equalsIgnoreCase("Processing")) + { + clazz = Boolean.class; + AD_Reference_ID = 0; + } + // Record_ID + else if (columnName.equalsIgnoreCase("Record_ID")) + { + clazz = Integer.class; + AD_Reference_ID = 0; + } + // String Key + else if (columnName.equalsIgnoreCase("AD_Language") + || columnName.equalsIgnoreCase("EntityType")) + { + clazz = String.class; + } + // Data Type + String dataType = clazz.getName(); + dataType = dataType.substring(dataType.lastIndexOf('.')+1); + if (dataType.equals("Boolean")) + dataType = "boolean"; + else if (dataType.equals("Integer")) + dataType = "int"; + else if (displayType == DisplayType.Binary) + dataType = "byte[]"; + + + StringBuffer sb = new StringBuffer(); + // ****** Set Comment ****** + sb.append("/** Set ").append(Name); + sb.append(".\n@param ").append(columnName).append(" "); + if (Description != null && Description.length() > 0) + sb.append(Description); + else + sb.append(Name); + sb.append(" */\n"); + + // Set ******** + String setValue = "set_Value"; + if (IsEncrypted) + setValue = "set_ValueE"; + // public void setColumn (xxx variable) + sb.append("public "); + if (!isUpdateable) + { + setValue = "set_ValueNoCheck"; + if (IsEncrypted) + setValue = "set_ValueNoCheckE"; + } + sb.append("void set").append(columnName).append(" (").append(dataType).append(" ").append(columnName).append(")" + + "{"); + // List Validation + if (AD_Reference_ID != 0) + { + String staticVar = addListValidation (sb, AD_Reference_ID, columnName, !isMandatory); + sb.insert(0, staticVar); // first check + } + // setValue ("ColumnName", xx); + if (virtualColumn) + { + sb.append ("throw new IllegalArgumentException (\"").append(columnName).append(" is virtual column\");"); + } + else if (clazz.equals(Integer.class)) + { + if (columnName.endsWith("_ID")) + { + if (isMandatory) // check mandatory ID + { + int firstOK = 1; // Valid ID 0 + if (columnName.equals("AD_Client_ID") || columnName.equals("AD_Org_ID") + || columnName.equals("Record_ID") || columnName.equals("C_DocType_ID") + || columnName.equals("Node_ID") || columnName.equals("AD_Role_ID") + || columnName.equals("M_AttributeSet_ID") || columnName.equals("M_AttributeSetInstance_ID")) + firstOK = 0; + sb.append("if (").append (columnName) + .append (" < ").append(firstOK).append(") throw new IllegalArgumentException (\"") + .append(columnName).append(" is mandatory.\");"); + } + else // set optional _ID to null if 0 + sb.append("if (").append (columnName).append (" <= 0) ") + .append(setValue).append(" (\"").append(columnName).append("\", null); else \n"); + } + sb.append(setValue).append(" (\"").append(columnName).append("\", new Integer(").append(columnName).append("));"); + } + else if (clazz.equals(Boolean.class)) + sb.append(setValue).append(" (\"").append(columnName).append("\", new Boolean(").append(columnName).append("));"); + else + { + if (isMandatory && AD_Reference_ID == 0) // does not apply to int/boolean + { + sb.append("if (") + .append (columnName).append (" == null)" + + " throw new IllegalArgumentException (\"") + .append(columnName).append(" is mandatory.\");"); + } + // String length check + if (clazz.equals(String.class) && fieldLength > 0) + { + sb.append ("if ("); + if (!isMandatory) + sb.append(columnName).append(" != null && "); + sb.append(columnName).append(".length() > ").append(fieldLength) + .append("){log.warning(\"Length > ") + .append(fieldLength).append(" - truncated\");") + .append(columnName).append(" = ") + .append(columnName).append(".substring(0,").append(fieldLength-1).append(");}"); + } + + // + sb.append (setValue).append(" (\"").append (columnName).append ("\", ") + .append (columnName).append (");"); + } + sb.append("}"); + + // Mandatory call in constructor + if (isMandatory) + { + mandatory.append("set").append(columnName).append(" ("); + if (clazz.equals(Integer.class)) + mandatory.append("0"); + else if (clazz.equals(Boolean.class)) + { + if (defaultValue.indexOf('Y') != -1) + mandatory.append(true); + else + mandatory.append("false"); + } + else if (clazz.equals(BigDecimal.class)) + mandatory.append("Env.ZERO"); + else if (clazz.equals(Timestamp.class)) + mandatory.append("new Timestamp(System.currentTimeMillis())"); + else + mandatory.append("null"); + mandatory.append(");"); + if (defaultValue.length() > 0) + mandatory.append("// ").append(defaultValue).append(Env.NL); + } + + + // ****** Get Comment ****** + sb.append("/** Get ").append(Name); + if (Description != null && Description.length() > 0) + sb.append(".\n@return ").append(Description); + else + sb.append(".\n@return ").append(Name); + sb.append(" */\n"); + + // Get ******** + String getValue = "get_Value"; + if (IsEncrypted) + getValue = "get_ValueE"; + sb.append("public ").append(dataType); + if (clazz.equals(Boolean.class)) + { + sb.append(" is"); + if (columnName.toLowerCase().startsWith("is")) + sb.append(columnName.substring(2)); + else + sb.append(columnName); + } + else + sb.append(" get").append(columnName); + sb.append("() {"); + if (clazz.equals(Integer.class)) + sb.append("Integer ii = (Integer)") + .append(getValue).append("(\"").append(columnName).append("\");" + + "if (ii == null)" + + " return 0;" + + "return ii.intValue();"); + else if (clazz.equals(BigDecimal.class)) + sb.append("BigDecimal bd = (BigDecimal)").append(getValue) + .append("(\"").append(columnName).append("\");" + + "if (bd == null)" + + " return Env.ZERO;" + + "return bd;"); + else if (clazz.equals(Boolean.class)) + sb.append("Object oo = ").append(getValue) + .append("(\"").append(columnName).append("\");" + + "if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return \"Y\".equals(oo);}" + + "return false;"); + else if (dataType.equals("Object")) + sb.append("return ").append(getValue) + .append("(\"").append(columnName).append("\");"); + else + sb.append("return (").append(dataType).append(")").append(getValue) + .append("(\"").append(columnName).append("\");"); + sb.append("}"); + // + return sb.toString(); + } // createColumnMethods + + + /** + * Add List Validation + * @param sb buffer - example: + if (NextAction.equals("N") || NextAction.equals("F")); + else throw new IllegalArgumentException ("NextAction Invalid value - Reference_ID=219 - N - F"); + * @param AD_Reference_ID reference + * @param columnName column + * @param nullable the validation must allow null values + * @return static parameter - Example: + public static final int NEXTACTION_AD_Reference_ID=219; + public static final String NEXTACTION_None = "N"; + public static final String NEXTACTION_FollowUp = "F"; + */ + private String addListValidation (StringBuffer sb, int AD_Reference_ID, + String columnName, boolean nullable) + { + StringBuffer retValue = new StringBuffer(); + retValue.append("\n/** ").append(columnName).append(" AD_Reference_ID=").append(AD_Reference_ID) .append(" */\n") + .append("public static final int ").append(columnName.toUpperCase()) + .append("_AD_Reference_ID=").append(AD_Reference_ID).append(";"); + // + boolean found = false; + StringBuffer values = new StringBuffer("Reference_ID=") + .append(AD_Reference_ID); + StringBuffer statement = new StringBuffer(); + if (nullable) + statement.append("if (").append(columnName).append(" == null"); + // + String sql = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Reference_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String value = rs.getString(1); + values.append(" - ").append(value); + if (statement.length() == 0) + statement.append("if (").append(columnName) + .append(".equals(\"").append(value).append("\")"); + else + statement.append(" || ").append(columnName) + .append(".equals(\"").append(value).append("\")"); + if (!found) + { + found = true; + sb.append("if (") + .append (columnName).append (" == null)" + + " throw new IllegalArgumentException (\"") + .append(columnName).append(" is mandatory\");"); + } + // Name (SmallTalkNotation) + String name = rs.getString(2); + char[] nameArray = name.toCharArray(); + StringBuffer nameClean = new StringBuffer(); + boolean initCap = true; + for (int i = 0; i < nameArray.length; i++) + { + char c = nameArray[i]; + if (Character.isJavaIdentifierPart(c)) + { + if (initCap) + nameClean.append(Character.toUpperCase(c)); + else + nameClean.append(c); + initCap = false; + } + else + { + if (c == '+') + nameClean.append("Plus"); + else if (c == '-') + nameClean.append("_"); + else if (c == '>') + { + if (name.indexOf('<') == -1) // ignore + nameClean.append("Gt"); + } + else if (c == '<') + { + if (name.indexOf('>') == -1) // ignore + nameClean.append("Le"); + } + else if (c == '!') + nameClean.append("Not"); + else if (c == '=') + nameClean.append("Eq"); + else if (c == '~') + nameClean.append("Like"); + initCap = true; + } + } + retValue.append("/** ").append(name).append(" = ").append(value).append(" */\n"); + retValue.append("public static final String ").append(columnName.toUpperCase()) + .append("_").append(nameClean) + .append(" = \"").append(value).append("\";"); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + found = false; + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + statement.append(")" + + "; " + + "else " + + "throw new IllegalArgumentException (\"").append(columnName) + .append(" Invalid value - \" + ").append(columnName) + .append(" + \" - ").append(values).append("\");"); + // + if (found && !columnName.equals("EntityType")) + sb.append (statement); + return retValue.toString(); + } // addListValidation + + /** + * Create getKeyNamePair() method with first identifier + * @param columnName name + * * @param displayType int + @return method code + */ + private StringBuffer createKeyNamePair (String columnName, int displayType) + { + String method = "get" + columnName + "()"; + if (displayType != DisplayType.String) + method = "String.valueOf(" + method + ")"; + StringBuffer sb = new StringBuffer("/** Get Record ID/ColumnName\n@return ID/ColumnName pair\n*/" + + "public KeyNamePair getKeyNamePair() " + + "{return new KeyNamePair(get_ID(), ").append(method).append(");}"); + return sb; + } // createKeyNamePair + + + /************************************************************************** + * Write to file + * @param sb string buffer + * @param fileName file name + */ + private void writeToFile (StringBuffer sb, String fileName) + { + try + { + File out = new File (fileName); + FileWriter fw = new FileWriter (out); + for (int i = 0; i < sb.length(); i++) + { + char c = sb.charAt(i); + // after + if (c == ';' || c == '}') + { + fw.write (c); + if (sb.substring(i+1).startsWith("//")) + fw.write('\t'); + else + fw.write(Env.NL); + } + // before & after + else if (c == '{') + { + fw.write(Env.NL); + fw.write (c); + fw.write(Env.NL); + } + else + fw.write (c); + } + fw.flush (); + fw.close (); + float size = out.length(); + size /= 1024; + log.info(out.getAbsolutePath() + " - " + size + " kB"); + } + catch (Exception ex) + { + log.log(Level.SEVERE, fileName, ex); + } + } // writeToFile + + /** + * String representation + * @return string representation + */ + public String toString() + { + StringBuffer sb = new StringBuffer ("GenerateModel[") + .append("]"); + return sb.toString(); + } // toString + + + + /************************************************************************** + * Generate PO Model Class. + *
+	 * 	Example: java GenerateModel.class mydirectory myPackage 'U','A'
+	 * 	would generate entity type User and Application classes into mydirectory.
+	 * 	Without parameters, the default is used:
+	 * 	C:\Adempiere\adempiere-all\extend\src\adempiere\model\ adempiere.model 'U','A'
+	 * 	
+ * @param args directory package entityType + * - directory where to save the generated file + * - package of the classes to be generated + * - entityType to be generated + */ + public static void main (String[] args) + { + org.compiere.Adempiere.startupEnvironment(true); + CLogMgt.setLevel(Level.FINE); + // CLogMgt.setLevel(Level.ALL); + log.info("Generate Model $Revision: 1.5 $"); + log.info("----------------------------------"); + // first parameter + String directory = "/app/adempiere/adempiere_branch_3.1.1/dbPort/src/org/adempiere/model/"; + if (args.length > 0) + directory = args[0]; + if (directory == null || directory.length() == 0) + { + System.err.println("No Directory"); + System.exit(1); + } + log.info("Directory: " + directory); + + // second parameter + String packageName = "adempiere.model"; + if (args.length > 1) + packageName = args[1]; + if (packageName == null || packageName.length() == 0) + { + System.err.println("No package"); + System.exit(1); + } + log.info("Package: " + packageName); + + // third parameter + String entityType = "'U','A','D'"; // User, Application + if (args.length > 2) + entityType = args[2]; + if (entityType == null || entityType.length() == 0) + { + System.err.println("No EntityType"); + System.exit(1); + } + StringBuffer sql = new StringBuffer("EntityType IN (") + .append(entityType).append(")"); + log.info(sql.toString()); + log.info("----------------------------------"); + + // complete sql + sql.insert(0, "SELECT AD_Table_ID " + + "FROM AD_Table " + + "WHERE (TableName IN ('RV_WarehousePrice','RV_BPartner')" // special views + + " OR IsView='N')" + + " AND TableName NOT LIKE '%_Trl' AND "); + sql.append(" ORDER BY TableName"); + + // + int count = 0; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql.toString(), null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + new GenerateModelJPA(rs.getInt(1), directory, packageName); + count++; + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.severe("main - " + e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + log.info("Generated = " + count); + + } // main + +} // GenerateModel diff --git a/dbPort/src/org/compiere/Adempiere.java b/dbPort/src/org/compiere/Adempiere.java new file mode 100644 index 0000000000..894a0a30ba --- /dev/null +++ b/dbPort/src/org/compiere/Adempiere.java @@ -0,0 +1,572 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere; + +import java.awt.*; +import java.io.*; +import java.net.*; +import java.util.logging.*; +import javax.jnlp.*; +import javax.swing.*; +import org.compiere.db.*; +import org.compiere.model.*; +import org.compiere.plaf.*; +import org.compiere.util.*; +import com.qoppa.pdf.*; + +/** + * Adempiere Control Class + * + * @author Jorg Janke + * @version $Id: Adempiere.java,v 1.8 2006/08/11 02:58:14 jjanke Exp $ + */ +public final class Adempiere +{ + /** Timestamp */ + static public final String ID = "$Id: Adempiere.java,v 1.8 2006/08/11 02:58:14 jjanke Exp $"; + /** Main Version String */ + static public final String MAIN_VERSION = "Release 3.1.1"; + /** Detail Version as date Used for Client/Server */ + static public final String DATE_VERSION = "2006-08-10"; + /** Database Version as date Compared with AD_System */ + static public final String DB_VERSION = "2006-08-10"; + + /** Product Name */ + static public final String NAME = "Adempiere\u00AE"; + /** URL of Product */ + static public final String URL = "www.adempiere.org"; + /** 16*16 Product Image. + /** Removing/modifying the Adempiere logo is a violation of the license */ + static private final String s_File16x16 = "images/AD16.gif"; + /** 32*32 Product Image. + /** Removing/modifying the Adempiere logo is a violation of the license */ + static private final String s_file32x32 = "images/AD32.gif"; + /** 100*30 Product Image. + /** Removing/modifying the Adempiere logo is a violation of the license */ + static private final String s_file100x30 = "images/AD10030.png"; + /** Removing/modifying the Adempiere logo is a violation of the license */ + static private final String s_file100x30HR = "images/AD10030HR.png"; + /** 48*15 Product Image. + /** Removing/modifying the Adempiere logo is a violation of the license */ + static private final String s_file48x15 = "images/Adempiere.png"; + /** Removing/modifying the Adempiere logo is a violation of the license */ + static private final String s_file48x15HR = "images/AdempiereHR.png"; + /** Support Email */ + static private String s_supportEmail = ""; + + /** Subtitle */ + static public final String SUB_TITLE = "The Open Source Profesional ERP,CRM and SCM "; + /** Adempiere is a wordwide registered Trademark + * - Don't modify this - Program will someday fail unexpectedly */ + static public final String ADEMPIERE_R = "Adempiere\u00AE"; + /** Copyright Notice - Don't modify this - Program will someday fail unexpectedly + * it also violates the license and you'll be held liable for any damage claims */ + static public final String COPYRIGHT = "\u00A9 1999-2006 Adempiere \u00AE"; + + static private String s_ImplementationVersion = null; + static private String s_ImplementationVendor = null; + + static private Image s_image16; + static private Image s_image48x15; + static private Image s_imageLogo; + static private ImageIcon s_imageIcon32; + static private ImageIcon s_imageIconLogo; + + /** Logging */ + private static CLogger log = null; + + /** + * Get Product Name + * @return Application Name + */ + public static String getName() + { + return NAME; + } // getName + + /** + * Get Product Version + * @return Application Version + */ + public static String getVersion() + { + return MAIN_VERSION + " - " + DATE_VERSION; + } // getVersion + + /** + * Short Summary (Windows) + * @return summary + */ + public static String getSum() + { + StringBuffer sb = new StringBuffer(); + sb.append(NAME).append(" ").append(MAIN_VERSION).append(SUB_TITLE); + return sb.toString(); + } // getSum + + /** + * Summary (Windows). + * Removing/modifying the Adempiere copyright notice is a violation of the license + * Adempiere(tm) Version 2.5.1a_2004-03-15 - Smart ERP & CRM - Copyright (c) 1999-2005 Jorg Janke; Implementation: 2.5.1a 20040417-0243 - (C) 1999-2005 Jorg Janke, Adempiere Inc. USA + * @return Summary in Windows character set + */ + public static String getSummary() + { + StringBuffer sb = new StringBuffer(); + sb.append(NAME).append(" ") + .append(MAIN_VERSION).append("_").append(DATE_VERSION) + .append(" -").append(SUB_TITLE) + .append("- ").append(COPYRIGHT) + .append("; Implementation: ").append(getImplementationVersion()) + .append(" - ").append(getImplementationVendor()); + return sb.toString(); + } // getSummary + + /** + * Set Package Info + */ + private static void setPackageInfo() + { + if (s_ImplementationVendor != null) + return; + + Package adempierePackage = Package.getPackage("org.compiere"); + s_ImplementationVendor = adempierePackage.getImplementationVendor(); + s_ImplementationVersion = adempierePackage.getImplementationVersion(); + if (s_ImplementationVendor == null) + { + s_ImplementationVendor = "not supported"; + s_ImplementationVersion = "unknown"; + } + } // setPackageInfo + + /** + * Get Jar Implementation Version + * @return Implementation-Version + */ + public static String getImplementationVersion() + { + if (s_ImplementationVersion == null) + setPackageInfo(); + return s_ImplementationVersion; + } // getImplementationVersion + + /** + * Get Jar Implementation Vendor + * @return Implementation-Vendor + */ + public static String getImplementationVendor() + { + if (s_ImplementationVendor == null) + setPackageInfo(); + return s_ImplementationVendor; + } // getImplementationVendor + + /** + * Get Checksum + * @return checksum + */ + public static int getCheckSum() + { + return getSum().hashCode(); + } // getCheckSum + + /** + * Summary in ASCII + * @return Summary in ASCII + */ + public static String getSummaryAscii() + { + String retValue = getSummary(); + // Registered Trademark + retValue = Util.replace(retValue, "\u00AE", "(r)"); + // Trademark + retValue = Util.replace(retValue, "\u2122", "(tm)"); + // Copyright + retValue = Util.replace(retValue, "\u00A9", "(c)"); + // Cr + retValue = Util.replace(retValue, Env.NL, " "); + retValue = Util.replace(retValue, "\n", " "); + return retValue; + } // getSummaryAscii + + /** + * Get Java VM Info + * @return VM info + */ + public static String getJavaInfo() + { + return System.getProperty("java.vm.name") + + " " + System.getProperty("java.vm.version"); + } // getJavaInfo + + /** + * Get Operating System Info + * @return OS info + */ + public static String getOSInfo() + { + return System.getProperty("os.name") + " " + + System.getProperty("os.version") + " " + + System.getProperty("sun.os.patch.level"); + } // getJavaInfo + + /** + * Get full URL + * @return URL + */ + public static String getURL() + { + return "http://" + URL; + } // getURL + + /** + * Get Sub Title + * @return Subtitle + */ + public static String getSubtitle() + { + return SUB_TITLE; + } // getSubitle + + /** + * Get 16x16 Image. + * Removing/modifying the Adempiere logo is a violation of the license + * @return Image Icon + */ + public static Image getImage16() + { + if (s_image16 == null) + { + Toolkit tk = Toolkit.getDefaultToolkit(); + URL url = org.compiere.Adempiere.class.getResource(s_File16x16); + // System.out.println(url); + if (url == null) + return null; + s_image16 = tk.getImage(url); + } + return s_image16; + } // getImage16 + + /** + * Get 28*15 Logo Image. + * @param hr high resolution + * @return Image Icon + */ + public static Image getImageLogoSmall(boolean hr) + { + if (s_image48x15 == null) + { + Toolkit tk = Toolkit.getDefaultToolkit(); + URL url = null; + if (hr) + url = org.compiere.Adempiere.class.getResource(s_file48x15HR); + else + url = org.compiere.Adempiere.class.getResource(s_file48x15); + // System.out.println(url); + if (url == null) + return null; + s_image48x15 = tk.getImage(url); + } + return s_image48x15; + } // getImageLogoSmall + + /** + * Get Logo Image. + * @return Image Logo + */ + public static Image getImageLogo() + { + if (s_imageLogo == null) + { + Toolkit tk = Toolkit.getDefaultToolkit(); + URL url = org.compiere.Adempiere.class.getResource(s_file100x30); + // System.out.println(url); + if (url == null) + return null; + s_imageLogo = tk.getImage(url); + } + return s_imageLogo; + } // getImageLogo + + /** + * Get 32x32 ImageIcon. + * Removing/modifying the Adempiere logo is a violation of the license + * @return Image Icon + */ + public static ImageIcon getImageIcon32() + { + if (s_imageIcon32 == null) + { + URL url = org.compiere.Adempiere.class.getResource(s_file32x32); + // System.out.println(url); + if (url == null) + return null; + s_imageIcon32 = new ImageIcon(url); + } + return s_imageIcon32; + } // getImageIcon32 + + /** + * Get 100x30 ImageIcon. + * Removing/modifying the Adempiere logo is a violation of the license + * @return Image Icon + */ + public static ImageIcon getImageIconLogo() + { + if (s_imageIconLogo == null) + { + URL url = org.compiere.Adempiere.class.getResource(s_file100x30); + // System.out.println(url); + if (url == null) + return null; + s_imageIconLogo = new ImageIcon(url); + } + return s_imageIconLogo; + } // getImageIconLogo + + /** + * Get default (Home) directory + * @return Home directory + */ + public static String getAdempiereHome() + { + // Try Environment + String retValue = Ini.getAdempiereHome(); + // Look in current Directory + if (retValue == null && System.getProperty("user.dir").indexOf("Adempiere") != -1) + { + retValue = System.getProperty("user.dir"); + int pos = retValue.indexOf("Adempiere"); + retValue = retValue.substring(pos+9); + } + if (retValue == null) + retValue = File.separator + "Adempiere"; + return retValue; + } // getHome + + /** + * Get Support Email + * @return Support mail address + */ + public static String getSupportEMail() + { + return s_supportEmail; + } // getSupportEMail + + /** + * Set Support Email + * @param email Support mail address + */ + public static void setSupportEMail(String email) + { + s_supportEmail = email; + } // setSupportEMail + + /** + * Get JNLP CodeBase + * @return code base or null + */ + public static URL getCodeBase() + { + try + { + BasicService bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService"); + URL url = bs.getCodeBase(); + return url; + } + catch(UnavailableServiceException ue) + { + return null; + } + } // getCodeBase + + /** + * Get JNLP CodeBase Host + * @return code base or null + */ + public static String getCodeBaseHost() + { + URL url = getCodeBase(); + if (url == null) + return null; + return url.getHost(); + } // getCodeBase + + /************************************************************************* + * Startup Client/Server. + * - Print greeting, + * - Check Java version and + * - load ini parameters + * If it is a client, load/set PLAF and exit if error. + * If Client, you need to call startupEnvironment explicitly! + * For testing call method startupEnvironment + * @param isClient true for client + * @return successful startup + */ + public static synchronized boolean startup (boolean isClient) + { + // Already started + if (log != null) + return true; + + // Check Version + if (!Login.isJavaOK(isClient) && isClient) + System.exit(1); + + CLogMgt.initialize(isClient); + Ini.setClient (isClient); // Ini requires Logging + // Init Log + log = CLogger.getCLogger(Adempiere.class); + // Greeting + log.info(getSummaryAscii()); + // log.info(getAdempiereHome() + " - " + getJavaInfo() + " - " + getOSInfo()); + + // Load System environment + // EnvLoader.load(Ini.ENV_PREFIX); + + // System properties + Ini.loadProperties (false); + + // Set up Log + CLogMgt.setLevel(Ini.getProperty(Ini.P_TRACELEVEL)); + if (isClient && Ini.isPropertyBool(Ini.P_TRACEFILE) + && CLogFile.get(false, null, isClient) == null) + CLogMgt.addHandler(CLogFile.get (true, Ini.findAdempiereHome(), isClient)); + + // Set UI + if (isClient) + { + if (CLogMgt.isLevelAll()) + log.log(Level.FINEST, System.getProperties().toString()); + // + //begin vpj-cd e-evolution + //CompiereTheme.load(); + AdempiereThemeInnova.load(); + //end vpj-cd e-evolution + AdempierePLAF.setPLAF (null); + } + + // Set Default Database Connection from Ini + DB.setDBTarget(CConnection.get(getCodeBaseHost())); + + if (isClient) // don't test connection + return false; // need to call + + return startupEnvironment(isClient); + } // startup + + /** + * Startup Adempiere Environment. + * Automatically called for Server connections + * For testing call this method. + * @param isClient true if client connection + * @return successful startup + */ + public static boolean startupEnvironment (boolean isClient) + { + startup(isClient); // returns if already initiated + if (!DB.isConnected()) + { + log.severe ("No Database"); + System.exit(1); + } + // Initialize main cached Singletons + ModelValidationEngine.get(); + try + { + MSystem system = MSystem.get(Env.getCtx()); // Initializes Base Context too + String className = system.getEncryptionKey(); + if (className == null || className.length() == 0) + { + className = System.getProperty(SecureInterface.ADEMPIERE_SECURE); + if (className != null && className.length() > 0 + && !className.equals(SecureInterface.ADEMPIERE_SECURE_DEFAULT)) + { + SecureEngine.init(className); // test it + system.setEncryptionKey(className); + system.save(); + } + } + SecureEngine.init(className); + + // + if (isClient) + MClient.get(Env.getCtx(),0); // Login Client loaded later + else + MClient.getAll(Env.getCtx()); + Document.setKey(system.getSummary()); + } + catch (Exception e) + { + log.warning("Environment problems: " + e.toString()); + } + + // Start Workflow Document Manager (in other package) for PO + String className = null; + try + { + className = "org.compiere.wf.DocWorkflowManager"; + Class.forName(className); + // Initialize Archive Engine + className = "org.compiere.print.ArchiveEngine"; + Class.forName(className); + } + catch (Exception e) + { + log.warning("Not started: " + className + " - " + e.getMessage()); + } + + if (!isClient) + DB.updateMail(); + return true; + } // startupEnvironment + + + /** + * Main Method + * + * @param args optional start class + */ + public static void main (String[] args) + { + Splash.getSplash(); + startup(true); // error exit and initUI + + // Start with class as argument - or if nothing provided with Client + String className = "org.compiere.apps.AMenu"; + for (int i = 0; i < args.length; i++) + { + if (!args[i].equals("-debug")) // ignore -debug + { + className = args[i]; + break; + } + } + // + try + { + Class startClass = Class.forName(className); + startClass.newInstance(); + } + catch (Exception e) + { + System.err.println("Adempiere starting: " + className + " - " + e.toString()); + e.printStackTrace(); + } + } // main +} // Adempiere diff --git a/dbPort/src/org/compiere/Adempiere.properties b/dbPort/src/org/compiere/Adempiere.properties new file mode 100644 index 0000000000..9f2ea5cee5 --- /dev/null +++ b/dbPort/src/org/compiere/Adempiere.properties @@ -0,0 +1 @@ +build=sometime \ No newline at end of file diff --git a/dbPort/src/org/compiere/db/AdempiereDatabase.java b/dbPort/src/org/compiere/db/AdempiereDatabase.java new file mode 100644 index 0000000000..33d7e78daa --- /dev/null +++ b/dbPort/src/org/compiere/db/AdempiereDatabase.java @@ -0,0 +1,276 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.math.*; +import java.sql.*; + +import javax.sql.*; + +//import org.compiere.util.CPreparedStatement; + +/** + * Interface for Adempiere Databases + * + * @author Jorg Janke + * @version $Id: AdempiereDatabase.java,v 1.5 2006/09/22 23:35:19 jjanke Exp $ + */ +public interface AdempiereDatabase +{ + /** + * Get Database Name + * @return database short name + */ + public String getName(); + + /** + * Get Database Description + * @return database long name and version + */ + public String getDescription(); + + /** + * Get and register Database Driver + * @return Driver + * @throws SQLException + */ + public Driver getDriver() throws SQLException; + + + /** + * Get Standard JDBC Port + * @return standard port + */ + public int getStandardPort(); + + /** + * Get Database Connection String + * @param connection Connection Descriptor + * @return connection String + */ + public String getConnectionURL (CConnection connection); + + /** + * Get Connection URL + * @param dbHost db Host + * @param dbPort db Port + * @param dbName db Name + * @param userName user name + * @return url + */ + public String getConnectionURL (String dbHost, int dbPort, String dbName, + String userName); + + /** + * Get Database Connection String + * @param connectionURL Connection URL + * @param userName user name + * @return connection String + */ + public String getConnectionURL (String connectionURL, String userName); + + /** + * Get JDBC Catalog + * @return catalog + */ + public String getCatalog(); + + /** + * Get JDBC Schema + * @return schema + */ + public String getSchema(); + + /** + * Supports BLOB + * @return true if BLOB is supported + */ + public boolean supportsBLOB(); + + /** + * String Representation + * @return info + */ + public String toString(); + + + /************************************************************************** + * Convert an individual Oracle Style statements to target database statement syntax + * + * @param oraStatement oracle statement + * @return converted Statement + */ + public String convertStatement (String oraStatement); + + + + /** + * Check if DBMS support the sql statement + * @sql SQL statement + * @return true: yes + */ + public boolean isSupported(String sql); + + + + + /** + * Get constraint type associated with the index + * @conn connection + * @tableName table name + * @IXName Index name + * @return String[0] = 0: do not know, 1: Primary Key 2: Foreign Key + * String[1] - String[n] = Constraint Name + */ + public String getConstraintType(Connection conn, String tableName, String IXName); + + + /** + * Check and generate an alternative SQL + * @reExNo number of re-execution + * @msg previous execution error message + * @sql previous executed SQL + * @return String, the alternative SQL, null if no alternative + */ + public String getAlternativeSQL(int reExNo, String msg, String sql); + + /** + * Get Name of System User + * @return e.g. sa, system + */ + public String getSystemUser(); + + /** + * Get Name of System Database + * @param databaseName database Name + * @return e.g. master or database Name + */ + public String getSystemDatabase(String databaseName); + + + /** + * Create SQL TO Date String from Timestamp + * + * @param time Date to be converted + * @param dayOnly true if time set to 00:00:00 + * @return date function + */ + public String TO_DATE (Timestamp time, boolean dayOnly); + + /** + * Create SQL for formatted Date, Number + * + * @param columnName the column name in the SQL + * @param displayType Display Type + * @param AD_Language 6 character language setting (from Env.LANG_*) + * + * @return TRIM(TO_CHAR(columnName,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''')) + * or TRIM(TO_CHAR(columnName,'TM9')) depending on DisplayType and Language + * @see org.compiere.util.DisplayType + * @see org.compiere.util.Env + * + **/ + public String TO_CHAR (String columnName, int displayType, String AD_Language); + + + /** + * Return number as string for INSERT statements with correct precision + * @param number number + * @param displayType display Type + * @return number as string + */ + public String TO_NUMBER (BigDecimal number, int displayType); + + + /** Create User commands */ + public static final int CMD_CREATE_USER = 0; + /** Create Database/Schema Commands */ + public static final int CMD_CREATE_DATABASE = 1; + /** Drop Database/Schema Commands */ + public static final int CMD_DROP_DATABASE = 2; + + /** + * Get SQL Commands. + * + * The following variables are resolved: + * @SystemPassword@, @AdempiereUser@, @AdempierePassword@ + * @SystemPassword@, @DatabaseName@, @DatabaseDevice@ + * + * @param cmdType CMD_* + * @return array of commands to be executed + */ + public String[] getCommands (int cmdType); + + + /** + * Get Cached Connection on Server + * @param connection info + * @param autoCommit true if autocommit connection + * @param transactionIsolation Connection transaction level + * @return connection or null + * @throws Exception + */ + public Connection getCachedConnection (CConnection connection, + boolean autoCommit, int transactionIsolation) throws Exception; + + /** + * Get Connection from Driver + * @param connection info + * @return connection or null + * @throws SQLException + */ + public Connection getDriverConnection (CConnection connection) throws SQLException; + + /** + * Get Driver Connection + * @param dbUrl URL + * @param dbUid user + * @param dbPwd password + * @return connection + * @throws SQLException + */ + public Connection getDriverConnection (String dbUrl, String dbUid, String dbPwd) + throws SQLException; + + /** + * Create DataSource + * @param connection connection + * @return data dource + */ + public DataSource getDataSource(CConnection connection); + + /** + * Get Status + * @return status info + */ + public String getStatus(); + + /** + * Close + */ + public void close(); + + /** + * Get Data Type + * @param DisplayType display type + * @return data type + */ +// public String getDataType (int displayType, int precision, +// boolean defaultValue) + +} // AdempiereDatabase + diff --git a/dbPort/src/org/compiere/db/CConnection.java b/dbPort/src/org/compiere/db/CConnection.java new file mode 100644 index 0000000000..a981a17b3a --- /dev/null +++ b/dbPort/src/org/compiere/db/CConnection.java @@ -0,0 +1,1660 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.naming.*; +import javax.sql.*; +import org.compiere.*; +import org.compiere.interfaces.*; +import org.compiere.util.*; + +/** + * Adempiere Connection Descriptor + * + * @author Jorg Janke + * @author Marek Mosiewicz - support for RMI over HTTP + * @version $Id: CConnection.java,v 1.5 2006/07/30 00:55:13 jjanke Exp $ + */ +public class CConnection implements Serializable +{ + /** Connection */ + private static CConnection s_cc = null; + /** Logger */ + private static CLogger log = CLogger.getCLogger (CConnection.class); + + /** Connection profiles */ + public static ValueNamePair[] CONNECTIONProfiles = new ValueNamePair[]{ + new ValueNamePair("L", "LAN"), + new ValueNamePair("T", "Terminal Server"), + new ValueNamePair("V", "VPN"), + new ValueNamePair("W", "WAN") }; + + /** Connection Profile LAN */ + public static final String PROFILE_LAN = "L"; + /** Connection Profile Terminal Server */ + public static final String PROFILE_TERMINAL = "T"; + /** Connection Profile VPM */ + public static final String PROFILE_VPN = "V"; + /** Connection Profile WAN */ + public static final String PROFILE_WAN = "W"; + + /** + * Get/Set default client/server Connection + * @return Connection Descriptor + */ + public static CConnection get () + { + return get(null); + } // get + + /** + * Get/Set default client/server Connection + * @param apps_host optional apps host for new connections + * @return Connection Descriptor + */ + public static CConnection get (String apps_host) + { + if (s_cc == null) + { + String attributes = Ini.getProperty (Ini.P_CONNECTION); + if (attributes == null || attributes.length () == 0) + { + CConnectionDialog ccd = new CConnectionDialog (new CConnection(apps_host)); + s_cc = ccd.getConnection (); + // set also in ALogin and Ctrl + Ini.setProperty (Ini.P_CONNECTION, s_cc.toStringLong ()); + Ini.saveProperties (Ini.isClient ()); + } + else + { + s_cc = new CConnection (null); + s_cc.setAttributes (attributes); + } + log.fine(s_cc.toString()); + } + + return s_cc; + } // get + + + /** + * Get specific connection + * @param type database Type, e.g. Database.DB_ORACLE + * @param db_host db host + * @param db_port db port + * @param db_name db name + * @return connection + */ + public static CConnection get (String type, String db_host, int db_port, String db_name) + { + return get (type, db_host, db_port, db_name, null, null); + } // get + + /** + * Get specific client connection + * @param type database Type, e.g. Database.DB_ORACLE + * @param db_host db host + * @param db_port db port + * @param db_name db name + * @param db_uid db user id + * @param db_pwd db user password + * @return connection + */ + public static CConnection get (String type, String db_host, int db_port, + String db_name, String db_uid, String db_pwd) + { + CConnection cc = new CConnection (db_host); + cc.setAppsHost (db_host); // set Apps=DB + cc.setType (type); + cc.setDbHost (db_host); + cc.setDbPort (db_port); + cc.setDbName (db_name); + // + if (db_uid != null) + cc.setDbUid (db_uid); + if (db_pwd != null) + cc.setDbPwd (db_pwd); + return cc; + } // get + + + + /************************************************************************** + * Adempiere Connection + * @param host optional application/db host + */ + private CConnection (String host) + { + if (host != null) + { + m_apps_host = host; + m_db_host = host; + } + } // CConnection + + /** Name of Connection */ + private String m_name = "Standard"; + + /** Application Host */ + private String m_apps_host = "MyAppsServer"; + /** Application Port */ + private int m_apps_port = 1099; + + /** Database Type */ + private String m_type = ""; + + /** Database Host */ + private String m_db_host = "MyDBServer"; + /** Database Port */ + private int m_db_port = 0; + /** Database name */ + private String m_db_name = "MyDBName"; + + /** Connection Profile */ + private String m_connectionProfile = null; + + /** In Memory connection */ + private boolean m_bequeath = false; + + /** Connection uses Firewall */ + private boolean m_firewall = false; + /** Firewall host */ + private String m_fw_host = ""; + /** Firewall port */ + private int m_fw_port = 0; + + /** DB User name */ + private String m_db_uid = "adempiere"; + /** DB User password */ + private String m_db_pwd = "adempiere"; + + /** Database */ + private AdempiereDatabase m_db = null; + /** ConnectionException */ + private Exception m_dbException = null; + private Exception m_appsException = null; + + /** Database Connection */ + private boolean m_okDB = false; + /** Apps Server Connection */ + private boolean m_okApps = false; + + /** Info */ + private String[] m_info = new String[2]; + + /** Server Version */ + private String m_version = null; + + /** DataSource */ + private DataSource m_ds = null; + /** Server Session */ + private Server m_server = null; + /** DB Info */ + private String m_dbInfo = null; + + + /************************************************************************* + * Get Name + * @return connection name + */ + public String getName () + { + return m_name; + } + + /** + * Set Name + * @param name connection name + */ + public void setName (String name) + { + m_name = name; + } // setName + + /** + * Set Name + */ + protected void setName () + { + m_name = toString (); + } // setName + + + /************* + * Get Application Host + * @return apps host + */ + public String getAppsHost () + { + return m_apps_host; + } + + /** + * Set Application Host + * @param apps_host apps host + */ + public void setAppsHost (String apps_host) + { + m_apps_host = apps_host; + m_name = toString (); + m_okApps = false; + } + + /** + * Get Apps Port + * @return port + */ + public int getAppsPort () + { + return m_apps_port; + } + + /** + * Set Apps Port + * @param apps_port apps port + */ + public void setAppsPort (int apps_port) + { + m_apps_port = apps_port; + m_okApps = false; + } + + /** + * Set Apps Port + * @param apps_portString appd port as String + */ + public void setAppsPort (String apps_portString) + { + try + { + if (apps_portString == null || apps_portString.length() == 0) + ; + else + setAppsPort (Integer.parseInt (apps_portString)); + } + catch (Exception e) + { + log.severe(e.toString ()); + } + } // setAppsPort + + /** + * Is Application Server OK + * @param tryContactAgain try to contact again + * @return true if Apps Server exists + */ + public boolean isAppsServerOK (boolean tryContactAgain) + { + if (!tryContactAgain) + return m_okApps; + + // Get Context + if (m_iContext == null) + { + getInitialContext (false); + if (!m_okApps) + return false; + } + + // Contact it + try + { + StatusHome statusHome = (StatusHome)m_iContext.lookup (StatusHome.JNDI_NAME); + Status status = statusHome.create (); + m_version = status.getDateVersion (); + status.remove (); + m_okApps = true; + } + catch (Exception ce) + { + m_okApps = false; + } + catch (Throwable t) + { + m_okApps = false; + } + return m_okApps; + } // isAppsOK + + /** + * Test ApplicationServer + * @return Exception or null + */ + public Exception testAppsServer () + { + if (queryAppsServerInfo ()) + testDatabase (false); + return getAppsServerException (); + } // testAppsServer + + /** + * Get Server + * @return Server + */ + public Server getServer() + { + if (m_server == null) + { + try + { + InitialContext ic = getInitialContext (true); + if (ic != null) + { + ServerHome serverHome = (ServerHome)ic.lookup (ServerHome.JNDI_NAME); + if (serverHome != null) + m_server = serverHome.create(); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "", ex); + m_iContext = null; + } + } + return m_server; + } // getServer + + + /** + * Get Apps Server Version + * @return db host name + */ + public String getServerVersion () + { + return m_version; + } // getServerVersion + + + /************* + * Get Database Host name + * @return db host name + */ + public String getDbHost () + { + return m_db_host; + } // getDbHost + + /** + * Set Database host name + * @param db_host db host + */ + public void setDbHost (String db_host) + { + m_db_host = db_host; + m_name = toString (); + m_okDB = false; + } // setDbHost + + /** + * Get Database Name (Service Name) + * @return db name + */ + public String getDbName () + { + return m_db_name; + } // getDbName + + /** + * Set Database Name (Service Name) + * @param db_name db name + */ + public void setDbName (String db_name) + { + m_db_name = db_name; + m_name = toString (); + m_okDB = false; + } // setDbName + + /** + * Get DB Port + * @return port + */ + public int getDbPort () + { + return m_db_port; + } // getDbPort + + /** + * Set DB Port + * @param db_port db port + */ + public void setDbPort (int db_port) + { + m_db_port = db_port; + m_okDB = false; + } // setDbPort + + /** + * Set DB Port + * @param db_portString db port as String + */ + public void setDbPort (String db_portString) + { + try + { + if (db_portString == null || db_portString.length() == 0) + ; + else + setDbPort (Integer.parseInt (db_portString)); + } + catch (Exception e) + { + log.severe(e.toString ()); + } + } // setDbPort + + /** + * Get Database Password + * @return db password + */ + public String getDbPwd () + { + return m_db_pwd; + } // getDbPwd + + /** + * Set DB password + * @param db_pwd db user password + */ + public void setDbPwd (String db_pwd) + { + m_db_pwd = db_pwd; + m_okDB = false; + } // setDbPwd + + /** + * Get Database User + * @return db user + */ + public String getDbUid () + { + return m_db_uid; + } // getDbUid + + /** + * Set Database User + * @param db_uid db user id + */ + public void setDbUid (String db_uid) + { + m_db_uid = db_uid; + m_name = toString (); + m_okDB = false; + } // setDbUid + + /** + * RMI over HTTP + * @return true if RMI over HTTP (Wan Connection Profile) + */ + public boolean isRMIoverHTTP () + { + return Ini.isClient() + && getConnectionProfile().equals(PROFILE_WAN); + } // isRMIoverHTTP + + /** + * Set Connection Profile + * @param connectionProfile connection profile + */ + public void setConnectionProfile (ValueNamePair connectionProfile) + { + if (connectionProfile != null) + setConnectionProfile(connectionProfile.getValue()); + } // setConnectionProfile + + /** + * Set Connection Profile + * @param connectionProfile connection profile + */ + public void setConnectionProfile (String connectionProfile) + { + if (connectionProfile == null + || (m_connectionProfile != null + && m_connectionProfile.equals(connectionProfile))) // same + return; + + if (PROFILE_LAN.equals(connectionProfile) + || PROFILE_TERMINAL.equals(connectionProfile) + || PROFILE_VPN.equals(connectionProfile) + || PROFILE_WAN.equals(connectionProfile)) + { + if (m_connectionProfile != null) + { + log.config(m_connectionProfile + " -> " + connectionProfile); + m_connectionProfile = connectionProfile; + Ini.setProperty(Ini.P_CONNECTION, toStringLong()); + } + else + m_connectionProfile = connectionProfile; + } + else + log.warning("Invalid: " + connectionProfile); + } // setConnectionProfile + + /** + * Get Connection Profile + * @return connection profile + */ + public String getConnectionProfile () + { + if (m_connectionProfile != null) + return m_connectionProfile; + return PROFILE_LAN; + } // getConnectionProfile + + /** + * Get Connection Profile Text + * @param connectionProfile + * @return connection profile text + */ + public String getConnectionProfileText (String connectionProfile) + { + for (int i = 0; i < CONNECTIONProfiles.length; i++) + { + if (CONNECTIONProfiles[i].getValue().equals(connectionProfile)) + return CONNECTIONProfiles[i].getName(); + } + return CONNECTIONProfiles[0].getName(); + } // getConnectionProfileText + + /** + * Get Connection Profile Text + * @return connection profile text + */ + public String getConnectionProfileText () + { + return getConnectionProfileText(getConnectionProfile()); + } // getConnectionProfileText + + /** + * Get Connection Profile + * @return connection profile + */ + public ValueNamePair getConnectionProfilePair () + { + for (int i = 0; i < CONNECTIONProfiles.length; i++) + { + if (CONNECTIONProfiles[i].getValue().equals(getConnectionProfile())) + return CONNECTIONProfiles[i]; + } + return CONNECTIONProfiles[0]; + } // getConnectionProfilePair + + /** + * Should objects be created on Server ? + * @return true if client and VPN/WAN + */ + public boolean isServerObjects() + { + return (Ini.isClient() + && (getConnectionProfile().equals(PROFILE_VPN) + || getConnectionProfile().equals(PROFILE_WAN) )); + } // isServerObjects + + /** + * Should objects be created on Server ? + * @return true if client and Terminal/VPN/WAN + */ + public boolean isServerProcess() + { + return (Ini.isClient() + && (getConnectionProfile().equals(PROFILE_TERMINAL) + || getConnectionProfile().equals(PROFILE_VPN) + || getConnectionProfile().equals(PROFILE_WAN) )); + } // isServerProcess + + /** + * Is this a Terminal Server ? + * @return true if client and Terminal + */ + public boolean isTerminalServer() + { + return Ini.isClient() && getConnectionProfile().equals(PROFILE_TERMINAL); + } // isTerminalServer + + /** + * Is DB via Firewall + * @return true if via firewall + */ + public boolean isViaFirewall () + { + return m_firewall; + } + + /** + * Method setViaFirewall + * @param viaFirewall boolean + */ + public void setViaFirewall (boolean viaFirewall) + { + m_firewall = viaFirewall; + m_okDB = false; + } + + /** + * Method setViaFirewall + * @param viaFirewallString String + */ + public void setViaFirewall (String viaFirewallString) + { + try + { + setViaFirewall (Boolean.valueOf (viaFirewallString).booleanValue ()); + } + catch (Exception e) + { + log.severe(e.toString ()); + } + } + + /** + * Method getFwHost + * @return String + */ + public String getFwHost () + { + return m_fw_host; + } + + /** + * Method setFwHost + * @param fw_host String + */ + public void setFwHost (String fw_host) + { + m_fw_host = fw_host; + m_okDB = false; + } + + /** + * Get Firewall port + * @return firewall port + */ + public int getFwPort () + { + return m_fw_port; + } + + /** + * Set Firewall port + * @param fw_port firewall port + */ + public void setFwPort (int fw_port) + { + m_fw_port = fw_port; + m_okDB = false; + } + + /** + * Set Firewall port + * @param fw_portString firewall port as String + */ + public void setFwPort (String fw_portString) + { + try + { + if (fw_portString == null || fw_portString.length() == 0) + ; + else + setFwPort (Integer.parseInt (fw_portString)); + } + catch (Exception e) + { + log.severe(e.toString ()); + } + } + + /** + * Is it a bequeath connection + * @return true if bequeath connection + */ + public boolean isBequeath () + { + return m_bequeath; + } + + /** + * Set Bequeath + * @param bequeath bequeath connection + */ + public void setBequeath (boolean bequeath) + { + m_bequeath = bequeath; + m_okDB = false; + } + + /** + * Set Bequeath + * @param bequeathString bequeath connection as String (true/false) + */ + public void setBequeath (String bequeathString) + { + try + { + setBequeath (Boolean.valueOf (bequeathString).booleanValue ()); + } + catch (Exception e) + { + log.severe(e.toString ()); + } + } // setBequeath + + /** + * Get Database Type + * @return database type + */ + public String getType () + { + return m_type; + } + + /** + * Set Database Type and default settings. + * Checked against installed databases + * @param type database Type, e.g. Database.DB_ORACLE + */ + public void setType (String type) + { + for (int i = 0; i < Database.DB_NAMES.length; i++) + { + if (Database.DB_NAMES[i].equals (type)) + { + m_type = type; + m_okDB = false; + break; + } + } + // Oracle + if (isOracle ()) + { + if (getDbPort () != DB_Oracle.DEFAULT_PORT) + setDbPort (DB_Oracle.DEFAULT_PORT); + setFwPort (DB_Oracle.DEFAULT_CM_PORT); + } + else + { + setBequeath (false); + setViaFirewall (false); + } + + // DB2 + if (isDB2()) + { + if (getDbPort () != DB_DB2.DEFAULT_PORT) + setDbPort (DB_DB2.DEFAULT_PORT); + } + else if (isDerby()) + { +// if (getDbPort () != DB_Derby.DEFAULT_PORT) +// setDbPort (DB_Derby.DEFAULT_PORT); + } + // begin vpj-cd e-evolution 09 ene 2006 + // PostgreSQL + if (isPostgreSQL ()) + { + if (getDbPort () != DB_PostgreSQL.DEFAULT_PORT) + setDbPort (DB_PostgreSQL.DEFAULT_PORT); + } + //end vpj-cd e-evolution 09 ene 2006 + } // setType + + /** + * Supports BLOB + * @return true if BLOB is supported + */ + public boolean supportsBLOB () + { + return m_db.supportsBLOB (); + } // supportsBLOB + + + /** + * Is Oracle DB + * @return true if Oracle + */ + public boolean isOracle () + { + return Database.DB_ORACLE.equals (m_type); + } // isOracle + + /** + * Is IBM DB/2 + * @return true if DB/2 + */ + public boolean isDB2 () + { + return Database.DB_DB2.equals (m_type); + } // isDB2 + + /** + * Is Apache Derby + * @return true if Derby + */ + public boolean isDerby () + { + return Database.DB_DERBY.equals (m_type); + } // isDerby + + /** + * Is Microsoft SQL Server + * @return true if Derby + */ + public boolean isMSSQLServer() + { + return Database.DB_MSSQLServer.equals (m_type); + } // isMSSQLServer + + //begin e-evolution vpj-cd 30 nov 2005 + /** + * Is PostgreSQL DB + * @return true if PostgreSQL + */ +// public boolean isEDB () +// { +// return Database.DB_EDB.equals (m_type); +// } // isPostgreSQL + /** + * Is PostgreSQL DB + * @return true if PostgreSQL + */ + public boolean isPostgreSQL () + { + return Database.DB_POSTGRESQL.equals (m_type); + } // isPostgreSQL + //end + + /** + * Is Database Connection OK + * @return true if database connection is OK + */ + public boolean isDatabaseOK () + { + return m_okDB; + } // isDatabaseOK + + /************************************************************************** + * Create DB Connection + * @return data source != null + */ + public boolean setDataSource() + { + // System.out.println ("CConnection.setDataSource - " + m_ds + " - Client=" + Ini.isClient()); + if (m_ds == null && Ini.isClient()) + { + if (getDatabase() != null) // no db selected + m_ds = getDatabase().getDataSource(this); + // System.out.println ("CConnection.setDataSource - " + m_ds); + } + return m_ds != null; + } // setDataSource + + /** + * Set Data Source + * @param ds data source + * @return data source != null + */ + public boolean setDataSource(DataSource ds) + { + if (ds == null && m_ds != null) + getDatabase().close(); + m_ds = ds; + return m_ds != null; + } // setDataSource + + /** + * Get Server Connection + * @return DataSource + */ + public DataSource getDataSource () + { + return m_ds; + } // getDataSource + + /** + * Has Server Connection + * @return true if DataSource exists + */ + public boolean isDataSource () + { + return m_ds != null; + } // isDataSource + + + /************************************************************************** + * Test Database Connection. + * -- Example -- + * Database: PostgreSQL - 7.1.3 + * Driver: PostgreSQL Native Driver - PostgreSQL 7.2 JDBC2 + * -- Example -- + * Database: Oracle - Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production With the Partitioning option JServer Release 8.1.7.0.0 - Production + * Driver: Oracle JDBC driver - 9.0.1.1.0 + * @param retest + * @return Exception or null + */ + public Exception testDatabase(boolean retest) + { + // At this point Application Server Connection is tested. + if (isRMIoverHTTP()) + return null; + if (!retest && m_ds != null && m_okDB) + return null; + + if (m_ds != null) + getDatabase().close(); + m_ds = null; + setDataSource(); + // the actual test + Connection conn = getConnection (true, + Connection.TRANSACTION_READ_COMMITTED); + if (conn != null) + { + try + { + DatabaseMetaData dbmd = conn.getMetaData (); + m_info[0] = "Database=" + dbmd.getDatabaseProductName () + + " - " + dbmd.getDatabaseProductVersion (); + m_info[0] = m_info[0].replace ('\n', ' '); + m_info[1] = "Driver =" + dbmd.getDriverName () + + " - " + dbmd.getDriverVersion (); + if (isDataSource()) + m_info[1] += " - via DataSource"; + m_info[1] = m_info[1].replace ('\n', ' '); + log.config(m_info[0] + " - " + m_info[1]); + conn.close (); + } + catch (Exception e) + { + log.severe (e.toString()); + return e; + } + } + return m_dbException; // from opening + } // testDatabase + + + /************************************************************************* + * Short String representation + * @return appsHost{dbHost-dbName-uid} + */ + public String toString () + { + StringBuffer sb = new StringBuffer (m_apps_host); + sb.append ("{").append (m_db_host) + .append ("-").append (m_db_name) + .append ("-").append (m_db_uid) + .append ("}"); + return sb.toString (); + } // toString + + /** + * Detail Info + * @return info + */ + public String toStringDetail () + { + StringBuffer sb = new StringBuffer (m_apps_host); + sb.append ("{").append (m_db_host) + .append ("-").append (m_db_name) + .append ("-").append (m_db_uid) + .append ("}"); + // + Connection conn = getConnection (true, + Connection.TRANSACTION_READ_COMMITTED); + if (conn != null) + { + try + { + DatabaseMetaData dbmd = conn.getMetaData (); + sb.append("\nDatabase=" + dbmd.getDatabaseProductName () + + " - " + dbmd.getDatabaseProductVersion()); + sb.append("\nDriver =" + dbmd.getDriverName () + + " - " + dbmd.getDriverVersion ()); + if (isDataSource()) + sb.append(" - via DS"); + conn.close (); + } + catch (Exception e) + { + } + } + conn = null; + return sb.toString (); + } // toStringDetail + + /** + * Get DB Version Info + * @return info + */ + public String getDBInfo() + { + if (m_dbInfo != null) + return m_dbInfo; + StringBuffer sb = new StringBuffer (); + Connection conn = getConnection (true, + Connection.TRANSACTION_READ_COMMITTED); + if (conn != null) + { + try + { + DatabaseMetaData dbmd = conn.getMetaData (); + sb.append(dbmd.getDatabaseProductVersion()) + .append(";").append(dbmd.getDriverVersion()); + if (isDataSource()) + sb.append(";DS"); + conn.close (); + m_dbInfo = sb.toString (); + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + sb.append(e.getLocalizedMessage()); + } + } + conn = null; + return sb.toString(); + } // toStringDetail + + + /** + * String representation. + * Used also for Instanciation + * @return string representation + * @see #setAttributes(String) setAttributes + */ + public String toStringLong () + { + StringBuffer sb = new StringBuffer ("CConnection["); + sb.append ("name=").append (m_name) + .append (",AppsHost=").append (m_apps_host) + .append (",AppsPort=").append (m_apps_port) + .append (",Profile=").append (getConnectionProfile()) + .append (",type=").append (m_type) + .append (",DBhost=").append (m_db_host) + .append (",DBport=").append (m_db_port) + .append (",DBname=").append (m_db_name) + .append (",BQ=").append (m_bequeath) + .append (",FW=").append (m_firewall) + .append (",FWhost=").append (m_fw_host) + .append (",FWport=").append (m_fw_port) + .append (",UID=").append (m_db_uid) + .append (",PWD=").append (m_db_pwd) + ; // the format is read by setAttributes + sb.append ("]"); + return sb.toString (); + } // toStringLong + + /** + * Set Attributes from String (pares toStringLong()) + * @param attributes attributes + */ + private void setAttributes (String attributes) + { + try + { + setName (attributes.substring (attributes.indexOf ("name=") + 5, attributes.indexOf (",AppsHost="))); + setAppsHost (attributes.substring (attributes.indexOf ("AppsHost=") + 9, attributes.indexOf (",AppsPort="))); + int index = attributes.indexOf("AppsPort="); + setAppsPort (attributes.substring (index + 9, attributes.indexOf (",", index))); + index = attributes.indexOf("Profile="); + if (index > 0) // new attribute, may not exist + setConnectionProfile(attributes.substring(index+8, attributes.indexOf (",", index))); + // + setType (attributes.substring (attributes.indexOf ("type=")+5, attributes.indexOf (",DBhost="))); + setDbHost (attributes.substring (attributes.indexOf ("DBhost=") + 7, attributes.indexOf (",DBport="))); + setDbPort (attributes.substring (attributes.indexOf ("DBport=") + 7, attributes.indexOf (",DBname="))); + setDbName (attributes.substring (attributes.indexOf ("DBname=") + 7, attributes.indexOf (",BQ="))); + // + setBequeath (attributes.substring (attributes.indexOf ("BQ=") + 3, attributes.indexOf (",FW="))); + setViaFirewall (attributes.substring (attributes.indexOf ("FW=") + 3, attributes.indexOf (",FWhost="))); + setFwHost (attributes.substring (attributes.indexOf ("FWhost=") + 7, attributes.indexOf (",FWport="))); + setFwPort (attributes.substring (attributes.indexOf ("FWport=") + 7, attributes.indexOf (",UID="))); + // + setDbUid (attributes.substring (attributes.indexOf ("UID=") + 4, attributes.indexOf (",PWD="))); + setDbPwd (attributes.substring (attributes.indexOf ("PWD=") + 4, attributes.indexOf ("]"))); + // + } + catch (Exception e) + { + log.severe(attributes + " - " + e.toString ()); + } + } // setAttributes + + /** + * Equals + * @param o object + * @return true if o equals this + */ + public boolean equals (Object o) + { + if (o instanceof CConnection) + { + CConnection cc = (CConnection)o; + if (cc.getAppsHost().equals (m_apps_host) + && cc.getAppsPort() == m_apps_port + && cc.getDbHost().equals (m_db_host) + && cc.getDbPort() == m_db_port + && cc.getConnectionProfile().equals(getConnectionProfile()) + && cc.getDbName().equals(m_db_name) + && cc.getType().equals(m_type) + && cc.getDbUid().equals(m_db_uid) + && cc.getDbPwd().equals(m_db_pwd)) + return true; + } + return false; + } // equals + + /** + * Get Info. + * - Database, Driver, Status Info + * @return info + */ + public String getInfo () + { + StringBuffer sb = new StringBuffer (m_info[0]); + sb.append (" - ").append (m_info[1]) + .append ("\n").append (getDatabase ().toString ()) + .append ("\nAppsServerOK=").append (isAppsServerOK (false)) + .append (", DatabaseOK=").append (isDatabaseOK ()); + return sb.toString (); + } // getInfo + + + /************************************************************************* + * Hashcode + * @return hashcode of name + */ + public int hashCode () + { + return m_name.hashCode (); + } // hashCode + + /** + * Get Database + * @return database + */ + public AdempiereDatabase getDatabase () + { + // different driver + if (m_db != null && !m_db.getName ().equals (m_type)) + m_db = null; + + if (m_db == null) + { + try + { + for (int i = 0; i < Database.DB_NAMES.length; i++) + { + if (Database.DB_NAMES[i].equals (m_type)) + { + m_db = (AdempiereDatabase)Database.DB_CLASSES[i]. + newInstance (); + break; + } + } + } + catch (Exception e) + { + log.severe(e.toString ()); + } + } + return m_db; + } // getDatabase + + /** + * Get Connection String + * @return connection string + */ + public String getConnectionURL () + { + getDatabase (); // updates m_db + if (m_db != null) + return m_db.getConnectionURL (this); + else + return ""; + } // getConnectionURL + + /** + * Get Server Connection - do close + * @param autoCommit true if autocommit connection + * @param trxLevel Connection transaction level + * @return Connection + */ + public Connection getServerConnection (boolean autoCommit, int trxLevel) + { + Connection conn = null; + // Server Connection + if (m_ds != null) + { + try + { + conn = m_ds.getConnection (); + conn.setAutoCommit (autoCommit); + conn.setTransactionIsolation (trxLevel); + m_okDB = true; + } + catch (SQLException ex) + { + m_dbException = ex; + log.log(Level.SEVERE, "", ex); + } + } + + // Server + return conn; + } // getServerConnection + + + /** + * Create Connection - no not close. + * Sets m_dbException + * @param autoCommit true if autocommit connection + * @param transactionIsolation Connection transaction level + * @return Connection + */ + public Connection getConnection (boolean autoCommit, int transactionIsolation) + { + Connection conn = null; + m_dbException = null; + m_okDB = false; + // + getDatabase (); // updates m_db + if (m_db == null) + { + m_dbException = new IllegalStateException("No Database Connector"); + return null; + } + // + + try + { + // if (!Ini.isClient() // Server + // && trxLevel != Connection.TRANSACTION_READ_COMMITTED) // PO_LOB.save() + // { + Exception ee = null; + try + { + conn = m_db.getCachedConnection(this, autoCommit, transactionIsolation); + } + catch (Exception e) + { + ee = e; + } + if (conn == null) + { + Thread.yield(); + log.config("retrying - " + ee); + conn = m_db.getCachedConnection(this, autoCommit, transactionIsolation); + } + // System.err.println ("CConnection.getConnection(Cache) - " + getConnectionURL() + ", AutoCommit=" + autoCommit + ", TrxLevel=" + trxLevel); + // } + // else if (isDataSource()) // Client + // { + // conn = m_ds.getConnection(); + // System.err.println ("CConnection.getConnection(DataSource) - " + getConnectionURL() + ", AutoCommit=" + autoCommit + ", TrxLevel=" + trxLevel); + // } + // else + // { + // conn = m_db.getDriverConnection (this); + // System.err.println ("CConnection.getConnection(Driver) - " + getConnectionURL() + ", AutoCommit=" + autoCommit + ", TrxLevel=" + trxLevel); + // } + // Verify Connection + if (conn != null) + { + if (conn.getTransactionIsolation() != transactionIsolation) + conn.setTransactionIsolation (transactionIsolation); + if (conn.getAutoCommit() != autoCommit) + conn.setAutoCommit (autoCommit); + m_okDB = true; + } + } + catch (UnsatisfiedLinkError ule) + { + String msg = ule.getLocalizedMessage() + + " -> Did you set the LD_LIBRARY_PATH ? - " + getConnectionURL(); + m_dbException = new Exception(msg); + log.severe(msg); + } + catch (SQLException ex) + { + m_dbException = ex; + if (conn == null) + log.log(Level.SEVERE, getConnectionURL () + + ", (1) AutoCommit=" + autoCommit + ",TrxIso=" + getTransactionIsolationInfo(transactionIsolation) + // + " (" + getDbUid() + "/" + getDbPwd() + ")" + + " - " + ex.getMessage()); + else + { + try + { + log.severe(getConnectionURL () + + ", (2) AutoCommit=" + conn.getAutoCommit() + "->" + autoCommit + + ", TrxIso=" + getTransactionIsolationInfo(conn.getTransactionIsolation()) + "->" + getTransactionIsolationInfo(transactionIsolation) + // + " (" + getDbUid() + "/" + getDbPwd() + ")" + + " - " + ex.getMessage()); + } + catch (Exception ee) + { + log.severe(getConnectionURL () + + ", (3) AutoCommit=" + autoCommit + ", TrxIso=" + getTransactionIsolationInfo(transactionIsolation) + // + " (" + getDbUid() + "/" + getDbPwd() + ")" + + " - " + ex.getMessage()); + } + } + } + catch (Exception ex) + { + m_dbException = ex; + log.log(Level.SEVERE, getConnectionURL(), ex); + } + // System.err.println ("CConnection.getConnection - " + conn); + return conn; + } // getConnection + + /** + * Get Database Exception of last connection attempt + * @return Exception or null + */ + public Exception getDatabaseException () + { + return m_dbException; + } // getConnectionException + + /*************************************************************************/ + + private InitialContext m_iContext = null; + private Hashtable m_env = null; + + /** + * Get Application Server Initial Context + * @param useCache if true, use existing cache + * @return Initial Context or null + */ + public InitialContext getInitialContext (boolean useCache) + { + if (useCache && m_iContext != null) + return m_iContext; + + // Set Environment + if (m_env == null || !useCache) + m_env = getInitialEnvironment(getAppsHost(), getAppsPort(), isRMIoverHTTP()); + String connect = (String)m_env.get(Context.PROVIDER_URL); + Env.setContext(Env.getCtx(), Context.PROVIDER_URL, connect); + + // Get Context + m_iContext = null; + try + { + m_iContext = new InitialContext (m_env); + } + catch (Exception ex) + { + m_okApps = false; + m_appsException = ex; + if (connect == null) + connect = (String)m_env.get(Context.PROVIDER_URL); + log.severe(connect + + "\n - " + ex.toString () + + "\n - " + m_env); + if (CLogMgt.isLevelFinest()) + ex.printStackTrace(); + } + return m_iContext; + } // getInitialContext + + /** + * Get Initial Environment + * @param AppsHost host + * @param AppsPort port + * @param RMIoverHTTP true if tunnel through HTTP + * @return environment + */ + public static Hashtable getInitialEnvironment (String AppsHost, int AppsPort, + boolean RMIoverHTTP) + { + // Set Environment + Hashtable env = new Hashtable(); + String connect = AppsHost; + if (RMIoverHTTP) + { + env.put (Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory"); + if (AppsHost.indexOf("://") == -1) + connect = "http://" + AppsHost + ":" + AppsPort + + "/invoker/JNDIFactory"; + env.put(Context.PROVIDER_URL, connect); + } + else + { + env.put (Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); + if (AppsHost.indexOf("://") == -1) + connect = "jnp://" + AppsHost + ":" + AppsPort; + env.put (Context.PROVIDER_URL, connect); + } + env.put (Context.URL_PKG_PREFIXES, "org.jboss.naming.client"); + // HTTP - default timeout 0 + env.put (org.jnp.interfaces.TimedSocketFactory.JNP_TIMEOUT, "5000"); // timeout in ms + env.put (org.jnp.interfaces.TimedSocketFactory.JNP_SO_TIMEOUT, "5000"); + // JNP - default timeout 5 sec + env.put(org.jnp.interfaces.NamingContext.JNP_DISCOVERY_TIMEOUT, "5000"); + return env; + } // getInitialEnvironment + + /** + * Get Initial Context + * @param env environment + * @return Initial Context + */ + public static InitialContext getInitialContext (Hashtable env) + { + InitialContext iContext = null; + try + { + iContext = new InitialContext (env); + } + catch (Exception ex) + { + log.warning ("URL=" + env.get(Context.PROVIDER_URL) + + "\n - " + ex.toString () + + "\n - " + env); + iContext = null; + if (CLogMgt.isLevelFinest()) + ex.printStackTrace(); + } + return iContext; + } // getInitialContext + + + /** + * Query Application Server Status. + * update okApps + * @return true ik OK + */ + private boolean queryAppsServerInfo () + { + log.finer(getAppsHost()); + long start = System.currentTimeMillis(); + m_okApps = false; + m_appsException = null; + // + getInitialContext (false); + if (m_iContext == null) + return m_okApps; // false + + // Carlos Ruiz - globalqss - speed up when jnp://MyAppsServer:1099 is set + if (getAppsHost().equalsIgnoreCase("MyAppsServer")) { + log.warning (getAppsHost() + " ignored"); + return m_okApps; // false + } + + // Prevent error trace + // CLogMgtLog4J.enable(false); + try + { + StatusHome statusHome = (StatusHome)m_iContext.lookup (StatusHome.JNDI_NAME); + Status status = statusHome.create (); + // + updateInfoFromServer(status); + // + status.remove (); + m_okApps = true; + } + catch (CommunicationException ce) // not a "real" error + { + // m_appsException = ce; + String connect = (String)m_env.get(Context.PROVIDER_URL); + log.warning (connect + + "\n - " + ce.toString () + + "\n - " + m_env); + } + catch (Exception e) + { + m_appsException = e; + String connect = (String)m_env.get(Context.PROVIDER_URL); + log.warning (connect + + "\n - " + e.toString () + + "\n - " + m_env); + } + CLogMgtLog4J.enable(true); + log.fine("Success=" + m_okApps + " - " + (System.currentTimeMillis()-start) + "ms"); + return m_okApps; + } // setAppsServerInfo + + /** + * Get Last Exception of Apps Server Connection attempt + * @return Exception or null + */ + public Exception getAppsServerException () + { + return m_appsException; + } // getAppsServerException + + /** + * Update Connection Info from Apps Server + * @param svr Apps Server Status + * @throws Exception + */ + private void updateInfoFromServer (Status svr) throws Exception + { + if (svr == null) + throw new IllegalArgumentException ("AppsServer was NULL"); + + setType (svr.getDbType()); + setDbHost (svr.getDbHost()); + setDbPort (svr.getDbPort ()); + setDbName (svr.getDbName ()); + setDbUid (svr.getDbUid ()); + setDbPwd (svr.getDbPwd ()); + setBequeath (false); + // + setFwHost (svr.getFwHost ()); + setFwPort (svr.getFwPort ()); + if (getFwHost ().length () == 0) + setViaFirewall (false); + m_version = svr.getDateVersion (); + log.config("Server=" + getDbHost() + ", DB=" + getDbName()); + } // update Info + + /** + * Convert Statement + * @param origStatement original statement (Oracle notation) + * @return converted Statement + * @throws Exception + */ + public String convertStatement (String origStatement) + throws Exception + { + // make sure we have a good database + if (m_db != null && !m_db.getName ().equals (m_type)) + getDatabase (); + if (m_db != null) + return m_db.convertStatement (origStatement); + throw new Exception ( + "CConnection.convertStatement - No Converstion Database"); + } // convertStatement + + /** + * Get Status Info + * @return info + */ + public String getStatus() + { + StringBuffer sb = new StringBuffer (m_apps_host); + sb.append ("{").append (m_db_host) + .append ("-").append (m_db_name) + .append ("-").append (m_db_uid) + .append ("}"); + if (m_db != null) + sb.append (m_db.getStatus()); + return sb.toString (); + } // getStatus + + /** + * Get Transaction Isolation Info + * @param transactionIsolation trx iso + * @return clear test + */ + public static String getTransactionIsolationInfo(int transactionIsolation) + { + if (transactionIsolation == Connection.TRANSACTION_NONE) + return "NONE"; + if (transactionIsolation == Connection.TRANSACTION_READ_COMMITTED) + return "READ_COMMITTED"; + if (transactionIsolation == Connection.TRANSACTION_READ_UNCOMMITTED) + return "READ_UNCOMMITTED"; + if (transactionIsolation == Connection.TRANSACTION_REPEATABLE_READ) + return "REPEATABLE_READ"; + if (transactionIsolation == Connection.TRANSACTION_READ_COMMITTED) + return "SERIALIZABLE"; + return ""; + } // getTransactionIsolationInfo + + + /************************************************************************** + * Testing + * @param args ignored + */ + public static void main (String[] args) + { + boolean server = true; + if (args.length == 0) + System.out.println("CConnection "); + else + server = "server".equals(args[0]); + System.out.println("CConnection - " + (server ? "server" : "client")); + // + if (server) + { + Adempiere.startup(false); + } + else + Adempiere.startup(true); + // + System.out.println ("Connection = "); + // CConnection[name=localhost{dev-dev1-adempiere},AppsHost=localhost,AppsPort=1099,type=Oracle,DBhost=dev,DBport=1521,DBname=dev1,BQ=false,FW=false,FWhost=,FWport=1630,UID=adempiere,PWD=adempiere] + System.out.println (Ini.getProperty (Ini.P_CONNECTION)); + + CConnection cc = CConnection.get (); + System.out.println (">> " + cc.toStringLong ()); + Connection con = cc.getConnection (false, + Connection.TRANSACTION_READ_COMMITTED); + new CConnectionDialog(cc); + } // main + +} // CConnection diff --git a/dbPort/src/org/compiere/db/CConnectionDialog.java b/dbPort/src/org/compiere/db/CConnectionDialog.java new file mode 100644 index 0000000000..aba7f85942 --- /dev/null +++ b/dbPort/src/org/compiere/db/CConnectionDialog.java @@ -0,0 +1,513 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.awt.*; +import java.awt.event.*; +import java.util.*; +import java.util.logging.*; +import javax.swing.*; +import org.compiere.plaf.*; +import org.compiere.swing.*; +import org.compiere.util.*; + +/** + * Connection Dialog. + * + * @author Jorg Janke + * @author Marek Mosiewicz - support for RMI over HTTP + * @version $Id: CConnectionDialog.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class CConnectionDialog extends CDialog implements ActionListener +{ + /** + * Connection Dialog using current Connection + */ + public CConnectionDialog() + { + this (null); + } // CConnectionDialog + + /** + * Connection Dialog + * @param cc Adempiere Connection + */ + public CConnectionDialog(CConnection cc) + { + super((Frame)null, true); + try + { + jbInit(); + setConnection (cc); + } + catch(Exception e) + { + log.log(Level.SEVERE, "", e); + } + AdempierePLAF.showCenterScreen(this); + } // CConnection + + /** Resources */ + private static ResourceBundle res = ResourceBundle.getBundle("org.compiere.db.DBRes"); + + static + { + /** Connection Profiles */ + CConnection.CONNECTIONProfiles = new ValueNamePair[]{ + new ValueNamePair("L", res.getString("LAN")), + new ValueNamePair("T", res.getString("TerminalServer")), + new ValueNamePair("V", res.getString("VPN")), + new ValueNamePair("W", res.getString("WAN")) + }; + } + + /** Default HTTP Port */ + public static final String APPS_PORT_HTTP = "80"; + /** Default RMI Port */ + public static final String APPS_PORT_JNP = "1099"; + /** Connection */ + private CConnection m_cc = null; + private CConnection m_ccResult = null; + private boolean m_updating = false; + private boolean m_saved = false; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (CConnectionDialog.class); + + private CPanel mainPanel = new CPanel(); + private BorderLayout mainLayout = new BorderLayout(); + private CPanel centerPanel = new CPanel(); + private CPanel southPanel = new CPanel(); + private CButton bOK = AdempierePLAF.getOKButton(); + private CButton bCancel = AdempierePLAF.getCancelButton(); + private FlowLayout southLayout = new FlowLayout(); + private GridBagLayout centerLayout = new GridBagLayout(); + private CLabel nameLabel = new CLabel(); + private CTextField nameField = new CTextField(); + private CLabel hostLabel = new CLabel(); + private CTextField hostField = new CTextField(); + private CLabel portLabel = new CLabel(); + private CTextField dbPortField = new CTextField(); + private CLabel sidLabel = new CLabel(); + private CTextField sidField = new CTextField(); + private CCheckBox cbFirewall = new CCheckBox(); + private CLabel fwHostLabel = new CLabel(); + private CTextField fwHostField = new CTextField(); + private CLabel fwPortLabel = new CLabel(); + private CTextField fwPortField = new CTextField(); + private CButton bTestDB = new CButton(); + private CLabel dbTypeLabel = new CLabel(); + private CComboBox dbTypeField = new CComboBox(Database.DB_NAMES); + private CCheckBox cbBequeath = new CCheckBox(); + private CLabel appsHostLabel = new CLabel(); + private CTextField appsHostField = new CTextField(); + private CLabel appsPortLabel = new CLabel(); + private CTextField appsPortField = new CTextField(); + private CButton bTestApps = new CButton(); + private CCheckBox cbOverwrite = new CCheckBox(); + private CLabel dbUidLabel = new CLabel(); + private CTextField dbUidField = new CTextField(); + private JPasswordField dbPwdField = new JPasswordField(); + private CLabel connectionProfileLabel = new CLabel(); + private CComboBox connectionProfileField = new CComboBox(CConnection.CONNECTIONProfiles); + + + /** + * Static Layout + * @throws Exception + */ + private void jbInit() throws Exception + { + this.setTitle(res.getString("CConnectionDialog")); + mainPanel.setLayout(mainLayout); + southPanel.setLayout(southLayout); + southLayout.setAlignment(FlowLayout.RIGHT); + centerPanel.setLayout(centerLayout); + nameLabel.setText(res.getString("Name")); + nameField.setColumns(30); + nameField.setReadWrite(false); + hostLabel.setText(res.getString("DBHost")); + hostField.setColumns(30); + portLabel.setText(res.getString("DBPort")); + dbPortField.setColumns(10); + sidLabel.setText(res.getString("DBName")); + cbFirewall.setToolTipText(""); + cbFirewall.setText(res.getString("ViaFirewall")); + fwHostLabel.setText(res.getString("FWHost")); + fwHostField.setColumns(30); + fwPortLabel.setText(res.getString("FWPort")); + bTestDB.setText(res.getString("TestConnection")); + bTestDB.setHorizontalAlignment(JLabel.LEFT); + dbTypeLabel.setText(res.getString("Type")); + sidField.setColumns(30); + fwPortField.setColumns(10); + cbBequeath.setText(res.getString("BequeathConnection")); + appsHostLabel.setText(res.getString("AppsHost")); + appsHostField.setColumns(30); + appsPortLabel.setText(res.getString("AppsPort")); + appsPortField.setColumns(10); + bTestApps.setText(res.getString("TestApps")); + bTestApps.setHorizontalAlignment(JLabel.LEFT); + cbOverwrite.setText(res.getString("Overwrite")); + dbUidLabel.setText(res.getString("DBUidPwd")); + dbUidField.setColumns(10); + connectionProfileLabel.setText(res.getString("ConnectionProfile")); + connectionProfileField.addActionListener(this); + this.getContentPane().add(mainPanel, BorderLayout.CENTER); + mainPanel.add(centerPanel, BorderLayout.CENTER); + mainPanel.add(southPanel, BorderLayout.SOUTH); + southPanel.add(bCancel, null); + southPanel.add(bOK, null); + // + centerPanel.add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(12, 12, 5, 5), 0, 0)); + centerPanel.add(nameField, new GridBagConstraints(1, 0, 2, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(12, 0, 5, 12), 0, 0)); + centerPanel.add(appsHostLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); + centerPanel.add(appsHostField, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); + + centerPanel.add(appsPortLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); + centerPanel.add(appsPortField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); + centerPanel.add(connectionProfileLabel, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); + centerPanel.add(connectionProfileField, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 0), 0, 0)); + // + centerPanel.add(bTestApps, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 + ,GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 12, 0), 0, 0)); + centerPanel.add(cbOverwrite, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 5, 0, 12), 0, 0)); + // DB + centerPanel.add(dbTypeLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); + centerPanel.add(dbTypeField, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 0), 0, 0)); + centerPanel.add(cbBequeath, new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 12), 0, 0)); + centerPanel.add(hostLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0)); + centerPanel.add(hostField, new GridBagConstraints(1, 6, 2, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0)); + centerPanel.add(portLabel, new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); + centerPanel.add(dbPortField, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); + centerPanel.add(sidLabel, new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); + centerPanel.add(sidField, new GridBagConstraints(1, 8, 2, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); + centerPanel.add(dbUidLabel, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); + centerPanel.add(dbUidField, new GridBagConstraints(1, 9, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); + centerPanel.add(dbPwdField, new GridBagConstraints(2, 9, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 12), 0, 0)); + centerPanel.add(cbFirewall, new GridBagConstraints(1, 10, 2, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 12), 0, 0)); + centerPanel.add(fwHostLabel, new GridBagConstraints(0, 11, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); + centerPanel.add(fwHostField, new GridBagConstraints(1, 11, 2, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0)); + centerPanel.add(fwPortLabel, new GridBagConstraints(0, 12, 1, 1, 0.0, 0.0 + ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0)); + centerPanel.add(fwPortField, new GridBagConstraints(1, 12, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); + centerPanel.add(bTestDB, new GridBagConstraints(1, 13, 1, 1, 0.0, 0.0 + ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 12, 0), 0, 0)); + // + nameField.addActionListener(this); + appsHostField.addActionListener(this); + appsPortField.addActionListener(this); + cbOverwrite.addActionListener(this); + bTestApps.addActionListener(this); + // + dbTypeField.addActionListener(this); + hostField.addActionListener(this); + dbPortField.addActionListener(this); + sidField.addActionListener(this); + cbBequeath.addActionListener(this); + cbFirewall.addActionListener(this); + fwHostField.addActionListener(this); + fwPortField.addActionListener(this); + bTestDB.addActionListener(this); + bOK.addActionListener(this); + bCancel.addActionListener(this); + + // Server + if (!Ini.isClient()) + { + appsHostLabel.setVisible(false); + appsHostField.setVisible(false); + appsPortLabel.setVisible(false); + appsPortField.setVisible(false); + bTestApps.setVisible(false); + connectionProfileLabel.setVisible(false); + connectionProfileField.setVisible(false); + } + else // Client + cbBequeath.setVisible(false); + } // jbInit + + /** + * Set Busy - lock UI + * @param busy busy + */ + private void setBusy (boolean busy) + { + if (busy) + this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + else + this.setCursor(Cursor.getDefaultCursor()); + m_updating = busy; + } // setBusy + + /** + * Set Connection + * @param cc - if null use current connection + */ + public void setConnection (CConnection cc) + { + m_cc = cc; + if (m_cc == null) + { + m_cc = CConnection.get(); + m_cc.setName(); + } + // Should copy values + m_ccResult = m_cc; + // + String type = m_cc.getType(); + if (type == null || type.length() == 0) + dbTypeField.setSelectedItem(null); + else + m_cc.setType(m_cc.getType()); // sets defaults + updateInfo(); + } // setConnection + + /** + * Get Connection + * @return CConnection + */ + public CConnection getConnection() + { + return m_ccResult; + } // getConnection; + + /** + * ActionListener + * @param e event + */ + public void actionPerformed(ActionEvent e) + { + if (m_updating) + return; + Object src = e.getSource(); + + if (src == bOK) + { + m_cc.setName(); + m_ccResult = m_cc; + dispose(); + return; + } + else if (src == bCancel) + { + m_cc.setName(); + dispose(); + return; + } + else if (src == connectionProfileField) + { + ValueNamePair pp = (ValueNamePair)connectionProfileField.getSelectedItem(); + m_cc.setConnectionProfile(pp.getValue()); + if (m_cc.isRMIoverHTTP()) + appsPortField.setText(APPS_PORT_HTTP); + else + appsPortField.setText(APPS_PORT_JNP); + return; + } + else if (src == dbTypeField) + { + if (dbTypeField.getSelectedItem() == null) + return; + } + + + if (Ini.isClient()) + { + m_cc.setAppsHost(appsHostField.getText()); + m_cc.setAppsPort(appsPortField.getText()); + } + else + m_cc.setAppsHost("localhost"); + // + ValueNamePair pp = (ValueNamePair)connectionProfileField.getSelectedItem(); + m_cc.setConnectionProfile(pp.getValue()); + // + m_cc.setType((String)dbTypeField.getSelectedItem()); + m_cc.setDbHost(hostField.getText()); + m_cc.setDbPort(dbPortField.getText()); + m_cc.setDbName(sidField.getText()); + m_cc.setDbUid(dbUidField.getText()); + m_cc.setDbPwd(String.valueOf(dbPwdField.getPassword())); + m_cc.setBequeath(cbBequeath.isSelected()); + m_cc.setViaFirewall(cbFirewall.isSelected()); + m_cc.setFwHost(fwHostField.getText()); + m_cc.setFwPort(fwPortField.getText()); + // + if (src == bTestApps) + cmd_testApps(); + + // Database Selection Changed + else if (src == dbTypeField) + { + m_cc.setType((String)dbTypeField.getSelectedItem()); + dbPortField.setText(String.valueOf(m_cc.getDbPort())); + cbBequeath.setSelected(m_cc.isBequeath()); + fwPortField.setText(String.valueOf(m_cc.getFwPort())); + } + // + else if (src == bTestDB) + cmd_testDB(); + + // Name + if (src == nameField) + m_cc.setName(nameField.getText()); + + updateInfo(); + } // actionPerformed + + /** + * Update Fields from Connection + */ + private void updateInfo() + { + m_updating = true; + nameField.setText(m_cc.getName()); + appsHostField.setText(m_cc.getAppsHost()); + appsPortField.setText(String.valueOf(m_cc.getAppsPort())); + // + String cp = m_cc.getConnectionProfile(); + ValueNamePair cpPP = null; + for (int i = 0; i < CConnection.CONNECTIONProfiles.length; i++) + { + if (cp.equals(CConnection.CONNECTIONProfiles[i].getValue())) + { + cpPP = CConnection.CONNECTIONProfiles[i]; + break; + } + } + if (cpPP == null) // LAN + cpPP = CConnection.CONNECTIONProfiles[0]; + connectionProfileField.setSelectedItem(cpPP); + bTestApps.setIcon(getStatusIcon(m_cc.isAppsServerOK(false))); + // bTestApps.setToolTipText(m_cc.getRmiUri()); + + cbOverwrite.setVisible(m_cc.isAppsServerOK(false)); + boolean rw = cbOverwrite.isSelected() || !m_cc.isAppsServerOK(false); + // + dbTypeLabel.setReadWrite(rw); + dbTypeField.setReadWrite(rw); + dbTypeField.setSelectedItem(m_cc.getType()); + // + hostLabel.setReadWrite(rw); + hostField.setReadWrite(rw); + hostField.setText(m_cc.getDbHost()); + portLabel.setReadWrite(rw); + dbPortField.setReadWrite(rw); + dbPortField.setText(String.valueOf(m_cc.getDbPort())); + sidLabel.setReadWrite(rw); + sidField.setReadWrite(rw); + sidField.setText(m_cc.getDbName()); + // + dbUidLabel.setReadWrite(rw); + dbUidField.setReadWrite(rw); + dbUidField.setText(m_cc.getDbUid()); + dbPwdField.setEditable(rw); + dbPwdField.setText(m_cc.getDbPwd()); + // + cbBequeath.setReadWrite(rw); + cbBequeath.setEnabled(m_cc.isOracle()); + cbBequeath.setSelected(m_cc.isBequeath()); + // + boolean fwEnabled = rw && m_cc.isViaFirewall() && m_cc.isOracle(); + cbFirewall.setReadWrite(rw && m_cc.isOracle()); + cbFirewall.setSelected(m_cc.isViaFirewall()); + fwHostLabel.setReadWrite(fwEnabled); + fwHostField.setReadWrite(fwEnabled); + fwHostField.setText(m_cc.getFwHost()); + fwPortLabel.setReadWrite(fwEnabled); + fwPortField.setReadWrite(fwEnabled); + fwPortField.setText(String.valueOf(m_cc.getFwPort())); + // + bTestDB.setToolTipText(m_cc.getConnectionURL()); + bTestDB.setIcon(getStatusIcon(m_cc.isDatabaseOK())); + m_updating = false; + } // updateInfo + + /** + * Get Status Icon - ok or not + * @param ok ok + * @return Icon + */ + private Icon getStatusIcon (boolean ok) + { + if (ok) + return bOK.getIcon(); + else + return bCancel.getIcon(); + } // getStatusIcon + + /** + * Test Database connection + */ + private void cmd_testDB() + { + setBusy (true); + Exception e = m_cc.testDatabase(true); + if (e != null) + { + JOptionPane.showMessageDialog(this, + e, // message + res.getString("ConnectionError") + ": " + m_cc.getConnectionURL(), + JOptionPane.ERROR_MESSAGE); + } + setBusy (false); + } // cmd_testDB + + /** + * Test Application connection + */ + private void cmd_testApps() + { + setBusy (true); + Exception e = m_cc.testAppsServer(); + if (e != null) + { + JOptionPane.showMessageDialog(this, + e.getLocalizedMessage(), + res.getString("ServerNotActive") + " - " + m_cc.getAppsHost(), + JOptionPane.ERROR_MESSAGE); + } + setBusy (false); + } // cmd_testApps + +} // CConnectionDialog diff --git a/dbPort/src/org/compiere/db/CConnectionEditor.java b/dbPort/src/org/compiere/db/CConnectionEditor.java new file mode 100644 index 0000000000..d363404d58 --- /dev/null +++ b/dbPort/src/org/compiere/db/CConnectionEditor.java @@ -0,0 +1,286 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; + +import org.compiere.plaf.*; +import org.compiere.swing.*; + +/** + * Connection Editor. + * A combo box and a button + * + * @author Jorg Janke + * @version $Id: CConnectionEditor.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class CConnectionEditor extends JComponent + implements CEditor +{ + /** + * Connection Editor creating new Connection + */ + public CConnectionEditor() + { + super(); + setName("ConnectionEditor"); + CConnectionEditor_MouseListener ml = new CConnectionEditor_MouseListener(); + // Layout + m_text.setEditable(false); + m_text.setBorder(null); + m_text.addMouseListener(ml); + m_server.setIcon(new ImageIcon(getClass().getResource("Server16.gif"))); + m_server.setFocusable(false); + m_server.setBorder(null); + m_server.setOpaque(true); + m_server.addMouseListener(ml); + m_db.setIcon(new ImageIcon(getClass().getResource("Database16.gif"))); + m_db.setFocusable(false); + m_db.setBorder(null); + m_db.setOpaque(true); + m_db.addMouseListener(ml); + LookAndFeel.installBorder(this, "TextField.border"); + // + setLayout(new BorderLayout(0,0)); + add(m_server, BorderLayout.WEST); + add(m_text, BorderLayout.CENTER); + add(m_db, BorderLayout.EAST); + } // CConnectionEditor + + /** Text Element */ + private JTextField m_text = new JTextField(10); + /** DB Button Element */ + private JLabel m_db = new JLabel (); + /** Host Button Element */ + private JLabel m_server = new JLabel(); + /** The Value */ + private CConnection m_value = null; + /** ReadWrite */ + private boolean m_rw = true; + /** Mandatory */ + private boolean m_mandatory = false; + + /** + * Enable Editor + * @param rw true, if you can enter/select data + */ + public void setReadWrite (boolean rw) + { + m_rw = rw; + setBackground(false); + } // setReadWrite + + /** + * Is it possible to edit + * @return true, if editable + */ + public boolean isReadWrite() + { + return m_rw; + } // isReadWrite + + /** + * Set Editor Mandatory + * @param mandatory true, if you have to enter data + */ + public void setMandatory (boolean mandatory) + { + m_mandatory = mandatory; + } // setMandatory + + /** + * Is Field mandatory + * @return true, if mandatory + */ + public boolean isMandatory() + { + return m_mandatory; + } // isMandatory + + /** + * Set Background based on editable / mandatory / error + * @param error if true, set background to error color, otherwise mandatory/editable + */ + public void setBackground (boolean error) + { + Color c = null; + if (error) + c = AdempierePLAF.getFieldBackground_Error(); + else if (!m_rw) + c = AdempierePLAF.getFieldBackground_Inactive(); + else if (m_mandatory) + c = AdempierePLAF.getFieldBackground_Mandatory(); + else + c = AdempierePLAF.getFieldBackground_Normal(); + setBackground(c); + } // setBackground + + /** + * Set Background color + * @param color + */ + public void setBackground (Color color) + { + m_server.setBackground(color); + m_text.setBackground(color); + m_db.setBackground(color); + } // setBackground + + /** + * Set Visible + * @param visible true if field is to be shown + */ + public void setVisible (boolean visible) + { + this.setVisible(visible); + } + + /** + * Set Editor to value + * @param value value of the editor + */ + public void setValue (Object value) + { + if (value != null && value instanceof CConnection) + m_value = (CConnection)value; + setDisplay(); + } // setValue + + /** + * Return Editor value + * @return current value + */ + public Object getValue() + { + return m_value; + } // getValue + + /** + * Return Display Value + * @return displayed String value + */ + public String getDisplay() + { + if (m_value == null) + return ""; + return m_value.getName(); + } // getDisplay + + /** + * Update Display with Connection info + */ + public void setDisplay() + { + m_text.setText(getDisplay()); + if (m_value == null) + return; + // Text + if (m_value.isAppsServerOK(false) || m_value.isDatabaseOK()) + { + m_text.setForeground(AdempierePLAF.getTextColor_OK()); + setBackground(false); + if (!m_value.isAppsServerOK(false)) + m_server.setBackground(AdempierePLAF.getFieldBackground_Error()); + if (!m_value.isDatabaseOK()) + m_db.setBackground(AdempierePLAF.getFieldBackground_Error()); + } + else + { + m_text.setForeground(AdempierePLAF.getTextColor_Issue()); + setBackground(true); + } + } // setDisplay + + + /************************************************************************** + * Remove Action Listener + * @param l + */ + public synchronized void removeActionListener(ActionListener l) + { + listenerList.remove(ActionListener.class, l); + } // removeActionListener + + /** + * Add Action Listener + * @param l + */ + public synchronized void addActionListener(ActionListener l) + { + listenerList.add(ActionListener.class, l); + } // addActionListener + + /** + * Fire Action Performed + */ + private void fireActionPerformed() + { + ActionEvent e = null; + ActionListener[] listeners = listenerList.getListeners(ActionListener.class); + for (int i = 0; i < listeners.length; i++) + { + if (e == null) + e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "actionPerformed"); + listeners[i].actionPerformed(e); + } + } // fireActionPerformed + + + /************************************************************************** + * Test Method + * @param args + */ + public static void main(String[] args) + { + // System.out.println("CConnectionEditor"); + JFrame frame = new JFrame("CConnectionEditor"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.getRootPane().getContentPane().add(new CConnectionEditor()); + AdempierePLAF.showCenterScreen(frame); + } // main + + + /** + * MouseListener + */ + public class CConnectionEditor_MouseListener extends MouseAdapter + { + /** + * Mouse Clicked - Open Dialog + * @param e + */ + public void mouseClicked(MouseEvent e) + { + if (!isEnabled() || !m_rw || m_active) + return; + m_active = true; + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + // + CConnectionDialog cd = new CConnectionDialog(m_value); + setValue(cd.getConnection()); + fireActionPerformed(); + // + setCursor(Cursor.getDefaultCursor()); + m_active = false; + } // mouseClicked + + private boolean m_active = false; + } // CConnectionExitor_MouseListener + +} // CConnectionEditor diff --git a/dbPort/src/org/compiere/db/CreateAdempiere.java b/dbPort/src/org/compiere/db/CreateAdempiere.java new file mode 100644 index 0000000000..05cf945767 --- /dev/null +++ b/dbPort/src/org/compiere/db/CreateAdempiere.java @@ -0,0 +1,846 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.*; +import org.compiere.model.*; +import org.compiere.util.*; + +/** + * Class to Create a new Adempiere Database from a reference DB. + *
+ *  - Create User
+ *  - Create DDL (table, procedures, functions, etc.)
+ *  
+ * + * @author Jorg Janke + * @version $Id: CreateAdempiere.java,v 1.5 2006/09/22 23:35:19 jjanke Exp $ + */ +public class CreateAdempiere +{ + /** + * Constructor + * @param databaseType AdempiereDatabase.TYPE_ + * @param databaseHost database host + * @param databasePort database port 0 for default + * @param systemPassword system password + */ + public CreateAdempiere(String databaseType, String databaseHost, int databasePort, + String systemPassword) + { + initDatabase(databaseType); + m_databaseHost = databaseHost; + if (databasePort == 0) + m_databasePort = m_dbTarget.getStandardPort(); + else + m_databasePort = databasePort; + m_systemPassword = systemPassword; + log.info(m_dbTarget.getName() + " on " + databaseHost); + } // create + + /** Adempiere Target Database */ + private AdempiereDatabase m_dbTarget = null; + /** Adempiere Source Database */ + private AdempiereDatabase m_dbSource = null; + // + private String m_databaseHost = null; + private int m_databasePort = 0; + private String m_systemPassword = null; + private String m_adempiereUser = null; + private String m_adempierePassword = null; + private String m_databaseName = null; + private String m_databaseDevice = null; + // + private Properties m_ctx = new Properties (); + /** Cached connection */ + private Connection m_conn = null; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (CreateAdempiere.class); + + /** + * Create Adempiere Database + * @param databaseType Database.DB_ + */ + private void initDatabase(String databaseType) + { + try + { + for (int i = 0; i < Database.DB_NAMES.length; i++) + { + if (Database.DB_NAMES[i].equals (databaseType)) + { + m_dbTarget = (AdempiereDatabase)Database.DB_CLASSES[i]. + newInstance (); + break; + } + } + } + catch (Exception e) + { + log.severe(e.toString ()); + e.printStackTrace(); + } + if (m_dbTarget == null) + throw new IllegalStateException("No database: " + databaseType); + + // Source Database + m_dbSource = DB.getDatabase(); + } // createDatabase + + /** + * Clean Start - drop & re-create DB + */ + public void cleanStart() + { + Connection conn = getConnection(true, true); + if (conn == null) + throw new IllegalStateException("No Database"); + // + dropDatabase(conn); + createUser(conn); + createDatabase(conn); + // + try + { + if (conn != null) + conn.close(); + } + catch (SQLException e2) + { + log.log(Level.SEVERE, "close connection", e2); + } + conn = null; + } // cleanStart + + + /** + * Set Adempiere User + * @param adempiereUser adempiere id + * @param adempierePassword adempiere password + */ + public void setAdempiereUser (String adempiereUser, String adempierePassword) + { + m_adempiereUser = adempiereUser; + m_adempierePassword = adempierePassword; + } // setAdempiereUser + + /** + * Set Database Name + * @param databaseName db name + * @param databaseDevice device or table space + */ + public void setDatabaseName (String databaseName, String databaseDevice) + { + m_databaseName = databaseName; + m_databaseDevice = databaseDevice; + } // createDatabase + + + /** + * Test Connection + * @return connection + */ + public boolean testConnection() + { + String dbUrl = m_dbTarget.getConnectionURL (m_databaseHost, m_databasePort, + m_databaseName, m_dbTarget.getSystemUser()); // adempiere may not be defined yet + log.info(dbUrl + " - " + m_dbTarget.getSystemUser() + "/" + m_systemPassword); + try + { + Connection conn = m_dbTarget.getDriverConnection(dbUrl, m_dbTarget.getSystemUser(), m_systemPassword); + // + JDBCInfo info = new JDBCInfo(conn); + if (CLogMgt.isLevelFinest()) + { + info.listCatalogs(); + info.listSchemas(); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "test", e); + return false; + } + + return true; + } // testConnection + + + /************************************************************************** + * Create User + * @param sysConn system connection + * @return true if success + */ + public boolean createUser (Connection sysConn) + { + log.info(m_adempiereUser + "/" + m_adempierePassword); + return executeCommands(m_dbTarget.getCommands(AdempiereDatabase.CMD_CREATE_USER), + sysConn, true, false); + } // createUser + + /** + * Create Database (User) + * @param sysConn system connection + * @return true if success + */ + public boolean createDatabase (Connection sysConn) + { + log.info(m_databaseName + "(" + m_databaseDevice + ")"); + return executeCommands(m_dbTarget.getCommands(AdempiereDatabase.CMD_CREATE_DATABASE), + sysConn, true, false); + } // createDatabase + + /** + * Drop Database (User) + * @param sysConn system connection + * @return true if success + */ + public boolean dropDatabase (Connection sysConn) + { + log.info(m_databaseName); + return executeCommands(m_dbTarget.getCommands(AdempiereDatabase.CMD_DROP_DATABASE), + sysConn, true, false); + } // dropDatabase + + + /** + * Create Tables and copy data + * @param whereClause optional where clause + * @param dropFirst drop first + * @return true if executed + */ + public boolean copy (String whereClause, boolean dropFirst) + { + log.info(whereClause); + if (getConnection(false, true) == null) + return false; + // + boolean success = true; + int count = 0; + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_Table"; + if (whereClause != null && whereClause.length() > 0) + sql += " WHERE " + whereClause; + sql += " ORDER BY TableName"; + // + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + //jz: pstmt.getConnection() could be null + Connection conn = pstmt.getConnection(); + DatabaseMetaData md = null; + if (conn != null) + md = conn.getMetaData(); + else + { + //jz: globalization issue?? + throw new DBException("No Connection"); + } + + ResultSet rs = pstmt.executeQuery (); + while (rs.next() && success) + { + MTable table = new MTable (m_ctx, rs, null); + if (table.isView()) + continue; + if (dropFirst) + { + executeCommands(new String[] + {"DROP TABLE " + table.getTableName()}, + m_conn, false, false); + } + // + if (createTable (table, md)) + { + list.add(table.getTableName()); + count++; + } + else + success = false; + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + success = false; + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (!success) + return false; + + /** Enable Contraints */ + enableConstraints(list); + + databaseBuild(); + + log.info("#" + count); + + try + { + if (m_conn != null) + m_conn.close(); + } + catch (SQLException e2) + { + log.log(Level.SEVERE, "close connection", e2); + } + m_conn = null; + return success; + } // copy + + /** + * Execute Script + * @param script file with script + * @return true if executed + */ + public boolean execute (File script) + { + return false; + } // createTables + + + + /** + * Create Table + * @param mTable table model + * @param md meta data + * @return true if created + */ + private boolean createTable (MTable mTable, DatabaseMetaData md) + { + String tableName = mTable.getTableName(); + log.info(tableName); + String catalog = m_dbSource.getCatalog(); + String schema = m_dbSource.getSchema(); + String table = tableName.toUpperCase(); + // + MColumn[] columns = mTable.getColumns(false); + + StringBuffer sb = new StringBuffer("CREATE TABLE "); + sb.append(tableName).append(" ("); + try + { + // Columns + boolean first = true; + ResultSet sourceColumns = md.getColumns(catalog, schema, table, null); + while (sourceColumns.next()) + { + sb.append(first ? "" : ", "); + first = false; + // Case sensitive Column Name + MColumn column = null; + String columnName = sourceColumns.getString("COLUMN_NAME"); + for (int i = 0; i < columns.length; i++) + { + String cn = columns[i].getColumnName(); + if (cn.equalsIgnoreCase(columnName)) + { + columnName = cn; + column = columns[i]; + break; + } + } + sb.append(columnName).append(" "); + // Data Type & Precision + int sqlType = sourceColumns.getInt ("DATA_TYPE"); // sql.Types + String typeName = sourceColumns.getString ("TYPE_NAME"); // DB Dependent + int size = sourceColumns.getInt ("COLUMN_SIZE"); + int decDigits = sourceColumns.getInt("DECIMAL_DIGITS"); + if (sourceColumns.wasNull()) + decDigits = -1; + if (typeName.equals("NUMBER")) + { + /** Oracle Style * + if (decDigits == -1) + sb.append(typeName); + else + sb.append(typeName).append("(") + .append(size).append(",").append(decDigits).append(")"); + /** Other DBs */ + int dt = column.getAD_Reference_ID(); + if (DisplayType.isID(dt)) + sb.append("INTEGER"); + else + { + int scale = DisplayType.getDefaultPrecision(dt); + sb.append("DECIMAL(") + .append(18+scale).append(",").append(scale).append(")"); + } + } + else if (typeName.equals("DATE") || typeName.equals("BLOB") || typeName.equals("CLOB")) + sb.append(typeName); + else if (typeName.equals("CHAR") || typeName.startsWith("VARCHAR")) + sb.append(typeName).append("(").append(size).append(")"); + else if (typeName.startsWith("NCHAR") || typeName.startsWith("NVAR")) + sb.append(typeName).append("(").append(size/2).append(")"); + else if (typeName.startsWith("TIMESTAMP")) + sb.append("DATE"); + else + log.severe("Do not support data type " + typeName); + // Default + String def = sourceColumns.getString("COLUMN_DEF"); + if (def != null) + { + //jz: replace '' to \', otherwise exception + def.replaceAll("''", "\\'"); + sb.append(" DEFAULT ").append(def); + } + // Null + if (sourceColumns.getInt("NULLABLE") == DatabaseMetaData.columnNoNulls) + sb.append(" NOT NULL"); + else + sb.append(" NULL"); + + // Check Contraints + + + } // for all columns + sourceColumns.close(); + + // Primary Key + ResultSet sourcePK = md.getPrimaryKeys(catalog, schema, table); + // TABLE_CAT=null, TABLE_SCHEM=REFERENCE, TABLE_NAME=A_ASSET, COLUMN_NAME=A_ASSET_ID, KEY_SEQ=1, PK_NAME=A_ASSET_KEY + first = true; + boolean hasPK = false; + while (sourcePK.next()) + { + hasPK = true; + if (first) + sb.append(", CONSTRAINT ").append(sourcePK.getString("PK_NAME")).append(" PRIMARY KEY ("); + else + sb.append(","); + first = false; + String columnName = sourcePK.getString("COLUMN_NAME"); + sb.append(checkColumnName(columnName)); + } + if (hasPK) // close constraint + sb.append(")"); // USING INDEX TABLESPACE INDX + sourcePK.close(); + // + sb.append(")"); // close create table + } + catch (Exception ex) + { + log.log(Level.SEVERE, "createTable", ex); + return false; + } + + // Execute Create Table + if (!executeCommands(new String[]{sb.toString()}, m_conn, false, true)) + return true; // continue + + // Create Inexes + createTableIndexes(mTable, md); + + return createTableData(mTable); + } // createTable + + /** + * Check Column Name + * @param columnName column name + * @return column name with correct case + */ + private String checkColumnName (String columnName) + { + return M_Element.getColumnName (columnName); + } // checkColumnName + + /** + * Create Table Indexes + * @param mTable table + * @param md meta data + */ + private void createTableIndexes(MTable mTable, DatabaseMetaData md) + { + String tableName = mTable.getTableName(); + log.info(tableName); + String catalog = m_dbSource.getCatalog(); + String schema = m_dbSource.getSchema(); + String table = tableName.toUpperCase(); + try + { + ResultSet sourceIndex = md.getIndexInfo(catalog, schema, table, false, false); + + } + catch (Exception e) + { + + } + } // createTableIndexes + + + /** + * Create/Copy Table Data + * @param mTable model table + * @return true if data created/copied + */ + private boolean createTableData (MTable mTable) + { + boolean success = true; + int count = 0; + int errors = 0; + long start = System.currentTimeMillis(); + + // Get Table Data + String sql = "SELECT * FROM " + mTable.getTableName(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, mTable.get_TrxName()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + if (createTableDataRow(rs, mTable)) + count++; + else + errors++; + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + success = false; + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + long elapsed = System.currentTimeMillis() - start; + log.config("Inserted=" + count + " - Errors=" + errors + + " - " + elapsed + " ms"); + return success; + } // createTableData + + /** + * Create Table Data Row + * @param rs result set + * @param mTable table + * @return true if created + */ + private boolean createTableDataRow (ResultSet rs, MTable mTable) + { + StringBuffer insert = new StringBuffer ("INSERT INTO ") + .append(mTable.getTableName()).append(" ("); + StringBuffer values = new StringBuffer (); + // + MColumn[] columns = mTable.getColumns(false); + for (int i = 0; i < columns.length; i++) + { + if (i != 0) + { + insert.append(","); + values.append(","); + } + MColumn column = columns[i]; + String columnName = column.getColumnName(); + insert.append(columnName); + // + int dt = column.getAD_Reference_ID(); + try + { + Object value = rs.getObject(columnName); + if (rs.wasNull()) + { + values.append("NULL"); + } + else if (columnName.endsWith("_ID") // Record_ID, C_ProjectType defined as Button + || DisplayType.isNumeric(dt) + || (DisplayType.isID(dt) && !columnName.equals("AD_Language"))) + { + BigDecimal bd = rs.getBigDecimal(columnName); + String s = m_dbTarget.TO_NUMBER(bd, dt); + values.append(s); + } + else if (DisplayType.isDate(dt)) + { + Timestamp ts = rs.getTimestamp(columnName); + String tsString = m_dbTarget.TO_DATE(ts, dt == DisplayType.Date); + values.append(tsString); + } + else if (DisplayType.isLOB(dt)) + { + // ignored + values.append("NULL"); + } + else if (DisplayType.isText(dt) || dt == DisplayType.YesNo + || dt == DisplayType.List || dt == DisplayType.Button + || columnName.equals("AD_Language")) + { + String s = rs.getString(columnName); + values.append(DB.TO_STRING(s)); + } + else + { + log.warning("Unknown DisplayType=" + dt + + " - " + value + " [" + value.getClass().getName() + "]"); + values.append("NuLl"); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, columnName, e); + } + } // for all columns + + // + insert.append(") VALUES (").append(values).append(")"); + return executeCommands(new String[]{insert.toString()}, + m_conn, false, false); // do not convert as text is converted + } // createTableDataRow + + + /** + * Enable Constraints + * @param list list + * @return true if constraints enabled/created + */ + private boolean enableConstraints (ArrayList list) + { + log.info(""); + return false; + } // enableConstraints + + + private void databaseBuild() + { + // Build Script + //jz remove hard coded path later + String fileName = "C:\\Adempiere\\adempiere-all2\\db\\database\\DatabaseBuild.sql"; + File file = new File (fileName); + if (!file.exists()) + log.severe("No file: " + fileName); + + // FileReader reader = new FileReader (file); + + + + } // databaseBuild + + /** + * Get Connection + * @param asSystem if true execute as db system administrator + * @param createNew create new connection + * @return connection or null + */ + private Connection getConnection (boolean asSystem, boolean createNew) + { + if (!createNew && m_conn != null) + return m_conn; + // + String dbUrl = m_dbTarget.getConnectionURL(m_databaseHost, m_databasePort, + (asSystem ? m_dbTarget.getSystemDatabase(m_databaseName) : m_databaseName), + (asSystem ? m_dbTarget.getSystemUser() : m_adempiereUser)); + try + { + if (asSystem) + m_conn = m_dbTarget.getDriverConnection(dbUrl, m_dbTarget.getSystemUser(), m_systemPassword); + else + m_conn = m_dbTarget.getDriverConnection(dbUrl, m_adempiereUser, m_adempierePassword); + } + catch (Exception e) + { + log.log(Level.SEVERE, dbUrl, e); + } + return m_conn; + } // getConnection + + + /************************************************************************** + * Execute Commands + * @param cmds array of SQL commands + * @param conn connection + * @param batch tf true commit as batch + * @param doConvert convert to DB specific notation + * @return true if success + */ + private boolean executeCommands (String[] cmds, Connection conn, + boolean batch, boolean doConvert) + { + if (cmds == null || cmds.length == 0) + { + log.warning("No Commands"); + return false; + } + + Statement stmt = null; + String cmd = null; + String cmdOriginal = null; + try + { + if (conn == null) + { + conn = getConnection(false, false); + if (conn == null) + return false; + } + if (conn.getAutoCommit() == batch) + conn.setAutoCommit(!batch); + stmt = conn.createStatement(); + + // Commands + for (int i = 0; i < cmds.length; i++) + { + cmd = cmds[i]; + cmdOriginal = cmds[i]; + if (cmd == null || cmd.length() == 0) + continue; + // + if (cmd.indexOf('@') != -1) + { + cmd = Util.replace(cmd, "@SystemPassword@", m_systemPassword); + cmd = Util.replace(cmd, "@AdempiereUser@", m_adempiereUser); + cmd = Util.replace(cmd, "@AdempierePassword@", m_adempierePassword); + cmd = Util.replace(cmd, "@SystemPassword@", m_systemPassword); + cmd = Util.replace(cmd, "@DatabaseName@", m_databaseName); + if (m_databaseDevice != null) + cmd = Util.replace(cmd, "@DatabaseDevice@", m_databaseDevice); + } + if (doConvert) + cmd = m_dbTarget.convertStatement(cmd); + writeLog(cmd); + log.finer(cmd); + int no = stmt.executeUpdate(cmd); + log.finest("# " + no); + } + // + stmt.close(); + stmt = null; + // + if (batch) + conn.commit(); + // + return true; + } + catch (Exception e) + { + String msg = e.getMessage(); + if (msg == null || msg.length() == 0) + msg = e.toString(); + msg += " ("; + if (e instanceof SQLException) + { + msg += "State=" + ((SQLException)e).getSQLState() + + ",ErrorCode=" + ((SQLException)e).getErrorCode(); + } + msg += ")"; + if (cmdOriginal != null && !cmdOriginal.equals(cmd)) + msg += " - " + cmdOriginal; + msg += "\n=>" + cmd; + log.log(Level.SEVERE, msg); + } + // Error clean up + try + { + if (stmt != null) + stmt.close(); + } + catch (SQLException e1) + { + log.log(Level.SEVERE, "close statement", e1); + } + stmt = null; + return false; + } // execureCommands + + + /** + * Write to File Log + * @param cmd cmd + */ + private void writeLog (String cmd) + { + try + { + if (m_writer == null) + { + File file = File.createTempFile("create", ".log"); + m_writer = new PrintWriter(new FileWriter(file)); + log.info(file.toString()); + } + m_writer.println(cmd); + m_writer.flush(); + } + catch (Exception e) + { + log.severe(e.toString()); + } + } // writeLog + + private PrintWriter m_writer = null; + + + /************************************************************************** + * Create DB + * @param args + */ + public static void main (String[] args) + { + Adempiere.startup(true); + CLogMgt.setLevel(Level.FINE); + CLogMgt.setLoggerLevel(Level.FINE,null); + + // C_UOM_Conversion + // I_BankStatement + // + // Derby + //jz: changed the password from "" to null + //begin vpj-cd e-Evolution 03/03/2005 PostgreSQL + //PostgreSQL + //CreateCompiere cc = new CreateCompiere (Database.DB_DERBY, "localhost", 1527, null); + //cc.setCompiereUser("adempiere", "adempiere"); + //cc.setDatabaseName("adempiere", "adempiere"); + CreateAdempiere cc = new CreateAdempiere (Database.DB_POSTGRESQL, "127.0.0.2", 5432 , "adempiere"); + cc.setAdempiereUser("adempiere", "adempiere"); + cc.setDatabaseName("adempiere", "adempiere"); + // end begin vpj-cd e-Evolution 03/03/2005 PostgreSQL + if (!cc.testConnection()) + return; + cc.cleanStart(); + // + // cc.copy(null, false); + cc.copy("TableName > 'C_RfQResponseLineQty'", false); + } // main + +} // CreateAdempiere diff --git a/dbPort/src/org/compiere/db/DBRes.java b/dbPort/src/org/compiere/db/DBRes.java new file mode 100644 index 0000000000..e3814b6656 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Jorg Janke + * @version $Id: DBRes.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Adempiere Connection" }, + { "Name", "Name" }, + { "AppsHost", "Application Host" }, + { "AppsPort", "Application Port" }, + { "TestApps", "Test Application Server" }, + { "DBHost", "Database Host" }, + { "DBPort", "Database Port" }, + { "DBName", "Database Name" }, + { "DBUidPwd", "User / Password" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Firewall Host" }, + { "FWPort", "Firewall Port" }, + { "TestConnection", "Test Database" }, + { "Type", "Database Type" }, + { "BequeathConnection", "Bequeath Connection" }, + { "Overwrite", "Overwrite" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Connection Error" }, + { "ServerNotActive", "Server Not Active" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_ar.java b/dbPort/src/org/compiere/db/DBRes_ar.java new file mode 100644 index 0000000000..aa547db217 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_ar.java @@ -0,0 +1,61 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * @author Jorg Janke + * @version $Id: DBRes_ar.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_ar extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "\u0631\u0628\u0637 \u0643\u0645\u0628\u064a\u0631" }, + { "Name", "\u0627\u0644\u0627\u0650\u0633\u0645" }, + { "AppsHost", "\u0645\u0636\u064a\u0641 \u0627\u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a" }, + { "AppsPort", "\u0627\u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0645\u0646\u0641\u062f" }, + { "TestApps", "\u062c\u0631\u0628 \u0645\u0648\u0632\u0639 \u0627\u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a" }, + { "DBHost", "\u0645\u0636\u064a\u0641 \u0642\u0627\u0639\u062f\u0629 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a" }, + { "DBPort", "\u0645\u0646\u0641\u0630 \u0642\u0627\u0639\u062f\u0629 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a" }, + { "DBName", "\u0627\u0650\u0633\u0645 \u0642\u0627\u0639\u062f\u0629 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a" }, + { "DBUidPwd", "\u0627\u0644\u0645\u0633\u062a\u0639\u0645\u0644\\u0643\u0644\u0645\u0629 \u0627\u0644\u0633\u0631" }, + { "ViaFirewall", "\u0639\u0628\u0631 \u062c\u062f\u0627\u0631 \u0646\u0627\u0631\u064a" }, + { "FWHost", "\u0645\u0636\u064a\u0641 \u0627\u0644\u062c\u062f\u0627\u0631 \u0627\u0644\u0646\u0627\u0631\u064a" }, + { "FWPort", "\u0645\u0646\u0641\u0630 \u0627\u0644\u062c\u062f\u0627\u0631 \u0627\u0644\u0646\u0627\u0631\u064a" }, + { "TestConnection", "\u0645\u0646\u0641\u0630 \u0628\u0646\u0643 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a" }, + { "Type", "\u0646\u0648\u0639 \u0642\u0627\u0639\u062f\u0629 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a" }, + { "BequeathConnection", "\u062a\u0631\u0643\u0629 \u0627\u0644\u0631\u0651\u064e\u0628\u0637" }, + { "Overwrite", "\u0627\u0633\u062d\u0642" }, + { "RMIoverHTTP", "HTTP \u0645\u0631\u0651\u0631 \u0627\u0644\u0643\u0627\u0626\u0646\u0627\u062a \u0639\u0628\u0631 \u0646\u0641\u0642" }, + { "ConnectionError", "\u062e\u0637\u0623 \u0623\u062b\u0646\u0627\u0621 \u0627\u0644\u0631\u0628\u0637" }, + { "ServerNotActive", "\u0627\u0644\u0645\u0648\u0632\u0639 \u0644\u0627 \u064a\u0639\u0645\u0644" } + }; + + /** + * Get Contsnts + * @return contents + * @uml.property name="contents" + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // DBRes_ar_TN + diff --git a/dbPort/src/org/compiere/db/DBRes_bg.java b/dbPort/src/org/compiere/db/DBRes_bg.java new file mode 100644 index 0000000000..c02dfd80a5 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_bg.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Plamen Niikolov + * @version $Id: DBRes_bg.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_bg extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "\u0412\u0440\u044a\u0437\u043a\u0430" }, + { "Name", "\u0418\u043c\u0435" }, + { "AppsHost", "\u0421\u044a\u0440\u0432\u0435\u0440 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u0442\u043e" }, + { "AppsPort", "\u041f\u043e\u0440\u0442 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u0442\u043e" }, + { "TestApps", "\u0422\u0435\u0441\u0442 \u043d\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u0442\u043e" }, + { "DBHost", "\u0421\u044a\u0440\u0432\u0435\u0440 \u043d\u0430 \u0431\u0430\u0437\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u0438" }, + { "DBPort", "\u041f\u043e\u0440\u0442 \u043d\u0430 \u0431\u0430\u0437\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u0438" }, + { "DBName", "\u0418\u043c\u0435 \u043d\u0430 \u0431\u0430\u0437\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u0438" }, + { "DBUidPwd", "\u041f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b / \u041f\u0430\u0440\u043e\u043b\u0430" }, + { "ViaFirewall", "\u0417\u0430\u0434 \u0437\u0430\u0449\u0438\u0442\u043d\u0430 \u0441\u0442\u0435\u043d\u0430" }, + { "FWHost", "\u0421\u044a\u0440\u0432\u0435\u0440 \u043d\u0430 \u0437\u0430\u0449\u0438\u0442\u043d\u0430\u0442\u0430 \u0441\u0442\u0435\u043d\u0430" }, + { "FWPort", "\u041f\u043e\u0440\u0442 \u043d\u0430 \u0437\u0430\u0449\u0438\u0442\u043d\u0430\u0442\u0430 \u0441\u0442\u0435\u043d\u0430" }, + { "TestConnection", "\u0422\u0435\u0441\u0442 \u043d\u0430 \u0431\u0430\u0437\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u0438" }, + { "Type", "\u0412\u0438\u0434 \u043d\u0430 \u0431\u0430\u0437\u0430\u0442\u0430 \u0434\u0430\u043d\u043d\u0438" }, + { "BequeathConnection", "\u041b\u043e\u043a\u0430\u043b\u043d\u0430 \u0432\u0440\u044a\u0437\u043a\u0430" }, + { "Overwrite", "\u0417\u0430\u043c\u044f\u043d\u0430" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u0413\u0440\u0435\u0448\u043a\u0430 \u043f\u0440\u0438 \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435" }, + { "ServerNotActive", "\u0421\u044a\u0440\u0432\u0435\u0440\u044a\u0442 \u043d\u0435 \u0435 \u0430\u043a\u0442\u0438\u0432\u0435\u043d" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_ca.java b/dbPort/src/org/compiere/db/DBRes_ca.java new file mode 100644 index 0000000000..86fa6f6c25 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_ca.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Jaume Teixi + * @version $Id: DBRes_ca.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_ca extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Connexiïŋ― Adempiere" }, + { "Name", "Nom" }, + { "AppsHost", "Servidor Aplicaciïŋ―" }, + { "AppsPort", "Port Aplicaciïŋ―" }, + { "TestApps", "Provar Aplicaciïŋ―" }, + { "DBHost", "Servidor Base de Dades" }, + { "DBPort", "Port Base de Dades" }, + { "DBName", "Nom Base de Dades" }, + { "DBUidPwd", "Usuari / Contrasenya" }, + { "ViaFirewall", "via Tallafocs" }, + { "FWHost", "Servidor Tallafocs" }, + { "FWPort", "Port Tallafocs" }, + { "TestConnection", "Provar Base de Dades" }, + { "Type", "Tipus Base de Dades" }, + { "BequeathConnection", "Delegar Connexiïŋ―" }, + { "Overwrite", "Sobrescriure" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Error Connexiïŋ―" }, + { "ServerNotActive", "Servidor No Actiu" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_da.java b/dbPort/src/org/compiere/db/DBRes_da.java new file mode 100644 index 0000000000..91c20cb53d --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_da.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Jorg Janke + * @version $Id: DBRes_da.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_da extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere forbindelse" }, + { "Name", "Navn" }, + { "AppsHost", "ProgramvÃĶrt" }, + { "AppsPort", "Programport" }, + { "TestApps", "Test programserver" }, + { "DBHost", "DatabasevÃĶrt" }, + { "DBPort", "Databaseport" }, + { "DBName", "Databasenavn" }, + { "DBUidPwd", "Bruger/adgangskode" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Firewall-vÃĶrt" }, + { "FWPort", "Firewall-port" }, + { "TestConnection", "Test database" }, + { "Type", "Databasetype" }, + { "BequeathConnection", "Nedarv forbindelse" }, + { "Overwrite", "Overskriv" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Fejl i forbindelse" }, + { "ServerNotActive", "Server er ikke aktiv" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_de.java b/dbPort/src/org/compiere/db/DBRes_de.java new file mode 100644 index 0000000000..bebfa6fb6c --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_de.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings (German) + * + * @author Jorg Janke + * @version $Id: DBRes_de.java,v 1.3 2006/08/30 20:30:44 comdivision Exp $ + */ +public class DBRes_de extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere Verbindung" }, + { "Name", "Name" }, + { "AppsHost", "Applikationsserver" }, + { "AppsPort", "Port Applikationsserver" }, + { "TestApps", "Test Applikationsserver" }, + { "DBHost", "Datenbank Server" }, + { "DBPort", "Datenbank Port" }, + { "DBName", "Datenbank Name" }, + { "DBUidPwd", "Nutzer / Kennwort" }, + { "ViaFirewall", "ïŋ―ber Firewall" }, + { "FWHost", "Firewall Server" }, + { "FWPort", "Firewall Port" }, + { "TestConnection", "Teste Datenbankverbindung" }, + { "Type", "Datenbank Typ" }, + { "BequeathConnection", "Bequeath Connection" }, + { "Overwrite", "ueberschreiben" }, + { "ConnectionProfile", "Verbindungsprofil" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Verbindungsfehler" }, + { "ServerNotActive", "Rechner nicht erreichbar" } + }; + + /** + * Get Contents + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContents +} // Res_de diff --git a/dbPort/src/org/compiere/db/DBRes_es.java b/dbPort/src/org/compiere/db/DBRes_es.java new file mode 100644 index 0000000000..a7544e3156 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_es.java @@ -0,0 +1,59 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Erwin Cortes + * @version $Id: DBRes_es.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_es extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Conexión ADempiere" }, + { "Name", "Nombre" }, + { "AppsHost", "Servidor de Aplicación" }, + { "AppsPort", "Puerto de Aplicación" }, + { "TestApps", "Test de Aplicación" }, + { "DBHost", "Host de Base de Datos" }, + { "DBPort", "Puerto de Base de Datos" }, + { "DBName", "Nombre de Base de datos" }, + { "DBUidPwd", "Usuario / Contraseņa" }, + { "ViaFirewall", "vía Firewall" }, + { "FWHost", "Servidor de Firewall" }, + { "FWPort", "Puerto del Firewall" }, + { "TestConnection", "Test de Base de datos" }, + { "Type", "Tipo de Base de Datos" }, + { "BequeathConnection", "Conexión Heredada" }, + { "Overwrite", "Sobreescribir" }, + { "RMIoverHTTP", "Tunelizar Objetos vía HTTP" }, + { "ConnectionError", "Error en conexión" }, + { "ServerNotActive", "Servidor inactivo" }}; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_fa.java b/dbPort/src/org/compiere/db/DBRes_fa.java new file mode 100644 index 0000000000..e66572b377 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_fa.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author . + * @version $Id: DBRes_fa.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_fa extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "\u0627\u062a\u0635\u0627\u0644 \u0628\u0647 \u06a9\u0627\u0645\u067e\u064a\u0631\u0647" }, + { "Name", "\u0646\u0627\u0645" }, + { "AppsHost", "\u0633\u064a\u0633\u062a\u0645 \u0645\u064a\u0632\u0628\u0627\u0646 \u06a9\u0627\u0631\u0628\u0631\u062f" }, + { "AppsPort", "\u062f\u0631\u06af\u0627\u0647 \u06a9\u0627\u0631\u0628\u0631\u062f" }, + { "TestApps", "\u0633\u0631\u0648\u0631 \u06a9\u0627\u0631\u0628\u0631\u062f \u0622\u0632\u0645\u0627\u064a\u0634\u06cc" }, + { "DBHost", "\u0645\u064a\u0632\u0628\u0627\u0646 \u0628\u0627\u0646\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc" }, + { "DBPort", "\u062f\u0631\u06af\u0627\u0647 \u0628\u0627\u0646\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc" }, + { "DBName", "\u0646\u0627\u0645 \u0628\u0627\u0646\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a" }, + { "DBUidPwd", "\u0645\u0634\u062e\u0635\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u0646\u062f\u0647 \u0648 \u06a9\u0644\u0645\u0647 \u0639\u0628\u0648\u0631" }, + { "ViaFirewall", "\u0627\u0632 \u0637\u0631\u0650\u064a\u0642 \u0641\u0627\u064a\u0631\u0648\u0627\u0644" }, + { "FWHost", "\u0645\u064a\u0632\u0628\u0627\u0646 \u0641\u0627\u064a\u0631\u0648\u0627\u0644" }, + { "FWPort", "\u062f\u0631\u06af\u0627\u0647 \u0641\u0627\u064a\u0631\u0648\u0627\u0644" }, + { "TestConnection", "\u0628\u0627\u0646\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0622\u0632\u0645\u0627\u064a\u0634" }, + { "Type", "\u0646\u0648\u0639 \u0628\u0627\u0646\u06a9 \u0627\u0637\u0644\u0627\u0639\u0627\u062a" }, + { "BequeathConnection", "\u0627\u062a\u0635\u0627\u0644 \u062a\u062e\u0635\u064a\u0635 \u062f\u0627\u062f\u0647 \u0634\u062f\u0647" }, + { "Overwrite", "\u0628\u0627\u0632\u0646\u0648\u064a\u0633\u06cc" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u062e\u0637\u0627 \u062f\u0631 \u0627\u062a\u0635\u0627\u0644" }, + { "ServerNotActive", "\u0633\u0631\u0648\u0631 \u0641\u0639\u0627\u0644 \u0646\u064a\u0633\u062a" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_fi.java b/dbPort/src/org/compiere/db/DBRes_fi.java new file mode 100644 index 0000000000..e8baca5b19 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_fi.java @@ -0,0 +1,67 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings for Finnish language + * + * @author Petteri Soininen (petteri.soininen@netorek.fi) + * @version $Id: DBRes_fi.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_fi extends ListResourceBundle +{ + /** + * Data + */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Adempiere-yhteys" }, + { "Name", "Nimi" }, + { "AppsHost", "Sovellusverkkoasema" }, + { "AppsPort", "Sovellusportti" }, + { "TestApps", "Testisovelluspalvelin" }, + { "DBHost", "Tietokantaverkkoasema" }, + { "DBPort", "Tietokantaportti" }, + { "DBName", "Tietokannan nimi" }, + { "DBUidPwd", "Kïŋ―yttïŋ―jïŋ―tunnus / Salasana" }, + { "ViaFirewall", "Palomuurin lïŋ―pi" }, + { "FWHost", "Palomuuriverkkoasema" }, + { "FWPort", "Palomuuriportti" }, + { "TestConnection", "Testitietokanta" }, + { "Type", "Tietokantatyyppi" }, + { "BequeathConnection", "Periytyvïŋ― yhteys" }, + { "Overwrite", "Korvaa" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Yhteysvirhe" }, + { "ServerNotActive", "Palvelin ei aktiivinen" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res + diff --git a/dbPort/src/org/compiere/db/DBRes_fr.java b/dbPort/src/org/compiere/db/DBRes_fr.java new file mode 100644 index 0000000000..86083a075e --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_fr.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings (French) + * + * @author Jean-Luc SCHEIDEGGER + * @version $Id: DBRes_fr.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_fr extends ListResourceBundle +{ + /** Translation Content */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Connexion Adempiere" }, + { "Name", "Nom" }, + { "AppsHost", "Hote d'Application" }, + { "AppsPort", "Port de l'Application" }, + { "TestApps", "Application de Test" }, + { "DBHost", "Hote Base de Donnïŋ―es" }, + { "DBPort", "Port Base de Donnïŋ―es" }, + { "DBName", "Nom Base de Donnïŋ―es" }, + { "DBUidPwd", "Utilisateur / Mot de Passe" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Hote Firewall" }, + { "FWPort", "Port Firewall" }, + { "TestConnection", "Test Base de Donnïŋ―es" }, + { "Type", "Type Base de Donnïŋ―es" }, + { "BequeathConnection", "Connexion dïŋ―diïŋ―e" }, + { "Overwrite", "Ecraser" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Erreur Connexion" }, + { "ServerNotActive", "Serveur Non Actif" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContents +} // DBRes_fr diff --git a/dbPort/src/org/compiere/db/DBRes_hr.java b/dbPort/src/org/compiere/db/DBRes_hr.java new file mode 100644 index 0000000000..ae21343e9f --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_hr.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Marko Bubalo + * @version $Id: DBRes_hr.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_hr extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Adempiere veza" }, + { "Name", "Naziv" }, + { "AppsHost", "Host aplikacije" }, + { "AppsPort", "Port aplikacije" }, + { "TestApps", "Testiranje servera" }, + { "DBHost", "Host baze" }, + { "DBPort", "Port baze" }, + { "DBName", "Naziv baze" }, + { "DBUidPwd", "Korisnik / lozinka" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Firewall Host" }, + { "FWPort", "Firewall Port" }, + { "TestConnection", "Tesiranje baze" }, + { "Type", "Tip baze" }, + { "BequeathConnection", "Bequeath Connection" }, + { "Overwrite", "Prebrisati" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Greïŋ―ka u vezi" }, + { "ServerNotActive", "Server nije aktivan" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res + diff --git a/dbPort/src/org/compiere/db/DBRes_in.java b/dbPort/src/org/compiere/db/DBRes_in.java new file mode 100644 index 0000000000..94d58bf8d7 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_in.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Halim Englen + * @version $Id: DBRes_in.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_in extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Koneksi Ke Adempiere" }, + { "Name", "Nama" }, + { "AppsHost", "Pusat Aplikasi" }, + { "AppsPort", "Port Aplikasi" }, + { "TestApps", "Uji Server Aplikasi" }, + { "DBHost", "Pusat Database" }, + { "DBPort", "Port Database" }, + { "DBName", "Nama Database" }, + { "DBUidPwd", "ID Pengguna / Kata Sandi" }, + { "ViaFirewall", "lewat Firewall" }, + { "FWHost", "Pusat Firewall" }, + { "FWPort", "Port Firewall" }, + { "TestConnection", "Uji Koneksi" }, + { "Type", "Tipe Database" }, + { "BequeathConnection", "Koneksi Warisan" }, + { "Overwrite", "Timpakan" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Kesalahan Koneksi" }, + { "ServerNotActive", "Server tidak aktif" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_it.java b/dbPort/src/org/compiere/db/DBRes_it.java new file mode 100644 index 0000000000..a66b279ce7 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_it.java @@ -0,0 +1,63 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Alessandro Riolo + * @version $Id: DBRes_it.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_it extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Connessione a Adempiere" }, + { "Name", "Nome" }, + { "AppsHost", "Host dell'Applicativo" }, + { "AppsPort", "Porta dell'Applicativo" }, + { "TestApps", "Applicazione di Test" }, + { "DBHost", "Host del Database" }, + { "DBPort", "Porta del Database" }, + { "DBName", "Nome del Database" }, + { "DBUidPwd", "Utente / Password" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Host del Firewall" }, + { "FWPort", "Porta del Firewall" }, + { "TestConnection", "Database di Test" }, + { "Type", "Tipo di Database" }, + { "BequeathConnection", "Connessione Dedicata" }, + { "Overwrite", "Sovrascri" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Errore di Connessione" }, + { "ServerNotActive", "Server non Attivo" }}; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_ja.java b/dbPort/src/org/compiere/db/DBRes_ja.java new file mode 100644 index 0000000000..1a1ad65675 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_ja.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Stefan Christians + * @version $Id: DBRes_ja.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_ja extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "\u30b3\u30f3\u30d4\u30a8\u30fc\u30ec\u306e\u63a5\u7d9a" }, + { "Name", "\u540d\u524d" }, + { "AppsHost", "\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30b5\u30fc\u30d0" }, + { "AppsPort", "\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30dd\u30fc\u30c8" }, + { "TestApps", "\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30fb\u30b5\u30fc\u30d0\u306e\u30c6\u30b9\u30c8" }, + { "DBHost", "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30fb\u30b5\u30fc\u30d0" }, + { "DBPort", "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30fb\u30dd\u30fc\u30c8" }, + { "DBName", "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u540d\u524d" }, + { "DBUidPwd", "\u30e6\u30fc\u30b6 / \u30d1\u30b9\u30ef\u30fc\u30c9" }, + { "ViaFirewall", "\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb" }, + { "FWHost", "\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30fb\u30b5\u30fc\u30d0" }, + { "FWPort", "\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30fb\u30dd\u30fc\u30c8" }, + { "TestConnection", "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30fb\u30b5\u30fc\u30d0\u306e\u30c6\u30b9\u30c8" }, + { "Type", "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9" }, + { "BequeathConnection", "\u53e4\u63a5\u7d9a" }, + { "Overwrite", "\u30aa\u30fc\u30f4\u30a1\u30e9\u30a4\u30c8" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u63a5\u7d9a\u306e\u30a8\u30e9\u30fc" }, + { "ServerNotActive", "\u30b5\u30fc\u30d0\u3092\u898b\u4ed8\u3051\u308c\u306a\u3044" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_ml.java b/dbPort/src/org/compiere/db/DBRes_ml.java new file mode 100644 index 0000000000..3298fe5c97 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_ml.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author . + * @version $Id: DBRes_ml.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_ml extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere Connection" }, + { "Name", "Name" }, + { "AppsHost", "Application Host" }, + { "AppsPort", "Application Port" }, + { "TestApps", "Test Application" }, + { "DBHost", "Database Host" }, + { "DBPort", "Database Port" }, + { "DBName", "Database Name" }, + { "DBUidPwd", "User / Password" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Firewall Host" }, + { "FWPort", "Firewall Port" }, + { "TestConnection", "Test Database" }, + { "Type", "Database Type" }, + { "BequeathConnection", "Bequeath Connection" }, + { "Overwrite", "Overwrite" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Connection Error" }, + { "ServerNotActive", "Server Not Active" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_nl.java b/dbPort/src/org/compiere/db/DBRes_nl.java new file mode 100644 index 0000000000..ba7ff7e4b6 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_nl.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Eldir Tomassen + * @version $Id: DBRes_nl.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_nl extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Verbinding met Adempiere" }, + { "Name", "Naam" }, + { "AppsHost", "Applicatie Server" }, + { "AppsPort", "Applicatie Poort" }, + { "TestApps", "Test Applicatie" }, + { "DBHost", "Database Server" }, + { "DBPort", "Database Poort" }, + { "DBName", "Database Naam" }, + { "DBUidPwd", "Gebruikersnaam / Wachtwoord" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Firewall" }, + { "FWPort", "Firewall Poort" }, + { "TestConnection", "Test Database" }, + { "Type", "Database Type" }, + { "BequeathConnection", "Lokale Connectie" }, + { "Overwrite", "Overschrijven" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Fout bij verbinden" }, + { "ServerNotActive", "Server Niet Actief" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_no.java b/dbPort/src/org/compiere/db/DBRes_no.java new file mode 100644 index 0000000000..385cffdeb5 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_no.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Norwegian Connection Resource Strings + * + * @author Olaf Slazak Lïŋ―ken + * @version $Id: DBRes_no.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_no extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere Forbindelse" }, + { "Name", "Navn" }, + { "AppsHost", "Applikasjon Maskine" }, + { "AppsPort", "Applikasjon Port" }, + { "TestApps", "Test Applikasjon " }, + { "DBHost", "Database Maskin" }, + { "DBPort", "Database Port" }, + { "DBName", "Database Navn" }, + { "DBUidPwd", "Bruker /Passord" }, + { "ViaFirewall", "Gjennom Brannmur" }, + { "FWHost", "Brannmur Maskin" }, + { "FWPort", "Brannmur Port" }, + { "TestConnection", "Test Database" }, + { "Type", "Database Type" }, + { "BequeathConnection", "Bequeath Forbindelse" }, + { "Overwrite", "Overskriv" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Feil ved Oppkobling" }, + { "ServerNotActive", "Server Ikke Aktivert" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_pl.java b/dbPort/src/org/compiere/db/DBRes_pl.java new file mode 100644 index 0000000000..8116b1150b --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_pl.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Adam Bodurka + * @version $Id: DBRes_pl.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_pl extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Po\u0142\u0105czenie z Adempiere" }, + { "Name", "Nazwa" }, + { "AppsHost", "Host Aplikacji" }, + { "AppsPort", "Port Aplikacji" }, + { "TestApps", "Test Aplikacji" }, + { "DBHost", "Host Bazy Danych" }, + { "DBPort", "Port Bazy Danych" }, + { "DBName", "Nazwa Bazy Danych" }, + { "DBUidPwd", "U\u017cytkownik / Has\u0142o" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Host Firewall-a" }, + { "FWPort", "Port Firewall-a" }, + { "TestConnection", "Test Bazy Danych" }, + { "Type", "Typ Bazy Danych" }, + { "BequeathConnection", "Zapisuj Po\u0142\u0105czenie" }, + { "Overwrite", "Nadpisuj" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "B\u0142\u0105d po\u0142\u0105czenia" }, + { "ServerNotActive", "Serwer nie jest aktywny" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_pt.java b/dbPort/src/org/compiere/db/DBRes_pt.java new file mode 100644 index 0000000000..c8aa88b09d --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_pt.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Jesse Jr + * @version $Id: DBRes_pt.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_pt extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere Conexïŋ―o" }, + { "Name", "Nome" }, + { "AppsHost", "Servidor de Aplicaïŋ―ïŋ―o" }, + { "AppsPort", "Porta TCP da Aplicaïŋ―ïŋ―o" }, + { "TestApps", "Testar Aplicaïŋ―ïŋ―o" }, + { "DBHost", "Servidor do Banco de Dado" }, + { "DBPort", "Porta TCP do Banco de Dados" }, + { "DBName", "Nome do Banco de Dados" }, + { "DBUidPwd", "Usuïŋ―rio / Senha" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Servidor de Firewall" }, + { "FWPort", "Porta TCP do Firewall" }, + { "TestConnection", "Testar Banco de Dados" }, + { "Type", "Tipo de Banco de Dados" }, + { "BequeathConnection", "Conexïŋ―o Bequeath" }, + { "Overwrite", "Sobrescrever" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Erro de Conexïŋ―o" }, + { "ServerNotActive", "Servidor nïŋ―o Ativo" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_ro.java b/dbPort/src/org/compiere/db/DBRes_ro.java new file mode 100644 index 0000000000..255faffe73 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_ro.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Jorg Janke + * @version $Id: DBRes_ro.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_ro extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Conexiune" }, + { "Name", "Nume" }, + { "AppsHost", "Server de aplica\u0163ie" }, + { "AppsPort", "Port de aplica\u0163ie" }, + { "TestApps", "Testare a serverului de aplica\u0163ie" }, + { "DBHost", "Server de baz\u0103 de date" }, + { "DBPort", "Port de baz\u0103 de date" }, + { "DBName", "Numele bazei de date" }, + { "DBUidPwd", "Utilizator / parol\u0103" }, + { "ViaFirewall", "Prin firewall" }, + { "FWHost", "Gazd\u0103 de firewall" }, + { "FWPort", "Port de firewall" }, + { "TestConnection", "Testare a bazei de date" }, + { "Type", "Tip al bazei de date" }, + { "BequeathConnection", "Cedare de conexiune" }, + { "Overwrite", "Suprascriere" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Eroare de conexiune" }, + { "ServerNotActive", "Serverul este inactiv" } + }; + + /** + * Get Contents + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_ru.java b/dbPort/src/org/compiere/db/DBRes_ru.java new file mode 100644 index 0000000000..d59a51dc14 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_ru.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Vyacheslav Pedak + * @version $Id: DBRes_ru.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_ru extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "\u0421\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 Adempiere" }, + { "Name", "\u0418\u043c\u044f" }, + { "AppsHost", "\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f" }, + { "AppsPort", "\u041f\u043e\u0440\u0442" }, + { "TestApps", "\u0422\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435" }, + { "DBHost", "\u0421\u0435\u0440\u0432\u0435\u0440 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445" }, + { "DBPort", "\u041f\u043e\u0440\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445" }, + { "DBName", "\u0418\u043c\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445" }, + { "DBUidPwd", "\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c / \u041f\u0430\u0440\u043e\u043b\u044c" }, + { "ViaFirewall", "\u0447\u0435\u0440\u0435\u0437 Firewall" }, + { "FWHost", "\u0421\u0435\u0440\u0432\u0435\u0440 Firewall" }, + { "FWPort", "\u041f\u043e\u0440\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Firewall" }, + { "TestConnection", "\u0422\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445" }, + { "Type", "\u0422\u0438\u043f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445" }, + { "BequeathConnection", "Bequeath \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435" }, + { "Overwrite", "\u041f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f" }, + { "ServerNotActive", "\u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0435\u043d" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_sl.java b/dbPort/src/org/compiere/db/DBRes_sl.java new file mode 100644 index 0000000000..f5996cfcf7 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_sl.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Matja\u017e Godec + * @version $Id: DBRes_sl.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_sl extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Adempiere povezava" }, + { "Name", "Ime" }, + { "AppsHost", "Programski stre\u017enik" }, + { "AppsPort", "Vrata programskega stre\u017enika" }, + { "TestApps", "Test programskega stre\u017enika" }, + { "DBHost", "Stre\u017enik baze podatkov" }, + { "DBPort", "Vrata baze podatkov" }, + { "DBName", "Ime baze podatkov" }, + { "DBUidPwd", "Uporabnik / geslo" }, + { "ViaFirewall", "Skozi po\u017earni zid" }, + { "FWHost", "Po\u017earni zid" }, + { "FWPort", "Vrata po\u017earnega zidu" }, + { "TestConnection", "Testiranje baze podatkov" }, + { "Type", "Tip baze podatkov" }, + { "BequeathConnection", "Bequeath Connection" }, + { "Overwrite", "Prepi\u0161i" }, + { "ConnectionProfile", "Povezava" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Napaka na povezavi" }, + { "ServerNotActive", "Stre\u017enik ni aktiven" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res + diff --git a/dbPort/src/org/compiere/db/DBRes_sv.java b/dbPort/src/org/compiere/db/DBRes_sv.java new file mode 100644 index 0000000000..da946c2a7d --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_sv.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Swedish Connection Resource Strings + * + * @author Thomas Dilts + * @version $Id: DBRes_sv.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_sv extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere anslutning" }, + { "Name", "Namn" }, + { "AppsHost", "Program vïŋ―rddator" }, + { "AppsPort", "Program port" }, + { "TestApps", "Test program" }, + { "DBHost", "Databas vïŋ―rddator" }, + { "DBPort", "Databas port" }, + { "DBName", "Databas namn" }, + { "DBUidPwd", "Anvïŋ―ndarnamn / lïŋ―senord" }, + { "ViaFirewall", "via Firewall" }, + { "FWHost", "Firewall vïŋ―rddator" }, + { "FWPort", "Firewall port" }, + { "TestConnection", "Test databas" }, + { "Type", "Databas typ" }, + { "BequeathConnection", "Efterlïŋ―mna anslutning" }, + { "Overwrite", "Skriv ïŋ―ver" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "Anslutningsfel" }, + { "ServerNotActive", "Server ej activ" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_th.java b/dbPort/src/org/compiere/db/DBRes_th.java new file mode 100644 index 0000000000..e48f91c518 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_th.java @@ -0,0 +1,63 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings (Thai) + * + * @author Sureeraya Limpaibul + * @version $Id: DBRes_th.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_th extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][]{ + { "CConnectionDialog", "Adempiere Connection" }, + { "Name", "\u0e0a\u0e37\u0e48\u0e2d" }, + { "AppsHost", "\u0e41\u0e2d\u0e47\u0e1e\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e48\u0e19 \u0e42\u0e2e\u0e2a" }, + { "AppsPort", "\u0e41\u0e2d\u0e47\u0e1e\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e48\u0e19 \u0e1e\u0e2d\u0e23\u0e4c\u0e15" }, + { "TestApps", "\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e41\u0e2d\u0e47\u0e1e\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e48\u0e19" }, + { "DBHost", "\u0e42\u0e2e\u0e2a\u0e02\u0e2d\u0e07\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25" }, + { "DBPort", "\u0e1e\u0e2d\u0e23\u0e4c\u0e15\u0e02\u0e2d\u0e07\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25" }, + { "DBName", "\u0e0a\u0e37\u0e48\u0e2d\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25" }, + { "DBUidPwd", "\u0e0a\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49 / \u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19" }, + { "ViaFirewall", "\u0e1c\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e23\u0e27\u0e2d\u0e25" }, + { "FWHost", "\u0e44\u0e1f\u0e23\u0e27\u0e2d\u0e25 \u0e42\u0e2e\u0e2a" }, + { "FWPort", "\u0e1e\u0e2d\u0e23\u0e4c\u0e15\u0e44\u0e1f\u0e23\u0e27\u0e2d\u0e25" }, + { "TestConnection", "\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25" }, + { "Type", "\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25" }, + { "BequeathConnection", "Bequeath Connection" }, + { "Overwrite", "\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e17\u0e31\u0e1a" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u0e01\u0e32\u0e23\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e1c\u0e34\u0e14\u0e1e\u0e25\u0e32\u0e14" }, + { "ServerNotActive", "\u0e40\u0e0a\u0e34\u0e23\u0e4c\u0e1f\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e44\u0e21\u0e48\u0e41\u0e2d\u0e47\u0e04\u0e17\u0e35\u0e1f" }}; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_vi.java b/dbPort/src/org/compiere/db/DBRes_vi.java new file mode 100644 index 0000000000..9c31fa2b88 --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_vi.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author Bui Chi Trung + * @version $Id: DBRes_vi.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_vi extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "K\u1EBFt n\u1ED1i" }, + { "Name", "Tïŋ―n" }, + { "AppsHost", "Mïŋ―y ch\u1EE7 \u1EE9ng d\u1EE5ng" }, + { "AppsPort", "C\u1ED5ng \u1EE9ng d\u1EE5ng" }, + { "TestApps", "Th\u1EED nghi\u1EC7m \u1EE9ng d\u1EE5ng" }, + { "DBHost", "Mïŋ―y ch\u1EE7 CSDL" }, + { "DBPort", "C\u1ED5ng CSDL" }, + { "DBName", "Tïŋ―n CSDL" }, + { "DBUidPwd", "Ng\u01B0\u1EDDi dïŋ―ng / M\u1EADt kh\u1EA9u" }, + { "ViaFirewall", "Qua b\u1EE9c t\u01B0\u1EDDng l\u1EEDa" }, + { "FWHost", "Mïŋ―y ch\u1EE7 b\u1EE9c t\u01B0\u1EDDng l\u1EEDa" }, + { "FWPort", "C\u1ED5ng vïŋ―o b\u1EE9c t\u01B0\u1EDDng l\u1EEDa" }, + { "TestConnection", "Ki\u1EC3m tra CSDL" }, + { "Type", "Lo\u1EA1i CSDL" }, + { "BequeathConnection", "Truy\u1EC1n l\u1EA1i k\u1EBFt n\u1ED1i" }, + { "Overwrite", "Ghi \u0111ïŋ―" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "L\u1ED7i k\u1EBFt n\u1ED1i" }, + { "ServerNotActive", "Mïŋ―y ch\u1EE7 hi\u1EC7n khïŋ―ng ho\u1EA1t \u0111\u1ED9ng" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_zh.java b/dbPort/src/org/compiere/db/DBRes_zh.java new file mode 100644 index 0000000000..055b304e0a --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_zh.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author kirinlin + * @version $Id: DBRes_zh.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_zh extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere \u9023\u7dda" }, + { "Name", "\u540d\u7a31" }, + { "AppsHost", "\u61c9\u7528\u7a0b\u5f0f\u4e3b\u6a5f" }, + { "AppsPort", "\u61c9\u7528\u7a0b\u5f0f\u57e0" }, + { "TestApps", "\u6e2c\u8a66" }, + { "DBHost", "\u8cc7\u6599\u5eab\u4e3b\u6a5f" }, + { "DBPort", "\u8cc7\u6599\u5eab\u9023\u63a5\u57e0" }, + { "DBName", "\u8cc7\u6599\u5eab\u540d\u7a31" }, + { "DBUidPwd", "\u5e33\u865f / \u5bc6\u78bc" }, + { "ViaFirewall", "\u7d93\u904e\u9632\u706b\u7246" }, + { "FWHost", "\u9632\u706b\u7246\u4e3b\u6a5f" }, + { "FWPort", "\u9632\u706b\u7246\u57e0" }, + { "TestConnection", "\u6e2c\u8a66\u8cc7\u6599\u5eab" }, + { "Type", "\u8cc7\u6599\u5eab\u7a2e\u985e" }, + { "BequeathConnection", "\u907a\u7559\u9023\u7dda" }, + { "Overwrite", "\u8986\u5beb" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u9023\u7dda\u932f\u8aa4" }, + { "ServerNotActive", "\u4f3a\u670d\u5668\u672a\u52d5\u4f5c" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DBRes_zh_CN.java b/dbPort/src/org/compiere/db/DBRes_zh_CN.java new file mode 100644 index 0000000000..e1803f6ebd --- /dev/null +++ b/dbPort/src/org/compiere/db/DBRes_zh_CN.java @@ -0,0 +1,65 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; + +/** + * Connection Resource Strings + * + * @author ZhaoXing Meng + * @version $Id: DBRes_zh_CN.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class DBRes_zh_CN extends ListResourceBundle +{ + /** Data */ + static final Object[][] contents = new String[][] + { + { "CConnectionDialog", "Adempiere \u8fde\u673a" }, + { "Name", "\u540d\u79f0" }, + { "AppsHost", "\u5e94\u7528\u670d\u52a1\u5668\u4e3b\u673a" }, + { "AppsPort", "\u5e94\u7528\u670d\u52a1\u5668\u7aef\u53e3" }, + { "TestApps", "\u6d4b\u8bd5\u5e94\u7528\u670d\u52a1\u5668" }, + { "DBHost", "\u6570\u636e\u5e93\u4e3b\u673a" }, + { "DBPort", "\u6570\u636e\u5e93\u7aef\u53e3" }, + { "DBName", "\u6570\u636e\u5e93\u540d" }, + { "DBUidPwd", "\u7528\u6237\u53f7 / \u53e3\u4ee4" }, + { "ViaFirewall", "\u901a\u8fc7\u9632\u706b\u5899" }, + { "FWHost", "\u9632\u706b\u5899\u4e3b\u673a" }, + { "FWPort", "\u9632\u706b\u5899\u7aef\u53e3" }, + { "TestConnection", "\u6d4b\u8bd5\u6570\u636e\u5e93" }, + { "Type", "\u6570\u636e\u5e93\u7c7b\u578b" }, + { "BequeathConnection", "\u9057\u7559\u8fde\u7ebf" }, + { "Overwrite", "\u8986\u5199" }, + { "ConnectionProfile", "Connection" }, + { "LAN", "LAN" }, + { "TerminalServer", "Terminal Server" }, + { "VPN", "VPN" }, + { "WAN", "WAN" }, + { "ConnectionError", "\u8fde\u673a\u9519\u8bef" }, + { "ServerNotActive", "\u670d\u52a1\u5668\u6ca1\u53cd\u5e94" } + }; + + /** + * Get Contsnts + * @return contents + */ + public Object[][] getContents() + { + return contents; + } // getContent +} // Res diff --git a/dbPort/src/org/compiere/db/DB_DB2.java b/dbPort/src/org/compiere/db/DB_DB2.java new file mode 100644 index 0000000000..0274d6e464 --- /dev/null +++ b/dbPort/src/org/compiere/db/DB_DB2.java @@ -0,0 +1,836 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.math.*; +import java.sql.*; +import java.util.logging.*; +import javax.sql.*; + +import org.compiere.util.*; + +import com.ibm.db2.jcc.*; + +/** + * DB2 Database Driver + * + * @author Jorg Janke + * @version $Id: DB_DB2.java,v 1.5 2006/09/22 23:35:19 jjanke Exp $ + */ +public class DB_DB2 + implements AdempiereDatabase +{ + /** + * Database DB2 + */ + public DB_DB2() + { + + } // DB_DB2 + + /** Static Driver */ + private static DB2Driver s_driver = null; + /** Driver Class Name */ + public static final String DRIVER = "com.ibm.db2.jcc.DB2Driver"; + /** Type 2 Driver */ + public static final String DRIVER2 = "COM.ibm.db2.jdbc.app.DB2Driver"; + + /** Default Port 446 */ + public static final int DEFAULT_PORT = 446; + /** Default Port 50000 */ + public static final int DEFAULT_PORT_0 = 50000; + + /** Cached User Name */ + private String m_userName = null; + + /** Connection String */ + private String m_connectionURL; + private DB2SimpleDataSource m_ds = null; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (DB_DB2.class); + + /** + * Get Database Name + * @return database short name + */ + public String getName() + { + return Database.DB_DB2; + } // getName + + /** + * Get Database Description + * @return database long name and version + */ + public String getDescription() + { + try + { + if (s_driver == null) + getDriver(); + } + catch (Exception e) + { + } + if (s_driver != null) + return s_driver.toString(); + return "No Driver"; + } // getDescription + + /** + * Get Standard JDBC Port + * @return standard port + */ + public int getStandardPort() + { + return DEFAULT_PORT_0; + } // getStandardPort + + /** + * Get and register Database Driver + * @return Driver + * @throws SQLException + */ + public Driver getDriver() throws SQLException + { + if (s_driver == null) + { + s_driver = new DB2Driver(); + DriverManager.registerDriver (s_driver); + DriverManager.setLoginTimeout (Database.CONNECTION_TIMEOUT); + } + return s_driver; + } // getDriver + + /** + * Get Database Connection String. + *
+	 *  Timing:
+	 *  
+ * @param connection Connection Descriptor + * @return connection String + */ + public String getConnectionURL (CConnection connection) + { + StringBuffer sb = null; + // connection//server:port/database + sb = new StringBuffer ("jdbc:db2:"); + // Cloudscape = jdbc:db2j:net: + sb.append("//") + .append(connection.getDbHost()) + .append(":").append(connection.getDbPort()) + .append("/").append(connection.getDbName()); + m_connectionURL = sb.toString(); + // log.config(m_connectionURL); + // + m_userName = connection.getDbUid(); + return m_connectionURL; + } // getConnectionURL + + /** + * Get Connection URL. + * @param dbHost db Host + * @param dbPort db Port + * @param dbName db Name + * @param userName user name + * @return connection + */ + public String getConnectionURL (String dbHost, int dbPort, String dbName, + String userName) + { + m_userName = userName; + m_connectionURL = "jdbc:db2://" + + dbHost + ":" + dbPort + "/" + dbName; + return m_connectionURL; + } // getConnectionURL + + /** + * Get Database Connection String + * @param connectionURL Connection URL + * @param userName user name + * @return connection String + */ + public String getConnectionURL (String connectionURL, String userName) + { + m_userName = userName; + m_connectionURL = connectionURL; + return m_connectionURL; + } // getConnectionURL + + /** + * Get JDBC Catalog + * @return null - not used + */ + public String getCatalog() + { + return null; + } // getCatalog + + /** + * Get JDBC Schema + * @return user name + */ + public String getSchema() + { + if (m_userName != null) + return m_userName.toUpperCase(); + log.severe("User Name not set (yet) - call getConnectionURL first"); + return null; + } // getSchema + + /** + * Supports BLOB + * @return true if BLOB is supported + */ + public boolean supportsBLOB() + { + return true; + } // supportsBLOB + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("DB_DB2["); + sb.append(m_connectionURL); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Get Status + * @return status info + */ + public String getStatus() + { + StringBuffer sb = new StringBuffer(); + return sb.toString(); + } // getStatus + + + /************************************************************************** + * Convert an individual Oracle Style statements to target database statement syntax. + * @param oraStatement oracle statement + * @return converted Statement oracle statement + */ + public String convertStatement (String oraStatement) + { + return oraStatement; + } // convertStatement + + + /** + * Check if DBMS support the sql statement + * @sql SQL statement + * @return true: yes + */ + public boolean isSupported(String sql) + { + return true; + //jz temp, modify later + } + + + + /** + * Get constraint type associated with the index + * @tableName table name + * @IXName Index name + * @return String[0] = 0: do not know, 1: Primary Key 2: Foreign Key + * String[1] - String[n] = Constraint Name + */ + public String getConstraintType(Connection conn, String tableName, String IXName) + { + if (IXName == null || IXName.length()==0) + return "0"; + + return "0"; + //jz temp, modify later + } + + /** + * Get Name of System User + * @return system + */ + public String getSystemUser() + { + return "db2adm"; + } // getSystemUser + + /** + * Get Name of System Database + * @param databaseName database Name + * @return e.g. master or database Name + */ + public String getSystemDatabase(String databaseName) + { + return databaseName; + } // getSystemDatabase + + + /** + * Create SQL TO Date String from Timestamp + * + * @param time Date to be converted + * @param dayOnly true if time set to 00:00:00 + * + * @return TO_DATE('1999-12-31 23:59:59', 'YYYY-MM-DD HH24:MI:SS') + * or TIMESTAMP('2000-01-10-00.00.00.000000') + */ + public String TO_DATE (Timestamp time, boolean dayOnly) + { + + if (time == null) + { + if (dayOnly) + return "trunc(CURRENT TIMESTAMP)"; + return "CURRENT TIMESTAMP"; + } + + // TIMESTAMP('2000-01-10-00.00.00.000000') + StringBuffer dateString = new StringBuffer("TIMESTAMP('"); + // YYYY-MM-DD HH24:MI:SS.mmmm JDBC Timestamp format + String myDate = time.toString(); + if (dayOnly) + { + dateString.append(myDate.substring(0,10)); + dateString.append("-00.00.00.000000')"); + } + else + { + myDate = myDate.replace('-', ' '); + myDate = myDate.replace(':', '.'); + dateString.append(myDate); + dateString.append("00')"); + } + return dateString.toString(); + } // TO_DATE + + /** + * Create SQL for formatted Date, Number + * + * @param columnName the column name in the SQL + * @param displayType Display Type + * @param AD_Language 6 character language setting (from Env.LANG_*) + * + * @return TRIM(TO_CHAR(columnName,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''')) + * or TRIM(TO_CHAR(columnName,'TM9')) depending on DisplayType and Language + * @see org.compiere.util.DisplayType + * @see org.compiere.util.Env + * + * */ + public String TO_CHAR (String columnName, int displayType, String AD_Language) + { + return columnName; + /** + StringBuffer retValue = new StringBuffer("TRIM(TO_CHAR("); + retValue.append(columnName); + + // Numbers + if (DisplayType.isNumeric(displayType)) + { + if (displayType == DisplayType.Amount) + retValue.append(",'9G999G990D00'"); + else + retValue.append(",'TM9'"); + // TO_CHAR(GrandTotal,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''') + if (!Language.isDecimalPoint(AD_Language)) // reversed + retValue.append(",'NLS_NUMERIC_CHARACTERS='',.'''"); + } + else if (DisplayType.isDate(displayType)) + { + retValue.append(",'") + .append(Language.getLanguage(AD_Language).getDBdatePattern()) + .append("'"); + } + retValue.append("))"); + // + return retValue.toString(); + **/ + } // TO_CHAR + + /** + * Return number as string for INSERT statements with correct precision + * @param number number + * @param displayType display Type + * @return number as string + */ + public String TO_NUMBER (BigDecimal number, int displayType) + { + if (number == null) + return "NULL"; + return number.toString(); + } // TO_NUMBER + + + /** + * Get SQL Commands. + * The following variables are resolved: + * @SystemPassword@, @AdempiereUser@, @AdempierePassword@ + * @SystemPassword@, @DatabaseName@, @DatabaseDevice@ + * @param cmdType CMD_* + * @return array of commands to be executed + */ + public String[] getCommands (int cmdType) + { + if (CMD_CREATE_USER == cmdType) + return new String[] + { + + }; + // + if (CMD_CREATE_DATABASE == cmdType) + return new String[] + { + + }; + // + if (CMD_DROP_DATABASE == cmdType) + return new String[] + { + + }; + // + return null; + } // getCommands + + /** + * Create DataSource + * @param connection connection + * @return data dource + */ + public DataSource getDataSource(CConnection connection) + { + if (m_ds == null) + { + m_ds = new DB2SimpleDataSource(); + m_ds.setServerName(connection.getDbHost()); + m_ds.setPortNumber(connection.getDbPort()); + m_ds.setDatabaseName(connection.getDbName()); + m_ds.setDescription("Adempiere DataSource"); + m_ds.setUser(connection.getDbUid()); + m_ds.setPassword(connection.getDbPwd()); + m_ds.setLoginTimeout(5); // seconds + // m_ds.setUseCachedCursor(true); + } + return m_ds; + } // getDataSource + + + /** + * Get Cached Connection + * @param connection info + * @param autoCommit true if autocommit connection + * @param transactionIsolation Connection transaction level + * @return connection or null + * @throws Exception + */ + public Connection getCachedConnection (CConnection connection, + boolean autoCommit, int transactionIsolation) + throws Exception + { + Connection conn = getDataSource(connection).getConnection(); + conn.setAutoCommit(autoCommit); + conn.setTransactionIsolation(transactionIsolation); + return conn; + } // getCachedConnection + + /** + * Get Connection from Driver + * @param connection info + * @return connection or null + * @throws SQLException + */ + public Connection getDriverConnection (CConnection connection) throws SQLException + { + getDriver(); + return DriverManager.getConnection (getConnectionURL (connection), + connection.getDbUid(), connection.getDbPwd()); + } // getDriverConnection + + /** + * Get Driver Connection + * @param dbUrl URL + * @param dbUid user + * @param dbPwd password + * @return connection + * @throws SQLException + */ + public Connection getDriverConnection (String dbUrl, String dbUid, String dbPwd) + throws SQLException + { + getDriver(); + return DriverManager.getConnection (dbUrl, dbUid, dbPwd); + } // getDriverConnection + + /** + * Close + */ + public void close() + { + log.config(toString()); + m_ds = null; + } // close + + /** + * Clean up + */ + public void cleanup() + { + log.config(""); + } // cleanup + + + /** + * Get Data Type + * @param displayType display type + * @param precision precision + * @param defaultValue if true adds default value + * @return data type + */ + public String getDataType (int displayType, int precision, + boolean defaultValue) + { + String retValue = null; + switch (displayType) + { + // IDs + case DisplayType.Account: + case DisplayType.Assignment: + case DisplayType.Color: + case DisplayType.ID: + case DisplayType.Location: + case DisplayType.Locator: + case DisplayType.PAttribute: + case DisplayType.Search: + case DisplayType.Table: + case DisplayType.TableDir: + case DisplayType.Image: + retValue = "INTEGER"; + break; + + // Dynamic Precision + case DisplayType.Amount: + retValue = "DECIMAL(18,2)"; + if (defaultValue) + retValue += " DEFAULT 0"; + break; + + case DisplayType.Binary: + retValue = "BLOB"; + break; + + case DisplayType.Button: + retValue = "CHAR(1)"; + break; + + // Number Dynamic Precision + case DisplayType.CostPrice: + retValue = "DECIMAL(22,6)"; + if (defaultValue) + retValue += " DEFAULT 0"; + break; + + // Date + case DisplayType.Date: + case DisplayType.DateTime: + case DisplayType.Time: + retValue = "Timestamp"; + if (defaultValue) + retValue += " DEFAULT 0"; + break; + + // Number(10) + case DisplayType.Integer: + retValue = "NUMBER(10)"; + break; + + case DisplayType.List: + retValue = "CHAR(" + precision + ")"; + break; + + // NVARCHAR + case DisplayType.Memo: + case DisplayType.String: + case DisplayType.Text: + retValue = "NVARCHAR(" + precision + ")"; + break; + + case DisplayType.TextLong: + retValue = "CLOB"; + break; + + // Dyn Prec + case DisplayType.Quantity: + retValue = "NUMBER"; + break; + + case DisplayType.YesNo: + retValue = "CHAR(1)"; + break; + + default: + log.severe("Unknown: " + displayType); + break; + } + return retValue; + } // getDataType + + + /** + * Check and generate an alternative SQL + * @reExNo number of re-execution + * @msg previous execution error message + * @sql previous executed SQL + * @return String, the alternative SQL, null if no alternative + */ + public String getAlternativeSQL(int reExNo, String msg, String sql) + { + return null; //do not do re-execution of alternative SQL + } + + + /************************************************************************** + * Testing + * @param args ignored + */ + public static void main (String[] args) + { + /** + Adempiere.startupEnvironment(true); + CConnection cc = CConnection.get(); + DB_Oracle db = (DB_Oracle)cc.getDatabase(); + db.cleanup(); + + try + { + Connection conn = ; + // System.out.println("Driver=" + db.getDriverConnection(cc)); + DataSource ds = db.getDataSource(cc); + System.out.println("DS=" + ds.getConnection()); + conn = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + System.out.println("Cached=" + conn); + System.out.println(db); + ////////////////////////// + System.out.println("JAVA classpath: [\n" + + System.getProperty("java.class.path") + "\n]"); + DatabaseMetaData dmd = conn.getMetaData(); + System.out.println("DriverVersion: ["+ + dmd.getDriverVersion()+"]"); + System.out.println("DriverMajorVersion: ["+ + dmd.getDriverMajorVersion()+"]"); + System.out.println("DriverMinorVersion: ["+ + dmd.getDriverMinorVersion()+"]"); + System.out.println("DriverName: ["+ + dmd.getDriverName()+"]"); + System.out.println("ProductName: ["+ + dmd.getDatabaseProductName() +"]"); + System.out.println("ProductVersion: [\n"+ + dmd.getDatabaseProductVersion()+"\n]"); + ////////////////////////// + } + catch (Exception e1) + { + e1.printStackTrace(); + } + db.cleanup(); + + System.out.println("--------------------------------------------------"); + try + { + Connection conn1 = db.getCachedConnection(cc, false, Connection.TRANSACTION_READ_COMMITTED); + Connection conn2 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + Connection conn3 = db.getCachedConnection(cc, false, Connection.TRANSACTION_READ_COMMITTED); + System.out.println("3 -> " + db); + conn1.close(); + conn2.close(); + conn1 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + conn2 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + System.out.println("3 -> " + db); + conn1.close(); + conn2.close(); + conn3.close(); + System.out.println("0 -> " + db); + } + catch (Exception e1) + { + e1.printStackTrace(); + } + + db.cleanup(); + + // System.exit(0); + System.out.println("--------------------------------------------------"); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(db); + + + try + { + System.out.println("-- Sleeping --"); + Thread.sleep(60000); + System.out.println(db); + db.close(); + db.cleanup(); + System.out.println(db); + } + catch (InterruptedException e) + { + } + /** **/ + + + /** **/ + // Connection option 1 + try + { + DB2Driver driver = new DB2Driver(); + DriverManager.registerDriver(driver); + + Connection con = DriverManager.getConnection("jdbc:db2://dev1:50000/sample", + "db2admin", "db2admin"); +// "adempiere", "adempiere"); +// "db2inst1", "daDm7rfr"); + System.out.println("Connection Catalog = " + con.getCatalog()); + // + DatabaseMetaData md = con.getMetaData(); + System.out.println(md.getDatabaseProductName() + " - " + md.getDatabaseProductVersion()); + // System.out.println(md.getDatabaseMajorVersion() + " - " + md.getDatabaseMinorVersion()); + System.out.println(md.getDriverName() + " - " + md.getDriverVersion()); + // System.out.println(md.getDriverMajorVersion() + " - " + md.getDriverMinorVersion()); + System.out.println("URL=" + md.getURL()); + System.out.println("User=" + md.getUserName()); + // + System.out.println(md.getNumericFunctions()); + System.out.println(md.getStringFunctions()); + System.out.println(md.getTimeDateFunctions()); + System.out.println(md.getSystemFunctions()); + // + System.out.println("Catalogs - " + md.getCatalogTerm()); + ResultSet rs = md.getCatalogs(); + while (rs.next()) + System.out.println("- " + rs.getString(1)); + // + System.out.println("Schemas - " + md.getSchemaTerm()); + rs = md.getSchemas(); + while (rs.next()) + System.out.println("- " + rs.getString(1)); + + + String sql = "SELECT GRANTOR,GRANTEE,DBADMAUTH FROM SYSCAT.DBAUTH"; + PreparedStatement pstmt = null; + try + { + pstmt = con.prepareStatement (sql); + rs = pstmt.executeQuery (); + while (rs.next ()) + { + String GRANTOR = rs.getString(1); + String GRANTEE = rs.getString(2); + String DBADMAUTH = rs.getString(3); + System.out.println(GRANTOR + " -> " + GRANTEE + " = " + DBADMAUTH); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + + System.out.println("SysCat Table"); + rs = md.getTables(null, "SYSCAT", null, new String[] {"TABLE", "VIEW"}); + while (rs.next()) + System.out.println("- User=" + rs.getString(2) + " | Table=" + rs.getString(3) + + " | Type=" + rs.getString(4) + " | " + rs.getString(5)); + // + System.out.println("Column"); + rs = md.getColumns(null, "SYSCAT", "DBAUTH", null); + while (rs.next()) + System.out.println("- Tab=" + rs.getString(3) + " | Col=" + rs.getString(4) + + " | Type=" + rs.getString(5) + ", " + rs.getString(6) + + " | Size=" + rs.getString(7) + " | " + rs.getString(8) + + " | Digits=" + rs.getString(9) + " | Radix=" + rs.getString(10) + + " | Null=" + rs.getString(11) + " | Rem=" + rs.getString(12) + + " | Def=" + rs.getString(13) + " | " + rs.getString(14) + + " | " + rs.getString(15) + " | " + rs.getString(16) + + " | Ord=" + rs.getString(17) + " | Null=" + rs.getString(18) + ); + + con.close(); + } + catch (SQLException ex) + { + ex.printStackTrace(); + } + /** **/ + } // main + +} // DB_DB2 diff --git a/dbPort/src/org/compiere/db/DB_Oracle.java b/dbPort/src/org/compiere/db/DB_Oracle.java new file mode 100644 index 0000000000..9f46fad846 --- /dev/null +++ b/dbPort/src/org/compiere/db/DB_Oracle.java @@ -0,0 +1,1112 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.sql.*; +import oracle.jdbc.*; +import oracle.jdbc.pool.*; +import org.compiere.*; +import org.compiere.util.*; + +/** + * Oracle Database Port + * + * @author Jorg Janke + * @version $Id: DB_Oracle.java,v 1.7 2006/09/22 23:35:19 jjanke Exp $ + */ +public class DB_Oracle implements AdempiereDatabase, OracleConnectionCacheCallback +{ + /** + * Oracle Database + */ + public DB_Oracle() + { + /** Causes VPN problems ??? + try + { + getDriver(); + } + catch (Exception e) + { + log.log(Level.SEVERE, e.getMessage()); + } + **/ + } // DB_Oracle + + /** Static Driver */ + private static OracleDriver s_driver = null; + /** Driver Class Name */ + public static final String DRIVER = "oracle.jdbc.OracleDriver"; + + /** Default Port */ + public static final int DEFAULT_PORT = 1521; + /** Default Connection Manager Port */ + public static final int DEFAULT_CM_PORT = 1630; + + /** Connection String */ + private String m_connectionURL; + + /** Statement Cache (50) */ + private static final int MAX_STATEMENTS = 50; + /** Data Source */ + private OracleDataSource m_ds = null; + + /** Use Connection Cache (false)*/ + private static final boolean USE_CACHE = false; + /** Connection Cache */ + private OracleConnectionCacheManager m_cacheMgr = null; + /** Connection Cache Name */ + private static final String CACHE_NAME = "AdempiereCCache"; + /** Cached User Name */ + private String m_userName = null; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (DB_Oracle.class); + + /** + * Get Database Name + * @return database short name + */ + public String getName() + { + return Database.DB_ORACLE; + } // getName + + /** + * Get Database Description + * @return database long name and version + */ + public String getDescription() + { + try + { + if (s_driver == null) + getDriver(); + } + catch (Exception e) + { + } + if (s_driver != null) + return s_driver.toString(); + return "No Driver"; + } // getDescription + + /** + * Get Standard JDBC Port + * @return standard port + */ + public int getStandardPort() + { + return DEFAULT_PORT; + } // getStandardPort + + /** + * Get and register Database Driver + * @return Driver + * @throws SQLException + */ + public Driver getDriver() throws SQLException + { + if (s_driver == null) + { + // Speed up transfer rate + System.setProperty("oracle.jdbc.TcpNoDelay", "true"); + // Oracle Multi - Language + System.setProperty("oracle.jdbc.defaultNChar", "true"); + // + s_driver = new OracleDriver(); + DriverManager.registerDriver (s_driver); + DriverManager.setLoginTimeout (Database.CONNECTION_TIMEOUT); + } + return s_driver; + } // getDriver + + /** + * Get Database Connection String. + *
+	 *  Timing:
+	 *  - CM with source_route not in address_list  = 28.5 sec
+	 *  - CM with source_route in address_list      = 58.0 sec
+	 *  - direct    = 4.3-8 sec  (no real difference if on other box)
+	 *  - bequeath  = 3.4-8 sec
+	 *  
+ * @param connection Connection Descriptor + * @return connection String + */ + public String getConnectionURL (CConnection connection) + { + StringBuffer sb = null; + // Server Connections (bequeath) + if (connection.isBequeath()) + { + sb = new StringBuffer ("jdbc:oracle:oci8:@"); + // bug: does not work if there is more than one db instance - use Net8 + // sb.append(connection.getDbName()); + } + else // thin driver + { + sb = new StringBuffer ("jdbc:oracle:thin:@"); + // direct connection + if (connection.isViaFirewall()) + { + // (description=(address_list= + // ( (source_route=yes) + // (address=(protocol=TCP)(host=cmhost)(port=1630)) + // (address=(protocol=TCP)(host=dev)(port=1521)) + // (connect_data=(service_name=dev1.adempiere.org))) + sb.append("(DESCRIPTION=(ADDRESS_LIST=") + .append("(SOURCE_ROUTE=YES)") + .append("(ADDRESS=(PROTOCOL=TCP)(HOST=").append(connection.getFwHost()) + .append(")(PORT=").append(connection.getFwPort()).append("))") + .append("(ADDRESS=(PROTOCOL=TCP)(HOST=").append(connection.getDbHost()) + .append(")(PORT=").append(connection.getDbPort()).append(")))") + .append("(CONNECT_DATA=(SERVICE_NAME=").append(connection.getDbName()).append(")))"); + } + else + { + // old: jdbc:oracle:thin:@dev2:1521:sid + // new: jdbc:oracle:thin:@//dev2:1521/serviceName + sb.append("//") + .append(connection.getDbHost()) + .append(":").append(connection.getDbPort()) + .append("/").append(connection.getDbName()); + } + } + m_connectionURL = sb.toString(); + // log.config(m_connectionURL); + // + m_userName = connection.getDbUid(); + return m_connectionURL; + } // getConnectionURL + + /** + * Get Connection URL. + * http://download-east.oracle.com/docs/cd/B14117_01/java.101/b10979/urls.htm#BEIDBFDF + * @param dbHost db Host + * @param dbPort db Port + * @param dbName db Name + * @param userName user name + * @return connection + */ + public String getConnectionURL (String dbHost, int dbPort, String dbName, + String userName) + { + m_userName = userName; + m_connectionURL = "jdbc:oracle:thin:@//" + + dbHost + ":" + dbPort + "/" + dbName; + return m_connectionURL; + } // getConnectionURL + + /** + * Get Database Connection String + * @param connectionURL Connection URL + * @param userName user name + * @return connection String + */ + public String getConnectionURL (String connectionURL, String userName) + { + m_userName = userName; + m_connectionURL = connectionURL; + return m_connectionURL; + } // getConnectionURL + + /** + * Get JDBC Catalog + * @return null - not used + */ + public String getCatalog() + { + return null; + } // getCatalog + + /** + * Get JDBC Schema + * @return user name + */ + public String getSchema() + { + if (m_userName != null) + return m_userName.toUpperCase(); + log.severe("User Name not set (yet) - call getConnectionURL first"); + return null; + } // getSchema + + /** + * Supports BLOB + * @return true if BLOB is supported + */ + public boolean supportsBLOB() + { + return true; + } // supportsBLOB + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("DB_Oracle["); + sb.append(m_connectionURL); + try + { + if (m_ds != null) + sb.append("-").append(m_ds.getDataSourceName()) + // .append(",ExplCache=").append(m_ds.getExplicitCachingEnabled()) + .append(",ImplCache=").append(m_ds.getImplicitCachingEnabled()) + .append(",MaxStmts=").append(m_ds.getMaxStatements()); + // .append(",Ref=").append(m_ds.getReference()); + if (m_cacheMgr != null && m_cacheMgr.existsCache(CACHE_NAME)) + sb.append(";ConnectionActive=").append(m_cacheMgr.getNumberOfActiveConnections(CACHE_NAME)) + .append(",CacheAvailable=").append(m_cacheMgr.getNumberOfAvailableConnections(CACHE_NAME)); + } + catch (Exception e) + { + sb.append("=").append(e.getLocalizedMessage()); + } + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Get Status + * @return status info + */ + public String getStatus() + { + StringBuffer sb = new StringBuffer(); + try + { + if (m_cacheMgr != null && m_cacheMgr.existsCache(CACHE_NAME)) + sb.append("-Connections=").append(m_cacheMgr.getNumberOfActiveConnections(CACHE_NAME)) + .append(",Cache=").append(m_cacheMgr.getNumberOfAvailableConnections(CACHE_NAME)); + } + catch (Exception e) + {} + return sb.toString(); + } // getStatus + + + /************************************************************************** + * Convert an individual Oracle Style statements to target database statement syntax. + * @param oraStatement oracle statement + * @return converted Statement oracle statement + */ + public String convertStatement (String oraStatement) + { + return oraStatement; + } // convertStatement + + + + /** + * Check if DBMS support the sql statement + * @sql SQL statement + * @return true: yes + */ + public boolean isSupported(String sql) + { + return true; + //jz temp, modify later + } + + + + /** + * Get constraint type associated with the index + * @tableName table name + * @IXName Index name + * @return String[0] = 0: do not know, 1: Primary Key 2: Foreign Key + * String[1] - String[n] = Constraint Name + */ + public String getConstraintType(Connection conn, String tableName, String IXName) + { + if (IXName == null || IXName.length()==0) + return "0"; + if (IXName.endsWith("_KEY")) + return "1"+IXName; + else + return "0"; + //jz temp, modify later from user.constraints + } + + /** + * Get Name of System User + * @return system + */ + public String getSystemUser() + { + return "system"; + } // getSystemUser + + /** + * Get Name of System Database + * @param databaseName database Name + * @return e.g. master or database Name + */ + public String getSystemDatabase(String databaseName) + { + return databaseName; + } // getSystemDatabase + + + /** + * Create SQL TO Date String from Timestamp + * + * @param time Date to be converted + * @param dayOnly true if time set to 00:00:00 + * + * @return TO_DATE('2001-01-30 18:10:20',''YYYY-MM-DD HH24:MI:SS') + * or TO_DATE('2001-01-30',''YYYY-MM-DD') + */ + public String TO_DATE (Timestamp time, boolean dayOnly) + { + if (time == null) + { + if (dayOnly) + return "TRUNC(SysDate)"; + return "SysDate"; + } + + StringBuffer dateString = new StringBuffer("TO_DATE('"); + // YYYY-MM-DD HH24:MI:SS.mmmm JDBC Timestamp format + String myDate = time.toString(); + if (dayOnly) + { + dateString.append(myDate.substring(0,10)); + dateString.append("','YYYY-MM-DD')"); + } + else + { + dateString.append(myDate.substring(0, myDate.indexOf("."))); // cut off miliseconds + dateString.append("','YYYY-MM-DD HH24:MI:SS')"); + } + return dateString.toString(); + } // TO_DATE + + /** + * Create SQL for formatted Date, Number + * + * @param columnName the column name in the SQL + * @param displayType Display Type + * @param AD_Language 6 character language setting (from Env.LANG_*) + * + * @return TRIM(TO_CHAR(columnName,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''')) + * or TRIM(TO_CHAR(columnName,'TM9')) depending on DisplayType and Language + * @see org.compiere.util.DisplayType + * @see org.compiere.util.Env + * + * */ + public String TO_CHAR (String columnName, int displayType, String AD_Language) + { + StringBuffer retValue = new StringBuffer("TRIM(TO_CHAR("); + retValue.append(columnName); + + // Numbers + if (DisplayType.isNumeric(displayType)) + { + if (displayType == DisplayType.Amount) + retValue.append(",'9G999G990D00'"); + else + retValue.append(",'TM9'"); + // TO_CHAR(GrandTotal,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''') + if (!Language.isDecimalPoint(AD_Language)) // reversed + retValue.append(",'NLS_NUMERIC_CHARACTERS='',.'''"); + } + else if (DisplayType.isDate(displayType)) + { + retValue.append(",'") + .append(Language.getLanguage(AD_Language).getDBdatePattern()) + .append("'"); + } + retValue.append("))"); + // + return retValue.toString(); + } // TO_CHAR + + /** + * Return number as string for INSERT statements with correct precision + * @param number number + * @param displayType display Type + * @return number as string + */ + public String TO_NUMBER (BigDecimal number, int displayType) + { + if (number == null) + return "NULL"; + return number.toString(); + } // TO_NUMBER + + + /** + * Get SQL Commands. + * The following variables are resolved: + * @SystemPassword@, @AdempiereUser@, @AdempierePassword@ + * @SystemPassword@, @DatabaseName@, @DatabaseDevice@ + * @param cmdType CMD_* + * @return array of commands to be executed + */ + public String[] getCommands (int cmdType) + { + if (CMD_CREATE_USER == cmdType) + return new String[] + { + + }; + // + if (CMD_CREATE_DATABASE == cmdType) + return new String[] + { + + }; + // + if (CMD_DROP_DATABASE == cmdType) + return new String[] + { + + }; + // + return null; + } // getCommands + + /** + * Create DataSource + * @param connection connection + * @return data dource + */ + public DataSource getDataSource(CConnection connection) + { + if (m_ds != null) + return m_ds; + try + { + m_ds = new OracleDataSource(); + m_ds.setDriverType("thin"); + m_ds.setNetworkProtocol("tcp"); + m_ds.setServerName(connection.getDbHost()); + m_ds.setServiceName(connection.getDbName()); + m_ds.setPortNumber(connection.getDbPort()); + m_ds.setUser(connection.getDbUid()); + m_ds.setPassword(connection.getDbPwd()); + // + m_ds.setDataSourceName("AdempiereDS"); + m_ds.setDescription("Adempiere Oracle Data Source"); + m_ds.setImplicitCachingEnabled(true); + m_ds.setExplicitCachingEnabled(true); + m_ds.setMaxStatements(MAX_STATEMENTS); + // http://download-east.oracle.com/docs/cd/B14117_01/java.101/b10979/oralob.htm#sthref1258 + Properties connProperties = new Properties(); + connProperties.setProperty("SetBigStringUseClob", "true"); + m_ds.setConnectionProperties(connProperties); + // + Properties cacheProperties = new Properties(); + // cacheProperties.setProperty("InitialLimit", "3"); // at startup + // cacheProperties.setProperty("MaxStatementsLimit", "10"); + cacheProperties.setProperty("ClosestConnectionMatch", "true"); + cacheProperties.setProperty("ValidateConnection", "true"); + if (Ini.isClient()) + { + cacheProperties.setProperty("MinLimit", "0"); + // cacheProperties.setProperty("MaxLimit", "5"); + cacheProperties.setProperty("InactivityTimeout", "300"); // 5 Min + cacheProperties.setProperty("AbandonedConnectionTimeout", "300"); // 5 Min + } + else // Server Settings + { + cacheProperties.setProperty("MinLimit", "3"); + // cacheProperties.setProperty("MaxLimit", "5"); + cacheProperties.setProperty("InactivityTimeout", "600"); // 10 Min + cacheProperties.setProperty("AbandonedConnectionTimeout", "600"); // 10 Min + } + cacheProperties.setProperty("PropertyCheckInterval", "120"); // 2 Min + // + if (USE_CACHE) + { + m_ds.setConnectionCachingEnabled(true); + m_ds.setConnectionCacheName(CACHE_NAME); + m_ds.setFastConnectionFailoverEnabled(true); + } + // + if (m_cacheMgr == null && USE_CACHE) + { + m_cacheMgr = OracleConnectionCacheManager.getConnectionCacheManagerInstance(); + if (!m_cacheMgr.existsCache(CACHE_NAME)) + m_cacheMgr.createCache(CACHE_NAME, m_ds, cacheProperties); + } + // test +// OracleConnection con = m_ds.getConnection(); +// con.close(); + // + log.config(toString()); + // + return m_ds; + } + catch (Exception e) + { + log.log(Level.SEVERE, toString(), e); + } + return null; + } // getDataSource + + + /** + * Get Cached Connection + * @param connection info + * @param autoCommit true if autocommit connection + * @param transactionIsolation Connection transaction level + * @return connection or null + * @throws Exception + */ + public Connection getCachedConnection (CConnection connection, + boolean autoCommit, int transactionIsolation) + throws Exception + { + OracleConnection conn = null; + Exception exception = null; + try + { + if (USE_CACHE && m_cacheMgr == null) + getDataSource(connection); + if (m_ds == null) + getDataSource(connection); + + // Properties connAttr = new Properties(); + // connAttr.setProperty("TRANSACTION_ISOLATION", CConnection.getTransactionIsolationInfo(transactionIsolation)); + // OracleConnection conn = (OracleConnection)m_ds.getConnection(connAttr); + // + // Try 5 times max + for (int i = 0; i < 5; i++) + { + try + { + conn = (OracleConnection)m_ds.getConnection(); + if (conn != null) + { + if (conn.getTransactionIsolation() != transactionIsolation) + conn.setTransactionIsolation(transactionIsolation); + if (conn.getAutoCommit() != autoCommit) + conn.setAutoCommit(autoCommit); + conn.setDefaultRowPrefetch(20); // 10 default - reduces round trips + } + } + catch (Exception e) + { + exception = e; + conn = null; + if (e instanceof SQLException + && ((SQLException)e).getErrorCode() == 1017) // invalid username/password + { + log.severe("Cannot connect to database: " + + getConnectionURL(connection) + + " - UserID=" + connection.getDbUid()); + break; + } + } + try + { + if (conn != null && conn.isClosed()) + conn = null; + // OK + if (conn != null && !conn.isClosed()) + break; + if (i == 0) + Thread.yield(); // give some time + else + Thread.sleep(100); + } + catch (Exception e) + { + exception = e; + conn = null; + } + } // 5 tries + + if (conn == null && exception != null) + { + log.log(Level.SEVERE, exception.toString()); + log.fine(toString()); + log.finest("Reference=" + m_ds.getReference()); + } + // else + // { + // System.out.println(conn + " " + getStatus()); + // conn.registerConnectionCacheCallback(this, "test", OracleConnection.ALL_CONNECTION_CALLBACKS); + // } + } + catch (Exception e) + { + // System.err.println ("DB_Oracle.getCachedConnection"); + // if (!(e instanceof SQLException)) + // e.printStackTrace(); + exception = e; + } + if (exception != null) + throw exception; + return conn; + } // getCachedConnection + + /** + * Get Connection from Driver + * @param connection info + * @return connection or null + * @throws SQLException + */ + public Connection getDriverConnection (CConnection connection) throws SQLException + { + getDriver(); + return DriverManager.getConnection (getConnectionURL (connection), + connection.getDbUid(), connection.getDbPwd()); + } // getDriverConnection + + /** + * Get Driver Connection + * @param dbUrl URL + * @param dbUid user + * @param dbPwd password + * @return connection + * @throws SQLException + */ + public Connection getDriverConnection (String dbUrl, String dbUid, String dbPwd) + throws SQLException + { + getDriver(); + return DriverManager.getConnection (dbUrl, dbUid, dbPwd); + } // getDriverConnection + + /** + * Close + */ + public void close() + { + log.config(toString()); + if (m_ds != null) + { + try + { + m_ds.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (m_cacheMgr != null) + { + try + { + if (m_cacheMgr.existsCache(CACHE_NAME)) + m_cacheMgr.purgeCache(CACHE_NAME, false); // not active + // m_cache.disableCache(CACHE_NAME); + // m_cache.removeCache(CACHE_NAME, 0); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + m_cacheMgr = null; + m_ds = null; + } // close + + /** + * Clean up + */ + public void cleanup() + { + if (!USE_CACHE) + return; + + log.config(""); + try + { + if (m_cacheMgr == null) + m_cacheMgr = OracleConnectionCacheManager.getConnectionCacheManagerInstance(); + String[] cacheNames = m_cacheMgr.getCacheNameList(); + for (int i = 0; i < cacheNames.length; i++) + { + String name = cacheNames[i]; + System.out.println(" cleanup: " + name); + System.out.println(" Before = Active=" + m_cacheMgr.getNumberOfActiveConnections(name) + + ", Available=" + m_cacheMgr.getNumberOfAvailableConnections(name)); + m_cacheMgr.purgeCache(name, false); + System.out.println(" Cached = Active=" + m_cacheMgr.getNumberOfActiveConnections(name) + + ", Available=" + m_cacheMgr.getNumberOfAvailableConnections(name)); + m_cacheMgr.purgeCache(name, true); + System.out.println(" All = Active=" + m_cacheMgr.getNumberOfActiveConnections(name) + + ", Available=" + m_cacheMgr.getNumberOfAvailableConnections(name)); + } + } + catch (Exception e) + { + e.printStackTrace(); + } + } // cleanup + + /************************************************************************** + * Handle Abandoned Connection + * @param conn connection + * @param userObject + * @return true if close - false for keeping it + */ + public boolean handleAbandonedConnection (OracleConnection conn, Object userObject) + { + System.out.println("--------------------handleAbandonedConnection " + conn + " - " + userObject); + return true; // reclaim it + } // handleAbandonedConnection + + /** + * Release Connection + * @param conn connection + * @param userObject + */ + public void releaseConnection (OracleConnection conn, Object userObject) + { + System.out.println("----------------------releaseConnection " + conn + " - " + userObject); + } // releaseConnection + + + /** + * Get Data Type + * @param displayType display type + * @param precision precision + * @param defaultValue if true adds default value + * @return data type + */ + public String getDataType (int displayType, int precision, + boolean defaultValue) + { + String retValue = null; + switch (displayType) + { + // IDs + case DisplayType.Account: + case DisplayType.Assignment: + case DisplayType.Color: + case DisplayType.ID: + case DisplayType.Location: + case DisplayType.Locator: + case DisplayType.PAttribute: + case DisplayType.Search: + case DisplayType.Table: + case DisplayType.TableDir: + case DisplayType.Image: + retValue = "NUMBER(10)"; + break; + + // Dynamic Precision + case DisplayType.Amount: + retValue = "NUMBER"; + if (defaultValue) + retValue += " DEFAULT 0"; + break; + + case DisplayType.Binary: + retValue = "BLOB"; + break; + + case DisplayType.Button: + retValue = "CHAR(1)"; + break; + + // Number Dynamic Precision + case DisplayType.CostPrice: + retValue = "NUMBER"; + if (defaultValue) + retValue += " DEFAULT 0"; + break; + + // Date + case DisplayType.Date: + case DisplayType.DateTime: + case DisplayType.Time: + retValue = "DATE"; + if (defaultValue) + retValue += " DEFAULT SYSDATE"; + break; + + // Number(10) + case DisplayType.Integer: + retValue = "NUMBER(10)"; + break; + + case DisplayType.List: + retValue = "CHAR(" + precision + ")"; + break; + + // NVARCHAR + case DisplayType.Memo: + case DisplayType.String: + case DisplayType.Text: + retValue = "NVARCHAR(" + precision + ")"; + break; + + case DisplayType.TextLong: + retValue = "CLOB"; + break; + + // Dyn Prec + case DisplayType.Quantity: + retValue = "NUMBER"; + break; + + case DisplayType.YesNo: + retValue = "CHAR(1)"; + break; + + default: + log.severe("Unknown: " + displayType); + break; + } + return retValue; + } // getDataType + + + /** + * Check and generate an alternative SQL + * @reExNo number of re-execution + * @msg previous execution error message + * @sql previous executed SQL + * @return String, the alternative SQL, null if no alternative + */ + public String getAlternativeSQL(int reExNo, String msg, String sql) + { + //check reExNo or based on reExNo to do a decision. Currently none + + return null; //do not do re-execution of alternative SQL + } + + + /************************************************************************** + * Testing + * @param args ignored + */ + public static void main (String[] args) + { + Adempiere.startupEnvironment(true); + CConnection cc = CConnection.get(); + DB_Oracle db = (DB_Oracle)cc.getDatabase(); + db.cleanup(); + + try + { + Connection conn = null; + // System.out.println("Driver=" + db.getDriverConnection(cc)); + DataSource ds = db.getDataSource(cc); + System.out.println("DS=" + ds.getConnection()); + conn = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + System.out.println("Cached=" + conn); + System.out.println(db); + ////////////////////////// + System.out.println("JAVA classpath: [\n" + + System.getProperty("java.class.path") + "\n]"); + DatabaseMetaData dmd = conn.getMetaData(); + System.out.println("DriverVersion: ["+ + dmd.getDriverVersion()+"]"); + System.out.println("DriverMajorVersion: ["+ + dmd.getDriverMajorVersion()+"]"); + System.out.println("DriverMinorVersion: ["+ + dmd.getDriverMinorVersion()+"]"); + System.out.println("DriverName: ["+ + dmd.getDriverName()+"]"); + System.out.println("ProductName: ["+ + dmd.getDatabaseProductName() +"]"); + System.out.println("ProductVersion: [\n"+ + dmd.getDatabaseProductVersion()+"\n]"); + ////////////////////////// + } + catch (Exception e1) + { + e1.printStackTrace(); + } + db.cleanup(); + + System.out.println("--------------------------------------------------"); + /** + DROP TABLE X_Test; + CREATE TABLE X_Test + ( + Text1 NVARCHAR2(2000) NULL, + Text2 VARCHAR2(2000) NULL + ); + **/ + try + { + String myString1 = "123456789 12345678"; + String myString = ""; + for (int i = 0; i < 99; i++) + myString += myString1 + (char)('a'+i) + "\n"; + System.out.println(myString.length()); + System.out.println(Util.size(myString)); + // + myString = Util.trimSize(myString, 2000); + System.out.println(myString.length()); + System.out.println(Util.size(myString)); + // + Connection conn2 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + /** **/ + PreparedStatement pstmt = conn2.prepareStatement + ("INSERT INTO X_Test(Text1, Text2) values(?,?)"); + pstmt.setString(1, myString); // NVARCHAR2 column + pstmt.setString(2, myString); // VARCHAR2 column + System.out.println(pstmt.executeUpdate()); + /** **/ + Statement stmt = conn2.createStatement(); + System.out.println(stmt.executeUpdate + ("INSERT INTO X_Test(Text1, Text2) values('" + myString + "','" + myString + "')")); + } + catch (Exception e) + { + e.printStackTrace(); + } + db.cleanup(); + System.out.println("--------------------------------------------------"); + System.exit(0); + + + System.out.println("--------------------------------------------------"); + try + { + Connection conn1 = db.getCachedConnection(cc, false, Connection.TRANSACTION_READ_COMMITTED); + Connection conn2 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + Connection conn3 = db.getCachedConnection(cc, false, Connection.TRANSACTION_READ_COMMITTED); + System.out.println("3 -> " + db); + conn1.close(); + conn2.close(); + conn1 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + conn2 = db.getCachedConnection(cc, true, Connection.TRANSACTION_READ_COMMITTED); + System.out.println("3 -> " + db); + conn1.close(); + conn2.close(); + conn3.close(); + System.out.println("0 -> " + db); + } + catch (Exception e1) + { + e1.printStackTrace(); + } + + db.cleanup(); + + // System.exit(0); + System.out.println("--------------------------------------------------"); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.getConnectionRO()); + System.out.println(DB.getConnectionRW()); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + System.out.println(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + + System.out.println(db); + + + try + { + System.out.println("-- Sleeping --"); + Thread.sleep(60000); + System.out.println(db); + db.close(); + db.cleanup(); + System.out.println(db); + } + catch (InterruptedException e) + { + } + + + + /** + // Connection option 1 + try + { + System.setProperty("oracle.jdbc.Trace", "true"); + DriverManager.registerDriver(new OracleDriver()); + Connection con = DriverManager.getConnection("jdbc:oracle:thin:@//dev:1521/dev", "adempiere", "adempiere"); + System.out.println("Catalog=" + con.getCatalog()); + DatabaseMetaData md = con.getMetaData(); + System.out.println("URL=" + md.getURL()); + System.out.println("User=" + md.getUserName()); + // + System.out.println("Catalog"); + ResultSet rs = md.getCatalogs(); + while (rs.next()) + System.out.println("- " + rs.getString(1)); + // + System.out.println("Table"); + rs = md.getTables(null, "ADEMPIERE", null, new String[] {"TABLE"}); + while (rs.next()) + System.out.println("- User=" + rs.getString(2) + " | Table=" + rs.getString(3) + + " | Type=" + rs.getString(4) + " | " + rs.getString(5)); + // + System.out.println("Column"); + rs = md.getColumns(null, "ADEMPIERE", "C_ORDER", null); + while (rs.next()) + System.out.println("- Tab=" + rs.getString(3) + " | Col=" + rs.getString(4) + + " | Type=" + rs.getString(5) + ", " + rs.getString(6) + + " | Size=" + rs.getString(7) + " | " + rs.getString(8) + + " | Digits=" + rs.getString(9) + " | Radix=" + rs.getString(10) + + " | Null=" + rs.getString(11) + " | Rem=" + rs.getString(12) + + " | Def=" + rs.getString(13) + " | " + rs.getString(14) + + " | " + rs.getString(15) + " | " + rs.getString(16) + + " | Ord=" + rs.getString(17) + " | Null=" + rs.getString(18) + ); + + con.close(); + } + catch (SQLException ex) + { + ex.printStackTrace(); + } + **/ + } // main + +} // DB_Oracle diff --git a/dbPort/src/org/compiere/db/DB_PostgreSQL.java b/dbPort/src/org/compiere/db/DB_PostgreSQL.java new file mode 100755 index 0000000000..c4289e3664 --- /dev/null +++ b/dbPort/src/org/compiere/db/DB_PostgreSQL.java @@ -0,0 +1,621 @@ +/****************************************************************************** + * The contents of this file are subject to the Compiere License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * You may obtain a copy of the License at http://www.compiere.org/license.html + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial + * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke + * are Copyright (C) 1999-2005 Jorg Janke. + * All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved. + * Portions created by Victor Perez are Copyright (C) 1999-2005 e-Evolution,S.C + * Contributor(s): Victor Perez + *****************************************************************************/ +package org.compiere.db; + +import java.math.*; +import java.sql.*; +import java.util.logging.Level; + +import javax.sql.*; +import org.compiere.dbPort.*; +import org.compiere.util.*; + +/** + * PostgreSQL Database Port + * + * @author @author Jorg Janke, Victor Pïŋ―rez + * @version $Id: DB_PostgreSQL.java,v 1.23 2005/03/11 20:29:01 jjanke Exp $ + */ +public class DB_PostgreSQL implements AdempiereDatabase +{ + /** + * PostgreSQL Database + */ + public DB_PostgreSQL() + { + } // DB_PostgreSQL + + /** Driver */ + private org.postgresql.Driver s_driver = null; + + /** Default Port */ + public static final int DEFAULT_PORT = 5432; + + /** Data Source */ + private org.postgresql.ds.PGPoolingDataSource m_ds = null; + + /** Statement Converter */ + private Convert m_convert = new Convert(Database.DB_POSTGRESQL); + /** Connection String */ + private String m_connection; + /** Cached Database Name */ + private String m_dbName = null; + + private String m_userName = null; + /** Connection String */ + private String m_connectionURL; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (DB_PostgreSQL.class); + + /** + * Get Database Name + * @return database short name + */ + public String getName() + { + return Database.DB_POSTGRESQL; + } // getName + + /** + * Get Database Description + * @return database long name and version + */ + public String getDescription() + { //begin vpj-cd e-evolution 30.09.2005 + //return s_driver.toString(); + try + { + if (s_driver == null) + getDriver(); + } + catch (Exception e) + { + } + if (s_driver != null) + return s_driver.toString(); + return "No Driver"; + //end vpj-cd e-evolution 30.09.2005 + } // getDescription + + /** + * Get Standard JDBC Port + * @return standard port + */ + public int getStandardPort() + { + return DEFAULT_PORT; + } // getStandardPort + + /** + * Get and register Database Driver + * @return Driver + */ + public java.sql.Driver getDriver() throws SQLException + { + if (s_driver == null) + { + s_driver = new org.postgresql.Driver(); + DriverManager.registerDriver (s_driver); + DriverManager.setLoginTimeout (Database.CONNECTION_TIMEOUT); + } + return s_driver; + } // getDriver + + /** + * Get Database Connection String. + * Requirements: + * - createdb -E UNICODE compiere + * @param connection Connection Descriptor + * @return connection String + */ + public String getConnectionURL (CConnection connection) + { + // jdbc:postgresql://hostname:portnumber/databasename?encoding=UNICODE + StringBuffer sb = new StringBuffer("jdbc:postgresql:"); + sb.append("//").append(connection.getDbHost()) + .append(":").append(connection.getDbPort()) + .append("/").append(connection.getDbName()) + .append("?encoding=UNICODE"); + m_connection = sb.toString(); + return m_connection; + } // getConnectionString + + /** + * Get Connection URL + * @param dbHost db Host + * @param dbPort db Port + * @param dbName sb Name + * @param userName user name + * @return connection url + */ + public String getConnectionURL (String dbHost, int dbPort, String dbName, + String userName) + { + return "jdbc:postgresql://" + + dbHost + ":" + dbPort + "/" + dbName; + } // getConnectionURL + + /** + * Get Database Connection String + * @param connectionURL Connection URL + * @param userName user name + * @return connection String + */ + public String getConnectionURL (String connectionURL, String userName) + { + m_userName = userName; + m_connectionURL = connectionURL; + return m_connectionURL; + } // getConnectionURL + + /** + * Get JDBC Catalog + * @return catalog (database name) + */ + public String getCatalog() + { + if (m_dbName != null) + return m_dbName; + // log.severe("Database Name not set (yet) - call getConnectionURL first"); + return null; + } // getCatalog + + /** + * Get JDBC Schema + * @return schema (dbo) + */ + public String getSchema() + { + //begin vpj-cd e-evolution 03/04/2005 + return "adempiere"; + //end vpj-cd e-evolution 03/04/2005 + } // getSchema + + /** + * Supports BLOB + * @return true if BLOB is supported + */ + public boolean supportsBLOB() + { + return true; + } // supportsBLOB + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("DB_PostgreSQL["); + sb.append(m_connection) + .append("]"); + return sb.toString(); + } // toString + + /** + * Get Status + * @return status info + */ + public String getStatus() + { + return ""; + } // getStatus + + /************************************************************************* + * Convert an individual Oracle Style statements to target database statement syntax + * + * @param oraStatement + * @return converted Statement + * @throws Exception + */ + public String convertStatement (String oraStatement) + { + String retValue[] = m_convert.convert(oraStatement); + + //begin vpj-cd e-evolution 03/14/2005 + if (retValue.length == 0 ) + return oraStatement; + //end vpj-cd e-evolution 03/14/2005 + + if (retValue == null) + //begin vpj-cd 24/06/2005 e-evolution + { + log.log(Level.SEVERE,("DB_PostgreSQL.convertStatement - Not Converted (" + oraStatement + ") - " + + m_convert.getConversionError())); + throw new IllegalArgumentException + ("DB_PostgreSQL.convertStatement - Not Converted (" + oraStatement + ") - " + + m_convert.getConversionError()); + } + // end vpj-cd 24/06/2005 e-evolution + if (retValue.length != 1) + //begin vpj-cd 24/06/2005 e-evolution + { + log.log(Level.SEVERE, ("DB_PostgreSQL.convertStatement - Convert Command Number=" + retValue.length + + " (" + oraStatement + ") - " + m_convert.getConversionError())); + throw new IllegalArgumentException + ("DB_PostgreSQL.convertStatement - Convert Command Number=" + retValue.length + + " (" + oraStatement + ") - " + m_convert.getConversionError()); + } + //end vpj-cd 24/06/2005 e-evolution + // Diagnostics (show changed, but not if AD_Error + if (!oraStatement.equals(retValue[0]) && retValue[0].indexOf("AD_Error") == -1) + //begin vpj-cd 24/06/2005 e-evolution + //System.out.println("PostgreSQL =>" + retValue[0] + "<= <" + oraStatement + ">"); + log.log(Level.INFO, "PostgreSQL =>" + retValue[0] + "<= <" + oraStatement + ">"); + //end vpj-cd 24/06/2005 e-evolution + // + return retValue[0]; + } // convertStatement + + + /** + * Get Name of System User + * @return e.g. sa, system + */ + public String getSystemUser() + { + return "postgres"; + } // getSystemUser + + /** + * Get Name of System Database + * @param databaseName database Name + * @return e.g. master or database Name + */ + public String getSystemDatabase(String databaseName) + { + return "template1"; + } // getSystemDatabase + + + /** + * Create SQL TO Date String from Timestamp + * + * @param time Date to be converted + * @param dayOnly true if time set to 00:00:00 + * + * @return TO_DATE('2001-01-30 18:10:20',''YYYY-MM-DD HH24:MI:SS') + * or TO_DATE('2001-01-30',''YYYY-MM-DD') + */ + public String TO_DATE (Timestamp time, boolean dayOnly) + { + if (time == null) + { + if (dayOnly) + return "current_date()"; + return "current_date()"; + } + + StringBuffer dateString = new StringBuffer("TO_DATE('"); + // YYYY-MM-DD HH24:MI:SS.mmmm JDBC Timestamp format + String myDate = time.toString(); + if (dayOnly) + { + dateString.append(myDate.substring(0,10)); + dateString.append("','YYYY-MM-DD')"); + } + else + { + dateString.append(myDate.substring(0, myDate.indexOf("."))); // cut off miliseconds + dateString.append("','YYYY-MM-DD HH24:MI:SS')"); + } + return dateString.toString(); + } // TO_DATE + + /** + * Create SQL for formatted Date, Number + * + * @param columnName the column name in the SQL + * @param displayType Display Type + * @param AD_Language 6 character language setting (from Env.LANG_*) + * + * @return TRIM(TO_CHAR(columnName,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''')) + * or TRIM(TO_CHAR(columnName,'TM9')) depending on DisplayType and Language + * @see org.compiere.util.DisplayType + * @see org.compiere.util.Env + * + **/ + public String TO_CHAR (String columnName, int displayType, String AD_Language) + { + StringBuffer retValue = new StringBuffer("CAST ("); + retValue.append(columnName); + retValue.append(" AS Text)"); + + // Numbers + /* + if (DisplayType.isNumeric(displayType)) + { + if (displayType == DisplayType.Amount) + retValue.append(" AS TEXT"); + else + retValue.append(" AS TEXT"); + //if (!Language.isDecimalPoint(AD_Language)) // reversed + //retValue.append(",'NLS_NUMERIC_CHARACTERS='',.'''"); + } + else if (DisplayType.isDate(displayType)) + { + retValue.append(",'") + .append(Language.getLanguage(AD_Language).getDBdatePattern()) + .append("'"); + } + retValue.append(")"); + //*/ + return retValue.toString(); + } // TO_CHAR + + /** + * Return number as string for INSERT statements with correct precision + * @param number number + * @param displayType display Type + * @return number as string + */ + public String TO_NUMBER (BigDecimal number, int displayType) + { + if (number == null) + return "NULL"; + BigDecimal result = number; + int scale = DisplayType.getDefaultPrecision(displayType); + if (scale > number.scale()) + { + try + { + result = number.setScale(scale, BigDecimal.ROUND_HALF_UP); + } + catch (Exception e) + { + // log.severe("Number=" + number + ", Scale=" + " - " + e.getMessage()); + } + } + return result.toString(); + } // TO_NUMBER + + + /** + * Get SQL Commands + * @param cmdType CMD_* + * @return array of commands to be executed + */ + public String[] getCommands (int cmdType) + { + if (CMD_CREATE_USER == cmdType) + return new String[] + { + "CREATE USER compiere;", + }; + // + if (CMD_CREATE_DATABASE == cmdType) + return new String[] + { + "CREATE DATABASE compiere OWNER compiere;", + "GRANT ALL PRIVILEGES ON compiere TO compiere;" , + "CREATE SCHEMA compiere;", + "SET search_path TO compiere;" + }; + // + if (CMD_DROP_DATABASE == cmdType) + return new String[] + { + "DROP DATABASE compiere;" + }; + // + return null; + } // getCommands + + + /************************************************************************** + * Get RowSet + * @param rs ResultSet + * @return RowSet + * @throws SQLException + */ + public RowSet getRowSet (java.sql.ResultSet rs) throws SQLException + { + throw new UnsupportedOperationException("PostgreSQL does not support RowSets"); + } // getRowSet + + + /** + * Get Cached Connection + * @param connection connection + * @param autoCommit auto commit + * @param transactionIsolation trx isolation + * @return Connection + * @throws Exception + */ + public Connection getCachedConnection (CConnection connection, + boolean autoCommit, int transactionIsolation) + throws Exception + { + if (m_ds == null) + getDataSource(connection); + // + Connection conn = m_ds.getConnection(); + // Connection conn = getDriverConnection(connection); + // + conn.setAutoCommit(autoCommit); + conn.setTransactionIsolation(transactionIsolation); + return conn; + } // getCachedConnection + + + /** + * Create DataSource (Client) + * @param connection connection + * @return data dource + */ + public DataSource getDataSource(CConnection connection) + { + //throw new UnsupportedOperationException("Not supported/implemented"); + if (m_ds != null) + return m_ds; + + //org.postgresql.ds.PGPoolingDataSource ds = new org.postgresql.ds.PGPoolingDataSource(); + org.postgresql.jdbc3.Jdbc3PoolingDataSource ds = new org.postgresql.jdbc3.Jdbc3PoolingDataSource(); + ds.setDataSourceName("CompiereDS"); + ds.setServerName(connection.getDbHost()); + ds.setDatabaseName(connection.getDbName()); + ds.setUser(connection.getDbUid()); + ds.setPassword(connection.getDbPwd()); + ds.setPortNumber(connection.getDbPort()); + ds.setMaxConnections(50); + ds.setInitialConnections(20); + + //new InitialContext().rebind("DataSource", source); + m_ds = ds; + + return m_ds; + } + + /** + * Create Pooled DataSource (Server) + * @param connection connection + * @return data dource + */ + public ConnectionPoolDataSource createPoolDataSource(CConnection connection) + { + throw new UnsupportedOperationException("Not supported/implemented"); + } + + /** + * Get Connection from Driver + * @param connection info + * @return connection or null + */ + public Connection getDriverConnection (CConnection connection) throws SQLException + { + getDriver(); + return DriverManager.getConnection (getConnectionURL (connection), + connection.getDbUid(), connection.getDbPwd()); + } // getDriverConnection + + /** + * Get Driver Connection + * @param dbUrl URL + * @param dbUid user + * @param dbPwd password + * @return connection + * @throws SQLException + */ + public Connection getDriverConnection (String dbUrl, String dbUid, String dbPwd) + throws SQLException + { + getDriver(); + return DriverManager.getConnection (dbUrl, dbUid, dbPwd); + } // getDriverConnection + + + /** + * Close + */ + public void close() + { + + log.config(toString()); + if (m_ds != null) + { + try + { + m_ds.close(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + m_ds = null; + } // close + + + /** + * Check and generate an alternative SQL + * @reExNo number of re-execution + * @msg previous execution error message + * @sql previous executed SQL + * @return String, the alternative SQL, null if no alternative + */ + public String getAlternativeSQL(int reExNo, String msg, String sql) + { + return null; //do not do re-execution of alternative SQL + } + + /** + * Get constraint type associated with the index + * @tableName table name + * @IXName Index name + * @return String[0] = 0: do not know, 1: Primary Key 2: Foreign Key + * String[1] - String[n] = Constraint Name + */ + public String getConstraintType(Connection conn, String tableName, String IXName) + { + if (IXName == null || IXName.length()==0) + return "0"; + if (IXName.endsWith("_KEY")) + return "1"+IXName; + else + return "0"; + //jz temp, modify later from user.constraints + } + + /** + * Check if DBMS support the sql statement + * @sql SQL statement + * @return true: yes + */ + public boolean isSupported(String sql) + { + return true; + //jz temp, modify later + } + + + + /** + * Test + * @param args ignored + */ + public static void main(String[] args) + { + DB_PostgreSQL postgresql = new DB_PostgreSQL(); + // + String databaseName = "adempiere"; + String uid = "adempiere"; + String pwd = "adempiere"; + String jdbcURL = postgresql.getConnectionURL("vpj", DEFAULT_PORT, databaseName, uid); + System.out.println(jdbcURL); + try + { + postgresql.getDriver(); + Connection conn = DriverManager.getConnection (jdbcURL, uid, pwd); + + //CachedRowSetImpl crs = null; + //crs = new CachedRowSetImpl(); + //crs.setSyncProvider("com.sun.rowset.providers.RIOptimisticProvider"); + //crs.setConcurrency(ResultSet.CONCUR_READ_ONLY); + //crs.setType(ResultSet.TYPE_SCROLL_INSENSITIVE); + //crs.setCommand("SELECT * FROM AD_Client"); + // + //crs.execute(conn); + // + conn.close(); + conn = null; + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } // main + +} // DB_PostgreSQL diff --git a/dbPort/src/org/compiere/db/Database.java b/dbPort/src/org/compiere/db/Database.java new file mode 100644 index 0000000000..b9f5b285ac --- /dev/null +++ b/dbPort/src/org/compiere/db/Database.java @@ -0,0 +1,70 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +/** + * General Database Constants and Utilities + * + * @author Jorg Janke + * @version $Id: Database.java,v 1.3 2006/07/30 00:55:13 jjanke Exp $ + */ +public class Database +{ + /** Oracle ID */ + public static String DB_ORACLE = "Oracle"; + /** IBM DB/2 ID */ + public static String DB_DB2 = "DB2"; + /** Derby ID */ + public static String DB_DERBY = "Derby"; + /** Microsoft ID */ + public static String DB_MSSQLServer = "SQLServer"; + /** PostgreSQL ID */ + public static String DB_POSTGRESQL = "PostgreSQL"; + // begin vpj-c e-evolution 11/30/2005 EDB + /** Enterprise DB */ + //public static String DB_EDB = "EnterpriseDB"; + // end vpj-c e-evolution 11/30/2005 EDB + + + /** Supported Databases */ + public static String[] DB_NAMES = new String[] { + DB_ORACLE + ,DB_DB2 + // ,DB_DERBY + // ,DB_MSSQLServer + // begin vpj-c e-evolution 02/08/205 PostgreSQL + ,DB_POSTGRESQL + // ,DB_EDB + // end e-evolution 02/08/2005 PostgreSQL + }; + + /** Database Classes */ + protected static Class[] DB_CLASSES = new Class[] { + DB_Oracle.class + ,DB_DB2.class + // ,DB_Derby.class + // ,DB_MSSQLServer.class + //begin vpj-c e-evolution 02/08/2005 PostgreSQL + ,DB_PostgreSQL.class + // ,DB_EDB.class + //end e-evolution 02/08/205 PostgreSQL + }; + + /** Connection Timeout in seconds */ + public static int CONNECTION_TIMEOUT = 10; + +} // Database diff --git a/dbPort/src/org/compiere/db/Database16.gif b/dbPort/src/org/compiere/db/Database16.gif new file mode 100644 index 0000000000..6ac0e3fd5d Binary files /dev/null and b/dbPort/src/org/compiere/db/Database16.gif differ diff --git a/dbPort/src/org/compiere/db/JDBCInfo.java b/dbPort/src/org/compiere/db/JDBCInfo.java new file mode 100644 index 0000000000..ba4cc3fbe2 --- /dev/null +++ b/dbPort/src/org/compiere/db/JDBCInfo.java @@ -0,0 +1,180 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.sql.*; +import java.util.logging.*; +import org.compiere.*; +import org.compiere.util.*; + +/** + * JDBC Meta Info + * + * @author Jorg Janke + * @version $Id: JDBCInfo.java,v 1.3 2006/07/30 00:55:13 jjanke Exp $ + */ +public class JDBCInfo +{ + /** + * Constructor + * @param conn connection + * @throws SQLException + */ + public JDBCInfo(Connection conn) throws SQLException + { + m_md = conn.getMetaData(); + log.info(m_md.getDatabaseProductName()); + log.config(m_md.getDatabaseProductVersion()); + // log.config(m_md.getDatabaseMajorVersion() + "/" + m_md.getDatabaseMinorVersion()); + // + log.info(m_md.getDriverName()); + log.config(m_md.getDriverVersion()); + log.config(m_md.getDriverMajorVersion() + "/" + m_md.getDriverMinorVersion()); + // + // log.info("JDBC = " + m_md.getJDBCMajorVersion() + "/" + m_md.getJDBCMinorVersion()); + } // JDBCInfo + + /** Mata Data */ + private DatabaseMetaData m_md = null; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (JDBCInfo.class); + + /** + * List All + */ + public void listAll() + { + try + { + listSchemas(); + } + catch (Exception e) + { + log.severe(e.getMessage()); + } + try + { + listCatalogs(); + } + catch (Exception e) + { + log.severe(e.getMessage()); + } + try + { + listTypes(); + } + catch (Exception e) + { + log.severe(e.getMessage()); + } + } // listAll + + /** + * List Catalogs + * @throws SQLException + */ + public void listCatalogs() throws SQLException + { + log.info(m_md.getCatalogTerm() + " -> " + m_md.getCatalogSeparator()); + ResultSet rs = m_md.getCatalogs(); + while (rs.next()) + { + dump(rs); + } + } // listCatalogs + + /** + * List Schemas + * @throws SQLException + */ + public void listSchemas() throws SQLException + { + log.info(m_md.getSchemaTerm()); + ResultSet rs = m_md.getSchemas(); + while (rs.next()) + { + dump(rs); + } + } // listSchemas + + /** + * List Types + * @throws SQLException + */ + public void listTypes() throws SQLException + { + ResultSet rs = m_md.getTypeInfo(); + while (rs.next()) + { + log.info(""); + dump(rs); + } + } // listTypes + + /** + * Dump the current row of a Result Set + * @param rs result set + * @throws SQLException + */ + public static void dump(ResultSet rs) throws SQLException + { + ResultSetMetaData md = rs.getMetaData(); + for (int i = 0; i < md.getColumnCount(); i++) + { + int index = i + 1; + String info = md.getColumnLabel(index); + String name = md.getColumnName(index); + if (info == null) + info = name; + else if (name != null && !name.equals(info)) + info += " (" + name + ")"; + info += " = " + + rs.getString(index); + info += " [" + md.getColumnTypeName(index) + + "(" + md.getPrecision(index); + if (md.getScale(index) != 0) + info += "," + md.getScale(index); + info += ")]"; + log.fine(info); + } + } // dump + + /************************************************************************** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + Adempiere.startup(true); + CLogMgt.setLevel(Level.ALL); + // + try + { + JDBCInfo info = new JDBCInfo(DB.createConnection(true, Connection.TRANSACTION_READ_COMMITTED)); + info.listCatalogs(); + info.listSchemas(); + info.listTypes(); + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + } + } // main + +} // JDBCInfo diff --git a/dbPort/src/org/compiere/db/LDAP.java b/dbPort/src/org/compiere/db/LDAP.java new file mode 100644 index 0000000000..2d7d159709 --- /dev/null +++ b/dbPort/src/org/compiere/db/LDAP.java @@ -0,0 +1,200 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.util.*; +import java.util.logging.*; + +import javax.naming.*; +import javax.naming.ldap.*; +import javax.naming.directory.*; + +import org.compiere.util.*; + + +/** + * LDAP Management Interface + * + * @author Jorg Janke + * @version $Id: LDAP.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class LDAP +{ + /** + * Validate User + * @param ldapURL provider url - e.g. ldap://dc.adempiere.org + * @param domain domain name = e.g. adempiere.org + * @param userName user name - e.g. jjanke + * @param password password + * @return true if validated with ldap + */ + public static boolean validate (String ldapURL, String domain, String userName, String password) + { + Hashtable env = new Hashtable(); + env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + // ldap://dc.adempiere.org + env.put(Context.PROVIDER_URL, ldapURL); + env.put(Context.SECURITY_AUTHENTICATION, "simple"); + // jjanke@adempiere.org + StringBuffer principal = new StringBuffer (userName) + .append("@").append(domain); + env.put(Context.SECURITY_PRINCIPAL, principal.toString()); + env.put(Context.SECURITY_CREDENTIALS, password); + // + try + { + // Create the initial context + InitialLdapContext ctx = new InitialLdapContext(env, null); + // DirContext ctx = new InitialDirContext(env); + + // Test - Get the attributes + Attributes answer = ctx.getAttributes(""); + + // Print the answer + // dump (answer); + } + catch (AuthenticationException e) + { + log.info("Error: " + principal + " - " + e.getLocalizedMessage()); + return false; + } + catch (Exception e) + { + log.log (Level.SEVERE, ldapURL + " - " + principal, e); + return false; + } + log.info("OK: " + principal); + return true; + } // validate + + /** Logger */ + private static CLogger log = CLogger.getCLogger (LDAP.class); + + + /** + * Test NT + * @throws LoginException + * + private static void testNT () throws LoginException + { + try + { + System.out.println ("NT system ----------------------------"); + NTSystem ntsystem = new NTSystem (); + System.out.println (ntsystem); + System.out.println (ntsystem.getDomain ()); + System.out.println (ntsystem.getDomainSID ()); + System.out.println (ntsystem.getName ()); + System.out.println (ntsystem.getUserSID ()); + System.out.println ("NT login ----------------------------"); + NTLoginModule ntlogin = new NTLoginModule (); + System.out.println (ntlogin); + Map map = new HashMap(); + map.put ("debug", "true"); + ntlogin.initialize (null, null, null, map); + System.out.println (ntlogin.login ()); + } + catch (LoginException le) + { + System.err.println ("Authentication attempt failed" + le); + } + } // testNT + + + /** + * testKerberos + * @throws LoginException + * + private static void testKerberos () + throws LoginException + { + System.out.println ("Krb login ----------------------------"); + Map map = new HashMap(); + // map.put("debug", "true"); + // map.put("debugNative", "true"); + Krb5LoginModule klogin = new Krb5LoginModule (); + System.out.println (klogin); + map.put ("principal", "username@adempiere.org"); + map.put ("credential", "pass"); + klogin.initialize (null, null, null, map); + System.out.println (klogin.login ()); + /*********************************************************************** + * ** No krb5.ini file found in entire system Debug is true storeKey + * false useTicketCache false useKeyTab false doNotPrompt false + * ticketCache is null KeyTab is null refreshKrb5Config is false + * principal is jjanke tryFirstPass is false useFirstPass is false + * storePass is false clearPass is false [Krb5LoginModule] + * authentication failed Could not load configuration file + * c:\winnt\krb5.ini (The system cannot find the file specified) + * javax.security.auth.login.LoginException: Could not load + * configuration file c:\winnt\krb5.ini (The system cannot find the file + * specified) + * + } // testKerbos + /**/ + + /** + * Print Attributes to System.out + * @param attrs + */ + private static void dump (Attributes attrs) + { + if (attrs == null) + { + System.out.println ("No attributes"); + } + else + { + /* Print each attribute */ + try + { + for (NamingEnumeration ae = attrs.getAll (); ae.hasMore ();) + { + Attribute attr = (Attribute) ae.next (); + System.out.println ("attribute: " + attr.getID ()); + /* print each value */ + for (NamingEnumeration e = attr.getAll(); + e.hasMore (); + System.out.println (" value: " + e.next())) + ; + } + } + catch (NamingException e) + { + e.printStackTrace (); + } + } + } // dump + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + try + { + validate("ldap://dc.adempiere.org", "adempiere.org", "red1", "ikeepforgetting"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } // main + +} // LDAP + diff --git a/dbPort/src/org/compiere/db/Server16.gif b/dbPort/src/org/compiere/db/Server16.gif new file mode 100644 index 0000000000..068ffebee2 Binary files /dev/null and b/dbPort/src/org/compiere/db/Server16.gif differ diff --git a/dbPort/src/org/compiere/db/TestConnection.java b/dbPort/src/org/compiere/db/TestConnection.java new file mode 100644 index 0000000000..f665577b3f --- /dev/null +++ b/dbPort/src/org/compiere/db/TestConnection.java @@ -0,0 +1,225 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import java.sql.*; + +/** + * Test Connection (speed) + * + * @author Jorg Janke + * @version $Id: TestConnection.java,v 1.2 2006/07/30 00:55:13 jjanke Exp $ + */ +public class TestConnection +{ + + /** + * Test Connection + * + * @param jdbcURL JDBC URL + * @param uid user + * @param pwd password + */ + public TestConnection (String jdbcURL, String uid, String pwd) + { + System.out.println("Test Connection for " + jdbcURL); + m_jdbcURL = jdbcURL; + m_uid = uid; + m_pwd = pwd; + init(); + if (m_conn != null) + { + long time = test(); + time += test(); + time += test(); + time += test(); + System.out.println(""); + System.out.println("Total Average (" + m_jdbcURL + ")= " + (time/4) + "ms"); + } + } // TestConnection + + private String m_jdbcURL; + private String m_uid = "adempiere"; + private String m_pwd = "adempiere"; + private String m_sql = "SELECT * FROM AD_Element"; + private Connection m_conn; + + /** + * Initialize & Open Connection + */ + private void init() + { + long start = System.currentTimeMillis(); + Driver driver = null; + try + { + driver = DriverManager.getDriver(m_jdbcURL); + } + catch (SQLException ex) + { + // System.err.println("Init - get Driver: " + ex); + } + if (driver == null) + { + try + { + DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); + } + catch (SQLException ex) + { + System.err.println("Init = register Driver: " + ex); + } + } + long end = System.currentTimeMillis(); + System.out.println("(1) Driver = " + (end - start) + "ms"); + // + start = System.currentTimeMillis(); + try + { + m_conn = DriverManager.getConnection(m_jdbcURL, m_uid, m_pwd); + } + catch (SQLException ex) + { + System.err.println("Init = get Connection: " + ex); + } + end = System.currentTimeMillis(); + System.out.println("(2) Get Connection = " + (end - start) + "ms"); + // + start = System.currentTimeMillis(); + try + { + if (m_conn != null) + m_conn.close(); + } + catch (SQLException ex) + { + System.err.println("Init = close Connection: " + ex); + } + end = System.currentTimeMillis(); + System.out.println("(3) Close Connection = " + (end - start) + "ms"); + } // init + + /** + * Test ResultSet + * @return time in ms + */ + private long test() + { + System.out.println(""); + long totalStart = System.currentTimeMillis(); + long start = System.currentTimeMillis(); + try + { + m_conn = DriverManager.getConnection(m_jdbcURL, m_uid, m_pwd); + } + catch (SQLException ex) + { + System.err.println("Test get Connection: " + ex); + return -1; + } + long end = System.currentTimeMillis(); + System.out.println("(A) Get Connection = " + (end - start) + "ms"); + // + try + { + start = System.currentTimeMillis(); + Statement stmt = m_conn.createStatement(); + end = System.currentTimeMillis(); + System.out.println("(B) Create Statement = " + (end - start) + "ms"); + // + start = System.currentTimeMillis(); + ResultSet rs = stmt.executeQuery(m_sql); + end = System.currentTimeMillis(); + System.out.println("(C) Execute Query = " + (end - start) + "ms"); + // + int no = 0; + start = System.currentTimeMillis(); + while (rs.next()) + { + int i = rs.getInt("AD_Client_ID"); + String s = rs.getString("Name"); + i += s.length(); + no++; + } + end = System.currentTimeMillis(); + System.out.println("(D) Read ResultSet = " + (end - start) + "ms - per 10 rows " + ((end - start)/(no/10)) + "ms"); + // + start = System.currentTimeMillis(); + rs.close(); + end = System.currentTimeMillis(); + System.out.println("(E) Close ResultSet = " + (end - start) + "ms"); + // + start = System.currentTimeMillis(); + stmt.close(); + end = System.currentTimeMillis(); + System.out.println("(F) Close Statement = " + (end - start) + "ms"); + } + catch (SQLException e) + { + System.err.println("Test: " + e); + } + // + start = System.currentTimeMillis(); + try + { + if (m_conn != null) + m_conn.close(); + } + catch (SQLException ex) + { + System.err.println("Test close Connection: " + ex); + } + end = System.currentTimeMillis(); + System.out.println("(G) Close Connection = " + (end - start) + "ms"); + + long totalEnd = System.currentTimeMillis(); + System.out.println("Total Test = " + (totalEnd - totalStart) + "ms"); + return (totalEnd - totalStart); + } // test + + /*************************************************************************/ + + /** + * Test Connection. + * java -cp dbPort.jar;oracle.jar org.compiere.db.TestConnection + * @param args arguments optional + * Example: jdbc:oracle:thin:@dev:1521:dev adempiere adempiere + */ + public static void main(String[] args) + { + String url = "jdbc:oracle:thin:@//24.151.26.64:1521/lap11"; + String uid = "adempiere"; + String pwd = "adempiere"; + // + if (args.length == 0) + { + System.out.println("TestConnection "); + System.out.println("Example: jdbc:oracle:thin:@//dev:1521/dev adempiere adempiere"); + System.out.println("Example: jdbc:oracle:oci8:@dev adempiere adempiere"); + } + else if (args.length > 0) + url = args[0]; + else if (args.length > 1) + url = args[1]; + else if (args.length > 2) + url = args[2]; + + System.out.println(""); + TestConnection test = new TestConnection(url, uid, pwd); + } // main + +} // TestConnection diff --git a/dbPort/src/org/compiere/db/TestEJB.java b/dbPort/src/org/compiere/db/TestEJB.java new file mode 100644 index 0000000000..95bd82ac46 --- /dev/null +++ b/dbPort/src/org/compiere/db/TestEJB.java @@ -0,0 +1,85 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.db; + +import javax.naming.*; +import org.compiere.interfaces.*; + +/** + * Test EJB + * + * @author Jorg Janke + * @version $Id: TestEJB.java,v 1.3 2006/07/30 00:55:13 jjanke Exp $ + */ +public class TestEJB +{ + /** + * TestEJB + */ + public TestEJB () + { + CConnection cc = CConnection.get(null); + cc.setAppsHost("dev1"); + InitialContext ic = cc.getInitialContext(false); + /**/ + try + { + System.out.println(ic.getEnvironment()); + System.out.println("----------------"); + NamingEnumeration ne = ic.list(""); + while (ne.hasMore()) + { + System.out.println(ne.next()); + } + } + catch (Exception e) + { + System.err.println(".."); + e.printStackTrace(); + System.exit(1); + } + /**/ + + // + try + { + StatusHome statusHome = (StatusHome)ic.lookup ("Status"); + Status status = statusHome.create (); + // + } + catch (CommunicationException ce) // not a "real" error + { + System.err.println("=ce="); + ce.printStackTrace(); + } + catch (Exception e) + { + System.err.println("=e="); + e.printStackTrace(); + } + } + + /** + * main + * @param args + */ + public static void main (String[] args) + { + new TestEJB(); + } // main + +} // TestEJB diff --git a/dbPort/src/org/compiere/db/package.html b/dbPort/src/org/compiere/db/package.html new file mode 100644 index 0000000000..4cbefaddaf --- /dev/null +++ b/dbPort/src/org/compiere/db/package.html @@ -0,0 +1,34 @@ + + + + + + + +Provides for.... + +

Package Specification

+ + + +

Related Documentation

+ +For overviews, tutorials, examples, guides, and tool documentation, please see: + + + + + + diff --git a/dbPort/src/org/compiere/dbPort/Convert.java b/dbPort/src/org/compiere/dbPort/Convert.java new file mode 100644 index 0000000000..84734dc1a6 --- /dev/null +++ b/dbPort/src/org/compiere/dbPort/Convert.java @@ -0,0 +1,2301 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.dbPort; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import java.util.regex.*; +import org.compiere.db.*; +import org.compiere.util.*; + +/** + * Convert SQL to Target DB + * + * @author Jorg Janke, Victor Perez + * @version $Id: Convert.java,v 1.3 2006/07/30 00:55:04 jjanke Exp $ + */ +public class Convert +{ + /** + * Cosntructor + * @param type Database.DB_ + */ + public Convert (String type) + { + if (Database.DB_ORACLE.equals(type)) + m_isOracle = true; + else if (Database.DB_DERBY.equals(type)) + m_map = ConvertMap.getDerbyMap(); + else if (Database.DB_DB2.equals(type)) + m_map = ConvertMap.getDB2Map(); + // begin vpj-cd e-evolution 07 Dic 2005 + else if (Database.DB_POSTGRESQL.equals(type)) + m_map = ConvertMap.getPostgeSQLMap(); +// else if (Database.DB_EDB.equals(type)) +// m_isOracle = true; + // end vpj-cd e-evolution 07 Dic 2005 + else + throw new UnsupportedOperationException ("Unsupported database: " + type); + } // Convert + + /** RegEx: insensitive and dot to include line end characters */ + public static final int REGEX_FLAGS = Pattern.CASE_INSENSITIVE | Pattern.DOTALL; + + /** Is Oracle */ + private boolean m_isOracle = false; + /** Used Resorce Bundle */ + private TreeMap m_map; + + /** Statement used */ + private Statement m_stmt = null; + + /** Last Conversion Error */ + private String m_conversionError = null; + /** Last Execution Error */ + private Exception m_exception = null; + /** Verbose Messages */ + private boolean m_verbose = true; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (Convert.class); + + /** + * Set Verbose + * @param verbose + */ + public void setVerbose (boolean verbose) + { + m_verbose = verbose; + } // setVerbose + + /** + * Is Oracle DB + * @return true if connection is Oracle DB + */ + public boolean isOracle() + { + return m_isOracle; + } // isOracle + + + /************************************************************************** + * Execute SQL Statement (stops at first error). + * If an error occured hadError() returns true. + * You can get details via getConversionError() or getException() + * @param sqlStatements + * @param conn connection + * @return true if success + * @throws IllegalStateException if no connection + */ + public boolean execute (String sqlStatements, Connection conn) + { + if (conn == null) + throw new IllegalStateException ("Require connection"); + // + String[] sql = convert (sqlStatements); + m_exception = null; + if (m_conversionError != null || sql == null) + return false; + + boolean ok = true; + int i = 0; + String statement = null; + try + { + if (m_stmt == null) + m_stmt = conn.createStatement(); + // + for (i = 0; ok && i < sql.length; i++) + { + statement = sql[i]; + if (statement.length() == 0) + { + if (m_verbose) + log.finer("Skipping empty (" + i + ")"); + } + else + { + if (m_verbose) + log.info("Executing (" + i + ") <<" + statement + ">>"); + else + log.info("Executing " + i); + try + { + m_stmt.clearWarnings(); + int no = m_stmt.executeUpdate(statement); + SQLWarning warn = m_stmt.getWarnings(); + if (warn != null) + { + if (m_verbose) + log.info("- " + warn); + else + { + log.info("Executing (" + i + ") <<" + statement + ">>"); + log.info("- " + warn); + } + } + if (m_verbose) + log.fine("- ok " + no); + } + catch (SQLException ex) + { + // Ignore Drop Errors + if (!statement.startsWith("DROP ")) + { + ok = false; + m_exception = ex; + } + if (!m_verbose) + log.info("Executing (" + i + ") <<" + statement + ">>"); + log.info("Error executing " + i + "/" + sql.length + " = " + ex); + } + } + } // for all statements + } + catch (SQLException e) + { + m_exception = e; + if (!m_verbose) + log.info("Executing (" + i + ") <<" + statement + ">>"); + log.info("Error executing " + i + "/" + sql.length + " = " + e); + return false; + } + return ok; + } // execute + + /** + * Return last execution exception + * @return execution exception + */ + public Exception getException() + { + return m_exception; + } // getException + + /** + * Returns true if a conversion or execution error had occured. + * Get more details via getConversionError() or getException() + * @return true if error had occured + */ + public boolean hasError() + { + return (m_exception != null) | (m_conversionError != null); + } // hasError + + /** + * Convert SQL Statement (stops at first error). + * Statements are delimited by / + * If an error occured hadError() returns true. + * You can get details via getConversionError() + * @param sqlStatements + * @return converted statement as a string + */ + public String convertAll (String sqlStatements) + { + String[] sql = convert (sqlStatements); + StringBuffer sb = new StringBuffer (sqlStatements.length() + 10); + for (int i = 0; i < sql.length; i++) + { + // line.separator + sb.append(sql[i]).append("\n/\n"); + if (m_verbose) + log.info("Statement " + i + ": " + sql[i]); + } + return sb.toString(); + } // convertAll + + /** + * Convert SQL Statement (stops at first error). + * If an error occured hadError() returns true. + * You can get details via getConversionError() + * @param sqlStatements + * @return Array of converted Statements + */ + public String[] convert (String sqlStatements) + { + m_conversionError = null; + if (sqlStatements == null || sqlStatements.length() == 0) + { + m_conversionError = "SQL_Statement is null or has zero length"; + log.info(m_conversionError); + return null; + } + // + return convertIt (sqlStatements); + } // convert + + /** + * Return last conversion error or null. + * @return lst conversion error + */ + public String getConversionError() + { + return m_conversionError; + } // getConversionError + + + /************************************************************************** + * Conversion routine (stops at first error). + *
+	 *  - mask / in Strings
+	 *  - break into single statement
+	 *  - unmask statements
+	 *  - for each statement: convertStatement
+	 *      - remove comments
+	 *          - process FUNCTION/TRIGGER/PROCEDURE
+	 *          - process Statement: convertSimpleStatement
+	 *              - based on ConvertMap
+	 *              - convertComplexStatement
+	 *                  - decode, sequence, exception
+	 *  
+ * @param sqlStatements + * @return array of converted statements + */ + private String[] convertIt (String sqlStatements) + { + // Need to mask / in SQL Strings ! + final char MASK = '\u001F'; // Unit Separator + StringBuffer masked = new StringBuffer(sqlStatements.length()); + Matcher m = Pattern.compile("'[^']+'", Pattern.DOTALL).matcher(sqlStatements); + while (m.find()) + { + String group = m.group(); // SQL string + if (group.indexOf("/") != -1) // / in string + group = group.replace('/', MASK); + if (group.indexOf('$') != -1) // Group character needs to be escaped + group = Util.replace(group, "$", "\\$"); + m.appendReplacement(masked, group); + } + m.appendTail(masked); + String tempResult = masked.toString(); + /** @todo Need to mask / in comments */ + + + // Statements ending with / + String[] sql = tempResult.split("\\s/\\s"); // ("(;\\s)|(\\s/\\s)"); + ArrayList result = new ArrayList (sql.length); + // process statements + for (int i = 0; i < sql.length; i++) + { + String statement = sql[i]; + if (statement.indexOf(MASK) != -1) + statement = statement.replace(MASK, '/'); + result.addAll(convertStatement(statement)); // may return more than one target statement + } + // convert to array + sql = new String[result.size()]; + result.toArray(sql); + return sql; + } // convertIt + + /** + * Convert single Statements. + * - remove comments + * - process FUNCTION/TRIGGER/PROCEDURE + * - process Statement + * @param sqlStatement + * @return converted statement + */ + private ArrayList convertStatement (String sqlStatement) + { + ArrayList result = new ArrayList(); + if (m_isOracle) + { + result.add(sqlStatement); + return result; + } + + // remove comments + String statement = removeComments (sqlStatement); + // log.info("------------------------------------------------------------"); + // log.info(statement); + // log.info("------------------->"); + + String cmpString = statement.toUpperCase(); + boolean isCreate = cmpString.startsWith("CREATE "); + + // Process + if (isCreate && cmpString.indexOf(" FUNCTION ") != -1) + result.addAll(convertFunction(statement)); + + else if (isCreate && cmpString.indexOf(" TRIGGER ") != -1) + result.addAll(convertTrigger(statement)); + + else if (isCreate && cmpString.indexOf(" PROCEDURE ") != -1) + result.addAll(convertProcedure(statement)); + + else if (isCreate && cmpString.indexOf(" VIEW ") != -1) + result.addAll(convertView(statement)); +//begin vpj-cd e-evolution 02/24/2005 PostgreSQL + else if (cmpString.indexOf("ALTER TABLE") != -1) + { + result.add(convertDDL(statement)); + } + else if (cmpString.indexOf("ROWNUM") != -1) + { + result.add(convertRowNum(convertAlias(converSimpleStatement(statement)))); + } + else if (cmpString.indexOf("DELETE ") != -1 && cmpString.indexOf("DELETE FROM") == -1) + { + + statement = convertDelete(statement); + cmpString = statement; + //System.out.println("-------------cmpString:"+cmpString); + result.add(converSimpleStatement(convertAlias(cmpString))); + } + else if (cmpString.indexOf("DELETE FROM") != -1) + { + + result.add(converSimpleStatement(convertAlias(statement))); + } + else if (cmpString.indexOf("UPDATE") != -1) + { + result.add(converSimpleStatement(convertUpdate(convertAlias(statement)))); + } + else + { + result.add(converSimpleStatement(convertAlias(statement))); + } + // else +// result.add(converSimpleStatement(statement)); + //end vpj-cd e-evolution 02/24/2005 PostgreSQL + // Simple Statement + + // + // log.info("<-------------------"); + // for (int i = 0; i < result.size(); i++) + // log.info(result.get(i)); + // log.info("------------------------------------------------------------"); + + return result; + } // convertStatement + + /** + * Convert simple SQL Statement. + * Based on ConvertMap + * + * @param sqlStatement + * @return converted Statement + */ + private String converSimpleStatement (String sqlStatement) + { + // Error Checks + if (sqlStatement.toUpperCase().indexOf("EXCEPTION WHEN") != -1) + { + String error = "Exception clause needs to be converted: " + sqlStatement; + log.info (error); + m_conversionError = error; + return sqlStatement; + } + + // Standard Statement + String retValue = sqlStatement; + Iterator iter = m_map.keySet().iterator(); + while (iter.hasNext()) + { + //begin e-evolution vpj-cd 26.09.2005 + // search reserved word ie DATE into 'DATE' and remplace for character temporal <--> + Vector retVars = new Vector(); + Pattern p = Pattern.compile("'[[\\w]*[-:,\\(\\)]*[ ]*]*'"); + Matcher m = p.matcher(retValue); + while(m.find()) { + retVars.addElement(new String(retValue.substring(m.start(),m.end())) ); + } + retVars.addElement( new String(m.replaceAll("<-->")) ); + // end e-evolution vpj-cd 26.09.2005*/ + + String regex = (String)iter.next(); + String replacement = (String)m_map.get(regex); + try + { + //begin e-evolution vpj-cd 29.09.2005 + //Pattern p = Pattern.compile(regex, REGEX_FLAGS ); + //Matcher m = p.matcher(retValue); + //retValue = m.replaceAll(replacement); + // remplace reserved work + p = Pattern.compile(regex, REGEX_FLAGS ); + m = p.matcher((String)retVars.get(retVars.size()-1)); + retValue=m.replaceAll(replacement); + + p = Pattern.compile("<-->",REGEX_FLAGS); + m = p.matcher(retValue); + for(int cont=0; cont + * /*ORACLE>*/ + * Oracle Specific Statement + * /*<ORACLE*/ + * /*POSTGRESQL> + * PostgreSQL Specicic Statements + * <POSTGRESQL*/ + * + * @param statement + * @return sql statement + */ + protected String removeComments (String statement) + { + String clean = statement.trim(); + + // Remove /*ORACLE>*/ /*.* + m = Pattern.compile("\\/\\*POSTGRESQL>").matcher(clean); + clean = m.replaceAll(""); + // Remove + * CREATE OR REPLACE FUNCTION AD_Message_Get + * (p_AD_Message IN VARCHAR, p_AD_Language IN VARCHAR) + * RETURN VARCHAR AS + * ... + * END AD_Message_Get; + * => + * CREATE FUNCTION AD_Message_Get + * (VARCHAR, VARCHAR) + * RETURNS VARCHAR AS ' + * DECLARE + * p_AD_Message ALIAS FOR $1; + * p_AD_Language ALIAS FOR $2; + * .... + * END; + * ' LANGUAGE 'plpgsql'; + * + * @param sqlStatement + * @return CREATE and DROP Function statement + */ + private ArrayList convertFunction (String sqlStatement) + { + ArrayList result = new ArrayList(); + // Convert statement - to avoid handling contents of comments + String stmt = converSimpleStatement(sqlStatement); + // Double quotes ' + stmt = Pattern.compile("'").matcher(stmt).replaceAll("''"); + // remove OR REPLACE + int orReplacePos = stmt.toUpperCase().indexOf(" OR REPLACE "); + if (orReplacePos != -1) + stmt = "CREATE" + stmt.substring(orReplacePos+11); + + // Line separators + String match = + "(\\([^\\)]*\\))" // (.) Parameter + + "|(\\bRETURN \\w+ (AS)|(IS))" // RETURN CLAUSE + + "|(;)" // Statement End + // Nice to have - for readability + + "|(\\bBEGIN\\b)" // BEGIN + + "|(\\bTHEN\\b)" + + "|(\\bELSE\\b)" + + "|(\\bELSIF\\b)"; + Matcher m = Pattern.compile(match, Pattern.CASE_INSENSITIVE).matcher(stmt); + + StringBuffer sb = new StringBuffer(); + // First group -> ( ) + // CREATE OR REPLACE FUNCTION AD_Message_Get ( p_AD_Message IN VARCHAR, p_AD_Language IN VARCHAR) + // CREATE FUNCTION AD_Message_Get (VARCHAR, VARCHAR) + m.find(); + m.appendReplacement(sb, ""); + String name = sb.substring(6).trim(); + StringBuffer signature = new StringBuffer(); + // + String group = m.group().trim(); + // log.info("Group: " + group); + StringBuffer alias = new StringBuffer(); + // Parameters + if (group.startsWith("(") && group.endsWith(")")) + { + // Default not supported + if (group.toUpperCase().indexOf(" DEFAULT ") != -1) + { + String error = "DEFAULT in Parameter not supported"; + log.info (error); + m_conversionError = error; + return result; + } + signature.append("("); + if (group.length() > 2) + { + group = group.substring(1,group.length()-1); + // Paraneters are delimited by , + String[] parameters = group.split(","); + for (int i = 0; i < parameters.length; i++) + { + if (i != 0) + signature.append(", "); + // name ALIAS FOR $1 + String p = parameters[i].trim(); + alias.append(p.substring(0,p.indexOf(" "))) + .append(" ALIAS FOR $").append(i+1).append(";\n"); + // Datatape + signature.append(p.substring(p.lastIndexOf(" ")+1)); + } + } + signature.append(")"); + sb.append(signature); + // log.info("Alias: " + alias.toString()); + // log.info("Signature: " + signature.toString()); + } + // No Parameters + else + { + String error = "Missing Parameter ()"; + log.info (error); + m_conversionError = error; + return result; + } + sb.append("\n"); + // Need to create drop statement + if (orReplacePos != -1) + { + String drop = "DROP " + name + signature.toString(); + // log.info(drop); + result.add(drop); + } + // log.info("1>" + sb.toString() + "<1"); + + // Second Group -> RETURN VARCHAR AS + // RETURNS VARCHAR AS + m.find(); + group = m.group(); + m.appendReplacement(sb, ""); + if (group.startsWith("RETURN")) + sb.append("RETURNS").append(group.substring(group.indexOf(" "))); + sb.append(" '\nDECLARE\n") + .append(alias); // add aliases here + // log.info("2>" + sb.toString() + "<2"); + + // remainder statements + while (m.find()) + { + String group2 = m.group(); + if (group2.indexOf('$') != -1) // Group character needs to be escaped + group2 = Util.replace(group2, "$", "\\$"); + m.appendReplacement(sb, group2); + sb.append("\n"); + } + m.appendTail(sb); + + // finish + sb.append("' LANGUAGE 'plpgsql';"); + // log.info(">" + sb.toString() + "<"); + result.add(sb.toString()); + // + return result; + } // convertFunction + + /** + * Convert Procedure. + *
+	 *      CREATE OR REPLACE PROCEDURE AD_Message_X
+	 *      (p_AD_Message IN VARCHAR, p_AD_Language IN VARCHAR)
+	 *      ...
+	 *      END AD_Message_X;
+	 *  =>
+	 *      CREATE FUNCTION AD_Message_X
+	 *      (VARCHAR, VARCHAR)
+	 *      RETURNS VARCHAR AS '
+	 *      DECLARE
+	 *      p_AD_Message ALIAS FOR $1;
+	 *      p_AD_Language ALIAS FOR $2;
+	 *      ....
+	 *      END;
+	 *      ' LANGUAGE 'plpgsql';
+	 *  
+ * @param sqlStatement + * @return CREATE and DROP Function statement + */ + private ArrayList convertProcedure (String sqlStatement) + { + ArrayList result = new ArrayList(); + // Convert statement - to avoid handling contents of comments + String stmt = converSimpleStatement(sqlStatement); + // Double quotes ' + stmt = Pattern.compile("'").matcher(stmt).replaceAll("''"); + // remove OR REPLACE + int orReplacePos = stmt.toUpperCase().indexOf(" OR REPLACE "); + if (orReplacePos != -1) + stmt = "CREATE" + stmt.substring(orReplacePos+11); + + // Line separators + String match = + "(\\([^\\)]*\\))" // (.) Parameter + + "|(\\bRETURN \\w+ (AS)|(IS))" // RETURN CLAUSE + + "|(;)" // Statement End + // Nice to have - for readability + + "|(\\bBEGIN\\b)" // BEGIN + + "|(\\bTHEN\\b)" + + "|(\\bELSE\\b)" + + "|(\\bELSIF\\b)"; + Matcher m = Pattern.compile(match, Pattern.CASE_INSENSITIVE).matcher(stmt); + + StringBuffer sb = new StringBuffer(); + // First group -> ( ) + // CREATE OR REPLACE FUNCTION AD_Message_Get ( p_AD_Message IN VARCHAR, p_AD_Language IN VARCHAR) + // CREATE FUNCTION AD_Message_Get (VARCHAR, VARCHAR) + m.find(); + m.appendReplacement(sb, ""); + String name = sb.substring(6).trim(); + StringBuffer signature = new StringBuffer(); + // + String group = m.group().trim(); + // log.info("Group: " + group); + StringBuffer alias = new StringBuffer(); + // Parameters + if (group.startsWith("(") && group.endsWith(")")) + { + // Default not supported + if (group.toUpperCase().indexOf(" DEFAULT ") != -1) + { + String error = "DEFAULT in Parameter not supported"; + log.info (error); + m_conversionError = error; + return result; + } + signature.append("("); + if (group.length() > 2) + { + group = group.substring(1,group.length()-1); + // Paraneters are delimited by , + String[] parameters = group.split(","); + for (int i = 0; i < parameters.length; i++) + { + if (i != 0) + signature.append(", "); + // name ALIAS FOR $1 + String p = parameters[i].trim(); + alias.append(p.substring(0,p.indexOf(" "))) + .append(" ALIAS FOR $").append(i+1).append(";\n"); + // Datatape + signature.append(p.substring(p.lastIndexOf(" ")+1)); + } + } + signature.append(")"); + sb.append(signature); + // log.info("Alias: " + alias.toString()); + // log.info("Signature: " + signature.toString()); + } + // No Parameters + else + { + String error = "Missing Parameter ()"; + log.info (error); + m_conversionError = error; + return result; + } + sb.append("\n"); + // Need to create drop statement + if (orReplacePos != -1) + { + String drop = "DROP " + name + signature.toString(); + // log.info(drop); + result.add(drop); + } + // log.info("1>" + sb.toString() + "<1"); + + // Second Group -> RETURN VARCHAR AS + // RETURNS VARCHAR AS + m.find(); + group = m.group(); + m.appendReplacement(sb, ""); + if (group.startsWith("RETURN")) + sb.append("RETURNS").append(group.substring(group.indexOf(" "))); + sb.append(" '\nDECLARE\n") + .append(alias); // add aliases here + // log.info("2>" + sb.toString() + "<2"); + + // remainder statements + while (m.find()) + { + String group2 = m.group(); + if (group2.indexOf('$') != -1) // Group character needs to be escaped + group2 = Util.replace(group2, "$", "\\$"); + m.appendReplacement(sb, group2); + sb.append("\n"); + } + m.appendTail(sb); + + // finish + sb.append("' LANGUAGE 'plpgsql';"); + // log.info(">" + sb.toString() + "<"); + result.add(sb.toString()); + // + return result; + } // convertProcedure + + /** + * Convert Trigger. + *
+	 *      DROP FUNCTION emp_trgF();
+	 *      CREATE FUNCTION emp_trg () RETURNS OPAQUE AS '....
+	 *          RETURN NEW; ...
+	 *          ' LANGUAGE 'plpgsql';
+	 *      DROP TRIGGER emp_trg ON emp;
+	 *      CREATE TRIGGER emp_trg BEFORE INSERT OR UPDATE ON emp
+	 *      FOR EACH ROW EXECUTE PROCEDURE emp_trgF();
+	 *  
+ * @param sqlStatement + * @return CREATE and DROP TRIGGER and associated Function statement + */ + private ArrayList convertTrigger (String sqlStatement) + { + ArrayList result = new ArrayList(); + // Convert statement - to avoid handling contents of comments + String stmt = converSimpleStatement(sqlStatement); + + // Trigger specific replacements + stmt = Pattern.compile("\\bINSERTING\\b").matcher(stmt).replaceAll("TG_OP='INSERT'"); + stmt = Pattern.compile("\\bUPDATING\\b").matcher(stmt).replaceAll("TG_OP='UPDATE'"); + stmt = Pattern.compile("\\bDELETING\\b").matcher(stmt).replaceAll("TG_OP='DELETE'"); + stmt = Pattern.compile(":new.").matcher(stmt).replaceAll("NEW."); + stmt = Pattern.compile(":old.").matcher(stmt).replaceAll("OLD."); + + // Double quotes ' + stmt = Pattern.compile("'").matcher(stmt).replaceAll("''"); + // remove OR REPLACE + int orReplacePos = stmt.toUpperCase().indexOf(" OR REPLACE "); + // trigger Name + int triggerPos = stmt.toUpperCase().indexOf(" TRIGGER ") + 9; + String triggerName = stmt.substring(triggerPos); + triggerName = triggerName.substring(0, triggerName.indexOf(" ")); + // table name + String tableName = stmt.substring(stmt.toUpperCase().indexOf(" ON ")+4); + tableName = tableName.substring(0, tableName.indexOf(" ")); + + // Function Drop + if (orReplacePos != -1) + { + String drop = "DROP FUNCTION " + triggerName + "F()"; + // log.info(drop); + result.add(drop); + } + + // Function & Trigger + int pos = stmt.indexOf("DECLARE "); + if (pos == -1) + pos = stmt.indexOf("BEGIN "); + String functionCode = stmt.substring(pos); + StringBuffer triggerCode = new StringBuffer ("CREATE TRIGGER "); + triggerCode.append(triggerName).append("\n") + .append(stmt.substring(triggerPos+triggerName.length(), pos)) + .append("\nEXECUTE PROCEDURE ").append(triggerName).append("F();"); + + // Add NEW to existing Return --> DELETE Trigger ? + functionCode = Pattern.compile("\\bRETURN;", Pattern.CASE_INSENSITIVE) + .matcher(functionCode) + .replaceAll("RETURN NEW;"); + // Add final return and change name + functionCode = Pattern.compile("\\bEND " + triggerName + ";", Pattern.CASE_INSENSITIVE) + .matcher(functionCode) + .replaceAll("\nRETURN NEW;\nEND " + triggerName + "F;"); + + // Line separators + String match = + "(\\(.*\\))" // (.) Parameter + + "|(;)" // Statement End + // Nice to have - for readability + + "|(\\bBEGIN\\b)" // BEGIN + + "|(\\bTHEN\\b)" + + "|(\\bELSE\\b)" + + "|(\\bELSIF\\b)"; + Matcher m = Pattern.compile(match, Pattern.CASE_INSENSITIVE).matcher(functionCode); + + // Function Header + StringBuffer sb = new StringBuffer("CREATE FUNCTION "); + sb.append(triggerName).append("F() RETURNS OPAQUE AS '\n"); + + // remainder statements + while (m.find()) + { + String group = m.group(); + if (group.indexOf('$') != -1) // Group character needs to be escaped + group = Util.replace(group, "$", "\\$"); + m.appendReplacement(sb, group); + sb.append("\n"); + } + m.appendTail(sb); + + // finish Function + sb.append("' LANGUAGE 'plpgsql';"); + // log.info(">" + sb.toString() + "<"); + result.add(sb.toString()); + + // Trigger Drop + if (orReplacePos != -1) + { + String drop = "DROP TRIGGER " + triggerName.toLowerCase() + " ON " + tableName; + // log.info(drop); + result.add(drop); + } + + // Trigger + // Remove Column references OF ... ON + String trigger = Pattern.compile("\\sOF.*ON\\s") + .matcher(triggerCode) + .replaceAll(" ON "); + // log.info(trigger); + result.add(trigger); + + // + return result; + } // convertTrigger + + /** + * Convert View. + * Handle CREATE OR REPLACE + * @param sqlStatement + * @return converted statement(s) + */ + private ArrayList convertView (String sqlStatement) + { + ArrayList result = new ArrayList(); + String stmt = converSimpleStatement(sqlStatement); + + // remove OR REPLACE + int orReplacePos = stmt.toUpperCase().indexOf(" OR REPLACE "); + if (orReplacePos != -1) + { + int index = stmt.indexOf(" VIEW "); + int space = stmt.indexOf(' ', index+6); + String drop = "DROP VIEW " + stmt.substring(index+6, space); + result.add(drop); + // + String create = "CREATE" + stmt.substring(index); + result.add(create); + } + else // simple statement + result.add(stmt); + return result; + } // convertView + + + /************************************************************************** + * Converts Decode, Outer Join and Sequence. + *
+	 *      DECODE (a, 1, 'one', 2, 'two', 'none')
+	 *       => CASE WHEN a = 1 THEN 'one' WHEN a = 2 THEN 'two' ELSE 'none' END
+	 *
+	 *      AD_Error_Seq.nextval
+	 *       => nextval('AD_Error_Seq')
+	 *
+	 *      RAISE_APPLICATION_ERROR (-20100, 'Table Sequence not found')
+	 *       => RAISE EXCEPTION 'Table Sequence not found'
+	 *
+	 *  
+ * @param sqlStatement + * @return converted statement + */ + private String convertComplexStatement(String sqlStatement) + { + String retValue = sqlStatement; + StringBuffer sb = null; + + // Convert all decode parts + while (retValue.indexOf("DECODE") != -1) + retValue = convertDecode(retValue); + + /** + * Sequence Handling -------------------------------------------------- + * AD_Error_Seq.nextval + * => nextval('AD_Error_Seq') + */ + Matcher m = Pattern.compile("\\w+\\.(nextval)|(curval)", Pattern.CASE_INSENSITIVE) + .matcher(retValue); + sb = new StringBuffer(); + while (m.find()) + { + String group = m.group(); + // System.out.print("-> " + group); + int pos = group.indexOf("."); + String seqName = group.substring(0,pos); + String funcName = group.substring(pos+1); + group = funcName + "('" + seqName + "')"; + // log.info(" => " + group); + if (group.indexOf('$') != -1) // Group character needs to be escaped + group = Util.replace(group, "$", "\\$"); + m.appendReplacement(sb, group); + } + m.appendTail(sb); + retValue = sb.toString(); + + /** + * RAISE -------------------------------------------------------------- + * RAISE_APPLICATION_ERROR (-20100, 'Table Sequence not found') + * => RAISE EXCEPTION 'Table Sequence not found' + */ + m = Pattern.compile("RAISE_APPLICATION_ERROR\\s*\\(.+'\\)", Pattern.CASE_INSENSITIVE) + .matcher(retValue); + sb = new StringBuffer(); + while (m.find()) + { + String group = m.group(); + System.out.print("-> " + group); + String result = "RAISE EXCEPTION " + group.substring(group.indexOf('\''), group.lastIndexOf('\'')+1); + log.info(" => " + result); + + if (result.indexOf('$') != -1) // Group character needs to be escaped + result = Util.replace(result, "$", "\\$"); + m.appendReplacement(sb, result); + } + m.appendTail(sb); + retValue = sb.toString(); + + // Truncate Handling ------------------------------------------------- + //begin vpj-cd e-evolution 16/07/2005 + //while (retValue.indexOf("TRUNC") != -1) + if(retValue.indexOf("TRUNC(((TRUNC(") != -1 && DB.isPostgreSQL()) + retValue = Util.replace(retValue,"TRUNC(((TRUNC(","(((TRUNC("); + //end vpj-cd e-evolution 16/07/2005 + + while (retValue.indexOf("TRUNC") != -1) + retValue = convertTrunc (retValue); + + // Outer Join Handling ----------------------------------------------- + int index = retValue.indexOf("SELECT "); + if (index != -1 && retValue.indexOf("(+)", index) != -1) + retValue = convertOuterJoin(retValue); + + return retValue; + } // convertComplexStatement + + + /************************************************************************** + * Converts Decode. + *
+	 *      DECODE (a, 1, 'one', 2, 'two', 'none')
+	 *       => CASE WHEN a = 1 THEN 'one' WHEN a = 2 THEN 'two' ELSE 'none' END
+	 *  
+ * @param sqlStatement + * @return converted statement + */ + private String convertDecode(String sqlStatement) + { + // log.info("DECODE<== " + sqlStatement); + String statement = sqlStatement; + StringBuffer sb = new StringBuffer("CASE"); + + int index = statement.indexOf("DECODE"); + String firstPart = statement.substring(0,index); + + // find the opening ( + index = statement.indexOf('(', index); + statement = statement.substring(index+1); + + // find the expression "a" - find first , ignoring () + index = Util.findIndexOf (statement, ','); + String expression = statement.substring(0, index).trim(); + // log.info("Expression=" + expression); + + // Pairs "1, 'one'," + statement = statement.substring(index+1); + index = Util.findIndexOf (statement, ','); + while (index != -1) + { + String first = statement.substring(0, index); + char cc = statement.charAt(index); + statement = statement.substring(index+1); + // log.info("First=" + first + ", Char=" + cc); + // + boolean error = false; + if (cc == ',') + { + index = Util.findIndexOf (statement, ',',')'); + if (index == -1) + error = true; + else + { + String second = statement.substring(0, index); + sb.append(" WHEN ").append(expression).append("=").append(first.trim()) + .append(" THEN ").append(second.trim()); + // log.info(">>" + sb.toString()); + statement = statement.substring(index+1); + index = Util.findIndexOf (statement, ',',')'); + } + } + else if (cc == ')') + { + sb.append(" ELSE ").append(first.trim()).append(" END"); + // log.info(">>" + sb.toString()); + index = -1; + } + else + error = true; + if (error) + { + log.log(Level.SEVERE, "SQL=(" + sqlStatement + + ")\n====Result=(" + sb.toString() + + ")\n====Statement=(" + statement + + ")\n====First=(" + first + + ")\n====Index=" + index); + m_conversionError = "Decode conversion error"; + } + } + sb.append(statement); + sb.insert(0, firstPart); + // log.info("DECODE==> " + sb.toString()); + return sb.toString(); + } // convertDecode + + + /************************************************************************** + * Convert Outer Join. + * Converting joins can ve very complex when multiple tables/keys are involved. + * The main scenarios supported are two tables with multiple key columns + * and multiple tables with single key columns. + *
+	 *      SELECT a.Col1, b.Col2 FROM tableA a, tableB b WHERE a.ID=b.ID(+)
+	 *      => SELECT a.Col1, b.Col2 FROM tableA a LEFT OUTER JOIN tableB b ON (a.ID=b.ID)
+	 *
+	 *      SELECT a.Col1, b.Col2 FROM tableA a, tableB b WHERE a.ID(+)=b.ID
+	 *      => SELECT a.Col1, b.Col2 FROM tableA a RIGHT OUTER JOIN tableB b ON (a.ID=b.ID)
+	 *  Assumptions:
+	 *  - No outer joins in sub queries (ignores sub-queries)
+	 *  - OR condition ignored (not sure what to do, should not happen)
+	 *  Limitations:
+	 *  - Parameters for outer joins must be first - as sequence of parameters changes
+	 *  
+ * @param sqlStatement + * @return converted statement + */ + private String convertOuterJoin (String sqlStatement) + { + boolean trace = false; + // + int fromIndex = Util.findIndexOf (sqlStatement.toUpperCase(), " FROM "); + int whereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " WHERE "); + //begin vpj-cd e-evolution 03/14/2005 PostgreSQL + //int endWhereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " GRPUP BY "); + int endWhereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " GROUP BY "); + //end vpj-cd e-evolution 03/14/2005 PostgreSQL + if (endWhereIndex == -1) + endWhereIndex = Util.findIndexOf(sqlStatement.toUpperCase(), " ORDER BY "); + if (endWhereIndex == -1) + endWhereIndex = sqlStatement.length(); + // + if (trace) + { + log.info("OuterJoin<== " + sqlStatement); + // log.info("From=" + fromIndex + ", Where=" + whereIndex + ", End=" + endWhereIndex + ", Length=" + sqlStatement.length()); + } + // + String selectPart = sqlStatement.substring(0, fromIndex); + String fromPart = sqlStatement.substring(fromIndex, whereIndex); + String wherePart = sqlStatement.substring(whereIndex, endWhereIndex); + String rest = sqlStatement.substring(endWhereIndex); + + // find/remove all (+) from WHERE clase ------------------------------ + String newWherePart = wherePart; + ArrayList joins = new ArrayList(); + int pos = newWherePart.indexOf("(+)"); + while (pos != -1) + { + // find starting point + int start = newWherePart.lastIndexOf(" AND ", pos); + int startOffset = 5; + if (start == -1) + { + start = newWherePart.lastIndexOf(" OR ", pos); + startOffset = 4; + } + if (start == -1) + { + start = newWherePart.lastIndexOf("WHERE ", pos); + startOffset = 6; + } + if (start == -1) + { + String error = "Start point not found in clause " + wherePart; + log.severe(error); + m_conversionError = error; + return sqlStatement; + } + // find end point + int end = newWherePart.indexOf(" AND ", pos); + if (end == -1) + end = newWherePart.indexOf(" OR ", pos); + if (end == -1) + end = newWherePart.length(); + // log.info("<= " + newWherePart + " - Start=" + start + "+" + startOffset + ", End=" + end); + + // extract condition + String condition = newWherePart.substring(start+startOffset, end); + joins.add(condition); + if (trace) + log.info("->" + condition); + // new WHERE clause + newWherePart = newWherePart.substring(0, start) + newWherePart.substring(end); + // log.info("=> " + newWherePart); + // + pos = newWherePart.indexOf("(+)"); + } + // correct beginning + newWherePart = newWherePart.trim(); + if (newWherePart.startsWith("AND ")) + newWherePart = "WHERE" + newWherePart.substring(3); + else if (newWherePart.startsWith("OR ")) + newWherePart = "WHERE" + newWherePart.substring(2); + if (trace) + log.info("=> " + newWherePart); + + // Correct FROM clause ----------------------------------------------- + // Disassemble FROM + String[] fromParts = fromPart.trim().substring(4).split(","); + HashMap fromAlias = new HashMap(); // tables to be processed + HashMap fromLookup = new HashMap(); // used tabled + for (int i = 0; i < fromParts.length; i++) + { + String entry = fromParts[i].trim(); + String alias = entry; // no alias + String table = entry; + int aPos = entry.lastIndexOf(' '); + if (aPos != -1) + { + alias = entry.substring(aPos+1); + table = entry.substring(0, entry.indexOf(' ')); // may have AS + } + fromAlias.put(alias, table); + fromLookup.put(alias, table); + if (trace) + log.info("Alias=" + alias + ", Table=" + table); + } + + /** Single column + SELECT t.TableName, w.Name FROM AD_Table t, AD_Window w + WHERE t.AD_Window_ID=w.AD_Window_ID(+) + -- 275 rows + SELECT t.TableName, w.Name FROM AD_Table t + LEFT OUTER JOIN AD_Window w ON (t.AD_Window_ID=w.AD_Window_ID) + + SELECT t.TableName, w.Name FROM AD_Table t, AD_Window w + WHERE t.AD_Window_ID(+)=w.AD_Window_ID + -- 239 rows + SELECT t.TableName, w.Name FROM AD_Table t + RIGHT OUTER JOIN AD_Window w ON (t.AD_Window_ID=w.AD_Window_ID) + + ** Multiple columns + SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive + FROM AD_TreeNode tn, AD_TreeBar tb + WHERE tn.AD_Tree_ID=tb.AD_Tree_ID(+) AND tn.Node_ID=tb.Node_ID(+) + AND tn.AD_Tree_ID=10 + -- 235 rows + SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive + FROM AD_TreeNode tn LEFT OUTER JOIN AD_TreeBar tb + ON (tn.Node_ID=tb.Node_ID AND tn.AD_Tree_ID=tb.AD_Tree_ID AND tb.AD_User_ID=0) + WHERE tn.AD_Tree_ID=10 + + SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive + FROM AD_TreeNode tn, AD_TreeBar tb + WHERE tn.AD_Tree_ID=tb.AD_Tree_ID(+) AND tn.Node_ID=tb.Node_ID(+) + AND tn.AD_Tree_ID=10 AND tb.AD_User_ID(+)=0 + -- 214 rows + SELECT tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive + FROM AD_TreeNode tn LEFT OUTER JOIN AD_TreeBar tb + ON (tn.Node_ID=tb.Node_ID AND tn.AD_Tree_ID=tb.AD_Tree_ID AND tb.AD_User_ID=0) + WHERE tn.AD_Tree_ID=10 + + */ + StringBuffer newFrom = new StringBuffer (); + for (int i = 0; i < joins.size(); i++) + { + Join first = new Join ((String)joins.get(i)); + first.setMainTable((String)fromLookup.get(first.getMainAlias())); + fromAlias.remove(first.getMainAlias()); // remove from list + first.setJoinTable((String)fromLookup.get(first.getJoinAlias())); + fromAlias.remove(first.getJoinAlias()); // remove from list + if (trace) + log.info("-First: " + first); + // + if (newFrom.length() == 0) + newFrom.append(" FROM "); + else + newFrom.append(", "); + newFrom.append(first.getMainTable()).append(" ").append(first.getMainAlias()) + .append(first.isLeft() ? " LEFT" : " RIGHT").append(" OUTER JOIN ") + .append(first.getJoinTable()).append(" ").append(first.getJoinAlias()) + .append(" ON (").append(first.getCondition()); + // keep it open - check for other key comparisons + for (int j = i+1; j < joins.size(); j++) + { + Join second = new Join ((String)joins.get(j)); + second.setMainTable((String)fromLookup.get(second.getMainAlias())); + second.setJoinTable((String)fromLookup.get(second.getJoinAlias())); + if ((first.getMainTable().equals(second.getMainTable()) + && first.getJoinTable().equals(second.getJoinTable())) + || second.isConditionOf(first) ) + { + if (trace) + log.info("-Second/key: " + second); + newFrom.append(" AND ").append(second.getCondition()); + joins.remove(j); // remove from join list + fromAlias.remove(first.getJoinAlias()); // remove from table list + //---- + for (int k = i+1; k < joins.size(); k++) + { + Join third = new Join ((String)joins.get(k)); + third.setMainTable((String)fromLookup.get(third.getMainAlias())); + third.setJoinTable((String)fromLookup.get(third.getJoinAlias())); + if (third.isConditionOf(second)) + { + if (trace) + log.info("-Third/key: " + third); + newFrom.append(" AND ").append(third.getCondition()); + joins.remove(k); // remove from join list + fromAlias.remove(third.getJoinAlias()); // remove from table list + } + else if (trace) + log.info("-Third/key-skip: " + third); + } + } + else if (trace) + log.info("-Second/key-skip: " + second); + } + newFrom.append(")"); // close ON + // check dependency on first table + for (int j = i+1; j < joins.size(); j++) + { + Join second = new Join ((String)joins.get(j)); + second.setMainTable((String)fromLookup.get(second.getMainAlias())); + second.setJoinTable((String)fromLookup.get(second.getJoinAlias())); + if (first.getMainTable().equals(second.getMainTable())) + { + if (trace) + log.info("-Second/dep: " + second); + // FROM (AD_Field f LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)) + // LEFT OUTER JOIN AD_FieldGroup fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID), + newFrom.insert(6, '('); // _FROM ... + newFrom.append(')'); // add parantesis on previous relation + // + newFrom.append(second.isLeft() ? " LEFT" : " RIGHT").append(" OUTER JOIN ") + .append(second.getJoinTable()).append(" ").append(second.getJoinAlias()) + .append(" ON (").append(second.getCondition()); + joins.remove(j); // remove from join list + fromAlias.remove(second.getJoinAlias()); // remove from table list + // additional join colums would come here + newFrom.append(")"); // close ON + //---- + for (int k = i+1; k < joins.size(); k++) + { + Join third = new Join ((String)joins.get(k)); + third.setMainTable((String)fromLookup.get(third.getMainAlias())); + third.setJoinTable((String)fromLookup.get(third.getJoinAlias())); + if (second.getJoinTable().equals(third.getMainTable())) + { + if (trace) + log.info("-Third-dep: " + third); + // FROM ((C_BPartner p LEFT OUTER JOIN AD_User c ON (p.C_BPartner_ID=c.C_BPartner_ID)) + // LEFT OUTER JOIN C_BPartner_Location l ON (p.C_BPartner_ID=l.C_BPartner_ID)) + // LEFT OUTER JOIN C_Location a ON (l.C_Location_ID=a.C_Location_ID) + newFrom.insert(6, '('); // _FROM ... + newFrom.append(')'); // add parantesis on previous relation + // + newFrom.append(third.isLeft() ? " LEFT" : " RIGHT").append(" OUTER JOIN ") + .append(third.getJoinTable()).append(" ").append(third.getJoinAlias()) + .append(" ON (").append(third.getCondition()); + joins.remove(k); // remove from join list + fromAlias.remove(third.getJoinAlias()); // remove from table list + // additional join colums would come here + newFrom.append(")"); // close ON + } + else if (trace) + log.info("-Third-skip: " + third); + } + } + else if (trace) + log.info("-Second/dep-skip: " + second); + } // dependency on first table + } + // remaining Tables + Iterator it = fromAlias.keySet().iterator(); + while (it.hasNext()) + { + Object alias = it.next(); + Object table = fromAlias.get(alias); + newFrom.append(", ").append(table); + if (!table.equals(alias)) + newFrom.append(" ").append(alias); + } + if (trace) + log.info(newFrom.toString()); + // + StringBuffer retValue = new StringBuffer (sqlStatement.length()+20); + retValue.append(selectPart) + .append(newFrom).append(" ") + .append(newWherePart).append(rest); + // + if (trace) + log.info("OuterJoin==> " + retValue.toString()); + return retValue.toString(); + } // convertOuterJoin + + /** + * Convert RowNum. + *
+	 *      SELECT Col1 FROM tableA WHERE ROWNUM=1
+	 *      => SELECT Col1 FROM tableA LIMIT 1
+	 *  Assumptions/Limitations:
+	 *  - RowNum not used in SELECT part
+	 *  
+ * @param sqlStatement + * @return converted statement + */ + private String convertRowNum (String sqlStatement) + { + log.info("RowNum<== " + sqlStatement); + if(DB.isPostgreSQL()) + { + log.info("RowNum<== " + sqlStatement); + String retValue = null; + + //find into (select from where) + + int s_end = 0; + int s_start = -1; + String select = sqlStatement; + String convert = ""; + while(true) + { + s_end = 0; + s_start = select.indexOf( "(SELECT"); + + if (s_start == -1) + break; + + convert = convert + select.substring(0,s_start); + //System.out.println("convert:" + convert); + int open = -1; + for (int i = s_start; i < select.length(); i++) + { + char c = select.charAt(i); + if (c == '(') + open ++; + + if (c == ')') + open --; + + if (open == -1) + { + s_end = i + 1; + break; + } + } + + String subselect = select.substring(s_start,s_end); + //System.out.println("subselect:" +subselect); + //System.out.println("select:" +select); + + if (subselect.indexOf("AND ROWNUM=1") > 1) + { + subselect = subselect.substring(0 , subselect.length() -1 ) + " LIMIT 1 )"; + //System.out.println("subselect:" +subselect); + convert = convert + Util.replace(subselect,"AND ROWNUM=1",""); + //System.out.println("convert:" + convert); + } + else if (subselect.indexOf(" WHERE ROWNUM=1 AND") > 1) + { + subselect = subselect.substring(0 , subselect.length() -1 ) + " LIMIT 1 )"; + //System.out.println("subselect:" +subselect); + convert = convert + Util.replace(subselect," WHERE ROWNUM=1 AND"," WHERE "); + //System.out.println("convert:" + convert); + } + else + { + convert = convert + subselect; + } + + + select = select.substring(s_end); + retValue = select; + + } + //System.out.println("convert:" + convert); + //System.out.println("select:" + select); + if (retValue==null) + retValue = sqlStatement; + + if (retValue.indexOf("AND ROWNUM=1") > 1) + { + int rownum = retValue.indexOf("AND ROWNUM=1"); + if(retValue.substring(0,rownum).contains("WHERE")) + { + retValue = Util.replace(retValue,"AND ROWNUM=1"," LIMIT 1"); + return convert + retValue ; + } + else + { + retValue = Util.replace(retValue,"AND ROWNUM=1",""); + return convert + retValue + " LIMIT 1"; + } + + } + else if (retValue.indexOf("AND ROWNUM= 1") > 1) + { + int rownum = retValue.indexOf("AND ROWNUM= 1"); + if(retValue.substring(0,rownum).contains("WHERE")) + { + + retValue = Util.replace(retValue,"AND ROWNUM= 1"," LIMIT 1"); + return convert + retValue ; + } + else + { + retValue = Util.replace(retValue,"AND ROWNUM= 1",""); + return convert + retValue + " LIMIT 1"; + } + } + else if (retValue.indexOf("AND ROWNUM = 1") > 1) + { + int rownum = retValue.indexOf("AND ROWNUM = 1"); + if(retValue.substring(0,rownum).contains("WHERE")) + { + + retValue = Util.replace(sqlStatement,"AND ROWNUM = 1"," LIMIT 1"); + return convert + retValue; + } + else + { + retValue = Util.replace(sqlStatement,"AND ROWNUM = 1",""); + return convert + retValue + " LIMIT 1"; + } + } + else if (retValue.indexOf("AND ROWNUM =1") > 1) + { + int rownum = retValue.indexOf("AND ROWNUM =1"); + if(retValue.substring(0,rownum).contains("WHERE")) + { + + retValue = Util.replace(retValue,"AND ROWNUM =1"," LIMIT 1"); + return convert + retValue ; + } + else + { + retValue = Util.replace(retValue,"AND ROWNUM =1",""); + return convert + retValue + " LIMIT 1"; + } + } + else if (retValue.indexOf("ROWNUM=1") > 1) + { + int rownum = retValue.indexOf("ROWNUM=1"); + System.out.println("retValue"+ retValue); + if(retValue.substring(0,rownum).contains("WHERE")) + { + retValue = Util.replace(retValue,"ROWNUM=1 "," LIMIT 1"); + return convert + retValue ; + } + else + { + retValue = Util.replace(retValue,"ROWNUM=1",""); + return convert + retValue + " LIMIT 1"; + } + } + // log.info("RowNum==> " + retValue); + return convert + retValue; + } + else + return sqlStatement; + // + // log.info("RowNum==> " + retValue); + // return retValue; + // end e-evolution PostgreSQL + } // convertRowNum + + /** + * Convert TRUNC. + * Assumed that it is used for date only! + * @param sqlStatement + * @return converted statement + */ + private String convertTrunc (String sqlStatement) + { + //return Util.replace(sqlStatement, "TRUNC(", "convert(date,"); + /** + *
+	 *      TRUNC(myDate)
+	 *      => DATE_Trunc('day',myDate)
+	 *
+	 *      TRUNC(myDate,'oracleFormat')
+	 *      => DATE_Trunc('pgFormat',myDate)
+	 *
+	 *      Oracle          =>  PostgreSQL  (list not complete!)
+	 *          Q               quarter
+	 *          MM              month
+	 *          DD              day
+	 *      Spacial handling of DAY,DY  (Starting dat of the week)
+	 *      => DATE_Trunc('day',($1-DATE_PART('dow',$1)));
+	 *  
+ //begin vpj-cd e-evolution 07/12/2005 + */ + if(DB.isPostgreSQL()) + { + //index = sqlStatement.indexOf("TRUNC("); + //beforeStatement = sqlStatement.substring(0, index); + //beforeStatement = sqlStatement.replaceFirst("TRUNC" , "DATE_Trunc"); + int find = -1; + find = sqlStatement.indexOf(",'Q'"); + if (find != -1) + + + + + { + + sqlStatement = sqlStatement.replaceFirst("TRUNC\\(" , "DATE_Trunc('quarter',"); + sqlStatement = sqlStatement.replaceFirst(",'Q'", ""); + return sqlStatement; + } + find = sqlStatement.indexOf(",'Y'"); + if (find != -1) + { + sqlStatement = sqlStatement.replaceFirst("TRUNC\\(" , "DATE_Trunc('year',"); + sqlStatement = sqlStatement.replaceFirst(",'Y'", ""); + return sqlStatement; + } + find = sqlStatement.indexOf(",'MM'"); + if (find != -1) + + + + + + + + { + sqlStatement = sqlStatement.replaceFirst("TRUNC\\(" , "DATE_Trunc('month',"); + sqlStatement = sqlStatement.replaceFirst(",'MM'", ""); + return sqlStatement; + } + find = sqlStatement.indexOf(",'DD'"); + if (find != -1) + { + sqlStatement = sqlStatement.replaceFirst("TRUNC\\(" , "DATE_Trunc('day',"); + sqlStatement = sqlStatement.replaceFirst(",'DD'", ""); + return sqlStatement; + } + find = sqlStatement.indexOf(",'DY'"); + if (find != -1) + { + sqlStatement = sqlStatement.replaceFirst("TRUNC\\(" , "DATE_Trunc('day',"); + sqlStatement = sqlStatement.replaceFirst(",'DY'", ""); + return sqlStatement; + } + if (find == -1) + { + sqlStatement = sqlStatement.replaceFirst("TRUNC\\(" , "DATE_Trunc('day',"); + //sqlStatement = sqlStatement.replaceFirst(",'DY'", ""); + return sqlStatement; + } + System.out.println("SQL=" + sqlStatement); + return sqlStatement; + + } + else + return sqlStatement; + + + + + //end vpj-cd e-evolution 09/02/2005 PostgreSQL + } // convertTrunc +// begin vpj-cd e-evolution 02/24/2005 PostgreSQL + /************************************************************************** + * Converts Decode. + *
+	 *      UPDATE C_Order i SET 
+	 *       => UPDATE C_Order SET
+	 *  
+ * @param sqlStatement + * @return converted statement + */ + /* + private String convertUpdate(String sqlStatement) + { + + if(DB.isPostgreSQL()) + { + String sqlUpdate = sqlStatement; + int index = 0; + int begintable = 0; + int begin = 0; + int end = 0; + String alias = null; + + + end = 0; + begin = Util.findIndexOf(sqlUpdate,"SET ("); + if(begin != -1) + { + + if (sqlUpdate.toUpperCase().indexOf("UPDATE ") == 0) + { + index = sqlUpdate.toUpperCase().indexOf("UPDATE "); + //String firstPart = statement.substring(0,index); + + begintable = sqlUpdate.indexOf(' ', 6 ); + + // begin the opening ' ' begin Alias + begin = sqlUpdate.indexOf(' ', 7 ); + //statement = statement.substring(begin); + + // end Alias + + end = sqlUpdate.toUpperCase().indexOf(" SET", 0 ); //statement.indexOf("SET", 0 ) + } + + String table = sqlUpdate.substring(begintable,begin).trim(); + + String select = ""; + + begin = Util.findIndexOf(sqlUpdate," SET ("); + end = sqlUpdate.indexOf(")=("); + if (end != -1) + select = sqlUpdate.substring(end + 2); + else + { + end = sqlUpdate.indexOf(") = ("); + if (end != -1) + select = sqlUpdate.substring(end + 4); + else + { + end = sqlUpdate.indexOf(")= ("); + if (end !=-1) + select = sqlUpdate.substring(end + 3); + else + { + end = sqlUpdate.indexOf(") =("); + if (end !=-1) + select = sqlUpdate.substring(end + 3); + } + + } + } + + + int where_begin = -1; + String rest = ""; + //String select = sqlUpdate.substring(end + 2); + //System.out.println("SELECT ->" + select); + //int s_end = select.indexOf( ")"); + int s_end = 0; + int s_start = select.indexOf( "("); + String where = null; + int open = -1; + for (int i = s_start; i < select.length(); i++) + { + char c = select.charAt(i); + if (c == '(') + open ++; + + if (c == ')') + open --; + + if (open == -1) + { + s_end = i + 1; + break; + } + } + + where = select.substring(s_end); + where = where.substring(where.indexOf(" WHERE ") + 7 ); + + String s = select.substring(s_start,s_end); + + //System.out.println("s:"+ s); + + //System.out.println("s_end"+ s_end); + //System.out.println("rest: " + rest); + String from =s.substring( s.toUpperCase().indexOf(" FROM ") + 6); + //System.out.println("from"+ from); + String tablejoin = from.substring(0,from.toUpperCase().indexOf(" ")); + //System.out.println("tablejoin"+ tablejoin); + String tablealias = from.substring(0,from.toUpperCase().indexOf(" WHERE ")); + //System.out.println("tablealias"+ tablealias); + //System.out.println("------------------select.toUpperCase().substring(s_end)" +select.substring(select.substring(s_end).toUpperCase().indexOf(" WHERE "))); + //String swhere = select.substring(s_end); + //s_end = + //System.out.println(); + ///System.out.println("string end" + swhere); + //String s_where = ""; + //System.out.println("string end" + select.substring(select.substring(s_end).toUpperCase().indexOf(" WHERE ")); + String s_where = s.substring(s.toUpperCase().indexOf(" WHERE ") + 7,s.length() -1); + //System.out.println("Where before join" + where); + //System.out.println("s_where:" + s_where); + //System.out.println("where:" + where); + //System.out.println("FROM:" + from); + //System.out.println("Table Join:" + tablejoin); + //System.out.println("Table Alias:" + tablejoin); + + + String Update = sqlUpdate.substring(0,begin); + Update = Update + " SET "; + int f_begin = begin + 6 ; + int f_beginjoin = 0 ; + //System.out.println(" sqlUpdate"+ sqlUpdate); + String fields = sqlUpdate.substring(f_begin, end); + //System.out.println("------fields" + fields); + int beginfrom = select.toUpperCase().indexOf(" FROM "); + String fieldsjoin = select.substring(select.toUpperCase().indexOf("(SELECT ")+8,beginfrom); + //System.out.println("fields"+fields); + //System.out.println("fields Joint"+fieldsjoin); + int f = fields.length(); + int fj = fieldsjoin.length(); + String field = null; + String fieldjoin = null; + //System.out.println("Update:"+ Update); + + while (f > 0) + { + f = Util.findIndexOf(fields,',');//fields.indexOf(','); + //System.out.println("comman" + c); + if (f < 0) + { + //System.out.print("fields:"+fields); + field = fields; + fieldjoin = fieldsjoin; + if (fieldjoin.indexOf(".") < 0) + { + fieldjoin = tablejoin + "." +fieldjoin; + } + + + //System.out.println("f_begin:" + f_begin + " end :" + end + " field:" + field); + //Update = Update + field.trim() + "=" + tablejoin + "." + field.trim() + rest + " FROM " + tablealias + " WHERE " + where ; // + select.substring(s_end + 8); + Update = Update + field.trim() + "=" + fieldjoin.trim() + rest + " FROM " + tablealias + " WHERE " + s_where ; // + select.substring(s_end + 8); + //System.out.println("Last Update" + Update); + // set alias all field before where + + if (where!=null) + where = " AND " + where; + + else + where = ""; + + + String sqlkey = "AND,OR,FROM,WHERE,JOIN,BY,GROUP,IN,INTO,SELECT,NOT,SET,UPDATE,DELETE,HAVING,IS,NULL,EXISTS" ; + int o = -1; + StringTokenizer st = new StringTokenizer(where); + String result = ""; + String word = ""; + while (true) // make sure there is stuff to get + { + word = st. nextToken(); + //System.out.println("Word:" + word); + if(sqlkey.indexOf(word) == -1) + { + + + for (int i = 0; i < word.length(); i++) + { + char c = word.charAt(i); + if (c == '(') + o ++; + if (c == ')') + o --; + } + if (o == -1 && (!word.contains(")") | !word.contains("("))) + { + + result = result + " " + table + "."+ word; + //System.out.println("Cadena :" + word); + } + else + { + result = result + " " + word; + } + + + } + else + result = result + " " + word; + if(!st.hasMoreElements()) + break; + } + + Update = Update + result ; + //System.out.println("UPDATE"+ Update); + } + else + { + + field = fields.substring(0 ,f); + //System.out.println("Field:"+ field); + //System.out.println("------fieldsjoin"+ fieldsjoin); + fj = Util.findIndexOf(fieldsjoin,',');//fj = fieldsjoin.indexOf(','); + + fieldjoin = fieldsjoin.substring(0 ,fj); + //System.out.println("fields"+ fields); + //System.out.println("fieldsjoin"+ fieldsjoin); + if (fieldjoin.indexOf(".") < 0 != fieldjoin.equals("SysDate")) + { + fieldjoin = tablejoin + "." +fieldjoin; + } + //System.out.println( " -----> fj" + fj + "fieldjoin " + fieldjoin); + //Update = Update + field + "=" + tablejoin + "." + field.trim() + ","; + Update = Update + field.trim() + "=" + fieldjoin.trim()+ ","; + f_beginjoin = fj; + fieldsjoin= fieldsjoin.substring(f_beginjoin + 1); + //System.out.println("fieldsjoin" + fieldsjoin); + f_beginjoin =fj; + } + + f_begin = f; + fields = fields.substring(f_begin + 1); + + //System.out.println("Update" + Update); + } + + sqlUpdate = Update ; + + } + //System.out.println("Convert Update:"+sqlUpdate); + return sqlUpdate; + } + else + return sqlStatement; + + } // convertDecode + **/ + + // Two regex's used in convertUpdate +private static final Pattern aliasPatternInUpdate = +Pattern.compile("(?i)\\s*UPDATE\\s+(\\S+)\\s+(\\S+)\\s+SET\\s.*"); +private static final Pattern tupleUpdatePatternInUpdate = +Pattern.compile("(?i)\\s*UPDATE\\s+(\\S+)\\s+SET\\s+\\(([^\\)]+)\\)\\s*=\\s*\\(\\s*SELECT\\s(.*?)\\s(FROM\\s.*)"); + +private String convertUpdate(String sqlStatement) +{ + String convertedSqlStatement = sqlStatement; + + // 1st step: Remove and replace alias + Matcher aliasMatcher = aliasPatternInUpdate.matcher(sqlStatement); + if (aliasMatcher.matches()) { + // We found an UPDATE-statement with an alias => convert + + // Extract table name and alias + String tableName = aliasMatcher.group(1); + String alias = aliasMatcher.group(2); + + // remove the alias before SET + convertedSqlStatement = sqlStatement.replaceFirst("\\s+" + alias + "\\s+", " "); + + // replace the alias with the real table name in all other places + convertedSqlStatement = convertedSqlStatement.replaceAll("\\b" + alias + "\\.", tableName + "."); + } // End of: Remove and replace alias + + // 2nd: step: Convert tuple updates with inner SELECT + Matcher tupleUpdateMatcher = tupleUpdatePatternInUpdate.matcher(convertedSqlStatement); + if (tupleUpdateMatcher.matches()) { + // We found an UPDATE-statement with a "tuple-update" + // of the form UPDATE a SET (b, c) = (SELECT x, y FROM z WHERE) WHERE ... + + // Extract some important parts of the statement + String tableName = tupleUpdateMatcher.group(1); + String columnsTupleString = tupleUpdateMatcher.group(2); + String innerSelectColumnsTupleString = tupleUpdateMatcher.group(3); + String innerSelectFromUntilEnd = tupleUpdateMatcher.group(4); + + // columnsArray contains the columns to be updated + String[] columnsArray = columnsTupleString.split("\\s*,\\s*"); + // innerSelectColumnsArray contains the corresponding "columns" + // of the inner SELECT statement + String[] innerSelectColumnsArray = new String[columnsArray.length]; + + // split the inner SELECT columns by ',' but not within parenthesis + char[] innerSelectColumnsCharArray = innerSelectColumnsTupleString.toCharArray(); + int openParenthesisCount = 0; + int columnCount = 0; + StringBuffer currentInnerSelectColumnSb = new StringBuffer(); + int innerSelectColumnsCharArrayLength = innerSelectColumnsCharArray.length; + int innerSelectColumnsCharArrayLastIndex= innerSelectColumnsCharArrayLength - 1; + for (int i=0; i 0) { + // If inside of a parenthesis pair simply append the character + currentInnerSelectColumnSb.append(innerSelectColumnsCharArray[i]); + } + else + { + // We're not inside of a parentheses pair + if (innerSelectColumnsCharArray[i] == ',') + { + // A ',' denotes the end of the inner SELECT column + innerSelectColumnsArray[columnCount] = currentInnerSelectColumnSb.toString().trim(); + // Start the next "column" of the inner SELECT + currentInnerSelectColumnSb = new StringBuffer(); + columnCount++; + } + else if (i == innerSelectColumnsCharArrayLastIndex) + { + // End of String reached => append last character and add last column + currentInnerSelectColumnSb.append(innerSelectColumnsCharArray[i]); + innerSelectColumnsArray[columnCount] = currentInnerSelectColumnSb.toString().trim(); + } + else + { + // We did not find a ',' and we did not reach the end of the string + // => this is a "normal" character; append + currentInnerSelectColumnSb.append(innerSelectColumnsCharArray[i]); + } + } + // Take care of opening and closing parenthesis + // to adjust the open parenthesis count + if (innerSelectColumnsCharArray[i] == '(') { + openParenthesisCount++; + } else if (innerSelectColumnsCharArray[i] == ')') { + openParenthesisCount--; + } + } + + // Split the FROM-until-end-part into + // a) the inner SELECT FROM-WHERE-Clause (innerSelectFromWhereClauseSb) + // b) the WHERE-clause of the UPDATE-statement (updateWhereClauseSb) + char[] innerSelectFromUntilEndCharArray = innerSelectFromUntilEnd.toCharArray(); + openParenthesisCount = 0; + int innerSelectFromUntilEndCharArrayLength = innerSelectFromUntilEndCharArray.length; + StringBuffer innerSelectFromWhereClauseSb = new StringBuffer(); + StringBuffer updateWhereClauseSb = new StringBuffer(); + boolean endOfinnerSelectFromWhereClauseReached = false; + for (int i=0; i increment the open parenthesis count + openParenthesisCount++; + innerSelectFromWhereClauseSb.append('('); + } else { + // Append all other characters + innerSelectFromWhereClauseSb.append(innerSelectFromUntilEndCharArray[i]); + + } + } + } + + // assemble the new UPDATE statement + int columnsArrayLength = columnsArray.length; + int columnsArrayLastIndex = columnsArrayLength - 1; + StringBuffer newUpdateStatementSb = new StringBuffer("UPDATE "); + newUpdateStatementSb.append(tableName); + newUpdateStatementSb.append(" SET "); + // We now have: "UPDATE tablename SET " + // Now iterate over all columns to be updated and add + // the SELECT clause + for (int i=0; i + * DELETE C_Order i WHERE + * => DELETE FROM C_Order WHERE + * + * @param sqlStatement + * @return converted statement + */ + private String convertDelete(String sqlStatement) + { + + if (DB.isPostgreSQL()) + { + int index = sqlStatement.toUpperCase().indexOf("DELETE "); + if(index < 7) + { + return "DELETE FROM " + sqlStatement.substring(index+7); + + } + } + + return sqlStatement; + } // convertDelete + + + //begin vpj-cd e-evolution 08/02/2005 + /************************************************************************** + * convertAlias. + * @param sqlStatement + * @return converted statementf + */ + private String convertAlias(String sqlStatement) + { + if(DB.isPostgreSQL()) + { + String statement = sqlStatement; + int index = 0; + int begintable = 0; + int begin = 0; + int end = 0; + String alias = null; + + if (statement.toUpperCase().indexOf("DELETE FROM ") == 0) + { + index = statement.toUpperCase().indexOf("DELETE FROM "); + begintable = statement.indexOf(' ', 11 ); + // begin the opening ' ' begin Alias + begin = statement.indexOf(' ', 12 ); + // end Alias + end = statement.toUpperCase().indexOf("WHERE", 0 ); + } + else if (statement.toUpperCase().indexOf("UPDATE ") == 0) + { + index = statement.toUpperCase().indexOf("UPDATE "); + //String firstPart = statement.substring(0,index); + + begintable = statement.indexOf(' ', 6 ); + + // begin the opening ' ' begin Alias + begin = statement.indexOf(' ', 7 ); + //statement = statement.substring(begin); + + // end Alias + + end = statement.toUpperCase().indexOf(" SET" , 0 ); //statement.indexOf("SET", 0 ); + + } + else + { + return statement; + } + + String sqlAlias = statement ; + if (end > begin) + { + alias = statement.substring(begin,end).trim()+"."; + String table = statement.substring(begintable,begin).trim(); + //System.out.println("Table" + table); + statement = statement.substring(0,begin) + " " + statement.substring(end); + if (!alias.equals(".")) + { + sqlAlias = Util.replace(statement, " " +alias , " " + table + "."); + sqlAlias = Util.replace(sqlAlias, "=" +alias , "=" + table + "."); + sqlAlias = Util.replace(sqlAlias, "(" +alias , "(" + table + "."); + } + } + + //sqlDelete = Util.replace(sqlDelete, "DELETE " , "DELETE FROM "); + //System.out.println("Convertion Alias:" + statement.substring(0, begin ) + " " + statement.substring(end)); + //System.out.println("Statement Convert:" + statement); + //System.out.println("begin Alias:" + begin + " end Alias:" + end ); + //System.out.println("Alias:" + statement.substring(begin, end).trim()); + //System.out.println("SQL Alias:"+sqlAlias); + return sqlAlias; + } + else + return sqlStatement; + } // convertDelete + // end vpj-cd e-evolution 02/24/2005 PostgreSQL + + // begin vpj-cd 08/02/2005 + //ALTER TABLE AD_FieldGroup MODIFY IsTab CHAR(1) DEFAULT N; + //ALTER TABLE AD_FieldGroup ALTER COLUMN IsTab TYPE CHAR(1); ALTER TABLE AD_FieldGroup ALTER COLUMN SET DEFAULT 'N'; + private String convertDDL(String sqlStatement) + { + if(DB.isPostgreSQL()) + { + if (sqlStatement.toUpperCase().indexOf("ALTER TABLE ") == 0) + { + String action = null; + int begin_col = -1; + if (sqlStatement.toUpperCase().indexOf(" MODIFY ") > 0) + { + action = " ALTER "; + begin_col = sqlStatement.toUpperCase().indexOf(" MODIFY ") + action.length() ; + } + else if (sqlStatement.toUpperCase().indexOf(" ADD ") > 0) + { + action = " ADD "; + begin_col = sqlStatement.toUpperCase().indexOf(" ADD ") + action.length() ; + } + + //System.out.println( "MODIFY :" + sqlStatement.toUpperCase().indexOf(" MODIFY ")); + //System.out.println( "ADD :" + sqlStatement.toUpperCase().indexOf(" ADD ")); + //System.out.println( "begincolumn:" + sqlStatement + "begincolumn:" + begin_col ); + + if (begin_col < 0) + return sqlStatement; + + + int end_col = 0; + int begin_default = -1; + int begin_type = -1; + + String column = null; + String type = null; + String defaultvalue = null; + String DDL = null; + + if (begin_col != -1) + { + column = sqlStatement.substring(begin_col); + end_col = begin_col + column.indexOf(" "); + column = sqlStatement.substring(begin_col , end_col); + //System.out.println(" column:" + column + " begincolumn:" + begin_col + "en column:" + end_col ); + //System.out.println(" type " + sqlStatement.substring(end_col + 1)); + type = sqlStatement.substring(end_col + 1) + " "; + //System.out.println(" type 1 :" + type); + type = type.substring(0 , type.indexOf(" ")); + //System.out.println(" type:" + type); + if (action.equals(" ADD ")) + DDL = sqlStatement.substring(0, begin_col - action.length()) + action + "COLUMN " + column + " " + type + "; "; + else if (action.equals(" ALTER ")) + DDL = sqlStatement.substring(0, begin_col - action.length()) + action + "COLUMN " + column + " TYPE " + type + "; "; + + if (sqlStatement.toUpperCase().indexOf(" DEFAULT ") != -1) + { + begin_default = sqlStatement.toUpperCase().indexOf(" DEFAULT ") + 9; + defaultvalue = sqlStatement.substring(begin_default); + String rest = defaultvalue.substring( defaultvalue.indexOf(" ")); + defaultvalue = defaultvalue.substring(0 , defaultvalue.indexOf(" ")); + + DDL += sqlStatement.substring(0 , begin_col - action.length()) + " ALTER COLUMN " + column + " SET DEFAULT '" + defaultvalue + "'; "; + if (rest != null && rest.indexOf(" NOT NULL ") == 0) + DDL += sqlStatement.substring(0 , begin_col ) + " ALTER COLUMN " + column + " SET " + rest + ";"; + //return DDL; + } + + //System.out.println("DDL" + DDL); + return DDL; + } + } + } + + return sqlStatement; + } + + private String convertIgnore(String sqlStatement) + { + String vars[]= new String[20]; + int cont=1; + Pattern p = Pattern.compile("'[[\\w]*[,]*[ ]*]*'",Pattern.CASE_INSENSITIVE); + Matcher m = p.matcher(sqlStatement); + while(m.find()) { + vars[cont++]=sqlStatement.substring(m.start(),m.end()); + } + vars[0]=m.replaceAll("<-->"); + String retVar[]=new String[cont]; + for(int i=0; i"); + m = p.matcher(retVar[0]); + cont=1; + for(cont=1; cont s_derby = new TreeMap(); + /** Tree Map for PostgreSQL */ + private static TreeMap s_db2 = new TreeMap(); + // begin e-evolution PostgreSQL + /** Tree Map for PostgreSQL */ + private static TreeMap s_pg = new TreeMap(); + // end e-evolution PostgreSQL + /** + * Derby Init + */ + static private void initDerby() + { // C:\Sources\db-derby-10.1.2.1-bin\docs\html\ref\index.html + + // Oracle Pattern Replacement + + // Data Types + s_derby.put("\\bNUMBER\\b", "DECIMAL(31,6)"); //jz: changed from decimal to decimal(31,6) + s_derby.put("\\bDATE\\b", "TIMESTAMP"); + s_derby.put("\\bVARCHAR2\\b", "VARCHAR"); + s_derby.put("\\bNVARCHAR2\\b", "VARCHAR"); + s_derby.put("\\bNCHAR\\b", "CHAR"); + + // Storage + s_derby.put("\\bCACHE\\b", ""); + s_derby.put("\\bUSING INDEX\\b", ""); + s_derby.put("\\bTABLESPACE\\s\\w+\\b", ""); + s_derby.put("\\bSTORAGE\\([\\w\\s]+\\)", ""); + // + s_derby.put("\\bBITMAP INDEX\\b", "INDEX"); + + // Select + s_derby.put("\\bFOR UPDATE\\b", ""); + s_derby.put("\\bTRUNC\\(", "convert(date,"); + + // Functions + s_derby.put("\\bSysDate\\b", "CURRENT_TIMESTAMP"); + s_derby.put("\\bSYSDATE\\b", "CURRENT_TIMESTAMP"); + s_derby.put("\\bNVL\\b", "NULLIF"); + s_derby.put("\\bCOALESCE\\b", "NULLIF"); + + s_derby.put("\\bTO_DATE\\b", "TO_TIMESTAMP"); + // + // s_derby.put("\\bDBMS_OUTPUT.PUT_LINE\\b", "RAISE NOTICE"); + + // Temporary + s_derby.put("\\bGLOBAL TEMPORARY\\b", "TEMPORARY"); + s_derby.put("\\bON COMMIT DELETE ROWS\\b", ""); + s_derby.put("\\bON COMMIT PRESERVE ROWS\\b", ""); + + + // DROP TABLE x CASCADE CONSTRAINTS + // s_derby.put("\\bCASCADE CONSTRAINTS\\b", ""); + + // Select + s_derby.put("\\sFROM\\s+DUAL\\b", ""); + + // Statements + s_derby.put("\\bELSIF\\b", "ELSE IF"); + + // Sequences + s_derby.put("\\bSTART WITH\\b", "START"); + s_derby.put("\\bINCREMENT BY\\b", "INCREMENT"); + + } // initDerby + + /** + * DB/2 Init + */ + static private void initDB2() + { + // Oracle Pattern Replacement + + // Data Types + s_db2.put("\\bNUMBER\\b", "NUMERIC"); + s_db2.put("\\bDATE\\b", "TIMESTAMP"); + s_db2.put("\\bVARCHAR2\\b", "VARCHAR"); + s_db2.put("\\bNVARCHAR2\\b", "VARCHAR"); + s_db2.put("\\bNCHAR\\b", "CHAR"); + s_db2.put("\\bBLOB\\b", "OID"); // BLOB not directly supported + s_db2.put("\\bCLOB\\b", "TEXT"); // CLOB not directly supported + + // Storage + s_db2.put("\\bCACHE\\b", ""); + s_db2.put("\\bUSING INDEX\\b", ""); + s_db2.put("\\bTABLESPACE\\s\\w+\\b", ""); + s_db2.put("\\bSTORAGE\\([\\w\\s]+\\)", ""); + // + s_db2.put("\\bBITMAP INDEX\\b", "INDEX"); + + // Functions + s_db2.put("\\bSYSDATE\\b", "CURRENT_TIMESTAMP"); // alternative: NOW() + s_db2.put("\\bNVL\\b", "COALESCE"); + s_db2.put("\\bTO_DATE\\b", "TO_TIMESTAMP"); + // + s_db2.put("\\bDBMS_OUTPUT.PUT_LINE\\b", "RAISE NOTICE"); + + // Temporary + s_db2.put("\\bGLOBAL TEMPORARY\\b", "TEMPORARY"); + s_db2.put("\\bON COMMIT DELETE ROWS\\b", ""); + s_db2.put("\\bON COMMIT PRESERVE ROWS\\b", ""); + + + // DROP TABLE x CASCADE CONSTRAINTS + s_db2.put("\\bCASCADE CONSTRAINTS\\b", ""); + + // Select + s_db2.put("\\sFROM\\s+DUAL\\b", ""); + + // Statements + s_db2.put("\\bELSIF\\b", "ELSE IF"); + + // Sequences + s_db2.put("\\bSTART WITH\\b", "START"); + s_db2.put("\\bINCREMENT BY\\b", "INCREMENT"); + + } // initPostgreSQL + + /** + * PostgreSQL Init + */ + static private void initPostgreSQL() + { + // Oracle Pattern Replacement + + // Data Types + s_pg.put("\\bNUMBER\\b", "NUMERIC"); + s_pg.put("\\bDATE\\b", "TIMESTAMP"); + s_pg.put("\\bVARCHAR2\\b", "VARCHAR"); + s_pg.put("\\bNVARCHAR2\\b", "VARCHAR"); + s_pg.put("\\bNCHAR\\b", "CHAR"); + //begin vpj-cd e-evolution 03/11/2005 PostgreSQL + s_pg.put("\\bBLOB\\b", "BYTEA"); // BLOB not directly supported + s_pg.put("\\bCLOB\\b", "BYTEA"); // CLOB not directly supported + s_pg.put("\\bLIMIT\\b","\"limit\""); + s_pg.put("\\bACTION\\b","\"action\""); + //s_pg.put("\\bBLOB\\b", "OID"); // BLOB not directly supported + //s_pg.put("\\bCLOB\\b", "OID"); // CLOB not directly supported + //end vpj-cd e-evolution 03/11/2005 PostgreSQL + + // Storage + s_pg.put("\\bCACHE\\b", ""); + s_pg.put("\\bUSING INDEX\\b", ""); + s_pg.put("\\bTABLESPACE\\s\\w+\\b", ""); + s_pg.put("\\bSTORAGE\\([\\w\\s]+\\)", ""); + // + s_pg.put("\\bBITMAP INDEX\\b", "INDEX"); + + // Functions + s_pg.put("\\bSYSDATE\\b", "CURRENT_TIMESTAMP"); // alternative: NOW() + //Bug fix, Gunther Hoppe 08.07.2005 e-evolution + //Begin ---------------------------------------------------------------------------------------- + s_pg.put("\\bSysDate\\b", "CURRENT_TIMESTAMP"); + s_pg.put("SysDate", "CURRENT_TIMESTAMP"); + //end ---------------------------------------------------------------------------------------- + //begin vpj-cd e-evolution 03/11/2005 PostgreSQL + s_pg.put("\\bDUMP\\b", "MD5"); + s_pg.put("END CASE", "END"); + s_pg.put("\\bgetDate()\\b", "CURRENT_TIMESTAMP"); // alternative: NOW() + //end vpj-cd e-evolution 03/11/2005 PostgreSQL + s_pg.put("\\bNVL\\b", "COALESCE"); + s_pg.put("\\bTO_DATE\\b", "TO_TIMESTAMP"); + // + s_pg.put("\\bDBMS_OUTPUT.PUT_LINE\\b", "RAISE NOTICE"); + + // Temporary + s_pg.put("\\bGLOBAL TEMPORARY\\b", "TEMPORARY"); + s_pg.put("\\bON COMMIT DELETE ROWS\\b", ""); + s_pg.put("\\bON COMMIT PRESERVE ROWS\\b", ""); + + //DDL + + // begin vpj-cd e-evolution 08/02/2005 PostgreSQL + //s_pg.put("\\bMODIFY\\b","ALTER COLUMN"); + //s_pg.put("\\bDEFAULT\\b","SET DEFAULT"); + // end vpj-cd e-evolution 08/02/2005 PostgreSQL + + // DROP TABLE x CASCADE CONSTRAINTS + s_pg.put("\\bCASCADE CONSTRAINTS\\b", ""); + + // Select + s_pg.put("\\sFROM\\s+DUAL\\b", ""); + + // Statements + s_pg.put("\\bELSIF\\b", "ELSE IF"); + // begin vpj-cd e-evolution 03/11/2005 PostgreSQL + s_pg.put("\\bREC \\b", "AS REC "); + //s_pg.put("\\bAND\\sROWNUM=\\b", "LIMIT "); + // end vpj-cd e-evolution 03/11/2005 PostgreSQL + + // Sequences + s_pg.put("\\bSTART WITH\\b", "START"); + s_pg.put("\\bINCREMENT BY\\b", "INCREMENT"); + + } // initPostgreSQL + +} // ConvertMap diff --git a/dbPort/src/org/compiere/dbPort/JdbcTest.java b/dbPort/src/org/compiere/dbPort/JdbcTest.java new file mode 100644 index 0000000000..824d97bcf2 --- /dev/null +++ b/dbPort/src/org/compiere/dbPort/JdbcTest.java @@ -0,0 +1,524 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.dbPort; + +import java.sql.*; +import javax.sql.*; +import oracle.jdbc.pool.*; + +//import oracle.jdbc.rowset.*; + +/** + * JDBC Performance Test - Oracle + * + * @author Jorg Janke + * @version $Id: JdbcTest.java,v 1.2 2006/07/30 00:55:04 jjanke Exp $ + */ +public class JdbcTest extends Thread +{ +/***************************************************************************** + +Multiple Connections Fetch=10 Conn=2032 Stmt=0 Query=47 Retrieve=2109 ClRs=0 ClStmt=0 ClConn=0 - Total=4188 Stmt=2156 Query=2156 +Multiple Connections Fetch=10 Conn=141 Stmt=0 Query=31 Retrieve=1875 ClRs=0 ClStmt=0 ClConn=0 - Total=2047 Stmt=1906 Query=1906 +Multiple Connections Fetch=10 Conn=141 Stmt=0 Query=31 Retrieve=1844 ClRs=0 ClStmt=0 ClConn=0 - Total=2016 Stmt=1875 Query=1875 +Data Source Fetch=10 Conn=172 Stmt=0 Query=16 Retrieve=1875 ClRs=0 ClStmt=0 ClConn=0 - Total=2063 Stmt=1891 Query=1891 +Data Source Fetch=10 Conn=672 Stmt=15 Query=16 Retrieve=1797 ClRs=0 ClStmt=0 ClConn=0 - Total=2500 Stmt=1828 Query=1813 +Data Source Fetch=10 Conn=156 Stmt=0 Query=16 Retrieve=1766 ClRs=0 ClStmt=0 ClConn=15 - Total=1953 Stmt=1782 Query=1782 +Connection Cache Fetch=10 Conn=141 Stmt=0 Query=125 Retrieve=1766 ClRs=0 ClStmt=0 ClConn=0 - Total=2032 Stmt=1891 Query=1891 +Connection Cache Fetch=10 Conn=0 Stmt=0 Query=15 Retrieve=1766 ClRs=0 ClStmt=0 ClConn=0 - Total=1781 Stmt=1781 Query=1781 +Connection Cache Fetch=10 Conn=0 Stmt=0 Query=16 Retrieve=1765 ClRs=0 ClStmt=0 ClConn=0 - Total=1781 Stmt=1781 Query=1781 +Multiple Connections Fetch=20 Conn=4501 Stmt=0 Query=15 Retrieve=1313 ClRs=0 ClStmt=0 ClConn=0 - Total=5829 Stmt=1328 Query=1328 +Multiple Connections Fetch=20 Conn=125 Stmt=0 Query=16 Retrieve=1312 ClRs=0 ClStmt=0 ClConn=0 - Total=1453 Stmt=1328 Query=1328 +Multiple Connections Fetch=20 Conn=141 Stmt=0 Query=31 Retrieve=1406 ClRs=0 ClStmt=0 ClConn=0 - Total=1578 Stmt=1437 Query=1437 +Data Source Fetch=20 Conn=126 Stmt=0 Query=31 Retrieve=1297 ClRs=0 ClStmt=0 ClConn=0 - Total=1454 Stmt=1328 Query=1328 +Data Source Fetch=20 Conn=125 Stmt=0 Query=16 Retrieve=1328 ClRs=0 ClStmt=0 ClConn=0 - Total=1469 Stmt=1344 Query=1344 +Data Source Fetch=20 Conn=140 Stmt=0 Query=16 Retrieve=1469 ClRs=0 ClStmt=0 ClConn=0 - Total=1625 Stmt=1485 Query=1485 +Connection Cache Fetch=20 Conn=0 Stmt=0 Query=31 Retrieve=1344 ClRs=0 ClStmt=0 ClConn=0 - Total=1375 Stmt=1375 Query=1375 +Connection Cache Fetch=20 Conn=0 Stmt=0 Query=16 Retrieve=1375 ClRs=0 ClStmt=0 ClConn=0 - Total=1391 Stmt=1391 Query=1391 +Connection Cache Fetch=20 Conn=0 Stmt=0 Query=15 Retrieve=1375 ClRs=0 ClStmt=0 ClConn=0 - Total=1390 Stmt=1390 Query=1390 +JDBC RowSet Fetch=10 Conn=16 Stmt=0 Query=3969 Retrieve=3047 ClRs=0 ClStmt=0 ClConn=0 - Total=7032 Stmt=7016 Query=7016 +JDBC RowSet Fetch=10 Conn=0 Stmt=0 Query=172 Retrieve=2781 ClRs=0 ClStmt=0 ClConn=0 - Total=2953 Stmt=2953 Query=2953 +JDBC RowSet Fetch=10 Conn=0 Stmt=0 Query=313 Retrieve=2609 ClRs=0 ClStmt=0 ClConn=0 - Total=2922 Stmt=2922 Query=2922 +Cached RowSet Fetch=10 Conn=63 Stmt=0 Query=5406 Retrieve=16 ClRs=0 ClStmt=0 ClConn=0 - Total=5485 Stmt=5422 Query=5422 +Cached RowSet Fetch=10 Conn=0 Stmt=0 Query=3907 Retrieve=0 ClRs=0 ClStmt=0 ClConn=0 - Total=3907 Stmt=3907 Query=3907 +Cached RowSet Fetch=10 Conn=0 Stmt=0 Query=3890 Retrieve=0 ClRs=0 ClStmt=0 ClConn=0 - Total=3890 Stmt=3890 Query=3890 +Shared Connection Threads=10 Yield=false ms= 18267 each= 1826 +Shared Connection Threads=10 Yield=false ms= 18220 each= 1822 +Shared Connection Threads=10 Yield=true ms= 18329 each= 1832 +Shared Connection Threads=10 Yield=true ms= 18314 each= 1831 +Multiple Connections Threads=10 Yield=false ms= 14610 each= 1461 +Multiple Connections Threads=10 Yield=false ms= 14360 each= 1436 +Multiple Connections Threads=10 Yield=true ms= 13986 each= 1398 +Multiple Connections Threads=10 Yield=true ms= 14017 each= 1401 +Multiple PreCreated Threads=10 Yield=false ms= 5376 each= 537 +Multiple PreCreated Threads=10 Yield=false ms= 1828 each= 182 +Multiple PreCreated Threads=10 Yield=true ms= 12017 each= 1201 +Multiple PreCreated Threads=10 Yield=true ms= 12032 each= 1203 +Data Source Threads=10 Yield=false ms= 13391 each= 1339 +Data Source Threads=10 Yield=false ms= 13532 each= 1353 +Data Source Threads=10 Yield=true ms= 13923 each= 1392 +Data Source Threads=10 Yield=true ms= 13829 each= 1382 +Connection Cache Threads=10 Yield=false ms= 12907 each= 1290 CacheSize=2, Active=0 +Connection Cache Threads=10 Yield=false ms= 12907 each= 1290 CacheSize=2, Active=0 +Connection Cache Threads=10 Yield=true ms= 12813 each= 1281 CacheSize=2, Active=0 +Connection Cache Threads=10 Yield=true ms= 12813 each= 1281 CacheSize=2, Active=0 + +******************************************************************************/ + + // Default no of threads to 10 + private static final int NUM_OF_THREADS = 10; + + private static final String DRIVER = + // "oci8"; + "thin"; + + private static final String CONNECTION = + // "jdbc:oracle:oci8:@"; + // "jdbc:oracle:oci8:@dev1"; + "jdbc:oracle:thin:@//dev:1521/dev1"; + + + private static final String UID = "adempiere"; + private static final String PWD = "adempiere"; + private static final String STATEMENT = "SELECT * FROM AD_Column"; + private static final boolean WITH_OUTPUT = false; + + private static boolean s_do_yield = true; + + private static Connection s_sconn = null; + private static Connection[] s_conn = null; + private static OracleDataSource s_ds = null; +// private static OracleConnectionCacheImpl s_cc = null; + + private static int s_fetchSize = 10; + + // Connection + private static int s_cType = 0; + private static final String[] C_INFO = { + "Shared Connection ", + "Multiple Connections ", + "Multiple PreCreated ", + "Data Source ", + "Connection Cache "}; + private static final int C_SHARED = 0; + private static final int C_MULTIPLE = 1; + private static final int C_PRECREATED = 2; + private static final int C_DATASOURCE = 3; + private static final int C_CACHE = 4; + + // Data + private static int s_rType = 0; + private static final String[] R_INFO = { + "ResultSet ", + "Cached RowSet ", + "JDBC RowSet "}; + private static final int R_RESULTSET = 0; + private static final int R_CACHED_ROWSET = 1; + private static final int R_JDBC_ROWSET = 2; + + + + /** + * Main Test Start + * @param args + */ + public static void main (String args []) + { + try + { + /* Load the JDBC driver */ + DriverManager.registerDriver(new oracle.jdbc.OracleDriver()); + + s_ds = new OracleDataSource(); + s_ds.setDriverType(DRIVER); + s_ds.setServerName("dev"); + s_ds.setNetworkProtocol("tcp"); + s_ds.setDatabaseName("dev1"); + s_ds.setPortNumber(1521); + s_ds.setUser("adempiere"); + s_ds.setPassword("adempiere"); + /* + s_cc = new OracleConnectionCacheImpl(); + s_cc.setDriverType(DRIVER); + s_cc.setServerName("dev"); + s_cc.setNetworkProtocol("tcp"); + s_cc.setDatabaseName("dev1"); + s_cc.setPortNumber(1521); + s_cc.setUser("adempiere"); + s_cc.setPassword("adempiere"); + s_cc.setMaxLimit(NUM_OF_THREADS/4); + s_cc.setCacheScheme(OracleConnectionCacheImpl.FIXED_WAIT_SCHEME); + // s_cc.setCacheScheme(OracleConnectionCacheImpl.DYNAMIC_SCHEME); + */ + + s_fetchSize = 10; + s_cType = C_MULTIPLE; + statementTiming(); + statementTiming(); + statementTiming(); + s_cType = C_DATASOURCE; + statementTiming(); + statementTiming(); + statementTiming(); + s_cType = C_CACHE; + statementTiming(); + statementTiming(); + statementTiming(); + s_fetchSize = 20; + s_cType = C_MULTIPLE; + statementTiming(); + statementTiming(); + statementTiming(); + s_cType = C_DATASOURCE; + statementTiming(); + statementTiming(); + statementTiming(); + s_cType = C_CACHE; + statementTiming(); + statementTiming(); + statementTiming(); + // + s_fetchSize = 10; // standard value +/** + s_rType = R_JDBC_ROWSET; + rowSetTiming(); + rowSetTiming(); + rowSetTiming(); + s_rType = R_CACHED_ROWSET; + rowSetTiming(); + rowSetTiming(); + rowSetTiming(); +**/ + // + s_cType = C_SHARED; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + s_cType = C_MULTIPLE; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + s_cType = C_PRECREATED; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + s_cType = C_DATASOURCE; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + s_cType = C_CACHE; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + + } + catch (Exception e) + { + e.printStackTrace(); + } + } // main + + /*************************************************************************/ + + /** + * Run the test + * @throws Exception + */ + static void runTest() throws Exception + { + // Create the threads + Thread[] threadList = new Thread[NUM_OF_THREADS]; + s_conn = new Connection[NUM_OF_THREADS]; + + if (s_cType == C_SHARED) + s_sconn = DriverManager.getConnection (CONNECTION, UID, PWD); + // + // spawn threads + for (int i = 0; i < NUM_OF_THREADS; i++) + { + if (s_cType == C_PRECREATED) + s_conn[i] = DriverManager.getConnection (CONNECTION, UID, PWD); + // + threadList[i] = new JdbcTest(i); + threadList[i].start(); + } + // Start everyone at the same time + long start = System.currentTimeMillis(); + setGreenLight (); + // wait for all threads to end + for (int i = 0; i < NUM_OF_THREADS; i++) + threadList[i].join(); + // + if (s_sconn != null) + s_sconn.close(); + s_sconn = null; + for (int i = 0; i < NUM_OF_THREADS; i++) + { + if (s_conn[i] != null) + s_conn[i].close(); + s_conn[i] = null; + } + long result = System.currentTimeMillis() - start; + System.out.print (C_INFO[s_cType] + + "Threads=" + NUM_OF_THREADS + + " \tYield=" + s_do_yield + + " \tms= " + result + + " \teach= " + (result/NUM_OF_THREADS)); + // if (s_cType == C_CACHE) + // System.out.print (" \tCacheSize=" + s_cc.getCacheSize() + ", Active=" + s_cc.getActiveSize()); + System.out.println(); + } // runTest + + + /** + * Statement Timing + */ + private static void statementTiming() + { + try + { + long startConnection = System.currentTimeMillis(); + Connection conn = null; + if (s_cType == C_MULTIPLE) + conn = DriverManager.getConnection (CONNECTION, UID, PWD); + if (s_cType == C_DATASOURCE) + conn = s_ds.getConnection(); + // if (s_cType == C_CACHE) + // conn = s_cc.getConnection(); + + long startStatement = System.currentTimeMillis(); + Statement stmt = conn.createStatement (); + stmt.setFetchSize(s_fetchSize); + + long startQuery = System.currentTimeMillis(); + ResultSet rs = stmt.executeQuery (STATEMENT); + + int i = 0; + long startRetrieve = System.currentTimeMillis(); + while (rs.next()) + { + rs.getString(1); + i++; + } + long endRetrieve = System.currentTimeMillis(); + // System.out.println(i); + + rs.close(); + rs = null; + long endQuery = System.currentTimeMillis(); + + stmt.close(); + stmt = null; + long endStatement = System.currentTimeMillis(); + + conn.close(); + conn = null; + long endConnection = System.currentTimeMillis(); + + // + System.out.println(C_INFO[s_cType] + + "Fetch=" + s_fetchSize + + " \tConn=" + (startStatement - startConnection) + + " \tStmt=" + (startQuery - startStatement) + + " \tQuery=" + (startRetrieve - startQuery) + + " \tRetrieve=" + (endRetrieve - startRetrieve) + + " \tClRs=" + (endQuery - endRetrieve) + + " \tClStmt=" + (endStatement - endQuery) + + " \tClConn=" + (endConnection - endStatement) + + " \t- Total=" + (endConnection - startConnection) + + " \tStmt=" + (endStatement - startStatement) + + " \tQuery=" + (endQuery - startQuery)); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } // statementTiming + + /** + * Row Set Timing + */ + private static void rowSetTiming() + { + try + { + long startConnection = System.currentTimeMillis(); + RowSet rowset = null; + /** + if (s_rType == R_JDBC_ROWSET) + rowset = new OracleJDBCRowSet (); + else if (s_rType == R_CACHED_ROWSET) + rowset = new OracleCachedRowSet(); + **/ + rowset.setUrl (CONNECTION); + rowset.setUsername (UID); + rowset.setPassword (PWD); + rowset.setFetchSize(s_fetchSize); + + long startStatement = System.currentTimeMillis(); + rowset.setCommand (STATEMENT); + + long startQuery = System.currentTimeMillis(); + rowset.execute (); + + long startRetrieve = System.currentTimeMillis(); + while (rowset.next ()) + { + } + long endRetrieve = System.currentTimeMillis(); + long endQuery = System.currentTimeMillis(); + + rowset.close(); + long endStatement = System.currentTimeMillis(); + long endConnection = System.currentTimeMillis(); + // + System.out.println(R_INFO[s_rType] + + "Fetch=" + s_fetchSize + + " \tConn=" + (startStatement - startConnection) + + " \tStmt=" + (startQuery - startStatement) + + " \tQuery=" + (startRetrieve - startQuery) + + " \tRetrieve=" + (endRetrieve - startRetrieve) + + " \tClRs=" + (endQuery - endRetrieve) + + " \tClStmt=" + (endStatement - endQuery) + + " \tClConn=" + (endConnection - endStatement) + + " \t- Total=" + (endConnection - startConnection) + + " \tStmt=" + (endStatement - startStatement) + + " \tQuery=" + (endQuery - startQuery)); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } // rowSetTiming + + /*************************************************************************/ + + /** + * JDBC Test + * @param id Thread ID + */ + public JdbcTest(int id) + { + super(); + m_myId = id; + } // JdbcTest + + private int m_myId = 0; + + /** + * Async Worker + */ + public void run() + { + ResultSet rs = null; + Statement stmt = null; + + try + { + while (!getGreenLight()) + yield(); + if (WITH_OUTPUT) + System.out.println("Thread " + m_myId + " started"); + + // Get the connection & statement + if (s_cType == C_SHARED) + stmt = s_sconn.createStatement (); + else if (s_cType == C_MULTIPLE) + { + s_conn[m_myId] = DriverManager.getConnection (CONNECTION, UID, PWD); + stmt = s_conn[m_myId].createStatement (); + } + else if (s_cType == C_PRECREATED) + { + stmt = s_conn[m_myId].createStatement (); + } + else if (s_cType == C_DATASOURCE) + { + s_conn[m_myId] = s_ds.getConnection(); + stmt = s_conn[m_myId].createStatement (); + } + // else if (s_cType == C_CACHE) + // { + // s_conn[m_myId] = s_cc.getConnection(); + // stmt = s_conn[m_myId].createStatement (); + // } + stmt.setFetchSize(s_fetchSize); + + // Execute the Query + rs = stmt.executeQuery (STATEMENT); + + // Loop through the results + while (rs.next()) + { + if (s_do_yield) + yield(); // Yield To other threads + } + + // Close all the resources + rs.close(); + rs = null; + + // Close the statement + stmt.close(); + stmt = null; + + // Close the local connection + if (s_cType == C_SHARED || s_cType == C_PRECREATED) + ; + else + { + s_conn[m_myId].close(); + s_conn[m_myId] = null; + } + } + catch (Exception e) + { + System.out.println("Thread " + m_myId + " got Exception: " + e); + e.printStackTrace(); + return; + } + if (WITH_OUTPUT) + System.out.println("Thread " + m_myId + " finished"); + } + + /*************************************************************************/ + + static boolean greenLight = false; + static synchronized void setGreenLight () { greenLight = true; } + synchronized boolean getGreenLight () { return greenLight; } + +} // JdbcTest diff --git a/dbPort/src/org/compiere/dbPort/JdbcTestPG.java b/dbPort/src/org/compiere/dbPort/JdbcTestPG.java new file mode 100755 index 0000000000..7cf72998e2 --- /dev/null +++ b/dbPort/src/org/compiere/dbPort/JdbcTestPG.java @@ -0,0 +1,346 @@ +/****************************************************************************** + * The contents of this file are subject to the Compiere License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * You may obtain a copy of the License at http://www.compiere.org/license.html + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for + * the specific language governing rights and limitations under the License. + * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial + * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke + * are Copyright (C) 1999-2005 Jorg Janke. + * All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved. + * Contributor(s): ______________________________________. + *****************************************************************************/ +package org.compiere.dbPort; + +import java.sql.*; + +/** + * JDBC Performance Test. + * + * @author Jorg Janke + * @version $Id: JdbcTestPG.java,v 1.4 2005/03/11 20:29:03 jjanke Exp $ + */ +public class JdbcTestPG extends Thread +{ +/***************************************************************************** + +Multiple Connections Fetch=10 Conn=407 Stmt=15 Query=1516 Retrieve=203 ClRs=0 ClStmt=0 ClConn=0 - Total=2141 Stmt=1734 Query=1719 +Multiple Connections Fetch=10 Conn=47 Stmt=0 Query=1234 Retrieve=31 ClRs=0 ClStmt=0 ClConn=0 - Total=1312 Stmt=1265 Query=1265 +Multiple Connections Fetch=10 Conn=31 Stmt=0 Query=1266 Retrieve=15 ClRs=0 ClStmt=0 ClConn=0 - Total=1312 Stmt=1281 Query=1281 +Shared Connection Threads=10 Yield=false ms= 13047 each= 1304 +Shared Connection Threads=10 Yield=false ms= 12891 each= 1289 +Shared Connection Threads=10 Yield=true ms= 13422 each= 1342 +Shared Connection Threads=10 Yield=true ms= 12969 each= 1296 +Multiple Connections Threads=10 Yield=false ms= 13046 each= 1304 +Multiple Connections Threads=10 Yield=false ms= 12891 each= 1289 +Multiple Connections Threads=10 Yield=true ms= 13062 each= 1306 +Multiple Connections Threads=10 Yield=true ms= 13062 each= 1306 +Multiple PreCreated Threads=10 Yield=false ms= 9968 each= 996 +Multiple PreCreated Threads=10 Yield=false ms= 10250 each= 1025 +Multiple PreCreated Threads=10 Yield=true ms= 10109 each= 1010 +Multiple PreCreated Threads=10 Yield=true ms= 9906 each= 990 + +******************************************************************************/ + + // Default no of threads to 10 + private static final int NUM_OF_THREADS = 10; + + private static final String CONNECTION = + "jdbc:postgresql://linux:5432/compiere"; + + private static final String UID = "compiere"; + private static final String PWD = "compiere"; + private static final String STATEMENT = "SELECT * FROM AD_Column"; + private static final boolean WITH_OUTPUT = false; + + private static boolean s_do_yield = true; + + private static Connection s_sconn = null; + private static Connection[] s_conn = null; + + private static int s_fetchSize = 10; + + // Connection + private static int s_cType = 0; + private static final String[] C_INFO = { + "Shared Connection ", + "Multiple Connections ", + "Multiple PreCreated ", + // "Data Source ", + // "Connection Cache " + }; + private static final int C_SHARED = 0; + private static final int C_MULTIPLE = 1; + private static final int C_PRECREATED = 2; +// private static final int C_DATASOURCE = 3; +// private static final int C_CACHE = 4; + + // Data + private static int s_rType = 0; + private static final String[] R_INFO = { + "ResultSet ", +// "Cached RowSet ", +// "JDBC RowSet " + }; + private static final int R_RESULTSET = 0; +// private static final int R_CACHED_ROWSET = 1; +// private static final int R_JDBC_ROWSET = 2; + + + /** + * Main Test + * @param args + */ + public static void main (String args []) + { + try + { + /* Load the JDBC driver */ + DriverManager.registerDriver(new org.postgresql.Driver()); + + s_cType = C_MULTIPLE; + statementTiming(); + statementTiming(); + statementTiming(); + // + s_fetchSize = 10; // standard value + + // + s_cType = C_SHARED; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + s_cType = C_MULTIPLE; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + s_cType = C_PRECREATED; + s_do_yield = false; + runTest(); + runTest(); + s_do_yield = true; + runTest(); + runTest(); + // + + } + catch (Exception e) + { + e.printStackTrace(); + } + } // main + + /*************************************************************************/ + + /** + * Run the test + * @throws Exception + */ + static void runTest() throws Exception + { + // Create the threads + Thread[] threadList = new Thread[NUM_OF_THREADS]; + s_conn = new Connection[NUM_OF_THREADS]; + + if (s_cType == C_SHARED) + s_sconn = DriverManager.getConnection (CONNECTION, UID, PWD); + // + // spawn threads + for (int i = 0; i < NUM_OF_THREADS; i++) + { + if (WITH_OUTPUT) + System.out.println("Starting #" + i); + if (s_cType == C_PRECREATED) + s_conn[i] = DriverManager.getConnection (CONNECTION, UID, PWD); + // + threadList[i] = new JdbcTestPG(i); + threadList[i].start(); + } + + // Start everyone at the same time + long start = System.currentTimeMillis(); + setGreenLight (); + + // wait for all threads to end + for (int i = 0; i < NUM_OF_THREADS; i++) + threadList[i].join(); + // + if (s_sconn != null) + s_sconn.close(); + s_sconn = null; + for (int i = 0; i < NUM_OF_THREADS; i++) + { + if (s_conn[i] != null) + s_conn[i].close(); + s_conn[i] = null; + } + long result = System.currentTimeMillis() - start; + System.out.print (C_INFO[s_cType] + + "Threads=" + NUM_OF_THREADS + + " \tYield=" + s_do_yield + + " \tms= " + result + + " \teach= " + (result/NUM_OF_THREADS)); + System.out.println(); + } // runTest + + + /** + * Statement Timing + */ + private static void statementTiming() + { + try + { + long startConnection = System.currentTimeMillis(); + Connection conn = null; + if (s_cType == C_MULTIPLE) + conn = DriverManager.getConnection (CONNECTION, UID, PWD); + + long startStatement = System.currentTimeMillis(); + Statement stmt = conn.createStatement (); + // stmt.setFetchSize(s_fetchSize); + + long startQuery = System.currentTimeMillis(); + ResultSet rs = stmt.executeQuery (STATEMENT); + + int i = 0; + long startRetrieve = System.currentTimeMillis(); + while (rs.next()) + { + rs.getString(1); + i++; + } + long endRetrieve = System.currentTimeMillis(); + // System.out.println(i); + + rs.close(); + rs = null; + long endQuery = System.currentTimeMillis(); + + stmt.close(); + stmt = null; + long endStatement = System.currentTimeMillis(); + + conn.close(); + conn = null; + long endConnection = System.currentTimeMillis(); + + // + System.out.println(C_INFO[s_cType] + + "Fetch=" + s_fetchSize + + " \tConn=" + (startStatement - startConnection) + + " \tStmt=" + (startQuery - startStatement) + + " \tQuery=" + (startRetrieve - startQuery) + + " \tRetrieve=" + (endRetrieve - startRetrieve) + + " \tClRs=" + (endQuery - endRetrieve) + + " \tClStmt=" + (endStatement - endQuery) + + " \tClConn=" + (endConnection - endStatement) + + " \t- Total=" + (endConnection - startConnection) + + " \tStmt=" + (endStatement - startStatement) + + " \tQuery=" + (endQuery - startQuery)); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } // statementTiming + + + /*************************************************************************/ + + /** + * JdbcTest Thread + * @param id Thread ID + */ + public JdbcTestPG (int id) + { + super(); + m_myId = id; + } + + private int m_myId = 0; + + /** + * Async Worker + */ + public void run() + { + ResultSet rs = null; + Statement stmt = null; + + try + { + if (WITH_OUTPUT) + System.out.println("Thread " + m_myId + " waiting"); + while (!getGreenLight()) + yield(); + if (WITH_OUTPUT) + System.out.println("Thread " + m_myId + " started"); + + // Get the connection & statement + if (s_cType == C_SHARED) + stmt = s_sconn.createStatement (); + else if (s_cType == C_MULTIPLE) + { + s_conn[m_myId] = DriverManager.getConnection (CONNECTION, UID, PWD); + stmt = s_conn[m_myId].createStatement (); + } + else if (s_cType == C_PRECREATED) + { + stmt = s_conn[m_myId].createStatement (); + } + // stmt.setFetchSize(s_fetchSize); + + // Execute the Query + rs = stmt.executeQuery (STATEMENT); + + // Loop through the results + while (rs.next()) + { + if (s_do_yield) + yield(); // Yield To other threads + } + + // Close all the resources + rs.close(); + rs = null; + + // Close the statement + stmt.close(); + stmt = null; + + // Close the local connection + if (s_cType == C_SHARED || s_cType == C_PRECREATED) + ; + else + { + s_conn[m_myId].close(); + s_conn[m_myId] = null; + } + } + catch (Exception e) + { + System.out.println("Thread " + m_myId + " got Exception: " + e); + e.printStackTrace(); + return; + } + if (WITH_OUTPUT) + System.out.println("Thread " + m_myId + " finished"); + } + + /*************************************************************************/ + + static boolean greenLight = false; + static synchronized void setGreenLight () { greenLight = true; } + synchronized boolean getGreenLight () { return greenLight; } + +} // JdbcTestPG diff --git a/dbPort/src/org/compiere/dbPort/Join.java b/dbPort/src/org/compiere/dbPort/Join.java new file mode 100644 index 0000000000..58e816f212 --- /dev/null +++ b/dbPort/src/org/compiere/dbPort/Join.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.dbPort; + +import org.compiere.util.*; + +/** + * Join Clause. + *
+ *  f.AD_Column_ID = c.AD_Column_ID(+)
+ *  
+ * @author Jorg Janke + * @version $Id: Join.java,v 1.2 2006/07/30 00:55:04 jjanke Exp $ + */ +public class Join +{ + /** + * Constructor + * @param joinClause + */ + public Join (String joinClause) + { + if (joinClause == null) + throw new IllegalArgumentException("Join - clause cannot be null"); + evaluate (joinClause); + } // Join + + private String m_joinClause; + private String m_mainTable; + private String m_mainAlias; + private String m_joinTable; + private String m_joinAlias; + private boolean m_left; + private String m_condition; + + /** + * Evaluate the clause. + * e.g. tb.AD_User_ID(+)=? + * f.AD_Column_ID = c.AD_Column_ID(+) + * @param joinClause + */ + private void evaluate (String joinClause) + { + m_joinClause = joinClause; + int indexEqual = joinClause.indexOf('='); + m_left = indexEqual < joinClause.indexOf("(+)"); // converts to LEFT if true + // get table alias of it + if (m_left) // f.AD_Column_ID = c.AD_Column_ID(+) => f / c + { + m_mainAlias = joinClause.substring + (0, Util.findIndexOf(joinClause, '.','=')).trim(); // f + int end = joinClause.indexOf('.', indexEqual); + if (end == -1) // no alias + end = joinClause.indexOf('(', indexEqual); + m_joinAlias = joinClause.substring(indexEqual+1, end).trim(); // c + } + else // f.AD_Column_ID(+) = c.AD_Column_ID => c / f + { + int end = joinClause.indexOf('.', indexEqual); + if (end == -1) // no alias + end = joinClause.length(); + m_mainAlias = joinClause.substring(indexEqual+1, end).trim(); // c + m_joinAlias = joinClause.substring + (0, Util.findIndexOf(joinClause, '.','(')).trim(); // f + } + m_condition = Util.replace(joinClause, "(+)", "").trim(); + } // evaluate + + /** + * Get origial Join Clause. + * e.g. f.AD_Column_ID = c.AD_Column_ID(+) + * @return Join cluase + */ + public String getJoinClause() + { + return m_joinClause; + } // getJoinClause + + /** + * Get Main Table Alias + * @return Main Table Alias + */ + public String getMainAlias() + { + return m_mainAlias; + } // getMainAlias + + /** + * Get Join Table Alias + * @return Join Table Alias + */ + public String getJoinAlias() + { + return m_joinAlias; + } // getJoinAlias + + /** + * Is Left Aouter Join + * @return true if left outer join + */ + public boolean isLeft() + { + return m_left; + } // isLeft + + /** + * Get Join condition. + * e.g. f.AD_Column_ID = c.AD_Column_ID + * @return join condition + */ + public String getCondition() + { + return m_condition; + } // getCondition + + /*************************************************************************/ + + /** + * Set Main Table Name. + * If table name equals alias, the alias is set to "" + * @param mainTable + */ + public void setMainTable(String mainTable) + { + if (mainTable == null || mainTable.length() == 0) + return; + m_mainTable = mainTable; + if (m_mainAlias.equals(mainTable)) + m_mainAlias = ""; + } // setMainTable + + /** + * Get Main Table Name + * @return Main Table Name + */ + public String getMainTable() + { + return m_mainTable; + } // getMainTable + + /** + * Set Main Table Name. + * If table name equals alias, the alias is set to "" + * @param joinTable + */ + public void setJoinTable(String joinTable) + { + if (joinTable == null || joinTable.length() == 0) + return; + m_joinTable = joinTable; + if (m_joinAlias.equals(joinTable)) + m_joinAlias = ""; + } // setJoinTable + + /** + * Get Join Table Name + * @return Join Table Name + */ + public String getJoinTable() + { + return m_joinTable; + } // getJoinTable + + /*************************************************************************/ + + /** + * This Join is a condition of the first Join. + * e.g. tb.AD_User_ID(+)=? or tb.AD_User_ID(+)='123' + * @param first + * @return true if condition + */ + public boolean isConditionOf (Join first) + { + if (m_mainTable == null // did not find Table from "Alias" + && (first.getJoinTable().equals(m_joinTable) // same join table + || first.getMainAlias().equals(m_joinTable))) // same main table + return true; + return false; + } // isConditionOf + + /** + * String representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer ("Join["); + sb.append(m_joinClause) + .append(" - Main=").append(m_mainTable).append("/").append(m_mainAlias) + .append(", Join=").append(m_joinTable).append("/").append(m_joinAlias) + .append(", Left=").append(m_left) + .append(", Condition=").append(m_condition) + .append("]"); + return sb.toString(); + } // toString + +} // Join diff --git a/dbPort/src/org/compiere/dbPort/package.html b/dbPort/src/org/compiere/dbPort/package.html new file mode 100644 index 0000000000..ac35fb16d3 --- /dev/null +++ b/dbPort/src/org/compiere/dbPort/package.html @@ -0,0 +1,34 @@ + + + + + + +Provides for conversion of SQL commands from Oracle to other databases. +

Package Specification

+ +
    +
  • The Oracle Source code statements need to be delimited by "/" +
  • Details of mapping see class ConvertMap +
  • http://www.adempiere.org +
+ +

Related Documentation

+ +For overviews, tutorials, examples, guides, and tool documentation, please see: + + + + + + diff --git a/dbPort/src/org/compiere/license.html b/dbPort/src/org/compiere/license.html new file mode 100644 index 0000000000..a4e87c198d --- /dev/null +++ b/dbPort/src/org/compiere/license.html @@ -0,0 +1,81 @@ + + +Adempiere Public License + + + +
+

ADEMPIERE PUBLIC LICENSE

+ Version 1.2 +

Contact info@adempiere.org for licensing alternatives.

+

GNU General Public License

+

Version 2, June 1991

+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
+59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+  
+
+

Preamble

+

The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.

+

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

+

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

+

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

+

We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

+

Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

+

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

+

The precise terms and conditions for copying, distribution and modification follow.

+

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

+

0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". +

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. +

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. +

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. +

2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +

+

+
    +
  • a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. +
  • + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. +
  • + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +
+
+
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. +

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. +

3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + +

+
    +
  • a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +
  • b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +
  • +
    c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
    +
  • +
+
+
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. +

4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. +

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. +

6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. +

7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. +

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. +

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. +

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. +

8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. +

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. +

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. +

10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. +

NO WARRANTY

+

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

+

END OF TERMS AND CONDITION

+

+ + diff --git a/dbPort/src/org/compiere/model/AccessSqlParser.java b/dbPort/src/org/compiere/model/AccessSqlParser.java new file mode 100644 index 0000000000..3d74375239 --- /dev/null +++ b/dbPort/src/org/compiere/model/AccessSqlParser.java @@ -0,0 +1,436 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Parse FROM in SQL WHERE clause + * + * @author Jorg Janke + * @version $Id: AccessSqlParser.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $ + */ +public class AccessSqlParser +{ + /** + * Base Constructor. + * You need to set the SQL and start the parsing manually. + */ + public AccessSqlParser () + { + } // AccessSqlParser + + /** + * Full Constructor + * @param sql sql command + */ + public AccessSqlParser (String sql) + { + setSql(sql); + } // AccessSqlParser + + /** FROM String */ + private static final String FROM = " FROM "; + private static final int FROM_LENGTH = FROM.length(); + private static final String WHERE = " WHERE "; + private static final String ON = " ON "; + + /** Logger */ + private CLogger log = CLogger.getCLogger(getClass()); + /** Original SQL */ + private String m_sqlOriginal; + /** SQL Selects */ + private String[] m_sql; + /** List of Arrays */ + private ArrayList m_tableInfo = new ArrayList(); + + /** + * Set Sql and parse it + * @param sql sql + */ + public void setSql (String sql) + { + if (sql == null) + throw new IllegalArgumentException("No SQL"); + m_sqlOriginal = sql; + int index = m_sqlOriginal.indexOf("\nFROM "); + if (index != -1) + m_sqlOriginal = m_sqlOriginal.replace("\nFROM ", FROM); + index = m_sqlOriginal.indexOf("\nWHERE "); + if (index != -1) + m_sqlOriginal = m_sqlOriginal.replace("\nWHERE ", WHERE); + // + parse(); + } // setSQL + + /** + * Get (original) Sql + * @return sql + */ + public String getSql() + { + return m_sqlOriginal; + } // getSql + + /** + * Parse Original SQL. + * Called from setSql or Constructor. + * @return true if pased + */ + public boolean parse() + { + if (m_sqlOriginal == null || m_sqlOriginal.length() == 0) + throw new IllegalArgumentException("No SQL"); + // + // if (CLogMgt.isLevelFinest()) + // log.fine(m_sqlOriginal); + getSelectStatements(); + // analyse each select + for (int i = 0; i < m_sql.length; i++) + { + TableInfo[] info = getTableInfo(m_sql[i].trim()); + m_tableInfo.add(info); + } + // + if (CLogMgt.isLevelFinest()) + log.fine(toString()); + return m_tableInfo.size() > 0; + } // parse + + /** + * Parses m_sqlOriginal and creates Array of m_sql statements + */ + private void getSelectStatements() + { + String[] sqlIn = new String[] {m_sqlOriginal}; + String[] sqlOut = null; + try + { + sqlOut = getSubSQL (sqlIn); + } + catch (Exception e) + { + log.log(Level.SEVERE, m_sqlOriginal, e); + throw new IllegalArgumentException(m_sqlOriginal); + } + // a sub-query was found + while (sqlIn.length != sqlOut.length) + { + sqlIn = sqlOut; + try + { + sqlOut = getSubSQL (sqlIn); + } + catch (Exception e) + { + log.log(Level.SEVERE, m_sqlOriginal, e); + throw new IllegalArgumentException(sqlOut.length + ": "+ m_sqlOriginal); + } + } + m_sql = sqlOut; + /** List & check ** + for (int i = 0; i < m_sql.length; i++) + { + if (m_sql[i].indexOf("SELECT ",2) != -1) + log.log(Level.SEVERE, "#" + i + " Has embedded SQL - " + m_sql[i]); + else + log.fine("#" + i + " - " + m_sql[i]); + } + /** **/ + } // getSelectStatements + + /** + * Get Sub SQL of sql statements + * @param sqlIn array of input sql + * @return array of resulting sql + */ + private String[] getSubSQL (String[] sqlIn) + { + ArrayList list = new ArrayList(); + for (int sqlIndex = 0; sqlIndex < sqlIn.length; sqlIndex++) + { + String sql = sqlIn[sqlIndex]; + int index = sql.indexOf("(SELECT ", 7); + while (index != -1) + { + int endIndex = index+1; + int parenthesisLevel = 0; + // search for the end of the sql + while (endIndex++ < sql.length()) + { + char c = sql.charAt(endIndex); + if (c == ')') + { + if (parenthesisLevel == 0) + break; + else + parenthesisLevel--; + } + else if (c == '(') + parenthesisLevel++; + } + String subSQL = sql.substring(index, endIndex+1); + list.add(subSQL); + // remove inner SQL (##) + sql = sql.substring(0,index+1) + "##" + + sql.substring(endIndex); + index = sql.indexOf("(SELECT ", 7); + } + list.add(sql); // last SQL + } + String[] retValue = new String[list.size()]; + list.toArray(retValue); + return retValue; + } // getSubSQL + + /** + * Get Table Info for SQL + * @param sql sql + * @return array of table info for sql + */ + private TableInfo[] getTableInfo (String sql) + { + ArrayList list = new ArrayList(); + // remove () + if (sql.startsWith("(") && sql.endsWith(")")) + sql = sql.substring(1,sql.length()-1); + + int fromIndex = sql.indexOf(FROM); + if (fromIndex != sql.lastIndexOf(FROM)) + log.log(Level.WARNING, "More than one FROM clause - " + sql); + while (fromIndex != -1) + { + String from = sql.substring(fromIndex+FROM_LENGTH); + int index = from.lastIndexOf(WHERE); // end at where + if (index != -1) + from = from.substring(0, index); + from = Util.replace(from, " AS ", " "); + from = Util.replace(from, " as ", " "); + from = Util.replace(from, " INNER JOIN ", ", "); + from = Util.replace(from, " LEFT OUTER JOIN ", ", "); + from = Util.replace(from, " RIGHT OUTER JOIN ", ", "); + from = Util.replace(from, " FULL JOIN ", ", "); + // Remove ON clause - assumes that there is no IN () in the clause + index = from.indexOf(ON); + while (index != -1) + { + int indexClose = from.indexOf(')'); // does not catch "IN (1,2)" in ON + int indexNextOn = from.indexOf(ON, index+4); + if (indexNextOn != -1) + indexClose = from.lastIndexOf(')', indexNextOn); + if (indexClose != -1) + from = from.substring(0, index) + from.substring(indexClose+1); + else + { + log.log(Level.SEVERE, "Could not remove ON " + from); + break; + } + index = from.indexOf(ON); + } + +// log.fine("getTableInfo - " + from); + StringTokenizer tableST = new StringTokenizer (from, ","); + while (tableST.hasMoreTokens()) + { + String tableString = tableST.nextToken().trim(); + StringTokenizer synST = new StringTokenizer (tableString, " "); + TableInfo tableInfo = null; + if (synST.countTokens() > 1) + tableInfo = new TableInfo(synST.nextToken(), synST.nextToken()); + else + tableInfo = new TableInfo(tableString); +// log.fine("getTableInfo -- " + tableInfo); + list.add(tableInfo); + } + // + sql = sql.substring(0, fromIndex); + fromIndex = sql.lastIndexOf(FROM); + } + TableInfo[] retValue = new TableInfo[list.size()]; + list.toArray(retValue); + return retValue; + } // getTableInfo + + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("AccessSqlParser["); + if (m_tableInfo == null) + sb.append(m_sqlOriginal); + else + { + for (int i = 0; i < m_tableInfo.size(); i++) + { + if (i > 0) + sb.append("|"); + TableInfo[] info = (TableInfo[])m_tableInfo.get(i); + for (int ii = 0; ii < info.length; ii++) + { + if (ii > 0) + sb.append(","); + sb.append(info[ii].toString()); + } + } + } + sb.append("|").append(getMainSqlIndex()); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Get Table Info. + * @param index record index + * @return table info + */ + public TableInfo[] getTableInfo (int index) + { + if (index < 0 || index > m_tableInfo.size()) + return null; + TableInfo[] retValue = (TableInfo[])m_tableInfo.get(index); + return retValue; + } // getTableInfo + + /** + * Get Sql Statements + * @param index record index + * @return index index of query + */ + public String getSqlStatement (int index) + { + if (index < 0 || index > m_sql.length) + return null; + return m_sql[index]; + } // getSqlStatement + + /** + * Get No of SQL Statements + * @return FROM clause count + */ + public int getNoSqlStatments() + { + if (m_sql == null) + return 0; + return m_sql.length; + } // getNoSqlStatments + + /** + * Get index of main Statements + * @return index of main statement or -1 if not found + */ + public int getMainSqlIndex() + { + if (m_sql == null) + return -1; + else if (m_sql.length == 1) + return 0; + for (int i = m_sql.length-1; i >= 0; i--) + { + if (m_sql[i].charAt(0) != '(') + return i; + } + return -1; + } // getMainSqlIndex + + /** + * Get main sql Statement + * @return main statement + */ + public String getMainSql() + { + if (m_sql == null) + return m_sqlOriginal; + + if (m_sql.length == 1) + return m_sql[0]; + for (int i = m_sql.length-1; i >= 0; i--) + { + if (m_sql[i].charAt(0) != '(') + return m_sql[i]; + } + return ""; + } // getMainSql + + /** + * Table Info VO + */ + public class TableInfo + { + /** + * Constructor + * @param tableName table + * @param synonym synonym + */ + public TableInfo (String tableName, String synonym) + { + m_tableName = tableName; + m_synonym = synonym; + } // TableInfo + + /** + * Short Constuctor - no syn + * @param tableName table + */ + public TableInfo (String tableName) + { + this (tableName, null); + } // TableInfo + + private String m_tableName; + private String m_synonym; + + /** + * Get Table Synonym + * @return synonym + */ + public String getSynonym() + { + if (m_synonym == null) + return ""; + return m_synonym; + } // getSynonym + + /** + * Get TableName + * @return table name + */ + public String getTableName() + { + return m_tableName; + } // getTableName + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer(m_tableName); + if (getSynonym().length() > 0) + sb.append("=").append(m_synonym); + return sb.toString(); + } // toString + + } // TableInfo + +} // AccessSqlParser diff --git a/dbPort/src/org/compiere/model/AccessSqlParserTest.java b/dbPort/src/org/compiere/model/AccessSqlParserTest.java new file mode 100644 index 0000000000..4f2d2cc5a5 --- /dev/null +++ b/dbPort/src/org/compiere/model/AccessSqlParserTest.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import junit.framework.*; +import org.compiere.*; + +/** + * AccessSqlParserTest tests the class + * AccessSqlParser + * + * @author Jorg Janke + * @version $Id: AccessSqlParserTest.java,v 1.2 2006/07/30 00:58:04 jjanke Exp $ + */ +public class AccessSqlParserTest extends TestCase +{ + /** + * Construct new test instance + * + * @param name the test name + */ + public AccessSqlParserTest(String name) + { + super(name); + } + + /** + * Launch the test. + * + * @param args String[] + */ + public static void main(String[] args) + { + junit.swingui.TestRunner.run(AccessSqlParserTest.class); + } + + /** + * Perform pre-test initialization + * + * @throws Exception + * + * @see TestCase#setUp() + */ + protected void setUp() throws Exception + { + super.setUp(); + Adempiere.startup(true); + } + + /** + * Run the oneTable test + */ + public void testOneTable() + { + String sql = "SELECT AD_Table_ID, TableName FROM AD_Table WHERE IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table|0]", fixture.toString()); + } + + /** + * Run the oneTableSyn test + */ + public void testOneTableSyn() + { + String sql = "SELECT t.AD_Table_ID, t.TableName FROM AD_Table t WHERE t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table=t|0]", fixture.toString()); + } + + /** + * Run the oneTableSyn test + */ + public void testOneTableSynAS() + { + String sql = "SELECT t.AD_Table_ID, t.TableName FROM AD_Table AS t WHERE t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table=t|0]", fixture.toString()); + } + + /** + * Run the twoTable test + */ + public void testTwoTable() + { + String sql = "SELECT t.AD_Table_ID, t.TableName, c.AD_Column_ID, c.ColumnName FROM AD_Table t, AD_Column c WHERE t.AD_Table_ID=c.AD_Table_ID AND t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table=t,AD_Column=c|0]", fixture.toString()); + } + + /** + * Run the twoTableSyn test + */ + public void testTwoTableSyn() + { + String sql = "SELECT t.AD_Table_ID, t.TableName, c.AD_Column_ID, c.ColumnName FROM AD_Table as t, AD_Column AS c WHERE t.AD_Table_ID=c.AD_Table_ID AND t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table=t,AD_Column=c|0]", fixture.toString()); + } + + /** + * Run the joinInner test + */ + public void testJoinInner() + { + String sql = "SELECT t.AD_Table_ID, t.TableName, c.AD_Column_ID, c.ColumnName " + + "FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) WHERE t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table=t,AD_Column=c|0]", fixture.toString()); + } + + /** + * Run the joinOuter test + */ + public void testJoinOuter() + { + String sql = "SELECT t.AD_Table_ID, t.TableName, c.AD_Column_ID, c.ColumnName " + + "FROM AD_Table t LEFT OUTER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) WHERE t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Table=t,AD_Column=c|0]", fixture.toString()); + } + + /** + * Run the exists test + */ + public void testExists() + { + String sql = "SELECT AD_Table.AD_Table_ID, AD_Table.TableName " + + "FROM AD_Table " + + "WHERE EXISTS (SELECT * FROM AD_Column c WHERE AD_Table.AD_Table_ID=c.AD_Table_ID)"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Column=c|AD_Table|1]", fixture.toString()); + } + + /** + * Run the exists test with syn + */ + public void testExistsSyn() + { + String sql = "SELECT t.AD_Table_ID, t.TableName " + + "FROM AD_Table t " + + "WHERE EXISTS (SELECT * FROM AD_Column c WHERE t.AD_Table_ID=c.AD_Table_ID)"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Column=c|AD_Table=t|1]", fixture.toString()); + } + + /** + * Run the embeddedSelect test + */ + public void testEmbeddedSelect() + { + String sql = "SELECT t.AD_Table_ID, t.TableName," + + "(SELECT COUNT(c.ColumnName) FROM AD_Column c WHERE t.AD_Table_ID=c.AD_Table_ID) " + + "FROM AD_Table t WHERE t.IsActive='Y'"; + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Column=c|AD_Table=t|1]", fixture.toString()); + } + + /** + * Run the embeddedFrom test + */ + public void testEmbeddedFrom() + { + String sql = "SELECT t.AD_Table_ID, t.TableName, cc.CCount " + + "FROM AD_Table t," + + "(SELECT COUNT(ColumnName) AS CCount FROM AD_Column) cc " + + "WHERE t.IsActive='Y'"; + + AccessSqlParser fixture = new AccessSqlParser(sql); + assertEquals("AccessSqlParser[AD_Column|AD_Table=t,(##)=cc|1]", fixture.toString()); + } + + /** + * Run the Product & Instance Attribute Query + */ + public void testProductInstanceAttributeQuery() + { + String sql = "SELECT p.M_Product_ID, p.Discontinued, p.Value, p.Name, BOM_Qty_Available(p.M_Product_ID,?) AS QtyAvailable, bomQtyList(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceList, bomQtyStd(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceStd, BOM_Qty_OnHand(p.M_Product_ID,?) AS QtyOnHand, BOM_Qty_Reserved(p.M_Product_ID,?) AS QtyReserved, BOM_Qty_Ordered(p.M_Product_ID,?) AS QtyOrdered, bomQtyStd(p.M_Product_ID, pr.M_PriceList_Version_ID)-bomQtyLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS Margin, bomQtyLimit(p.M_Product_ID, pr.M_PriceList_Version_ID) AS PriceLimit, pa.IsInstanceAttribute FROM M_Product p INNER JOIN M_ProductPrice pr ON (p.M_Product_ID=pr.M_Product_ID) LEFT OUTER JOIN M_AttributeSet pa ON (p.M_AttributeSet_ID=pa.M_AttributeSet_ID) WHERE p.IsSummary='N' AND p.IsActive='Y' AND pr.IsActive='Y' AND pr.M_PriceList_Version_ID=? AND EXISTS (SELECT * FROM M_Storage s INNER JOIN M_AttributeSetInstance asi ON (s.M_AttributeSetInstance_ID=asi.M_AttributeSetInstance_ID) WHERE s.M_Product_ID=p.M_Product_ID AND asi.SerNo LIKE '33' AND asi.Lot LIKE '33' AND asi.M_Lot_ID=101 AND TRUNC(asi.GuaranteeDate)(); // dummy + } + else + { + createFields (vo); + if (vo.Fields == null || vo.Fields.size() == 0) + { + CLogger.get().log(Level.SEVERE, "No Fields"); + return null; + } + } + return vo; + } // create + + /** + * Load Tab Details from rs into vo + * @param vo Tab value object + * @param rs ResultSet from AD_Tab_v/t + * @return true if read ok + */ + private static boolean loadTabDetails (GridTabVO vo, ResultSet rs) + { + MRole role = MRole.getDefault(vo.ctx, false); + boolean showTrl = "Y".equals(Env.getContext(vo.ctx, "#ShowTrl")); + boolean showAcct = "Y".equals(Env.getContext(vo.ctx, "#ShowAcct")); + boolean showAdvanced = "Y".equals(Env.getContext(vo.ctx, "#ShowAdvanced")); + // CLogger.get().warning("ShowTrl=" + showTrl + ", showAcct=" + showAcct); + try + { + vo.AD_Tab_ID = rs.getInt("AD_Tab_ID"); + Env.setContext(vo.ctx, vo.WindowNo, vo.TabNo, "AD_Tab_ID", String.valueOf(vo.AD_Tab_ID)); + vo.Name = rs.getString("Name"); + Env.setContext(vo.ctx, vo.WindowNo, vo.TabNo, "Name", vo.Name); + + // Translation Tab ** + if (rs.getString("IsTranslationTab").equals("Y")) + { + // Document Translation + vo.TableName = rs.getString("TableName"); + if (!Env.isBaseTranslation(vo.TableName) // C_UOM, ... + && !Env.isMultiLingualDocument(vo.ctx)) + showTrl = false; + if (!showTrl) + { + CLogger.get().config("TrlTab Not displayed - AD_Tab_ID=" + + vo.AD_Tab_ID + "=" + vo.Name + ", Table=" + vo.TableName + + ", BaseTrl=" + Env.isBaseTranslation(vo.TableName) + + ", MultiLingual=" + Env.isMultiLingualDocument(vo.ctx)); + return false; + } + } + // Advanced Tab ** + if (!showAdvanced && rs.getString("IsAdvancedTab").equals("Y")) + { + CLogger.get().config("AdvancedTab Not displayed - AD_Tab_ID=" + + vo.AD_Tab_ID + " " + vo.Name); + return false; + } + // Accounting Info Tab ** + if (!showAcct && rs.getString("IsInfoTab").equals("Y")) + { + CLogger.get().fine("AcctTab Not displayed - AD_Tab_ID=" + + vo.AD_Tab_ID + " " + vo.Name); + return false; + } + + // DisplayLogic + vo.DisplayLogic = rs.getString("DisplayLogic"); + + // Access Level + vo.AccessLevel = rs.getString("AccessLevel"); + if (!role.canView (vo.ctx, vo.AccessLevel)) // No Access + { + CLogger.get().fine("No Role Access - AD_Tab_ID=" + vo.AD_Tab_ID + " " + vo. Name); + return false; + } // Used by MField.getDefault + Env.setContext(vo.ctx, vo.WindowNo, vo.TabNo, "AccessLevel", vo.AccessLevel); + + // Table Access + vo.AD_Table_ID = rs.getInt("AD_Table_ID"); + Env.setContext(vo.ctx, vo.WindowNo, vo.TabNo, "AD_Table_ID", String.valueOf(vo.AD_Table_ID)); + if (!role.isTableAccess(vo.AD_Table_ID, true)) + { + CLogger.get().config("No Table Access - AD_Tab_ID=" + + vo.AD_Tab_ID + " " + vo. Name); + return false; + } + if (rs.getString("IsReadOnly").equals("Y")) + vo.IsReadOnly = true; + vo.ReadOnlyLogic = rs.getString("ReadOnlyLogic"); + if (rs.getString("IsInsertRecord").equals("N")) + vo.IsInsertRecord = false; + + // + vo.Description = rs.getString("Description"); + if (vo.Description == null) + vo.Description = ""; + vo.Help = rs.getString("Help"); + if (vo.Help == null) + vo.Help = ""; + + if (rs.getString("IsSingleRow").equals("Y")) + vo.IsSingleRow = true; + if (rs.getString("HasTree").equals("Y")) + vo.HasTree = true; + + vo.AD_Table_ID = rs.getInt("AD_Table_ID"); + vo.TableName = rs.getString("TableName"); + if (rs.getString("IsView").equals("Y")) + vo.IsView = true; + vo.AD_Column_ID = rs.getInt("AD_Column_ID"); // Primary Parent Column + + if (rs.getString("IsSecurityEnabled").equals("Y")) + vo.IsSecurityEnabled = true; + if (rs.getString("IsDeleteable").equals("Y")) + vo.IsDeleteable = true; + if (rs.getString("IsHighVolume").equals("Y")) + vo.IsHighVolume = true; + + vo.CommitWarning = rs.getString("CommitWarning"); + if (vo.CommitWarning == null) + vo.CommitWarning = ""; + vo.WhereClause = rs.getString("WhereClause"); + if (vo.WhereClause == null) + vo.WhereClause = ""; + vo.OrderByClause = rs.getString("OrderByClause"); + if (vo.OrderByClause == null) + vo.OrderByClause = ""; + + vo.AD_Process_ID = rs.getInt("AD_Process_ID"); + if (rs.wasNull()) + vo.AD_Process_ID = 0; + vo.AD_Image_ID = rs.getInt("AD_Image_ID"); + if (rs.wasNull()) + vo.AD_Image_ID = 0; + vo.Included_Tab_ID = rs.getInt("Included_Tab_ID"); + if (rs.wasNull()) + vo.Included_Tab_ID = 0; + // + vo.TabLevel = rs.getInt("TabLevel"); + if (rs.wasNull()) + vo.TabLevel = 0; + // + vo.IsSortTab = rs.getString("IsSortTab").equals("Y"); + if (vo.IsSortTab) + { + vo.AD_ColumnSortOrder_ID = rs.getInt("AD_ColumnSortOrder_ID"); + vo.AD_ColumnSortYesNo_ID = rs.getInt("AD_ColumnSortYesNo_ID"); + } + // + // Replication Type - set R/O if Reference + try + { + int index = rs.findColumn ("ReplicationType"); + vo.ReplicationType = rs.getString (index); + if ("R".equals(vo.ReplicationType)) + vo.IsReadOnly = true; + } + catch (Exception e) + { + } + } + catch (SQLException ex) + { + CLogger.get().log(Level.SEVERE, "", ex); + return false; + } + + return true; + } // loadTabDetails + + + /************************************************************************** + * Create Tab Fields + * @param mTabVO tab value object + * @return true if fields were created + */ + private static boolean createFields (GridTabVO mTabVO) + { + mTabVO.Fields = new ArrayList(); + + String sql = GridFieldVO.getSQL(mTabVO.ctx); + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, mTabVO.AD_Tab_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + GridFieldVO voF = GridFieldVO.create (mTabVO.ctx, + mTabVO.WindowNo, mTabVO.TabNo, + mTabVO.AD_Window_ID, mTabVO.AD_Tab_ID, + mTabVO.IsReadOnly, rs); + if (voF != null) + mTabVO.Fields.add(voF); + } + rs.close(); + pstmt.close(); + } + catch (Exception e) + { + CLogger.get().log(Level.SEVERE, "", e); + return false; + } + return mTabVO.Fields.size() != 0; + } // createFields + + /** + * Return the SQL statement used for the MTabVO.create + * @param ctx context + * @return SQL SELECT String + */ + protected static String getSQL (Properties ctx) + { + // View only returns IsActive='Y' + String sql = "SELECT * FROM AD_Tab_v WHERE AD_Window_ID=?" + + " ORDER BY SeqNo"; + if (!Env.isBaseLanguage(ctx, "AD_Window")) + sql = "SELECT * FROM AD_Tab_vt WHERE AD_Window_ID=?" + + " AND AD_Language='" + Env.getAD_Language(ctx) + "'" + + " ORDER BY SeqNo"; + return sql; + } // getSQL + + + /************************************************************************** + * Private constructor - must use Factory + * @param Ctx context + * @param windowNo window + */ + private GridTabVO (Properties Ctx, int windowNo) + { + ctx = Ctx; + WindowNo = windowNo; + } // MTabVO + + static final long serialVersionUID = 9160212869277319305L; + + /** Context - replicated */ + public Properties ctx; + /** Window No - replicated */ + public int WindowNo; + /** AD Window - replicated */ + public int AD_Window_ID; + + /** Tab No (not AD_Tab_ID) 0.. */ + public int TabNo; + + /** Tab ID */ + public int AD_Tab_ID; + /** Name */ + public String Name = ""; + /** Description */ + public String Description = ""; + /** Help */ + public String Help = ""; + /** Single Row */ + public boolean IsSingleRow = false; + /** Read Only */ + public boolean IsReadOnly = false; + /** Insert Record */ + public boolean IsInsertRecord = true; + /** Tree */ + public boolean HasTree = false; + /** Table */ + public int AD_Table_ID; + /** Primary Parent Column */ + public int AD_Column_ID = 0; + /** Table Name */ + public String TableName; + /** Table is View */ + public boolean IsView = false; + /** Table Access Level */ + public String AccessLevel; + /** Security */ + public boolean IsSecurityEnabled = false; + /** Table Deleteable */ + public boolean IsDeleteable = false; + /** Table High Volume */ + public boolean IsHighVolume = false; + /** Process */ + public int AD_Process_ID = 0; + /** Commot Warning */ + public String CommitWarning; + /** Where */ + public String WhereClause; + /** Order by */ + public String OrderByClause; + /** Tab Read Only */ + public String ReadOnlyLogic; + /** Tab Display */ + public String DisplayLogic; + /** Level */ + public int TabLevel = 0; + /** Image */ + public int AD_Image_ID = 0; + /** Included Tab */ + public int Included_Tab_ID = 0; + /** Replication Type */ + public String ReplicationType = "L"; + + /** Sort Tab */ + public boolean IsSortTab = false; + /** Column Sort */ + public int AD_ColumnSortOrder_ID = 0; + /** Column Displayed */ + public int AD_ColumnSortYesNo_ID = 0; + + /** Only Current Rows - derived */ + public boolean onlyCurrentRows = true; + /** Only Current Days - derived */ + public int onlyCurrentDays = 0; + + /** Fields contain MFieldVO entities */ + public ArrayList Fields = null; + + + /** + * Set Context including contained elements + * @param newCtx new context + */ + public void setCtx (Properties newCtx) + { + ctx = newCtx; + for (int i = 0; i < Fields.size() ; i++) + { + GridFieldVO field = (GridFieldVO)Fields.get(i); + field.setCtx(newCtx); + } + } // setCtx + + /** + * Get Variable Value (Evaluatee) + * @param variableName name + * @return value + */ + public String get_ValueAsString (String variableName) + { + return Env.getContext (ctx, WindowNo, variableName, false); // not just window + } // get_ValueAsString + + /** + * Clone + * @param Ctx context + * @param windowNo no + * @return MTabVO or null + */ + protected GridTabVO clone(Properties Ctx, int windowNo) + { + GridTabVO clone = new GridTabVO(Ctx, windowNo); + clone.AD_Window_ID = AD_Window_ID; + clone.TabNo = TabNo; + Env.setContext(Ctx, windowNo, clone.TabNo, "AD_Tab_ID", String.valueOf(clone.AD_Tab_ID)); + // + clone.AD_Tab_ID = AD_Tab_ID; + clone.Name = Name; + Env.setContext(Ctx, windowNo, clone.TabNo, "Name", clone.Name); + clone.Description = Description; + clone.Help = Help; + clone.IsSingleRow = IsSingleRow; + clone.IsReadOnly = IsReadOnly; + clone.IsInsertRecord = IsInsertRecord; + clone.HasTree = HasTree; + clone.AD_Table_ID = AD_Table_ID; + clone.AD_Column_ID = AD_Column_ID; + clone.TableName = TableName; + clone.IsView = IsView; + clone.AccessLevel = AccessLevel; + clone.IsSecurityEnabled = IsSecurityEnabled; + clone.IsDeleteable = IsDeleteable; + clone.IsHighVolume = IsHighVolume; + clone.AD_Process_ID = AD_Process_ID; + clone.CommitWarning = CommitWarning; + clone.WhereClause = WhereClause; + clone.OrderByClause = OrderByClause; + clone.ReadOnlyLogic = ReadOnlyLogic; + clone.DisplayLogic = DisplayLogic; + clone.TabLevel = TabLevel; + clone.AD_Image_ID = AD_Image_ID; + clone.Included_Tab_ID = Included_Tab_ID; + clone.ReplicationType = ReplicationType; + Env.setContext(Ctx, windowNo, clone.TabNo, "AccessLevel", clone.AccessLevel); + Env.setContext(Ctx, windowNo, clone.TabNo, "AD_Table_ID", String.valueOf(clone.AD_Table_ID)); + + // + clone.IsSortTab = IsSortTab; + clone.AD_ColumnSortOrder_ID = AD_ColumnSortOrder_ID; + clone.AD_ColumnSortYesNo_ID = AD_ColumnSortYesNo_ID; + // Derived + clone.onlyCurrentRows = true; + clone.onlyCurrentDays = 0; + + clone.Fields = new ArrayList(); + for (int i = 0; i < Fields.size(); i++) + { + GridFieldVO field = Fields.get(i); + GridFieldVO cloneField = field.clone(Ctx, windowNo, TabNo, + AD_Window_ID, AD_Tab_ID, IsReadOnly); + if (cloneField == null) + return null; + clone.Fields.add(cloneField); + } + + return clone; + } // clone + +} // MTabVO + diff --git a/dbPort/src/org/compiere/model/GridWindowVO.java b/dbPort/src/org/compiere/model/GridWindowVO.java new file mode 100644 index 0000000000..293c38409a --- /dev/null +++ b/dbPort/src/org/compiere/model/GridWindowVO.java @@ -0,0 +1,346 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Model Window Value Object + * + * @author Jorg Janke + * @version $Id: GridWindowVO.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ + */ +public class GridWindowVO implements Serializable +{ + /** + * Create Window Value Object + * @param ctx context + * @param WindowNo window no for ctx + * @param AD_Window_ID window id + * @return MWindowVO + */ + public static GridWindowVO create (Properties ctx, int WindowNo, int AD_Window_ID) + { + return create (ctx, WindowNo, AD_Window_ID, 0); + } // create + + /** + * Create Window Value Object + * + * @param ctx context + * @param WindowNo window no for ctx + * @param AD_Window_ID window id + * @param AD_Menu_ID menu id + * @return MWindowVO + */ + public static GridWindowVO create (Properties ctx, int WindowNo, int AD_Window_ID, int AD_Menu_ID) + { + CLogger.get().config("#" + WindowNo + + " - AD_Window_ID=" + AD_Window_ID + "; AD_Menu_ID=" + AD_Menu_ID); + GridWindowVO vo = new GridWindowVO (ctx, WindowNo); + vo.AD_Window_ID = AD_Window_ID; + + // Get Window_ID if required - (used by HTML UI) + if (vo.AD_Window_ID == 0 && AD_Menu_ID != 0) + { + String sql = "SELECT AD_Window_ID, IsSOTrx, IsReadOnly FROM AD_Menu " + + "WHERE AD_Menu_ID=? AND Action='W'"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Menu_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + vo.AD_Window_ID = rs.getInt(1); + String IsSOTrx = rs.getString(2); + Env.setContext(ctx, WindowNo, "IsSOTrx", (IsSOTrx != null && IsSOTrx.equals("Y"))); + // + String IsReadOnly = rs.getString(3); + if (IsReadOnly != null && IsReadOnly.equals("Y")) + vo.IsReadWrite = "Y"; + else + vo.IsReadWrite = "N"; + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + CLogger.get().log(Level.SEVERE, "Menu", e); + return null; + } + CLogger.get().config("AD_Window_ID=" + vo.AD_Window_ID); + } + + // -- Get Window + + StringBuffer sql = new StringBuffer("SELECT Name,Description,Help,WindowType, " + + "AD_Color_ID,AD_Image_ID, a.IsReadWrite, WinHeight,WinWidth, " + + "IsSOTrx "); + + if (Env.isBaseLanguage(vo.ctx, "AD_Window")) + sql.append("FROM AD_Window w, AD_Window_Access a " + + "WHERE w.AD_Window_ID=?" + + " AND w.AD_Window_ID=a.AD_Window_ID AND a.AD_Role_ID=?" + + " AND w.IsActive='Y' AND a.IsActive='Y'"); + else + sql.append("FROM AD_Window_vt w, AD_Window_Access a " + + "WHERE w.AD_Window_ID=?" + + " AND w.AD_Window_ID=a.AD_Window_ID AND a.AD_Role_ID=?" + + " AND a.IsActive='Y'") + .append(" AND AD_Language='") + .append(Env.getAD_Language(vo.ctx)).append("'"); + + int AD_Role_ID = Env.getContextAsInt(vo.ctx, "#AD_Role_ID"); + try + { + // create statement + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, vo.AD_Window_ID); + pstmt.setInt(2, AD_Role_ID); + // get data + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + vo.Name = rs.getString(1); + vo.Description = rs.getString(2); + if (vo.Description == null) + vo.Description = ""; + vo.Help = rs.getString(3); + if (vo.Help == null) + vo.Help = ""; + vo.WindowType = rs.getString(4); + // + vo.AD_Color_ID = rs.getInt(5); + vo.AD_Image_ID = rs.getInt(6); + vo.IsReadWrite = rs.getString(7); + // + vo.WinHeight = rs.getInt(8); + vo.WinWidth = rs.getInt(9); + // + vo.IsSOTrx = "Y".equals(rs.getString(10)); + } + else + vo = null; + rs.close(); + pstmt.close(); + } + catch (SQLException ex) + { + CLogger.get().log(Level.SEVERE, sql.toString(), ex); + return null; + } + // Not found + if (vo == null) + { + CLogger.get().log(Level.SEVERE, "No Window - AD_Window_ID=" + AD_Window_ID + + ", AD_Role_ID=" + AD_Role_ID + " - " + sql); + CLogger.get().saveError("AccessTableNoView", "(Not found)"); + return null; + } + // Read Write + if (vo.IsReadWrite == null) + { + CLogger.get().saveError("AccessTableNoView", "(found)"); + return null; + } + + // Create Tabs + createTabs (vo); + if (vo.Tabs == null || vo.Tabs.size() == 0) + return null; + + return vo; + } // create + + /** + * Create Window Tabs + * @param mWindowVO Window Value Object + * @return true if tabs were created + */ + private static boolean createTabs (GridWindowVO mWindowVO) + { + mWindowVO.Tabs = new ArrayList(); + + String sql = GridTabVO.getSQL(mWindowVO.ctx); + int TabNo = 0; + try + { + // create statement + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, mWindowVO.AD_Window_ID); + ResultSet rs = pstmt.executeQuery(); + boolean firstTab = true; + while (rs.next()) + { + if (mWindowVO.AD_Table_ID == 0) + mWindowVO.AD_Table_ID = rs.getInt("AD_Table_ID"); + // Create TabVO + GridTabVO mTabVO = GridTabVO.create(mWindowVO, TabNo, rs, + mWindowVO.WindowType.equals(WINDOWTYPE_QUERY), // isRO + mWindowVO.WindowType.equals(WINDOWTYPE_TRX)); // onlyCurrentRows + if (mTabVO == null && firstTab) + break; // don't continue if first tab is null + if (mTabVO != null) + { + if (!mTabVO.IsReadOnly && "N".equals(mWindowVO.IsReadWrite)) + mTabVO.IsReadOnly = true; + mWindowVO.Tabs.add(mTabVO); + TabNo++; // must be same as mWindow.getTab(x) + firstTab = false; + } + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + CLogger.get().log(Level.SEVERE, "createTabs", e); + return false; + } + + // No Tabs + if (TabNo == 0 || mWindowVO.Tabs.size() == 0) + { + CLogger.get().log(Level.SEVERE, "No Tabs - AD_Window_ID=" + + mWindowVO.AD_Window_ID + " - " + sql); + return false; + } + + // Put base table of window in ctx (for VDocAction) + Env.setContext(mWindowVO.ctx, mWindowVO.WindowNo, "BaseTable_ID", mWindowVO.AD_Table_ID); + return true; + } // createTabs + + + /************************************************************************** + * Private Constructor + * @param Ctx context + * @param windowNo window no + */ + private GridWindowVO (Properties Ctx, int windowNo) + { + ctx = Ctx; + WindowNo = windowNo; + } // MWindowVO + + static final long serialVersionUID = 3802628212531678981L; + + /** Properties */ + public Properties ctx; + /** Window Number */ + public int WindowNo; + + /** Window */ + public int AD_Window_ID = 0; + /** Name */ + public String Name = ""; + /** Desription */ + public String Description = ""; + /** Help */ + public String Help = ""; + /** Window Type */ + public String WindowType = ""; + /** Image */ + public int AD_Image_ID = 0; + /** Color */ + public int AD_Color_ID = 0; + /** Read Write */ + public String IsReadWrite = null; + /** Window Width */ + public int WinWidth = 0; + /** Window Height */ + public int WinHeight = 0; + /** Sales Order Trx */ + public boolean IsSOTrx = false; + + /** Tabs contains MTabVO elements */ + public ArrayList Tabs = null; + /** Base Table */ + public int AD_Table_ID = 0; + + /** Qyery */ + public static final String WINDOWTYPE_QUERY = "Q"; + /** Transaction */ + public static final String WINDOWTYPE_TRX = "T"; + /** Maintenance */ + public static final String WINDOWTYPE_MMAINTAIN = "M"; + + /** + * Set Context including contained elements + * @param newCtx context + */ + public void setCtx (Properties newCtx) + { + ctx = newCtx; + for (int i = 0; i < Tabs.size() ; i++) + { + GridTabVO tab = (GridTabVO)Tabs.get(i); + tab.setCtx(newCtx); + } + } // setCtx + + /** + * Clone + * @param windowNo no + * @return WindowVO + */ + public GridWindowVO clone (int windowNo) + { + GridWindowVO clone = null; + try + { + clone = new GridWindowVO(ctx, windowNo); + clone.AD_Window_ID = AD_Window_ID; + clone.Name = Name; + clone.Description = Description; + clone.Help = Help; + clone.WindowType = WindowType; + clone.AD_Image_ID = AD_Image_ID; + clone.AD_Color_ID = AD_Color_ID; + clone.IsReadWrite = IsReadWrite; + clone.WinWidth = WinWidth; + clone.WinHeight = WinHeight; + clone.IsSOTrx = IsSOTrx; + Env.setContext(ctx, windowNo, "IsSOTrx", clone.IsSOTrx); + clone.AD_Table_ID = AD_Table_ID; + Env.setContext(ctx, windowNo, "BaseTable_ID", clone.AD_Table_ID); + // + clone.Tabs = new ArrayList(); + for (int i = 0; i < Tabs.size(); i++) + { + GridTabVO tab = Tabs.get(i); + GridTabVO cloneTab = tab.clone(clone.ctx, windowNo); + if (cloneTab == null) + return null; + clone.Tabs.add(cloneTab); + } + } + catch (Exception e) + { + clone = null; + } + return clone; + } // clone + +} // MWindowVO + diff --git a/dbPort/src/org/compiere/model/Lookup.java b/dbPort/src/org/compiere/model/Lookup.java new file mode 100644 index 0000000000..3cf115c8a2 --- /dev/null +++ b/dbPort/src/org/compiere/model/Lookup.java @@ -0,0 +1,457 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.util.*; +import javax.swing.*; +import org.compiere.util.*; + +/** + * Base Class for MLookup, MLocator. + * as well as for MLocation, MAccount (only single value) + * Maintains selectable data as NamePairs in ArrayList + * The objects itself may be shared by the lookup implementation (ususally HashMap) + * + * @author Jorg Janke + * @version $Id: Lookup.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public abstract class Lookup extends AbstractListModel + implements MutableComboBoxModel, Serializable +{ + /** + * Lookup + * @param displayType display type + * @param windowNo window no + */ + public Lookup (int displayType, int windowNo) + { + m_displayType = displayType; + m_WindowNo = windowNo; + } // Lookup + + /** The Data List */ + protected volatile ArrayList p_data = new ArrayList(); + + /** The Selected Item */ + private volatile Object m_selectedObject; + + /** Temporary Data */ + private Object[] m_tempData = null; + + /** Logger */ + protected CLogger log = CLogger.getCLogger(getClass()); + + /** Display Type */ + private int m_displayType; + /** Window No */ + private int m_WindowNo; + + /** + * Get Display Type + * @return display type + */ + public int getDisplayType() + { + return m_displayType; + } // getDisplayType + + /** + * Get Window No + * @return Window No + */ + public int getWindowNo() + { + return m_WindowNo; + } // getWindowNo + + + /************************************************************************** + * Set the value of the selected item. The selected item may be null. + *

+ * @param anObject The combo box value or null for no selection. + */ + public void setSelectedItem(Object anObject) + { + if ((m_selectedObject != null && !m_selectedObject.equals( anObject )) + || m_selectedObject == null && anObject != null) + { + if (p_data.contains(anObject) || anObject == null) + { + m_selectedObject = anObject; + // Log.trace(s_ll, "Lookup.setSelectedItem", anObject); + } + else + { + m_selectedObject = null; + log.fine(getColumnName() + ": setSelectedItem - Set to NULL"); + } + // if (m_worker == null || !m_worker.isAlive()) + fireContentsChanged(this, -1, -1); + } + } // setSelectedItem + + /** + * Return previously selected Item + * @return value + */ + public Object getSelectedItem() + { + return m_selectedObject; + } // getSelectedItem + + /** + * Get Size of Model + * @return size + */ + public int getSize() + { + return p_data.size(); + } // getSize + + /** + * Get Element at Index + * @param index index + * @return value + */ + public Object getElementAt (int index) + { + return p_data.get(index); + } // getElementAt + + /** + * Returns the index-position of the specified object in the list. + * + * @param anObject object + * @return an int representing the index position, where 0 is + * the first position + */ + public int getIndexOf (Object anObject) + { + return p_data.indexOf(anObject); + } // getIndexOf + + /** + * Add Element at the end + * @param anObject object + */ + public void addElement (Object anObject) + { + p_data.add(anObject); + fireIntervalAdded (this, p_data.size()-1, p_data.size()-1); + if (p_data.size() == 1 && m_selectedObject == null && anObject != null) + setSelectedItem (anObject); + } // addElement + + /** + * Insert Element At + * @param anObject object + * @param index index + */ + public void insertElementAt (Object anObject, int index) + { + p_data.add (index, anObject); + fireIntervalAdded (this, index, index); + } // insertElementAt + + /** + * Remove Item at index + * @param index index + */ + public void removeElementAt (int index) + { + if (getElementAt(index) == m_selectedObject) + { + if (index == 0) + setSelectedItem (getSize() == 1 ? null : getElementAt( index + 1 )); + else + setSelectedItem (getElementAt (index - 1)); + } + p_data.remove(index); + fireIntervalRemoved (this, index, index); + } // removeElementAt + + /** + * Remove Item + * @param anObject object + */ + public void removeElement (Object anObject) + { + int index = p_data.indexOf (anObject); + if (index != -1) + removeElementAt(index); + } // removeItem + + /** + * Empties the list. + */ + public void removeAllElements() + { + if (p_data.size() > 0) + { + int firstIndex = 0; + int lastIndex = p_data.size() - 1; + p_data.clear(); + m_selectedObject = null; + fireIntervalRemoved (this, firstIndex, lastIndex); + } + } // removeAllElements + + + /************************************************************************** + * Put Value + * @param key key + * @param value value + */ + public void put (String key, String value) + { + NamePair pp = new ValueNamePair (key, value); + addElement(pp); + } // put + + /** + * Put Value + * @param key key + * @param value value + */ + public void put (int key, String value) + { + NamePair pp = new KeyNamePair (key, value); + addElement(pp); + } // put + + /** + * Fill ComboBox with lookup data (async using Worker). + * - try to maintain selected item + * @param mandatory has mandatory data only (i.e. no "null" selection) + * @param onlyValidated only validated + * @param onlyActive onlt active + * @param temporary save current values - restore via fillComboBox (true) + */ + public void fillComboBox (boolean mandatory, boolean onlyValidated, + boolean onlyActive, boolean temporary) + { + long startTime = System.currentTimeMillis(); + + // Save current data + if (temporary) + { + int size = p_data.size(); + m_tempData = new Object[size]; + // We need to do a deep copy, so store it in Array + p_data.toArray(m_tempData); + // for (int i = 0; i < size; i++) + // m_tempData[i] = p_data.get(i); + } + + + Object obj = m_selectedObject; + p_data.clear(); + + // may cause delay *** The Actual Work *** + p_data = getData (mandatory, onlyValidated, onlyActive, temporary); + + // Selected Object changed + if (obj != m_selectedObject) + { + log.finest(getColumnName() + ": SelectedValue Changed=" + obj + "->" + m_selectedObject); + obj = m_selectedObject; + } + + // if nothing selected & mandatory, select first + if (obj == null && mandatory && p_data.size() > 0) + { + obj = p_data.get(0); + m_selectedObject = obj; + log.finest(getColumnName() + ": SelectedValue SetToFirst=" + obj); + // fireContentsChanged(this, -1, -1); + } + fireContentsChanged(this, 0, p_data.size()); + if (p_data.size() == 0) + log.fine(getColumnName() + ": #0 - ms=" + + String.valueOf(System.currentTimeMillis()-startTime)); + else + log.fine(getColumnName() + ": #" + p_data.size() + " - ms=" + + String.valueOf(System.currentTimeMillis()-startTime)); + } // fillComboBox + + /** + * Fill ComboBox with old saved data (if exists) or all data available + * @param restore if true, use saved data - else fill it with all data + */ + public void fillComboBox (boolean restore) + { + if (restore && m_tempData != null) + { + Object obj = m_selectedObject; + p_data.clear(); + // restore old data + p_data = new ArrayList(m_tempData.length); + for (int i = 0; i < m_tempData.length; i++) + p_data.add(m_tempData[i]); + m_tempData = null; + + // if nothing selected, select first + if (obj == null && p_data.size() > 0) + obj = p_data.get(0); + setSelectedItem(obj); + fireContentsChanged(this, 0, p_data.size()); + return; + } + if (p_data != null) + fillComboBox(false, false, false, false); + } // fillComboBox + + + /************************************************************************** + * Get Display of Key Value + * @param key key + * @return String + */ + public abstract String getDisplay (Object key); + + /** + * Get Object of Key Value + * @param key key + * @return Object or null + */ + public abstract NamePair get (Object key); + + + /** + * Fill ComboBox with Data (Value/KeyNamePair) + * @param mandatory has mandatory data only (i.e. no "null" selection) + * @param onlyValidated only validated + * @param onlyActive only active + * @param temporary force load for temporary display + * @return ArrayList + */ + public abstract ArrayList getData (boolean mandatory, + boolean onlyValidated, boolean onlyActive, boolean temporary); + + /** + * Get underlying fully qualified Table.Column Name. + * Used for VLookup.actionButton (Zoom) + * @return column name + */ + public abstract String getColumnName(); + + /** + * The Lookup contains the key + * @param key key + * @return true if contains key + */ + public abstract boolean containsKey (Object key); + + + /************************************************************************** + * Refresh Values - default implementation + * @return size + */ + public int refresh() + { + return 0; + } // refresh + + /** + * Is Validated - default implementation + * @return true if validated + */ + public boolean isValidated() + { + return true; + } // isValidated + + /** + * Get dynamic Validation SQL (none) + * @return validation + */ + public String getValidation() + { + return ""; + } // getValidation + + /** + * Has Inactive records - default implementation + * @return true if inactive + */ + public boolean hasInactive() + { + return false; + } + + /** + * Get Zoom - default implementation + * @return Zoom AD_Window_ID + */ + public int getZoom() + { + return 0; + } // getZoom + + /** + * Get Zoom - default implementation + * @param query query + * @return Zoom Window - here 0 + */ + public int getZoom(MQuery query) + { + return 0; + } // getZoom + + /** + * Get Zoom Query String - default implementation + * @return Zoom Query + */ + public MQuery getZoomQuery() + { + return null; + } // getZoomQuery + + /** + * Get Data Direct from Table. + * Default implementation - does not requery + * @param key key + * @param saveInCache save in cache for r/w + * @param cacheLocal cache locally for r/o + * @return value + */ + public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) + { + return get (key); + } // getDirect + + /** + * Dispose - clear items w/o firing events + */ + public void dispose() + { + if (p_data != null) + p_data.clear(); + p_data = null; + m_selectedObject = null; + m_tempData = null; + } // dispose + + /** + * Wait until async Load Complete + */ + public void loadComplete() + { + } // loadComplete + +} // Lookup diff --git a/dbPort/src/org/compiere/model/LookupDisplayColumn.java b/dbPort/src/org/compiere/model/LookupDisplayColumn.java new file mode 100644 index 0000000000..c911914d55 --- /dev/null +++ b/dbPort/src/org/compiere/model/LookupDisplayColumn.java @@ -0,0 +1,72 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.Serializable; + + +/** + * Lookup Display Column Value Object + * + * @author Jorg Janke + * @version $Id: LookupDisplayColumn.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class LookupDisplayColumn implements Serializable +{ + /** + * Lookup Column Value Object + * @param columnName column name + * @param isTranslated translated + * @param ad_Reference_ID display type + * @param ad_Reference_Value_ID table/list reference id + */ + public LookupDisplayColumn(String columnName, boolean isTranslated, + int ad_Reference_ID, int ad_Reference_Value_ID) + { + ColumnName = columnName; + IsTranslated = isTranslated; + DisplayType = ad_Reference_ID; + AD_Reference_ID = ad_Reference_Value_ID; + } // + + /** Column Name */ + public String ColumnName; + /** Translated */ + public boolean IsTranslated; + /** Display Type */ + public int DisplayType; + /** Value Reference */ + public int AD_Reference_ID; + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("LookupDisplayColumn["); + sb.append("ColumnName=").append(ColumnName); + if (IsTranslated) + sb.append(",IsTranslated"); + sb.append(",DisplayType=").append(DisplayType); + if (AD_Reference_ID != 0) + sb.append(",AD_Reference_ID=").append(AD_Reference_ID); + sb.append("]"); + return sb.toString(); + } // toString + +} // LookupDisplayColumn diff --git a/dbPort/src/org/compiere/model/MAccessLog.java b/dbPort/src/org/compiere/model/MAccessLog.java new file mode 100644 index 0000000000..8142e358fe --- /dev/null +++ b/dbPort/src/org/compiere/model/MAccessLog.java @@ -0,0 +1,87 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + + +/** + * Access Log Model + * + * @author Jorg Janke + * @version $Id: MAccessLog.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MAccessLog extends X_AD_AccessLog +{ + + /** + * Standard Constructor + * @param ctx context + * @param AD_AccessLog_ID id + * @param trxName transaction + */ + public MAccessLog (Properties ctx, int AD_AccessLog_ID, String trxName) + { + super (ctx, AD_AccessLog_ID, trxName); + } // MAccessLog + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAccessLog (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAccessLog + + /** + * New Constructor + * @param ctx context + * @param Remote_Host host + * @param Remote_Addr address + * @param TextMsg text message + * @param trxName transaction + */ + public MAccessLog (Properties ctx, String Remote_Host, String Remote_Addr, + String TextMsg, String trxName) + { + this (ctx, 0, trxName); + setRemote_Addr(Remote_Addr); + setRemote_Host(Remote_Host); + setTextMsg(TextMsg); + } // MAccessLog + + /** + * New Constructor + * @param ctx context + * @param AD_Table_ID table + * @param AD_Column_ID column + * @param Record_ID record + * @param trxName transaction + */ + public MAccessLog (Properties ctx, int AD_Table_ID, int AD_Column_ID, int Record_ID, String trxName) + { + this (ctx, 0, trxName); + setAD_Table_ID(AD_Table_ID); + setAD_Column_ID(AD_Column_ID); + setRecord_ID(Record_ID); + } // MAccessLog + +} // MAccessLog diff --git a/dbPort/src/org/compiere/model/MAccount.java b/dbPort/src/org/compiere/model/MAccount.java new file mode 100644 index 0000000000..c2b5532dd0 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAccount.java @@ -0,0 +1,869 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Account Object Entity to maintain all segment values. + * C_ValidCombination + * + * @author Jorg Janke + * @version $Id: MAccount.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MAccount extends X_C_ValidCombination +{ + /** + * Get existing Account or create it + * @param ctx context + * @param AD_Client_ID + * @param AD_Org_ID + * @param C_AcctSchema_ID + * @param Account_ID + * @param C_SubAcct_ID + * @param M_Product_ID + * @param C_BPartner_ID + * @param AD_OrgTrx_ID + * @param C_LocFrom_ID + * @param C_LocTo_ID + * @param C_SalesRegion_ID + * @param C_Project_ID + * @param C_Campaign_ID + * @param C_Activity_ID + * @param User1_ID + * @param User2_ID + * @param UserElement1_ID + * @param UserElement2_ID + * @return account or null + */ + public static MAccount get (Properties ctx, + int AD_Client_ID, int AD_Org_ID, int C_AcctSchema_ID, + int Account_ID, int C_SubAcct_ID, + int M_Product_ID, int C_BPartner_ID, int AD_OrgTrx_ID, + int C_LocFrom_ID, int C_LocTo_ID, int C_SalesRegion_ID, + int C_Project_ID, int C_Campaign_ID, int C_Activity_ID, + int User1_ID, int User2_ID, int UserElement1_ID, int UserElement2_ID) + { + MAccount existingAccount = null; + // + StringBuffer info = new StringBuffer(); + StringBuffer sql = new StringBuffer("SELECT * FROM C_ValidCombination " + // Mandatory fields + + "WHERE AD_Client_ID=?" // #1 + + " AND AD_Org_ID=?" + + " AND C_AcctSchema_ID=?" + + " AND Account_ID=?"); // #4 + // Optional fields + if (C_SubAcct_ID == 0) + sql.append(" AND C_SubAcct_ID IS NULL"); + else + sql.append(" AND C_SubAcct_ID=?"); + if (M_Product_ID == 0) + sql.append(" AND M_Product_ID IS NULL"); + else + sql.append(" AND M_Product_ID=?"); + if (C_BPartner_ID == 0) + sql.append(" AND C_BPartner_ID IS NULL"); + else + sql.append(" AND C_BPartner_ID=?"); + if (AD_OrgTrx_ID == 0) + sql.append(" AND AD_OrgTrx_ID IS NULL"); + else + sql.append(" AND AD_OrgTrx_ID=?"); + if (C_LocFrom_ID == 0) + sql.append(" AND C_LocFrom_ID IS NULL"); + else + sql.append(" AND C_LocFrom_ID=?"); + if (C_LocTo_ID == 0) + sql.append(" AND C_LocTo_ID IS NULL"); + else + sql.append(" AND C_LocTo_ID=?"); + if (C_SalesRegion_ID == 0) + sql.append(" AND C_SalesRegion_ID IS NULL"); + else + sql.append(" AND C_SalesRegion_ID=?"); + if (C_Project_ID == 0) + sql.append(" AND C_Project_ID IS NULL"); + else + sql.append(" AND C_Project_ID=?"); + if (C_Campaign_ID == 0) + sql.append(" AND C_Campaign_ID IS NULL"); + else + sql.append(" AND C_Campaign_ID=?"); + if (C_Activity_ID == 0) + sql.append(" AND C_Activity_ID IS NULL"); + else + sql.append(" AND C_Activity_ID=?"); + if (User1_ID == 0) + sql.append(" AND User1_ID IS NULL"); + else + sql.append(" AND User1_ID=?"); + if (User2_ID == 0) + sql.append(" AND User2_ID IS NULL"); + else + sql.append(" AND User2_ID=?"); + if (UserElement1_ID == 0) + sql.append(" AND UserElement1_ID IS NULL"); + else + sql.append(" AND UserElement1_ID=?"); + if (UserElement2_ID == 0) + sql.append(" AND UserElement2_ID IS NULL"); + else + sql.append(" AND UserElement2_ID=?"); + sql.append(" AND IsActive='Y'"); + // sql.append(" ORDER BY IsFullyQualified DESC"); + try + { + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + // -- Mandatory Accounting fields + int index = 1; + pstmt.setInt(index++, AD_Client_ID); + pstmt.setInt(index++, AD_Org_ID); + info.append("AD_Client_ID=").append(AD_Client_ID).append(",AD_Org_ID=").append(AD_Org_ID); + // Schema + pstmt.setInt(index++, C_AcctSchema_ID); + info.append(",C_AcctSchema_ID=").append(C_AcctSchema_ID); + // Account + pstmt.setInt(index++, Account_ID); + info.append(",Account_ID=").append(Account_ID).append(" "); + + // -- Optional Accounting fields + if (C_SubAcct_ID != 0) + pstmt.setInt(index++, C_SubAcct_ID); + if (M_Product_ID != 0) + pstmt.setInt(index++, M_Product_ID); + if (C_BPartner_ID != 0) + pstmt.setInt(index++, C_BPartner_ID); + if (AD_OrgTrx_ID != 0) + pstmt.setInt(index++, AD_OrgTrx_ID); + if (C_LocFrom_ID != 0) + pstmt.setInt(index++, C_LocFrom_ID); + if (C_LocTo_ID != 0) + pstmt.setInt(index++, C_LocTo_ID); + if (C_SalesRegion_ID != 0) + pstmt.setInt(index++, C_SalesRegion_ID); + if (C_Project_ID != 0) + pstmt.setInt(index++, C_Project_ID); + if (C_Campaign_ID != 0) + pstmt.setInt(index++, C_Campaign_ID); + if (C_Activity_ID != 0) + pstmt.setInt(index++, C_Activity_ID); + if (User1_ID != 0) + pstmt.setInt(index++, User1_ID); + if (User2_ID != 0) + pstmt.setInt(index++, User2_ID); + if (UserElement1_ID != 0) + pstmt.setInt(index++, UserElement1_ID); + if (UserElement2_ID != 0) + pstmt.setInt(index++, UserElement2_ID); + // + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + existingAccount = new MAccount (ctx, rs, null); + rs.close(); + pstmt.close(); + } + catch(SQLException e) + { + s_log.log(Level.SEVERE, info + "\n" + sql, e); + } + // Existing + if (existingAccount != null) + return existingAccount; + + // New + MAccount newAccount = new MAccount (ctx, 0, null); + newAccount.setClientOrg(AD_Client_ID, AD_Org_ID); + newAccount.setC_AcctSchema_ID(C_AcctSchema_ID); + newAccount.setAccount_ID(Account_ID); + // -- Optional Accounting fields + newAccount.setC_SubAcct_ID(C_SubAcct_ID); + newAccount.setM_Product_ID(M_Product_ID); + newAccount.setC_BPartner_ID(C_BPartner_ID); + newAccount.setAD_OrgTrx_ID(AD_OrgTrx_ID); + newAccount.setC_LocFrom_ID(C_LocFrom_ID); + newAccount.setC_LocTo_ID(C_LocTo_ID); + newAccount.setC_SalesRegion_ID(C_SalesRegion_ID); + newAccount.setC_Project_ID(C_Project_ID); + newAccount.setC_Campaign_ID(C_Campaign_ID); + newAccount.setC_Activity_ID(C_Activity_ID); + newAccount.setUser1_ID(User1_ID); + newAccount.setUser2_ID(User2_ID); + newAccount.setUserElement1_ID(UserElement1_ID); + newAccount.setUserElement2_ID(UserElement2_ID); + // + if (!newAccount.save()) + { + s_log.log(Level.SEVERE, "Could not create new account - " + info); + return null; + } + s_log.fine("New: " + newAccount); + return newAccount; + } // get + + /** + * Get first with Alias + * @param ctx context + * @param C_AcctSchema_ID as + * @param alias alias + * @return account + */ + public static MAccount get (Properties ctx, int C_AcctSchema_ID, String alias) + { + MAccount retValue = null; + String sql = "SELECT * FROM C_ValidCombination WHERE C_AcctSchema_ID=? AND Alias=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt(1, C_AcctSchema_ID); + pstmt.setString (2, alias); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MAccount (ctx, rs, null); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** + * Get from existing Accounting fact + * @param fa accounting fact + * @return account + */ + public static MAccount get (X_Fact_Acct fa) + { + MAccount acct = get (fa.getCtx(), + fa.getAD_Client_ID(), fa.getAD_Org_ID(), fa.getC_AcctSchema_ID(), + fa.getAccount_ID(), fa.getC_SubAcct_ID(), + fa.getM_Product_ID(), fa.getC_BPartner_ID(), fa.getAD_OrgTrx_ID(), + fa.getC_LocFrom_ID(), fa.getC_LocTo_ID(), fa.getC_SalesRegion_ID(), + fa.getC_Project_ID(), fa.getC_Campaign_ID(), fa.getC_Activity_ID(), + fa.getUser1_ID(), fa.getUser2_ID(), fa.getUserElement1_ID(), fa.getUserElement2_ID()); + return acct; + } // get + + /************************************************************************** + * Factory: default combination + * @param ctx context + * @param C_AcctSchema_ID accounting schema + * @param optionalNull if true the optional values are null + * @param trxName transaction + * @return Account + */ + public static MAccount getDefault (Properties ctx, int C_AcctSchema_ID, + boolean optionalNull, String trxName) + { + MAcctSchema acctSchema = new MAcctSchema (ctx, C_AcctSchema_ID, trxName); + return getDefault (acctSchema, optionalNull); + } // getDefault + + /** + * Factory: default combination + * @param acctSchema accounting schema + * @param optionalNull if true, the optional values are null + * @return Account + */ + public static MAccount getDefault (MAcctSchema acctSchema, boolean optionalNull) + { + MAccount vc = new MAccount(acctSchema); + // Active Elements + MAcctSchemaElement[] elements = acctSchema.getAcctSchemaElements(); + for (int i = 0; i < elements.length; i++) + { + MAcctSchemaElement ase = elements[i]; + String elementType = ase.getElementType(); + int defaultValue = ase.getDefaultValue(); + boolean setValue = ase.isMandatory() || (!ase.isMandatory() && !optionalNull); + // + if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Organization)) + vc.setAD_Org_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Account)) + vc.setAccount_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_SubAccount) && setValue) + vc.setC_SubAcct_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_BPartner) && setValue) + vc.setC_BPartner_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Product) && setValue) + vc.setM_Product_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Activity) && setValue) + vc.setC_Activity_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_LocationFrom) && setValue) + vc.setC_LocFrom_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_LocationTo) && setValue) + vc.setC_LocTo_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Campaign) && setValue) + vc.setC_Campaign_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_OrgTrx) && setValue) + vc.setAD_OrgTrx_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_Project) && setValue) + vc.setC_Project_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_SalesRegion) && setValue) + vc.setC_SalesRegion_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_UserList1) && setValue) + vc.setUser1_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_UserList2) && setValue) + vc.setUser2_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_UserElement1) && setValue) + vc.setUserElement1_ID(defaultValue); + else if (elementType.equals(MAcctSchemaElement.ELEMENTTYPE_UserElement2) && setValue) + vc.setUserElement2_ID(defaultValue); + } + s_log.fine("Client_ID=" + + vc.getAD_Client_ID() + ", Org_ID=" + vc.getAD_Org_ID() + + " - AcctSchema_ID=" + vc.getC_AcctSchema_ID() + ", Account_ID=" + vc.getAccount_ID()); + return vc; + } // getDefault + + + /** + * Get Account + * @param ctx context + * @param C_ValidCombination_ID combination + * @return Account + */ + public static MAccount get (Properties ctx, int C_ValidCombination_ID) + { + // Maybe later cache + return new MAccount(ctx, C_ValidCombination_ID, null); + } // getAccount + + /** + * Update Value/Description after change of + * account element value/description. + * @param ctx context + * @param where where clause + * @param trxName transaction + */ + public static void updateValueDescription (Properties ctx, String where, String trxName) + { + String sql = "SELECT * FROM C_ValidCombination"; + if (where != null && where.length() > 0) + sql += " WHERE " + where; + sql += " ORDER BY C_ValidCombination_ID"; + int count = 0; + int errors = 0; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + MAccount account = new MAccount (ctx, rs, trxName); + account.setValueDescription(); + if (account.save()) + count++; + else + errors++; + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + s_log.info(where + " #" + count + ", Errors=" + errors); + } // updateValueDescription + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MAccount.class); + + + + /************************************************************************** + * Default constructor + * @param ctx context + * @param C_ValidCombination_ID combination + * @param trxName transaction + */ + public MAccount (Properties ctx, int C_ValidCombination_ID, String trxName) + { + super (ctx, C_ValidCombination_ID, trxName); + if (C_ValidCombination_ID == 0) + { + // setAccount_ID (0); + // setC_AcctSchema_ID (0); + setIsFullyQualified (false); + } + } // MAccount + + /** + * Load constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAccount (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAccount + + /** + * Parent Constructor + * @param as account schema + */ + public MAccount (MAcctSchema as) + { + this (as.getCtx(), 0, as.get_TrxName()); + setClientOrg(as); + setC_AcctSchema_ID(as.getC_AcctSchema_ID()); + } // Account + + /** Account Segment */ + private MElementValue m_accountEV = null; + + + /************************************************************************** + * Return String representation + * @return String + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MAccount=["); + sb.append(getC_ValidCombination_ID()); + if (getCombination() != null) + sb.append(",") + .append(getCombination()); + else + { + // .append(",Client=").append(getAD_Client_ID()) + sb.append(",Schema=").append(getC_AcctSchema_ID()) + .append(",Org=").append(getAD_Org_ID()) + .append(",Acct=").append(getAccount_ID()) + .append(" "); + if (getC_SubAcct_ID() != 0) + sb.append(",C_SubAcct_ID=").append(getC_SubAcct_ID()); + if (getM_Product_ID() != 0) + sb.append(",M_Product_ID=").append(getM_Product_ID()); + if (getC_BPartner_ID() != 0) + sb.append(",C_BPartner_ID=").append(getC_BPartner_ID()); + if (getAD_OrgTrx_ID() != 0) + sb.append(",AD_OrgTrx_ID=").append(getAD_OrgTrx_ID()); + if (getC_LocFrom_ID() != 0) + sb.append(",C_LocFrom_ID=").append(getC_LocFrom_ID()); + if (getC_LocTo_ID() != 0) + sb.append(",C_LocTo_ID=").append(getC_LocTo_ID()); + if (getC_SalesRegion_ID() != 0) + sb.append(",C_SalesRegion_ID=").append(getC_SalesRegion_ID()); + if (getC_Project_ID() != 0) + sb.append(",C_Project_ID=").append(getC_Project_ID()); + if (getC_Campaign_ID() != 0) + sb.append(",C_Campaign_ID=").append(getC_Campaign_ID()); + if (getC_Activity_ID() != 0) + sb.append(",C_Activity_ID=").append(getC_Activity_ID()); + if (getUser1_ID() != 0) + sb.append(",User1_ID=").append(getUser1_ID()); + if (getUser2_ID() != 0) + sb.append(",User2_ID=").append(getUser2_ID()); + if (getUserElement1_ID() != 0) + sb.append(",UserElement1_ID=").append(getUserElement1_ID()); + if (getUserElement2_ID() != 0) + sb.append(",UserElement2_ID=").append(getUserElement2_ID()); + } + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Set Account_ID + * @param Account_ID id + */ + public void setAccount_ID (int Account_ID) + { + m_accountEV = null; // reset + super.setAccount_ID(Account_ID); + } // setAccount + + /** + * Set Account_ID + * @return element value + */ + public MElementValue getAccount () + { + if (m_accountEV == null) + { + if (getAccount_ID() != 0) + m_accountEV = new MElementValue(getCtx(), getAccount_ID(), get_TrxName()); + } + return m_accountEV; + } // setAccount + + + /** + * Get Account Type + * @return Account Type of Account Element + */ + public String getAccountType() + { + if (m_accountEV == null) + getAccount(); + if (m_accountEV == null) + { + log.log(Level.SEVERE, "No ElementValue for Account_ID=" + getAccount_ID()); + return ""; + } + return m_accountEV.getAccountType(); + } // getAccountType + + /** + * Is this a Balance Sheet Account + * @return boolean + */ + public boolean isBalanceSheet() + { + String accountType = getAccountType(); + return (MElementValue.ACCOUNTTYPE_Asset.equals(accountType) + || MElementValue.ACCOUNTTYPE_Liability.equals(accountType) + || MElementValue.ACCOUNTTYPE_OwnerSEquity.equals(accountType)); + } // isBalanceSheet + + /** + * Is this an Activa Account + * @return boolean + */ + public boolean isActiva() + { + return MElementValue.ACCOUNTTYPE_Asset.equals(getAccountType()); + } // isActive + + /** + * Is this a Passiva Account + * @return boolean + */ + public boolean isPassiva() + { + String accountType = getAccountType(); + return (MElementValue.ACCOUNTTYPE_Liability.equals(accountType) + || MElementValue.ACCOUNTTYPE_OwnerSEquity.equals(accountType)); + } // isPassiva + + /** + * Set Value and Description and Fully Qualified Flag for Combination + */ + public void setValueDescription() + { + StringBuffer combi = new StringBuffer(); + StringBuffer descr = new StringBuffer(); + boolean fullyQualified = true; + // + MAcctSchema as = new MAcctSchema(getCtx(), getC_AcctSchema_ID(), get_TrxName()); // In Trx! + MAcctSchemaElement[] elements = MAcctSchemaElement.getAcctSchemaElements(as); + for (int i = 0; i < elements.length; i++) + { + if (i > 0) + { + combi.append(as.getSeparator()); + descr.append(as.getSeparator()); + } + MAcctSchemaElement element = elements[i]; + String combiStr = "_"; // not defined + String descrStr = "_"; + + if (MAcctSchemaElement.ELEMENTTYPE_Organization.equals(element.getElementType())) + { + if (getAD_Org_ID() != 0) + { + MOrg org = new MOrg(getCtx(), getAD_Org_ID(), get_TrxName()); // in Trx! + combiStr = org.getValue(); + descrStr = org.getName(); + } + else + { + combiStr = "*"; + descrStr = "*"; + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_Account.equals(element.getElementType())) + { + if (getAccount_ID() != 0) + { + if (m_accountEV == null) + m_accountEV = new MElementValue(getCtx(), getAccount_ID(), get_TrxName()); + combiStr = m_accountEV.getValue(); + descrStr = m_accountEV.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Account"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_SubAccount.equals(element.getElementType())) + { + if (getC_SubAcct_ID() != 0) + { + X_C_SubAcct sa = new X_C_SubAcct(getCtx(), getC_SubAcct_ID(), get_TrxName()); + combiStr = sa.getValue(); + descrStr = sa.getName(); + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_Product.equals(element.getElementType())) + { + if (getM_Product_ID() != 0) + { + X_M_Product product = new X_M_Product (getCtx(), getM_Product_ID(), get_TrxName()); + combiStr = product.getValue(); + descrStr = product.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Product"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_BPartner.equals(element.getElementType())) + { + if (getC_BPartner_ID() != 0) + { + X_C_BPartner partner = new X_C_BPartner (getCtx(), getC_BPartner_ID(),get_TrxName()); + combiStr = partner.getValue(); + descrStr = partner.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Business Partner"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_OrgTrx.equals(element.getElementType())) + { + if (getAD_OrgTrx_ID() != 0) + { + MOrg org = new MOrg(getCtx(), getAD_OrgTrx_ID(), get_TrxName()); // in Trx! + combiStr = org.getValue(); + descrStr = org.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Trx Org"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_LocationFrom.equals(element.getElementType())) + { + if (getC_LocFrom_ID() != 0) + { + MLocation loc = new MLocation(getCtx(), getC_LocFrom_ID(), get_TrxName()); // in Trx! + combiStr = loc.getPostal(); + descrStr = loc.getCity(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Location From"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_LocationTo.equals(element.getElementType())) + { + if (getC_LocTo_ID() != 0) + { + MLocation loc = new MLocation(getCtx(), getC_LocFrom_ID(), get_TrxName()); // in Trx! + combiStr = loc.getPostal(); + descrStr = loc.getCity(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Location To"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_SalesRegion.equals(element.getElementType())) + { + if (getC_SalesRegion_ID() != 0) + { + MSalesRegion loc = new MSalesRegion(getCtx(), getC_SalesRegion_ID(), get_TrxName()); + combiStr = loc.getValue(); + descrStr = loc.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: SalesRegion"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_Project.equals(element.getElementType())) + { + if (getC_Project_ID() != 0) + { + X_C_Project project = new X_C_Project (getCtx(), getC_Project_ID(), get_TrxName()); + combiStr = project.getValue(); + descrStr = project.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Project"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_Campaign.equals(element.getElementType())) + { + if (getC_Campaign_ID() != 0) + { + X_C_Campaign campaign = new X_C_Campaign (getCtx(), getC_Campaign_ID(), get_TrxName()); + combiStr = campaign.getValue(); + descrStr = campaign.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Campaign"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_Activity.equals(element.getElementType())) + { + if (getC_Activity_ID() != 0) + { + X_C_Activity act = new X_C_Activity (getCtx(), getC_Activity_ID(), get_TrxName()); + combiStr = act.getValue(); + descrStr = act.getName(); + } + else if (element.isMandatory()) + { + log.warning("Mandatory Element missing: Campaign"); + fullyQualified = false; + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_UserList1.equals(element.getElementType())) + { + if (getUser1_ID() != 0) + { + MElementValue ev = new MElementValue(getCtx(), getUser1_ID(), get_TrxName()); + combiStr = ev.getValue(); + descrStr = ev.getName(); + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_UserList2.equals(element.getElementType())) + { + if (getUser2_ID() != 0) + { + MElementValue ev = new MElementValue(getCtx(), getUser2_ID(), get_TrxName()); + combiStr = ev.getValue(); + descrStr = ev.getName(); + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_UserElement1.equals(element.getElementType())) + { + if (getUserElement1_ID() != 0) + { + } + } + else if (MAcctSchemaElement.ELEMENTTYPE_UserElement2.equals(element.getElementType())) + { + if (getUserElement2_ID() != 0) + { + } + } + combi.append(combiStr); + descr.append(descrStr); + } + // Set Values + super.setCombination(combi.toString()); + super.setDescription(descr.toString()); + if (fullyQualified != isFullyQualified()) + setIsFullyQualified(fullyQualified); + log.fine("Combination=" + getCombination() + + " - " + getDescription() + + " - FullyQualified=" + fullyQualified); + } // setValueDescription + + /** + * Validate combination + * @return true if valid + */ + public boolean validate() + { + boolean ok = true; + // Validate Sub-Account + if (getC_SubAcct_ID() != 0) + { + X_C_SubAcct sa = new X_C_SubAcct(getCtx(), getC_SubAcct_ID(), get_TrxName()); + if (sa.getC_ElementValue_ID() != getAccount_ID()) + { + log.saveError("Error", "C_SubAcct.C_ElementValue_ID=" + sa.getC_ElementValue_ID() + + "<>Account_ID=" + getAccount_ID()); + ok = false; + } + } + return ok; + } // validate + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + setValueDescription(); + return validate(); + } // beforeSave + + + /** + * Test + * @param args + */ + public static void main (String[] args) + { + org.compiere.Adempiere.startup(true); + MAccount acct = get (Env.getCtx(), 11, 11, 101, 600, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + System.out.println(acct); + System.out.println(acct.get_xmlString(new StringBuffer ("xxxx"))); + + // + MAccount acct2 = get (Env.getCtx(), 11, 12, 101, 600, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + System.out.println(acct2); + + } // main + +} // Account + diff --git a/dbPort/src/org/compiere/model/MAccountLookup.java b/dbPort/src/org/compiere/model/MAccountLookup.java new file mode 100644 index 0000000000..5f35eec031 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAccountLookup.java @@ -0,0 +1,209 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Account Model Lookup - Maintains ValidCombination Info for Display & Edit - not cached + * + * @author Jorg Janke + * @version $Id: MAccountLookup.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public final class MAccountLookup extends Lookup implements Serializable +{ + /** + * Constructor + * @param ctx context + * @param WindowNo window no + */ + public MAccountLookup (Properties ctx, int WindowNo) + { + super (DisplayType.TableDir, WindowNo); + m_ctx = ctx; + } // MAccountLookup + + /** Context */ + private Properties m_ctx; + /** Account_ID */ + public int C_ValidCombination_ID; + private String Combination; + private String Description; + + /** + * Get Display for Value + * @param value value + * @return String + */ + public String getDisplay (Object value) + { + if (!containsKey (value)) + return "<" + value.toString() + ">"; + return toString(); + } // getDisplay + + /** + * Get Object of Key Value + * @param value value + * @return Object or null + */ + public NamePair get (Object value) + { + if (value == null) + return null; + if (!containsKey (value)) + return null; + return new KeyNamePair (C_ValidCombination_ID, toString()); + } // get + + /** + * The Lookup contains the key + * @param key key + * @return true if exists + */ + public boolean containsKey (Object key) + { + int intValue = 0; + if (key instanceof Integer) + intValue = ((Integer)key).intValue(); + else if (key != null) + intValue = Integer.parseInt(key.toString()); + // + return load (intValue); + } // containsKey + + /** + * Get Description + * @return Description + */ + public String getDescription() + { + return Description; + } // getDescription + + /** + * Return String representation + * @return Combination + */ + public String toString() + { + if (C_ValidCombination_ID == 0) + return ""; + return Combination; + } // toString + + /** + * Load C_ValidCombination with ID + * @param ID C_ValidCombination_ID + * @return true if found + */ + public boolean load (int ID) + { + if (ID == 0) // new + { + C_ValidCombination_ID = 0; + Combination = ""; + Description = ""; + return true; + } + if (ID == C_ValidCombination_ID) // already loaded + return true; + + String SQL = "SELECT C_ValidCombination_ID, Combination, Description " + + "FROM C_ValidCombination WHERE C_ValidCombination_ID=?"; + try + { + // Prepare Statement + PreparedStatement pstmt = DB.prepareStatement(SQL, null); + pstmt.setInt(1, ID); + ResultSet rs = pstmt.executeQuery(); + if (!rs.next()) + { + rs.close(); + pstmt.close(); + return false; + } + // + C_ValidCombination_ID = rs.getInt(1); + Combination = rs.getString(2); + Description = rs.getString(3); + // + rs.close(); + pstmt.close(); + + } + catch (SQLException e) + { + return false; + } + return true; + } // load + + /** + * Get underlying fully qualified Table.Column Name + * @return "" + */ + public String getColumnName() + { + return ""; + } // getColumnName + + /** + * Return data as sorted Array. + * Used in Web Interface + * @param mandatory mandatory + * @param onlyValidated only valid + * @param onlyActive only active + * @param temporary force load for temporary display + * @return ArrayList with KeyNamePair + */ + public ArrayList getData (boolean mandatory, boolean onlyValidated, + boolean onlyActive, boolean temporary) + { + ArrayList list = new ArrayList(); + if (!mandatory) + list.add(new KeyNamePair (-1, "")); + // + StringBuffer sql = new StringBuffer ("SELECT C_ValidCombination_ID, Combination, Description " + + "FROM C_ValidCombination WHERE AD_Client_ID=?"); + if (onlyActive) + sql.append(" AND IsActive='Y'"); + sql.append(" ORDER BY 2"); + try + { + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, Env.getAD_Client_ID(m_ctx)); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add (new KeyNamePair(rs.getInt(1), rs.getString(2) + " - " + rs.getString(3))); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql.toString(), e); + } + + // Sort & return + return list; + } // getData + +} // MAccountLookup diff --git a/dbPort/src/org/compiere/model/MAcctSchema.java b/dbPort/src/org/compiere/model/MAcctSchema.java new file mode 100644 index 0000000000..5949783a4a --- /dev/null +++ b/dbPort/src/org/compiere/model/MAcctSchema.java @@ -0,0 +1,605 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Accounting Schema Model (base) + * + * @author Jorg Janke + * @version $Id: MAcctSchema.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MAcctSchema extends X_C_AcctSchema +{ + /** + * Get AccountSchema of Client + * @param ctx context + * @param C_AcctSchema_ID schema id + * @return Accounting schema + */ + public static MAcctSchema get (Properties ctx, int C_AcctSchema_ID) + { + return get(ctx, C_AcctSchema_ID, null); + } // get + + /** + * Get AccountSchema of Client + * @param ctx context + * @param C_AcctSchema_ID schema id + * @param trxName optional trx + * @return Accounting schema + */ + public static MAcctSchema get (Properties ctx, int C_AcctSchema_ID, String trxName) + { + // Check Cache + Integer key = new Integer(C_AcctSchema_ID); + MAcctSchema retValue = (MAcctSchema)s_cache.get(key); + if (retValue != null) + return retValue; + retValue = new MAcctSchema (ctx, C_AcctSchema_ID, trxName); + if (trxName == null) + s_cache.put(key, retValue); + return retValue; + } // get + + /** + * Get AccountSchema of Client + * @param ctx context + * @param AD_Client_ID client or 0 for all + * @return Array of AcctSchema of Client + */ + public static MAcctSchema[] getClientAcctSchema (Properties ctx, int AD_Client_ID) + { + return getClientAcctSchema(ctx, AD_Client_ID, null); + } // getClientAcctSchema + + /** + * Get AccountSchema of Client + * @param ctx context + * @param AD_Client_ID client or 0 for all + * @param trxName optional trx + * @return Array of AcctSchema of Client + */ + public static MAcctSchema[] getClientAcctSchema (Properties ctx, int AD_Client_ID, String trxName) + { + // Check Cache + Integer key = new Integer(AD_Client_ID); + if (s_schema.containsKey(key)) + return (MAcctSchema[])s_schema.get(key); + + // Create New + ArrayList list = new ArrayList(); + MClientInfo info = MClientInfo.get(ctx, AD_Client_ID, trxName); + MAcctSchema as = MAcctSchema.get (ctx, info.getC_AcctSchema1_ID(), trxName); + if (as.get_ID() != 0 && trxName == null) + list.add(as); + + // Other + String sql = "SELECT C_AcctSchema_ID FROM C_AcctSchema acs " + + "WHERE IsActive='Y'" + + " AND EXISTS (SELECT * FROM C_AcctSchema_GL gl WHERE acs.C_AcctSchema_ID=gl.C_AcctSchema_ID)" + + " AND EXISTS (SELECT * FROM C_AcctSchema_Default d WHERE acs.C_AcctSchema_ID=d.C_AcctSchema_ID)"; + if (AD_Client_ID != 0) + sql += " AND AD_Client_ID=?"; + sql += " ORDER BY C_AcctSchema_ID"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, trxName); + if (AD_Client_ID != 0) + pstmt.setInt(1, AD_Client_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + int id = rs.getInt(1); + if (id != info.getC_AcctSchema1_ID()) // already in list + { + as = MAcctSchema.get (ctx, id, trxName); + if (as.get_ID() != 0 && trxName == null) + list.add(as); + } + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + } + // Save + MAcctSchema[] retValue = new MAcctSchema [list.size()]; + list.toArray(retValue); + if (trxName == null) + s_schema.put(key, retValue); + return retValue; + } // getClientAcctSchema + + /** Cache of Client AcctSchema Arrays **/ + private static CCache s_schema = new CCache("AD_ClientInfo", 3); // 3 clients + /** Cache of AcctSchemas **/ + private static CCache s_cache = new CCache("C_AcctSchema", 3); // 3 accounting schemas + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MAcctSchema.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_AcctSchema_ID id + * @param trxName transaction + */ + public MAcctSchema (Properties ctx, int C_AcctSchema_ID, String trxName) + { + super (ctx, C_AcctSchema_ID, trxName); + if (C_AcctSchema_ID == 0) + { + // setC_Currency_ID (0); + // setName (null); + setAutoPeriodControl (true); + setPeriod_OpenFuture(2); + setPeriod_OpenHistory(2); + setCostingMethod (COSTINGMETHOD_StandardCosting); + setCostingLevel(COSTINGLEVEL_Client); + setIsAdjustCOGS(false); + setGAAP (GAAP_InternationalGAAP); + setHasAlias (true); + setHasCombination (false); + setIsAccrual (true); // Y + setCommitmentType(COMMITMENTTYPE_None); + setIsDiscountCorrectsTax (false); + setTaxCorrectionType(TAXCORRECTIONTYPE_None); + setIsTradeDiscountPosted (false); + setIsPostServices(false); + setIsExplicitCostAdjustment(false); + setSeparator ("-"); // - + } + } // MAcctSchema + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAcctSchema (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAcctSchema + + /** + * Parent Constructor + * @param client client + * @param currency currency + */ + public MAcctSchema (MClient client, KeyNamePair currency) + { + this (client.getCtx(), 0, client.get_TrxName()); + setClientOrg(client); + setC_Currency_ID (currency.getKey()); + setName (client.getName() + " " + getGAAP() + "/" + get_ColumnCount() + " " + currency.getName()); + } // MAcctSchema + + + /** Element List */ + private MAcctSchemaElement[] m_elements = null; + /** GL Info */ + private MAcctSchemaGL m_gl = null; + /** Default Info */ + private MAcctSchemaDefault m_default = null; + + private MAccount m_SuspenseError_Acct = null; + private MAccount m_CurrencyBalancing_Acct = null; + private MAccount m_DueTo_Acct = null; + private MAccount m_DueFrom_Acct = null; + /** Accounting Currency Precision */ + private int m_stdPrecision = -1; + /** Costing Currency Precision */ + private int m_costPrecision = -1; + + /** Only Post Org */ + private MOrg m_onlyOrg = null; + /** Only Post Org Childs */ + private Integer[] m_onlyOrgs = null; + + /************************************************************************** + * AcctSchema Elements + * @return ArrayList of AcctSchemaElement + */ + public MAcctSchemaElement[] getAcctSchemaElements() + { + if (m_elements == null) + m_elements = MAcctSchemaElement.getAcctSchemaElements(this); + return m_elements; + } // getAcctSchemaElements + + /** + * Get AcctSchema Element + * @param elementType segment type - AcctSchemaElement.ELEMENTTYPE_ + * @return AcctSchemaElement + */ + public MAcctSchemaElement getAcctSchemaElement (String elementType) + { + if (m_elements == null) + getAcctSchemaElements(); + for (int i = 0; i < m_elements.length; i++) + { + MAcctSchemaElement ase = m_elements[i]; + if (ase.getElementType().equals(elementType)) + return ase; + } + return null; + } // getAcctSchemaElement + + /** + * Has AcctSchema Element + * @param segmentType segment type - AcctSchemaElement.SEGMENT_ + * @return true if schema has segment type + */ + public boolean isAcctSchemaElement (String segmentType) + { + return getAcctSchemaElement(segmentType) != null; + } // isAcctSchemaElement + + /** + * Get AcctSchema GL info + * @return GL info + */ + public MAcctSchemaGL getAcctSchemaGL() + { + if (m_gl == null) + m_gl = MAcctSchemaGL.get(getCtx(), getC_AcctSchema_ID()); + if (m_gl == null) + throw new IllegalStateException("No GL Definition for C_AcctSchema_ID=" + getC_AcctSchema_ID()); + return m_gl; + } // getAcctSchemaGL + + /** + * Get AcctSchema Defaults + * @return defaults + */ + public MAcctSchemaDefault getAcctSchemaDefault() + { + if (m_default == null) + m_default = MAcctSchemaDefault.get(getCtx(), getC_AcctSchema_ID()); + if (m_default == null) + throw new IllegalStateException("No Default Definition for C_AcctSchema_ID=" + getC_AcctSchema_ID()); + return m_default; + } // getAcctSchemaDefault + + /** + * String representation + * @return String rep + */ + public String toString() + { + StringBuffer sb = new StringBuffer("AcctSchema["); + sb.append(get_ID()).append("-").append(getName()) + .append("]"); + return sb.toString(); + } // toString + + /** + * Is Suspense Balancing active + * @return suspense balancing + */ + public boolean isSuspenseBalancing() + { + if (m_gl == null) + getAcctSchemaGL(); + return m_gl.isUseSuspenseBalancing() && m_gl.getSuspenseBalancing_Acct() != 0; + } // isSuspenseBalancing + + /** + * Get Suspense Error Account + * @return suspense error account + */ + public MAccount getSuspenseBalancing_Acct() + { + if (m_SuspenseError_Acct != null) + return m_SuspenseError_Acct; + if (m_gl == null) + getAcctSchemaGL(); + int C_ValidCombination_ID = m_gl.getSuspenseBalancing_Acct(); + m_SuspenseError_Acct = MAccount.get(getCtx(), C_ValidCombination_ID); + return m_SuspenseError_Acct; + } // getSuspenseBalancing_Acct + + /** + * Is Currency Balancing active + * @return suspense balancing + */ + public boolean isCurrencyBalancing() + { + if (m_gl == null) + getAcctSchemaGL(); + return m_gl.isUseCurrencyBalancing(); + } // isSuspenseBalancing + + /** + * Get Currency Balancing Account + * @return currency balancing account + */ + public MAccount getCurrencyBalancing_Acct() + { + if (m_CurrencyBalancing_Acct != null) + return m_CurrencyBalancing_Acct; + if (m_gl == null) + getAcctSchemaGL(); + int C_ValidCombination_ID = m_gl.getCurrencyBalancing_Acct(); + m_CurrencyBalancing_Acct = MAccount.get(getCtx(), C_ValidCombination_ID); + return m_CurrencyBalancing_Acct; + } // getCurrencyBalancing_Acct + + + /** + * Get Due To Account for Segment + * @param segment ignored + * @return Account + */ + public MAccount getDueTo_Acct(String segment) + { + if (m_DueTo_Acct != null) + return m_DueTo_Acct; + if (m_gl == null) + getAcctSchemaGL(); + int C_ValidCombination_ID = m_gl.getIntercompanyDueTo_Acct(); + m_DueTo_Acct = MAccount.get(getCtx(), C_ValidCombination_ID); + return m_DueTo_Acct; + } // getDueTo_Acct + + /** + * Get Due From Account for Segment + * @param segment ignored + * @return Account + */ + public MAccount getDueFrom_Acct(String segment) + { + if (m_DueFrom_Acct != null) + return m_DueFrom_Acct; + if (m_gl == null) + getAcctSchemaGL(); + int C_ValidCombination_ID = m_gl.getIntercompanyDueFrom_Acct(); + m_DueFrom_Acct = MAccount.get(getCtx(), C_ValidCombination_ID); + return m_DueFrom_Acct; + } // getDueFrom_Acct + + /** + * Set Only Org Childs + * @param orgs + */ + public void setOnlyOrgs (Integer[] orgs) + { + m_onlyOrgs = orgs; + } // setOnlyOrgs + + /** + * Set Only Org Childs + * @return orgs + */ + public Integer[] getOnlyOrgs() + { + return m_onlyOrgs; + } // getOnlyOrgs + + /** + * Skip creating postings for this Org. + * Requires setOnlyOrgs (MReportTree requires MTree in Basis) + * @param AD_Org_ID + * @return true if to skip + */ + public boolean isSkipOrg (int AD_Org_ID) + { + if (getAD_OrgOnly_ID() == 0) + return false; + // Only Organization + if (getAD_OrgOnly_ID() == AD_Org_ID) + return false; + if (m_onlyOrg == null) + m_onlyOrg = MOrg.get(getCtx(), getAD_OrgOnly_ID()); + // Not Summary Only - i.e. skip it + if (!m_onlyOrg.isSummary()) + return true; + if (m_onlyOrgs == null) + return false; + for (int i = 0; i < m_onlyOrgs.length; i++) + { + if (AD_Org_ID == m_onlyOrgs[i].intValue()) + return false; + } + return true; + } // isSkipOrg + + /** + * Get Std Precision of accounting Currency + * @return precision + */ + public int getStdPrecision() + { + if (m_stdPrecision < 0) + { + MCurrency cur = MCurrency.get(getCtx(), getC_Currency_ID()); + m_stdPrecision = cur.getStdPrecision(); + m_costPrecision = cur.getCostingPrecision(); + } + return m_stdPrecision; + } // getStdPrecision + + /** + * Get Costing Precision of accounting Currency + * @return precision + */ + public int getCostingPrecision() + { + if (m_costPrecision < 0) + getStdPrecision(); + return m_costPrecision; + } // getCostingPrecision + + + /** + * Check Costing Setup. + * Make sure that there is a Cost Type and Cost Element + */ + public void checkCosting() + { + log.info(toString()); + // Create Cost Type + if (getM_CostType_ID() == 0) + { + MCostType ct = new MCostType (getCtx(), 0, get_TrxName()); + ct.setClientOrg(getAD_Client_ID(), 0); + ct.setName(getName()); + ct.save(); + setM_CostType_ID(ct.getM_CostType_ID()); + } + + // Create Cost Elements + MCostElement.getMaterialCostElement(this, getCostingMethod()); + + // Default Costing Level + if (getCostingLevel() == null) + setCostingLevel(COSTINGLEVEL_Client); + if (getCostingMethod() == null) + setCostingMethod (COSTINGMETHOD_StandardCosting); + if (getGAAP() == null) + setGAAP (GAAP_InternationalGAAP); + } // checkCosting + + /** + * Is Client Costing Level (default) + * @return true if Client + */ + public boolean isCostingLevelClient() + { + String s = getCostingLevel(); + if (s == null || COSTINGLEVEL_Client.equals(s)) + return true; + return false; + } // isCostingLevelClient + + /** + * Is Org Costing Level + * @return true if Org + */ + public boolean isCostingLevelOrg() + { + return COSTINGLEVEL_Organization.equals(getCostingLevel()); + } // isCostingLevelOrg + + /** + * Is Batch Costing Level + * @return true if Batch + */ + public boolean isCostingLevelBatch() + { + return COSTINGLEVEL_BatchLot.equals(getCostingLevel()); + } // isCostingLevelBatch + + /** + * Create Commitment Accounting + * @return true if creaet commitments + */ + public boolean isCreateCommitment() + { + String s = getCommitmentType(); + if (s == null) + return false; + return COMMITMENTTYPE_CommitmentOnly.equals(s) + || COMMITMENTTYPE_CommitmentReservation.equals(s); + } // isCreateCommitment + + /** + * Create Commitment/Reservation Accounting + * @return true if create reservations + */ + public boolean isCreateReservation() + { + String s = getCommitmentType(); + if (s == null) + return false; + return COMMITMENTTYPE_CommitmentReservation.equals(s); + } // isCreateReservation + + /** + * Get Tax Correction Type + * @return tax correction type + */ + public String getTaxCorrectionType() + { + if (super.getTaxCorrectionType() == null) // created 07/23/06 2.5.3d + setTaxCorrectionType(isDiscountCorrectsTax() + ? TAXCORRECTIONTYPE_Write_OffAndDiscount : TAXCORRECTIONTYPE_None); + return super.getTaxCorrectionType (); + } // getTaxCorrectionType + + /** + * Tax Correction + * @return true if not none + */ + public boolean isTaxCorrection() + { + return !getTaxCorrectionType().equals(TAXCORRECTIONTYPE_None); + } // isTaxCorrection + + /** + * Tax Correction for Discount + * @return true if tax is corrected for Discount + */ + public boolean isTaxCorrectionDiscount() + { + return getTaxCorrectionType().equals(TAXCORRECTIONTYPE_DiscountOnly) + || getTaxCorrectionType().equals(TAXCORRECTIONTYPE_Write_OffAndDiscount); + } // isTaxCorrectionDiscount + + /** + * Tax Correction for WriteOff + * @return true if tax is corrected for WriteOff + */ + public boolean isTaxCorrectionWriteOff() + { + return getTaxCorrectionType().equals(TAXCORRECTIONTYPE_Write_OffOnly) + || getTaxCorrectionType().equals(TAXCORRECTIONTYPE_Write_OffAndDiscount); + } // isTaxCorrectionWriteOff + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + if (super.getTaxCorrectionType() == null) + setTaxCorrectionType(isDiscountCorrectsTax() + ? TAXCORRECTIONTYPE_Write_OffAndDiscount : TAXCORRECTIONTYPE_None); + checkCosting(); + // Check Primary + if (getAD_OrgOnly_ID() != 0) + { + MClientInfo info = MClientInfo.get(getCtx(), getAD_Client_ID()); + if (info.getC_AcctSchema1_ID() == getC_AcctSchema_ID()) + setAD_OrgOnly_ID(0); + } + return true; + } // beforeSave + +} // MAcctSchema diff --git a/dbPort/src/org/compiere/model/MAcctSchemaDefault.java b/dbPort/src/org/compiere/model/MAcctSchemaDefault.java new file mode 100644 index 0000000000..e39208a4a4 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAcctSchemaDefault.java @@ -0,0 +1,167 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Default Accounts for MAcctSchema + * + * @author Jorg Janke + * @version $Id: MAcctSchemaDefault.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MAcctSchemaDefault extends X_C_AcctSchema_Default +{ + /** + * Get Accounting Schema Default Info + * @param ctx context + * @param C_AcctSchema_ID id + * @return defaults + */ + public static MAcctSchemaDefault get (Properties ctx, int C_AcctSchema_ID) + { + MAcctSchemaDefault retValue = null; + String sql = "SELECT * FROM C_AcctSchema_Default WHERE C_AcctSchema_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, C_AcctSchema_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + retValue = new MAcctSchemaDefault (ctx, rs, null); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Logger */ + protected static CLogger s_log = CLogger.getCLogger(MAcctSchemaDefault.class); + + /** + * Load Constructor + * @param ctx context + * @param C_AcctSchema_ID parent + * @param trxName transaction + */ + public MAcctSchemaDefault(Properties ctx, int C_AcctSchema_ID, String trxName) + { + super(ctx, C_AcctSchema_ID, trxName); + } // MAcctSchemaDefault + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAcctSchemaDefault(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAcctSchemaDefault + + /** + * Get Realized Gain Acct for currency + * @param C_Currency_ID currency + * @return gain acct + */ + public int getRealizedGain_Acct (int C_Currency_ID) + { + MCurrencyAcct acct = MCurrencyAcct.get (this, C_Currency_ID); + if (acct != null) + return acct.getRealizedGain_Acct(); + return super.getRealizedGain_Acct(); + } // getRealizedGain_Acct + + /** + * Get Realized Loss Acct for currency + * @param C_Currency_ID currency + * @return loss acct + */ + public int getRealizedLoss_Acct (int C_Currency_ID) + { + MCurrencyAcct acct = MCurrencyAcct.get (this, C_Currency_ID); + if (acct != null) + return acct.getRealizedLoss_Acct(); + return super.getRealizedLoss_Acct(); + } // getRealizedLoss_Acct + + /** + * Get Acct Info list + * @return list + */ + public ArrayList getAcctInfo() + { + ArrayList list = new ArrayList(); + for (int i = 0; i < get_ColumnCount(); i++) + { + String columnName = get_ColumnName(i); + if (columnName.endsWith("Acct")) + { + int id = ((Integer)get_Value(i)); + list.add(new KeyNamePair (id, columnName)); + } + } + return list; + } // getAcctInfo + + /** + * Set Value (don't use) + * @param columnName column name + * @param value value + * @return true if value set + */ + public boolean setValue (String columnName, Integer value) + { + return super.set_Value (columnName, value); + } // setValue + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + +} // MAcctSchemaDefault diff --git a/dbPort/src/org/compiere/model/MAcctSchemaElement.java b/dbPort/src/org/compiere/model/MAcctSchemaElement.java new file mode 100644 index 0000000000..4f664cd903 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAcctSchemaElement.java @@ -0,0 +1,513 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Account Schema Element Object + * + * @author Jorg Janke + * @version $Id: MAcctSchemaElement.java,v 1.4 2006/08/10 01:00:44 jjanke Exp $ + */ +public final class MAcctSchemaElement extends X_C_AcctSchema_Element +{ + /** + * Factory: Return ArrayList of Account Schema Elements + * @param as Accounting Schema + * @return ArrayList with Elements + */ + public static MAcctSchemaElement[] getAcctSchemaElements (MAcctSchema as) + { + Integer key = new Integer (as.getC_AcctSchema_ID()); + MAcctSchemaElement[] retValue = (MAcctSchemaElement[]) s_cache.get (key); + if (retValue != null) + return retValue; + + s_log.fine("C_AcctSchema_ID=" + as.getC_AcctSchema_ID()); + ArrayList list = new ArrayList(); + // + String sql = "SELECT * FROM C_AcctSchema_Element " + + "WHERE C_AcctSchema_ID=? AND IsActive='Y' ORDER BY SeqNo"; + + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, as.get_TrxName()); + pstmt.setInt(1, as.getC_AcctSchema_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + MAcctSchemaElement ase = new MAcctSchemaElement(as.getCtx(), rs, as.get_TrxName()); + s_log.fine(" - " + ase); + if (ase.isMandatory() && ase.getDefaultValue() == 0) + s_log.log(Level.SEVERE, "No default value for " + ase.getName()); + list.add(ase); + // + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + } + + retValue = new MAcctSchemaElement[list.size()]; + list.toArray(retValue); + s_cache.put (key, retValue); + return retValue; + } // getAcctSchemaElements + + /** + * Get Column Name of ELEMENTTYPE + * @param elementType ELEMENTTYPE + * @return column name + */ + public static String getColumnName(String elementType) + { + if (elementType.equals(ELEMENTTYPE_Organization)) + return "AD_Org_ID"; + else if (elementType.equals(ELEMENTTYPE_Account)) + return "Account_ID"; + else if (elementType.equals(ELEMENTTYPE_BPartner)) + return "C_BPartner_ID"; + else if (elementType.equals(ELEMENTTYPE_Product)) + return "M_Product_ID"; + else if (elementType.equals(ELEMENTTYPE_Activity)) + return "C_Activity_ID"; + else if (elementType.equals(ELEMENTTYPE_LocationFrom)) + return "C_LocFrom_ID"; + else if (elementType.equals(ELEMENTTYPE_LocationTo)) + return "C_LocTo_ID"; + else if (elementType.equals(ELEMENTTYPE_Campaign)) + return "C_Campaign_ID"; + else if (elementType.equals(ELEMENTTYPE_OrgTrx)) + return "AD_OrgTrx_ID"; + else if (elementType.equals(ELEMENTTYPE_Project)) + return "C_Project_ID"; + else if (elementType.equals(ELEMENTTYPE_SalesRegion)) + return "C_SalesRegion_ID"; + else if (elementType.equals(ELEMENTTYPE_UserList1)) + return "User1_ID"; + else if (elementType.equals(ELEMENTTYPE_UserList2)) + return "User2_ID"; + else if (elementType.equals(ELEMENTTYPE_UserElement1)) + return "UserElement1_ID"; + else if (elementType.equals(ELEMENTTYPE_UserElement2)) + return "UserElement2_ID"; + // + return ""; + } // getColumnName + + /** + * Get Value Query for ELEMENTTYPE Type + * @param elementType ELEMENTTYPE type + * @return query "SELECT Value,Name FROM Table WHERE ID=" + */ + public static String getValueQuery (String elementType) + { + if (elementType.equals(ELEMENTTYPE_Organization)) + return "SELECT Value,Name FROM AD_Org WHERE AD_Org_ID="; + else if (elementType.equals(ELEMENTTYPE_Account)) + return "SELECT Value,Name FROM C_ElementValue WHERE C_ElementValue_ID="; + else if (elementType.equals(ELEMENTTYPE_SubAccount)) + return "SELECT Value,Name FROM C_SubAccount WHERE C_SubAccount_ID="; + else if (elementType.equals(ELEMENTTYPE_BPartner)) + return "SELECT Value,Name FROM C_BPartner WHERE C_BPartner_ID="; + else if (elementType.equals(ELEMENTTYPE_Product)) + return "SELECT Value,Name FROM M_Product WHERE M_Product_ID="; + else if (elementType.equals(ELEMENTTYPE_Activity)) + return "SELECT Value,Name FROM C_Activity WHERE C_Activity_ID="; + else if (elementType.equals(ELEMENTTYPE_LocationFrom)) + return "SELECT City,Address1 FROM C_Location WHERE C_Location_ID="; + else if (elementType.equals(ELEMENTTYPE_LocationTo)) + return "SELECT City,Address1 FROM C_Location WHERE C_Location_ID="; + else if (elementType.equals(ELEMENTTYPE_Campaign)) + return "SELECT Value,Name FROM C_Campaign WHERE C_Campaign_ID="; + else if (elementType.equals(ELEMENTTYPE_OrgTrx)) + return "SELECT Value,Name FROM AD_Org WHERE AD_Org_ID="; + else if (elementType.equals(ELEMENTTYPE_Project)) + return "SELECT Value,Name FROM C_Project WHERE C_Project_ID="; + else if (elementType.equals(ELEMENTTYPE_SalesRegion)) + return "SELECT Value,Name FROM C_SalesRegion WHERE C_SalesRegion_ID"; + else if (elementType.equals(ELEMENTTYPE_UserList1)) + return "SELECT Value,Name FROM C_ElementValue WHERE C_ElementValue_ID="; + else if (elementType.equals(ELEMENTTYPE_UserList2)) + return "SELECT Value,Name FROM C_ElementValue WHERE C_ElementValue_ID="; + // + else if (elementType.equals(ELEMENTTYPE_UserElement1)) + return null; + else if (elementType.equals(ELEMENTTYPE_UserElement2)) + return null; + // + return ""; + } // getColumnName + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MAcctSchemaElement.class); + + /** Cache */ + private static CCache s_cache = new CCache("C_AcctSchema_Element", 10); + + + /************************************************************************* + * Standard Constructor + * @param ctx context + * @param C_AcctSchema_Element_ID id + * @param trxName transaction + */ + public MAcctSchemaElement (Properties ctx, int C_AcctSchema_Element_ID, String trxName) + { + super (ctx, C_AcctSchema_Element_ID, trxName); + if (C_AcctSchema_Element_ID == 0) + { + // setC_AcctSchema_Element_ID (0); + // setC_AcctSchema_ID (0); + // setC_Element_ID (0); + // setElementType (null); + setIsBalanced (false); + setIsMandatory (false); + // setName (null); + // setOrg_ID (0); + // setSeqNo (0); + } + } // MAcctSchemaElement + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAcctSchemaElement (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAcctSchemaElement + + /** + * Parent Constructor + * @param as accounting schema + */ + public MAcctSchemaElement (MAcctSchema as) + { + this (as.getCtx(), 0, as.get_TrxName()); + setClientOrg(as); + setC_AcctSchema_ID (as.getC_AcctSchema_ID()); + + // setC_Element_ID (0); + // setElementType (null); + // setName (null); + // setSeqNo (0); + + } // MAcctSchemaElement + + /** User Element Column Name */ + private String m_ColumnName = null; + + /** + * Set Organization Type + * @param SeqNo sequence + * @param Name name + * @param Org_ID id + */ + public void setTypeOrg (int SeqNo, String Name, int Org_ID) + { + setElementType (ELEMENTTYPE_Organization); + setSeqNo(SeqNo); + setName (Name); + setOrg_ID(Org_ID); + } // setTypeOrg + + /** + * Set Type Account + * @param SeqNo squence + * @param Name name + * @param C_Element_ID element + * @param C_ElementValue_ID element value + */ + public void setTypeAccount (int SeqNo, String Name, int C_Element_ID, int C_ElementValue_ID) + { + setElementType (ELEMENTTYPE_Account); + setSeqNo(SeqNo); + setName (Name); + setC_Element_ID (C_Element_ID); + setC_ElementValue_ID(C_ElementValue_ID); + } // setTypeAccount + + /** + * Set Type BPartner + * @param SeqNo sequence + * @param Name name + * @param C_BPartner_ID id + */ + public void setTypeBPartner (int SeqNo, String Name, int C_BPartner_ID) + { + setElementType (ELEMENTTYPE_BPartner); + setSeqNo(SeqNo); + setName (Name); + setC_BPartner_ID(C_BPartner_ID); + } // setTypeBPartner + + /** + * Set Type Product + * @param SeqNo sequence + * @param Name name + * @param M_Product_ID id + */ + public void setTypeProduct (int SeqNo, String Name, int M_Product_ID) + { + setElementType (ELEMENTTYPE_Product); + setSeqNo(SeqNo); + setName (Name); + setM_Product_ID(M_Product_ID); + } // setTypeProduct + + /** + * Set Type Project + * @param SeqNo sequence + * @param Name name + * @param C_Project_ID id + */ + public void setTypeProject (int SeqNo, String Name, int C_Project_ID) + { + setElementType (ELEMENTTYPE_Project); + setSeqNo(SeqNo); + setName (Name); + setC_Project_ID(C_Project_ID); + } // setTypeProject + + /** + * Is Element Type + * @param elementType type + * @return ELEMENTTYPE type + */ + public boolean isElementType (String elementType) + { + if (elementType == null) + return false; + return elementType.equals(getElementType()); + } // isElementType + + /** + * Get Default element value + * @return default + */ + public int getDefaultValue() + { + String elementType = getElementType(); + int defaultValue = 0; + if (elementType.equals(ELEMENTTYPE_Organization)) + defaultValue = getOrg_ID(); + else if (elementType.equals(ELEMENTTYPE_Account)) + defaultValue = getC_ElementValue_ID(); + else if (elementType.equals(ELEMENTTYPE_BPartner)) + defaultValue = getC_BPartner_ID(); + else if (elementType.equals(ELEMENTTYPE_Product)) + defaultValue = getM_Product_ID(); + else if (elementType.equals(ELEMENTTYPE_Activity)) + defaultValue = getC_Activity_ID(); + else if (elementType.equals(ELEMENTTYPE_LocationFrom)) + defaultValue = getC_Location_ID(); + else if (elementType.equals(ELEMENTTYPE_LocationTo)) + defaultValue = getC_Location_ID(); + else if (elementType.equals(ELEMENTTYPE_Campaign)) + defaultValue = getC_Campaign_ID(); + else if (elementType.equals(ELEMENTTYPE_OrgTrx)) + defaultValue = getOrg_ID(); + else if (elementType.equals(ELEMENTTYPE_Project)) + defaultValue = getC_Project_ID(); + else if (elementType.equals(ELEMENTTYPE_SalesRegion)) + defaultValue = getC_SalesRegion_ID(); + else if (elementType.equals(ELEMENTTYPE_UserList1)) + defaultValue = getC_ElementValue_ID(); + else if (elementType.equals(ELEMENTTYPE_UserList2)) + defaultValue = getC_ElementValue_ID(); + else if (elementType.equals(ELEMENTTYPE_UserElement1)) + defaultValue = 0; + else if (elementType.equals(ELEMENTTYPE_UserElement2)) + defaultValue = 0; + return defaultValue; + } // getDefault + + + /** + * Get Acct Fact ColumnName + * @return column name + */ + public String getColumnName() + { + String et = getElementType(); + return getColumnName(et); + } // getColumnName + + /** + * Get Display ColumnName + * @return column name + */ + public String getDisplayColumnName() + { + String et = getElementType(); + if (ELEMENTTYPE_UserElement1.equals(et) || ELEMENTTYPE_UserElement2.equals(et)) + { + if (m_ColumnName == null) + m_ColumnName = MColumn.getColumnName(getCtx(), getAD_Column_ID()); + return m_ColumnName; + } + return getColumnName(et); + } // getColumnName + + + /** + * String representation + * @return info + */ + public String toString() + { + return "AcctSchemaElement[" + get_ID() + + "-" + getName() + + "(" + getElementType() + ")=" + getDefaultValue() + + ",Pos=" + getSeqNo() + "]"; + } // toString + + + + /** + * Before Save + * @param newRecord new + * @return true if it can be saved + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + String et = getElementType(); + if (isMandatory() && + (ELEMENTTYPE_UserList1.equals(et) || ELEMENTTYPE_UserList2.equals(et) + || ELEMENTTYPE_UserElement1.equals(et) || ELEMENTTYPE_UserElement2.equals(et))) + setIsMandatory(false); + else if (isMandatory()) + { + String errorField = null; + if (ELEMENTTYPE_Account.equals(et) && getC_ElementValue_ID() == 0) + errorField = "C_ElementValue_ID"; + else if (ELEMENTTYPE_Activity.equals(et) && getC_Activity_ID() == 0) + errorField = "C_Activity_ID"; + else if (ELEMENTTYPE_BPartner.equals(et) && getC_BPartner_ID() == 0) + errorField = "C_BPartner_ID"; + else if (ELEMENTTYPE_Campaign.equals(et) && getC_Campaign_ID() == 0) + errorField = "C_Campaign_ID"; + else if (ELEMENTTYPE_LocationFrom.equals(et) && getC_Location_ID() == 0) + errorField = "C_Location_ID"; + else if (ELEMENTTYPE_LocationTo.equals(et) && getC_Location_ID() == 0) + errorField = "C_Location_ID"; + else if (ELEMENTTYPE_Organization.equals(et) && getOrg_ID() == 0) + errorField = "Org_ID"; + else if (ELEMENTTYPE_OrgTrx.equals(et) && getOrg_ID() == 0) + errorField = "Org_ID"; + else if (ELEMENTTYPE_Product.equals(et) && getM_Product_ID() == 0) + errorField = "M_Product_ID"; + else if (ELEMENTTYPE_Project.equals(et) && getC_Project_ID() == 0) + errorField = "C_Project_ID"; + else if (ELEMENTTYPE_SalesRegion.equals(et) && getC_SalesRegion_ID() == 0) + errorField = "C_SalesRegion_ID"; + if (errorField != null) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@IsMandatory@: @" + errorField + "@")); + return false; + } + } + // + if (getAD_Column_ID() == 0 + && (ELEMENTTYPE_UserElement1.equals(et) || ELEMENTTYPE_UserElement2.equals(et))) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@IsMandatory@: @AD_Column_ID@")); + return false; + } + return true; + } // beforeSave + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + // Default Value + if (isMandatory() && is_ValueChanged("IsMandatory")) + { + if (ELEMENTTYPE_Activity.equals(getElementType())) + updateData ("C_Activity_ID", getC_Activity_ID()); + else if (ELEMENTTYPE_BPartner.equals(getElementType())) + updateData ("C_BPartner_ID", getC_BPartner_ID()); + else if (ELEMENTTYPE_Product.equals(getElementType())) + updateData ("M_Product_ID", getM_Product_ID()); + else if (ELEMENTTYPE_Project.equals(getElementType())) + updateData ("C_Project_ID", getC_Project_ID()); + } + // Resequence + if (newRecord || is_ValueChanged("SeqNo")) + MAccount.updateValueDescription(getCtx(), + "AD_Client_ID=" + getAD_Client_ID(), get_TrxName()); + // Clear Cache + s_cache.clear(); + return success; + } // afterSave + + /** + * Update ValidCombination and Fact with mandatory value + * @param element element + * @param id new default + */ + private void updateData (String element, int id) + { + MAccount.updateValueDescription(getCtx(), + element + "=" + id, get_TrxName()); + // + String sql = "UPDATE C_ValidCombination SET " + element + "=" + id + + " WHERE " + element + " IS NULL AND AD_Client_ID=" + getAD_Client_ID(); + int noC = DB.executeUpdate(sql, get_TrxName()); + // + sql = "UPDATE Fact_Acct SET " + element + "=" + id + + " WHERE " + element + " IS NULL AND C_AcctSchema_ID=" + getC_AcctSchema_ID(); + int noF = DB.executeUpdate(sql, get_TrxName()); + // + log.fine("ValidCombination=" + noC + ", Fact=" + noF); + } // updateData + + + + /** + * After Delete + * @param success success + * @return success + */ + protected boolean afterDelete (boolean success) + { + // Update Account Info + MAccount.updateValueDescription(getCtx(), + "AD_Client_ID=" + getAD_Client_ID(), get_TrxName()); + // + s_cache.clear(); + return success; + } // afterDelete + +} // AcctSchemaElement diff --git a/dbPort/src/org/compiere/model/MAcctSchemaGL.java b/dbPort/src/org/compiere/model/MAcctSchemaGL.java new file mode 100644 index 0000000000..2643ecc4e2 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAcctSchemaGL.java @@ -0,0 +1,148 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Accounting Schema GL info + * + * @author Jorg Janke + * @version $Id: MAcctSchemaGL.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MAcctSchemaGL extends X_C_AcctSchema_GL +{ + /** + * Get Accounting Schema GL Info + * @param ctx context + * @param C_AcctSchema_ID id + * @return defaults + */ + public static MAcctSchemaGL get (Properties ctx, int C_AcctSchema_ID) + { + MAcctSchemaGL retValue = null; + String sql = "SELECT * FROM C_AcctSchema_GL WHERE C_AcctSchema_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, C_AcctSchema_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + retValue = new MAcctSchemaGL (ctx, rs, null); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Logger */ + protected static CLogger s_log = CLogger.getCLogger(MAcctSchemaGL.class); + + + /** + * Load Constructor + * @param ctx context + * @param C_AcctSchema_ID AcctSchema + * @param trxName transaction + */ + public MAcctSchemaGL (Properties ctx, int C_AcctSchema_ID, String trxName) + { + super(ctx, C_AcctSchema_ID, trxName); + if (C_AcctSchema_ID == 0) + { + setUseCurrencyBalancing (false); + setUseSuspenseBalancing (false); + setUseSuspenseError (false); + } + } // MAcctSchemaGL + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAcctSchemaGL (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAcctSchemaGL + + /** + * Get Acct Info list + * @return list + */ + public ArrayList getAcctInfo() + { + ArrayList list = new ArrayList(); + for (int i = 0; i < get_ColumnCount(); i++) + { + String columnName = get_ColumnName(i); + if (columnName.endsWith("Acct")) + { + int id = ((Integer)get_Value(i)); + list.add(new KeyNamePair (id, columnName)); + } + } + return list; + } // getAcctInfo + + /** + * Set Value (don't use) + * @param columnName column name + * @param value value + * @return true if set + */ + public boolean setValue (String columnName, Integer value) + { + return super.set_Value (columnName, value); + } // setValue + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + +} // MAcctSchemaGL diff --git a/dbPort/src/org/compiere/model/MArchive.java b/dbPort/src/org/compiere/model/MArchive.java new file mode 100644 index 0000000000..730086b89f --- /dev/null +++ b/dbPort/src/org/compiere/model/MArchive.java @@ -0,0 +1,309 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import java.util.zip.*; +import org.compiere.util.*; + + +/** + * Archive Model + * + * @author Jorg Janke + * @version $Id: MArchive.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $ + */ +public class MArchive extends X_AD_Archive +{ + /** + * Get Archives + * @param ctx context + * @param whereClause optional where clause (starting with AND) + * @return archives + */ + public static MArchive[] get (Properties ctx, String whereClause) + { + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Archive WHERE AD_Client_ID=?"; + if (whereClause != null && whereClause.length() > 0) + sql += whereClause; + sql += " ORDER BY Created"; + + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, Env.getAD_Client_ID(ctx)); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MArchive(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (list.size() == 0) + s_log.fine(sql); + else + s_log.finer(sql); + // + MArchive[] retValue = new MArchive[list.size()]; + list.toArray(retValue); + return retValue; + } // get + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MArchive.class); + + private Integer m_inflated = null; + private Integer m_deflated = null; + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Archive_ID id + * @param trxName transaction + */ + public MArchive (Properties ctx, int AD_Archive_ID, String trxName) + { + super (ctx, AD_Archive_ID, trxName); + } // MArchive + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MArchive (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MArchive + + /** + * Constructor + * @param ctx context + * @param info print info + * @param trxName transaction + */ + public MArchive (Properties ctx, PrintInfo info, String trxName) + { + this (ctx, 0, trxName); + setName(info.getName()); + setIsReport(info.isReport()); + // + setAD_Process_ID(info.getAD_Process_ID()); + setAD_Table_ID(info.getAD_Table_ID()); + setRecord_ID(info.getRecord_ID()); + setC_BPartner_ID(info.getC_BPartner_ID()); + } // MArchive + + + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MArchive["); + sb.append(get_ID()).append(",Name=").append(getName()); + if (m_inflated != null) + sb.append(",Inflated=" + m_inflated); + if (m_deflated != null) + sb.append(",Deflated=" + m_deflated); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Get Binary Data. + * (inflate) + * @return inflated data + */ + public byte[] getBinaryData() + { + byte[] deflatedData = super.getBinaryData(); + m_deflated = null; + m_inflated = null; + if (deflatedData == null) + return null; + // + log.fine("ZipSize=" + deflatedData.length); + m_deflated = new Integer(deflatedData.length); + if (deflatedData.length == 0) + return null; + + byte[] inflatedData = null; + try + { + ByteArrayInputStream in = new ByteArrayInputStream(deflatedData); + ZipInputStream zip = new ZipInputStream (in); + ZipEntry entry = zip.getNextEntry(); + if (entry != null) // just one entry + { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buffer = new byte[2048]; + int length = zip.read(buffer); + while (length != -1) + { + out.write(buffer, 0, length); + length = zip.read(buffer); + } + // + inflatedData = out.toByteArray(); + log.fine("Size=" + inflatedData.length + " - zip=" + + entry.getCompressedSize() + "(" + entry.getSize() + ") " + + (entry.getCompressedSize()*100/entry.getSize())+ "%"); + m_inflated = new Integer(inflatedData.length); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + inflatedData = null; + } + return inflatedData; + } // getBinaryData + + /** + * Get Data as Input Stream + * @return input stream or null + */ + public InputStream getInputStream() + { + byte[] inflatedData = getBinaryData(); + if (inflatedData == null) + return null; + return new ByteArrayInputStream(inflatedData); + } // getInputStream + + /** + * Save Binary Data. + * (deflate) + * @param inflatedData inflated data + */ + public void setBinaryData (byte[] inflatedData) + { + if (inflatedData == null || inflatedData.length == 0) + throw new IllegalArgumentException("InflatedData is NULL"); + m_inflated = new Integer(inflatedData.length); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(out); + zip.setMethod(ZipOutputStream.DEFLATED); + zip.setLevel(Deflater.BEST_COMPRESSION); + zip.setComment("adempiere"); + // + byte[] deflatedData = null; + try + { + ZipEntry entry = new ZipEntry("AdempiereArchive"); + entry.setTime(System.currentTimeMillis()); + entry.setMethod(ZipEntry.DEFLATED); + zip.putNextEntry(entry); + zip.write (inflatedData, 0, inflatedData.length); + zip.closeEntry(); + log.fine(entry.getCompressedSize() + " (" + entry.getSize() + ") " + + (entry.getCompressedSize()*100/entry.getSize())+ "%"); + // + // zip.finish(); + zip.close(); + deflatedData = out.toByteArray(); + log.fine("Length=" + inflatedData.length); + m_deflated = new Integer(deflatedData.length); + } + catch (Exception e) + { + log.log(Level.SEVERE, "saveLOBData", e); + deflatedData = null; + m_deflated = null; + } + super.setBinaryData (deflatedData); + } // setBinaryData + + /** + * Get Created By (User) Name + * @return name + */ + public String getCreatedByName() + { + String name = "?"; + String sql = "SELECT Name FROM AD_User WHERE AD_User_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getCreatedBy()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + name = rs.getString(1); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return name; + } // getCreatedByName + + + /** + * Before Save + * @param newRecord new + * @return true if can be saved + */ + protected boolean beforeSave (boolean newRecord) + { + // Binary Data is Mandatory + byte[] data = super.getBinaryData(); + if (data == null || data.length == 0) + return false; + // + log.fine(toString()); + return true; + } // beforeSave + +} // MArchive diff --git a/dbPort/src/org/compiere/model/MAttachment.java b/dbPort/src/org/compiere/model/MAttachment.java new file mode 100644 index 0000000000..b2f0bee81e --- /dev/null +++ b/dbPort/src/org/compiere/model/MAttachment.java @@ -0,0 +1,545 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import java.util.zip.*; +import org.compiere.util.*; + +/** + * Attachment Model. + * One Attachment can have multiple entries + * + * @author Jorg Janke + * @version $Id: MAttachment.java,v 1.4 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MAttachment extends X_AD_Attachment +{ + /** + * Get Attachment + * @param ctx context + * @param AD_Table_ID table + * @param Record_ID record + * @return attachment or null + */ + public static MAttachment get (Properties ctx, int AD_Table_ID, int Record_ID) + { + MAttachment retValue = null; + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Attachment WHERE AD_Table_ID=? AND Record_ID=?"; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Table_ID); + pstmt.setInt (2, Record_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MAttachment (ctx, rs, null); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MAttachment.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Attachment_ID id + * @param trxName transaction + */ + public MAttachment(Properties ctx, int AD_Attachment_ID, String trxName) + { + super (ctx, AD_Attachment_ID, trxName); + } // MAttachment + + /** + * New Constructor + * @param ctx context + * @param AD_Table_ID table + * @param Record_ID record + * @param trxName transaction + */ + public MAttachment(Properties ctx, int AD_Table_ID, int Record_ID, String trxName) + { + this (ctx, 0, trxName); + setAD_Table_ID (AD_Table_ID); + setRecord_ID (Record_ID); + } // MAttachment + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAttachment(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAttachment + + /** Indicator for no data */ + public static final String NONE = "."; + /** Indicator for zip data */ + public static final String ZIP = "zip"; + + /** List of Entry Data */ + private ArrayList m_items = null; + + /** + * Set Client Org + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + public void setClientOrg(int AD_Client_ID, int AD_Org_ID) + { + super.setClientOrg(AD_Client_ID, AD_Org_ID); + } // setClientOrg + + /** + * Add to Text Msg + * @param added text + */ + public void addTextMsg (String added) + { + String oldTextMsg = getTextMsg(); + if (oldTextMsg == null) + setTextMsg (added); + else if (added != null) + setTextMsg (oldTextMsg + added); + } // addTextMsg + + /** + * Get Text Msg + * @return trimmed message + */ + public String getTextMsg () + { + String msg = super.getTextMsg (); + if (msg == null) + return null; + return msg.trim(); + } // setTextMsg + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MAttachment["); + sb.append(getAD_Attachment_ID()).append(",Title=").append(getTitle()) + .append(",Entries=").append(getEntryCount()); + for (int i = 0; i < getEntryCount(); i++) + { + if (i == 0) + sb.append(":"); + else + sb.append(","); + sb.append(getEntryName(i)); + } + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Add new Data Entry + * @param file file + * @return true if added + */ + public boolean addEntry (File file) + { + if (file == null) + { + log.warning("No File"); + return false; + } + if (!file.exists() || file.isDirectory()) + { + log.warning("not added - " + file + + ", Exists=" + file.exists() + ", Directory=" + file.isDirectory()); + return false; + } + log.fine("addEntry - " + file); + // + String name = file.getName(); + byte[] data = null; + try + { + FileInputStream fis = new FileInputStream (file); + ByteArrayOutputStream os = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024*8]; // 8kB + int length = -1; + while ((length = fis.read(buffer)) != -1) + os.write(buffer, 0, length); + fis.close(); + data = os.toByteArray(); + os.close(); + } + catch (IOException ioe) + { + log.log(Level.SEVERE, "(file)", ioe); + } + return addEntry (name, data); + } // addEntry + + /** + * Add new Data Entry + * @param name name + * @param data data + * @return true if added + */ + public boolean addEntry (String name, byte[] data) + { + if (name == null || data == null) + return false; + return addEntry (new MAttachmentEntry (name, data)); // random index + } // addEntry + + /** + * Add Entry + * @param item attachment entry + * @return true if added + */ + public boolean addEntry (MAttachmentEntry item) + { + if (item == null) + return false; + if (m_items == null) + loadLOBData(); + boolean retValue = m_items.add(item); + log.fine(item.toStringX()); + addTextMsg(" "); // otherwise not saved + return retValue; + } // addEntry + + /** + * Get Attachment Entry + * @param index index of the item + * @return Entry or null + */ + public MAttachmentEntry getEntry (int index) + { + if (m_items == null) + loadLOBData(); + if (index < 0 || index >= m_items.size()) + return null; + return (MAttachmentEntry)m_items.get(index); + } // getEntry + + /** + * Get Attachment Entries as array + * @return array or null + */ + public MAttachmentEntry[] getEntries () + { + if (m_items == null) + loadLOBData(); + MAttachmentEntry[] retValue = new MAttachmentEntry[m_items.size()]; + m_items.toArray (retValue); + return retValue; + } // getEntries + + /** + * Delete Entry + * @param index index + * @return true if deleted + */ + public boolean deleteEntry (int index) + { + if (index >= 0 && index < m_items.size()) + { + m_items.remove(index); + log.config("Index=" + index + " - NewSize=" + m_items.size()); + return true; + } + log.warning("Not deleted Index=" + index + " - Size=" + m_items.size()); + return false; + } // deleteEntry + + /** + * Get Entry Count + * @return number of entries + */ + public int getEntryCount() + { + if (m_items == null) + loadLOBData(); + return m_items.size(); + } // getEntryCount + + + /** + * Get Entry Name + * @param index index + * @return name or null + */ + public String getEntryName (int index) + { + MAttachmentEntry item = getEntry(index); + if (item != null) + return item.getName(); + return null; + } // getEntryName + + /** + * Dump Entry Names + */ + public void dumpEntryNames() + { + if (m_items == null) + loadLOBData(); + if (m_items == null || m_items.size() == 0) + { + System.out.println("- no entries -"); + return; + } + System.out.println("- entries: " + m_items.size()); + for (int i = 0; i < m_items.size(); i++) + System.out.println(" - " + getEntryName(i)); + } // dumpEntryNames + + /** + * Get Entry Data + * @param index index + * @return data or null + */ + public byte[] getEntryData (int index) + { + MAttachmentEntry item = getEntry(index); + if (item != null) + return item.getData(); + return null; + } // getEntryData + + /** + * Get Entry File with name + * @param index index + * @param fileName optional file name + * @return file + */ + public File getEntryFile (int index, String fileName) + { + MAttachmentEntry item = getEntry(index); + if (item != null) + return item.getFile(fileName); + return null; + } // getEntryFile + + /** + * Get Entry File with name + * @param index index + * @param file file + * @return file + */ + public File getEntryFile (int index, File file) + { + MAttachmentEntry item = getEntry(index); + if (item != null) + return item.getFile(file); + return null; + } // getEntryFile + + /** + * Save Entry Data in Zip File format + * @return true if saved + */ + private boolean saveLOBData() + { + if (m_items == null || m_items.size() == 0) + { + setBinaryData(null); + return true; + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ZipOutputStream zip = new ZipOutputStream(out); + zip.setMethod(ZipOutputStream.DEFLATED); + zip.setLevel(Deflater.BEST_COMPRESSION); + zip.setComment("adempiere"); + // + try + { + for (int i = 0; i < m_items.size(); i++) + { + MAttachmentEntry item = getEntry(i); + ZipEntry entry = new ZipEntry(item.getName()); + entry.setTime(System.currentTimeMillis()); + entry.setMethod(ZipEntry.DEFLATED); + zip.putNextEntry(entry); + byte[] data = item.getData(); + zip.write (data, 0, data.length); + zip.closeEntry(); + log.fine(entry.getName() + " - " + + entry.getCompressedSize() + " (" + entry.getSize() + ") " + + (entry.getCompressedSize()*100/entry.getSize())+ "%"); + } + // zip.finish(); + zip.close(); + byte[] zipData = out.toByteArray(); + log.fine("Length=" + zipData.length); + setBinaryData(zipData); + return true; + } + catch (Exception e) + { + log.log(Level.SEVERE, "saveLOBData", e); + } + setBinaryData(null); + return false; + } // saveLOBData + + /** + * Load Data into local m_data + * @return true if success + */ + private boolean loadLOBData () + { + // Reset + m_items = new ArrayList(); + // + byte[] data = getBinaryData(); + if (data == null) + return true; + log.fine("ZipSize=" + data.length); + if (data.length == 0) + return true; + + // Old Format - single file + if (!ZIP.equals(getTitle())) + { + m_items.add (new MAttachmentEntry(getTitle(), data, 1)); + return true; + } + + try + { + ByteArrayInputStream in = new ByteArrayInputStream(data); + ZipInputStream zip = new ZipInputStream (in); + ZipEntry entry = zip.getNextEntry(); + while (entry != null) + { + String name = entry.getName(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buffer = new byte[2048]; + int length = zip.read(buffer); + while (length != -1) + { + out.write(buffer, 0, length); + length = zip.read(buffer); + } + // + byte[] dataEntry = out.toByteArray(); + log.fine(name + + " - size=" + dataEntry.length + " - zip=" + + entry.getCompressedSize() + "(" + entry.getSize() + ") " + + (entry.getCompressedSize()*100/entry.getSize())+ "%"); + // + m_items.add (new MAttachmentEntry (name, dataEntry, m_items.size()+1)); + entry = zip.getNextEntry(); + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "loadLOBData", e); + m_items = null; + return false; + } + return true; + } // loadLOBData + + + /** + * Before Save + * @param newRecord new + * @return true if can be saved + */ + protected boolean beforeSave (boolean newRecord) + { + if (getTitle() == null || !getTitle().equals(ZIP)) + setTitle (ZIP); + return saveLOBData(); // save in BinaryData + } // beforeSave + + + /************************************************************************** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + // System.setProperty("javax.activation.debug", "true"); + + System.out.println(MimeType.getMimeType("data.xls")); + System.out.println(MimeType.getMimeType("data.cvs")); + System.out.println(MimeType.getMimeType("data.txt")); + System.out.println(MimeType.getMimeType("data.log")); + System.out.println(MimeType.getMimeType("data.html")); + System.out.println(MimeType.getMimeType("data.htm")); + System.out.println(MimeType.getMimeType("data.png")); + System.out.println(MimeType.getMimeType("data.gif")); + System.out.println(MimeType.getMimeType("data.jpg")); + System.out.println(MimeType.getMimeType("data.xml")); + System.out.println(MimeType.getMimeType("data.rtf")); + + System.exit(0); + + org.compiere.Adempiere.startupEnvironment(true); + MAttachment att = new MAttachment(Env.getCtx(), 100, 0, null); + att.addEntry(new File ("C:\\Adempiere\\Dev.properties")); + att.addEntry(new File ("C:\\Adempiere\\index.html")); + att.save(); + System.out.println (att); + att.dumpEntryNames(); + int AD_Attachment_ID = att.getAD_Attachment_ID(); + // + System.out.println ("==========================================="); + att = new MAttachment (Env.getCtx(), AD_Attachment_ID, null); + System.out.println (att); + att.dumpEntryNames(); + System.out.println ("==========================================="); + MAttachmentEntry[] entries = att.getEntries(); + for (int i = 0; i < entries.length; i++) + { + MAttachmentEntry entry = entries[i]; + entry.dump(); + } + System.out.println ("==========================================="); + att.delete(true); + } // main + +} // MAttachment diff --git a/dbPort/src/org/compiere/model/MAttachmentEntry.java b/dbPort/src/org/compiere/model/MAttachmentEntry.java new file mode 100644 index 0000000000..2f2d8f0d11 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAttachmentEntry.java @@ -0,0 +1,290 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * Individual Attachment Entry of MAttachment + * + * @author Jorg Janke + * @version $Id: MAttachmentEntry.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MAttachmentEntry +{ + /** + * Attachment Entry + * @param name name + * @param data binary data + * @param index optional index + */ + public MAttachmentEntry (String name, byte[] data, int index) + { + super (); + setName (name); + setData (data); + if (index > 0) + m_index = index; + else + { + long now = System.currentTimeMillis(); + if (s_seed+3600000l < now) // older then 1 hour + { + s_seed = now; + s_random = new Random(s_seed); + } + m_index = s_random.nextInt(); + } + } // MAttachmentItem + + /** + * Attachment Entry + * @param name name + * @param data binary data + */ + public MAttachmentEntry (String name, byte[] data) + { + this (name, data, 0); + } // MAttachmentItem + + /** The Name */ + private String m_name = "?"; + /** The Data */ + private byte[] m_data = null; + + /** Random Seed */ + private static long s_seed = System.currentTimeMillis(); + /** Random Number */ + private static Random s_random = new Random(s_seed); + /** Index */ + private int m_index = 0; + + /** Logger */ + protected CLogger log = CLogger.getCLogger(getClass()); + + + /** + * @return Returns the data. + */ + public byte[] getData () + { + return m_data; + } + /** + * @param data The data to set. + */ + public void setData (byte[] data) + { + m_data = data; + } + /** + * @return Returns the name. + */ + public String getName () + { + return m_name; + } + + /** + * @param name The name to set. + */ + public void setName (String name) + { + if (name != null) + m_name = name; + if (m_name == null) + m_name = "?"; + } // setName + + /** + * Get Attachment Index + * @return timestamp + */ + public int getIndex() + { + return m_index; + } // getIndex + + /** + * To String + * @return name + */ + public String toString () + { + return m_name; + } // toString + + /** + * To String Extended + * @return name (length) + */ + public String toStringX () + { + StringBuffer sb = new StringBuffer (m_name); + if (m_data != null) + { + sb.append(" ("); + // + float size = m_data.length; + if (size <= 1024) + sb.append(m_data.length).append(" B"); + else + { + size /= 1024; + if (size > 1024) + { + size /= 1024; + sb.append(size).append(" MB"); + } + else + sb.append(size).append(" kB"); + } + // + sb.append(")"); + } + sb.append(" - ").append(getContentType()); + return sb.toString(); + } // toStringX + + + /** + * Dump Data + */ + public void dump () + { + String hdr = "----- " + getName() + " -----"; + System.out.println (hdr); + if (m_data == null) + { + System.out.println ("----- no data -----"); + return; + } + // raw data + for (int i = 0; i < m_data.length; i++) + { + char data = (char)m_data[i]; + System.out.print(data); + } + + System.out.println (); + System.out.println (hdr); + // Count nulls at end + int ii = m_data.length -1; + int nullCount = 0; + while (m_data[ii--] == 0) + nullCount++; + System.out.println("----- Length=" + m_data.length + ", EndNulls=" + nullCount + + ", RealLength=" + (m_data.length-nullCount)); + /** + // Dump w/o nulls + if (nullCount > 0) + { + for (int i = 0; i < m_data.length-nullCount; i++) + System.out.print((char)m_data[i]); + System.out.println (); + System.out.println (hdr); + } + /** **/ + } // dump + + /** + * Get File with default name + * @return File + */ + public File getFile () + { + return getFile (getName()); + } // getFile + + /** + * Get File with name + * @param fileName optional file name + * @return file + */ + public File getFile (String fileName) + { + if (fileName == null || fileName.length() == 0) + fileName = getName(); + return getFile (new File(fileName)); + } // getFile + + /** + * Get File + * @param file out file + * @return file + */ + public File getFile (File file) + { + if (m_data == null || m_data.length == 0) + return null; + try + { + FileOutputStream fos = new FileOutputStream(file); + fos.write(m_data); + fos.close(); + } + catch (IOException ioe) + { + log.log(Level.SEVERE, "getFile", ioe); + } + return file; + } // getFile + + /** + * Is attachment entry a PDF + * @return true if PDF + */ + public boolean isPDF() + { + return m_name.endsWith(".pdf"); + } // isPDF + + /** + * Isattachment entry a Graphic + * @return true if *.gif, *.jpg, *.png + */ + public boolean isGraphic() + { + return m_name.endsWith(".gif") || m_name.endsWith(".jpg") || m_name.endsWith(".png"); + } // isGraphic + + + /** + * Get Content (Mime) Type + * @return content type + */ + public String getContentType() + { + return MimeType.getMimeType(m_name); + } // getContentType + + /** + * Get Data as Input Stream + * @return input stream + */ + public InputStream getInputStream() + { + if (m_data == null) + return null; + return new ByteArrayInputStream(m_data); + } // getInputStream + +} // MAttachmentItem diff --git a/dbPort/src/org/compiere/model/MAttachmentNote.java b/dbPort/src/org/compiere/model/MAttachmentNote.java new file mode 100644 index 0000000000..3b9c5d6dd6 --- /dev/null +++ b/dbPort/src/org/compiere/model/MAttachmentNote.java @@ -0,0 +1,79 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Attachment Note + * + * @author Jorg Janke + * @version $Id: MAttachmentNote.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MAttachmentNote extends X_AD_AttachmentNote +{ + /** + * Standard Constructor + * @param ctx context + * @param AD_AttachmentNote_ID id + * @param trxName transaction + */ + public MAttachmentNote (Properties ctx, int AD_AttachmentNote_ID, String trxName) + { + super (ctx, AD_AttachmentNote_ID, trxName); + /** + if (AD_AttachmentNote_ID == 0) + { + setAD_Attachment_ID (0); + setAD_User_ID (0); + setTextMsg (null); + setTitle (null); + } + /**/ + } // MAttachmentNote + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MAttachmentNote (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MAttachmentNote + + /** + * Parent Constructor. + * Sets current user. + * @param attach attachment + * @param Title title + * @param TextMsg ext message + */ + public MAttachmentNote (MAttachment attach, String Title, String TextMsg) + { + this (attach.getCtx(), 0, attach.get_TrxName()); + setClientOrg(attach); + setAD_Attachment_ID (attach.getAD_Attachment_ID()); + setAD_User_ID(Env.getAD_User_ID(attach.getCtx())); + setTitle (Title); + setTextMsg (TextMsg); + } // MAttachmentNote + +} // MAttachmentNote diff --git a/dbPort/src/org/compiere/model/MChangeLog.java b/dbPort/src/org/compiere/model/MChangeLog.java new file mode 100644 index 0000000000..1bafd1956c --- /dev/null +++ b/dbPort/src/org/compiere/model/MChangeLog.java @@ -0,0 +1,213 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.*; +import org.compiere.util.*; + +/** + * Change Log Model + * + * @author Jorg Janke + * @version $Id: MChangeLog.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MChangeLog extends X_AD_ChangeLog +{ + /** + * Do we track changes for this table + * @param AD_Table_ID table + * @return true if changes are tracked + */ + public static boolean isLogged (int AD_Table_ID) + { + if (s_changeLog == null || s_changeLog.length == 0) + fillChangeLog(); + // + int index = Arrays.binarySearch(s_changeLog, AD_Table_ID); + return index >= 0; + } // trackChanges + + /** + * Fill Log with tables to be logged + */ + private static void fillChangeLog() + { + ArrayList list = new ArrayList(40); + String sql = "SELECT t.AD_Table_ID FROM AD_Table t " + + "WHERE t.IsChangeLog='Y'" // also inactive + + " OR EXISTS (SELECT * FROM AD_Column c " + + "WHERE t.AD_Table_ID=c.AD_Table_ID AND c.ColumnName='EntityType') " + + "ORDER BY t.AD_Table_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new Integer(rs.getInt(1))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // Convert to Array + s_changeLog = new int [list.size()]; + for (int i = 0; i < s_changeLog.length; i++) + { + Integer id = (Integer)list.get(i); + s_changeLog[i] = id.intValue(); + } + s_log.info("#" + s_changeLog.length); + } // fillChangeLog + + /** Change Log */ + private static int[] s_changeLog = null; + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MChangeLog.class); + /** NULL Value */ + public static String NULL = "NULL"; + + + /************************************************************************** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MChangeLog(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MChangeLog + + /** + * Standard Constructor + * @param ctx context + * @param AD_ChangeLog_ID id + * @param trxName transaction + */ + public MChangeLog (Properties ctx, int AD_ChangeLog_ID, String trxName) + { + super (ctx, 0, trxName); + } // MChangeLog + + /** + * Full Constructor + * @param ctx context + * @param AD_ChangeLog_ID 0 for new change log + * @param TrxName transaction + * @param AD_Session_ID session + * @param AD_Table_ID table + * @param AD_Column_ID column + * @param Record_ID record + * @param AD_Client_ID client + * @param AD_Org_ID org + * @param OldValue old + * @param NewValue new + */ + public MChangeLog (Properties ctx, + int AD_ChangeLog_ID, String TrxName, int AD_Session_ID, + int AD_Table_ID, int AD_Column_ID, int Record_ID, + int AD_Client_ID, int AD_Org_ID, + Object OldValue, Object NewValue) + { + this (ctx, 0, null); // out of trx + if (AD_ChangeLog_ID == 0) + { + AD_ChangeLog_ID = DB.getNextID (AD_Client_ID, Table_Name, null); + if (AD_ChangeLog_ID <= 0) + log.severe("No NextID (" + AD_ChangeLog_ID + ")"); + } + setAD_ChangeLog_ID (AD_ChangeLog_ID); + setTrxName(TrxName); + setAD_Session_ID (AD_Session_ID); + // + setAD_Table_ID (AD_Table_ID); + setAD_Column_ID (AD_Column_ID); + setRecord_ID (Record_ID); + // + setClientOrg (AD_Client_ID, AD_Org_ID); + // + setOldValue (OldValue); + setNewValue (NewValue); + // R2.5.2f_2005-09-25 2.5.2f_20050925-2201 + setDescription(Adempiere.MAIN_VERSION + "_" + + Adempiere.DATE_VERSION + " " + Adempiere.getImplementationVersion()); + } // MChangeLog + + + /** + * Set Old Value + * @param OldValue old + */ + public void setOldValue (Object OldValue) + { + if (OldValue == null) + super.setOldValue (NULL); + else + super.setOldValue (OldValue.toString()); + } // setOldValue + + /** + * Is Old Value Null + * @return true if null + */ + public boolean isOldNull() + { + String value = getOldValue(); + return value == null || value.equals(NULL); + } // isOldNull + + /** + * Set New Value + * @param NewValue new + */ + public void setNewValue (Object NewValue) + { + if (NewValue == null) + super.setNewValue (NULL); + else + super.setNewValue (NewValue.toString()); + } // setNewValue + + /** + * Is New Value Null + * @return true if null + */ + public boolean isNewNull() + { + String value = getNewValue(); + return value == null || value.equals(NULL); + } // isNewNull + +} // MChangeLog diff --git a/dbPort/src/org/compiere/model/MClient.java b/dbPort/src/org/compiere/model/MClient.java new file mode 100644 index 0000000000..0f80949849 --- /dev/null +++ b/dbPort/src/org/compiere/model/MClient.java @@ -0,0 +1,785 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.rmi.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.mail.internet.*; +import java.io.*; + +import org.compiere.db.*; +import org.compiere.interfaces.*; +import org.compiere.util.*; + +/** + * Client Model + * + * @author Jorg Janke + * @version $Id: MClient.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MClient extends X_AD_Client +{ + /** + * Get client + * @param ctx context + * @param AD_Client_ID id + * @return client + */ + public static MClient get (Properties ctx, int AD_Client_ID) + { + Integer key = new Integer (AD_Client_ID); + MClient client = (MClient)s_cache.get(key); + if (client != null) + return client; + client = new MClient (ctx, AD_Client_ID, null); + s_cache.put (key, client); + return client; + } // get + + /** + * Get all clients + * @param ctx context + * @return clients + */ + public static MClient[] getAll (Properties ctx) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_Client"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + MClient client = new MClient (ctx, rs, null); + s_cache.put (new Integer (client.getAD_Client_ID()), client); + list.add (client); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MClient[] retValue = new MClient[list.size ()]; + list.toArray (retValue); + return retValue; + } // get + + /** + * Get optionally cached client + * @param ctx context + * @return client + */ + public static MClient get (Properties ctx) + { + return get (ctx, Env.getAD_Client_ID(ctx)); + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MClient.class); + /** Cache */ + private static CCache s_cache = new CCache("AD_Client", 3); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Client_ID id + * @param createNew create new + * @param trxName transaction + */ + public MClient (Properties ctx, int AD_Client_ID, boolean createNew, String trxName) + { + super (ctx, AD_Client_ID, trxName); + m_createNew = createNew; + if (AD_Client_ID == 0) + { + if (m_createNew) + { + // setValue (null); + // setName (null); + setAD_Org_ID(0); + setIsMultiLingualDocument (false); + setIsSmtpAuthorization (false); + setIsUseBetaFunctions (true); + setIsServerEMail(false); + setAD_Language(Language.getBaseAD_Language()); + setAutoArchive(AUTOARCHIVE_None); + setMMPolicy (MMPOLICY_FiFo); // F + setIsPostImmediate(false); + setIsCostImmediate(false); + } + else + load(get_TrxName()); + } + } // MClient + + /** + * Standard Constructor + * @param ctx context + * @param AD_Client_ID id + * @param trxName transaction + */ + public MClient (Properties ctx, int AD_Client_ID, String trxName) + { + this (ctx, AD_Client_ID, false, trxName); + } // MClient + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MClient (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MClient + + /** + * Simplified Constructor + * @param ctx context + * @param trxName transaction + */ + public MClient (Properties ctx, String trxName) + { + this (ctx, Env.getAD_Client_ID(ctx), trxName); + } // MClient + + /** Client Info */ + private MClientInfo m_info = null; + /** Language */ + private Language m_language = null; + /** New Record */ + private boolean m_createNew = false; + /** Client Info Setup Tree for Account */ + private int m_AD_Tree_Account_ID; + + /** + * Get SMTP Host + * @return SMTP or loaclhost + */ + public String getSMTPHost() + { + String s = super.getSMTPHost(); + if (s == null) + s = "localhost"; + return s; + } // getSMTPHost + + /** + * Get Client Info + * @return Client Info + */ + public MClientInfo getInfo() + { + if (m_info == null) + m_info = MClientInfo.get (getCtx(), getAD_Client_ID(), get_TrxName()); + return m_info; + } // getMClientInfo + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer ("MClient[") + .append(get_ID()).append("-").append(getValue()) + .append("]"); + return sb.toString(); + } // toString + + /** + * Get Default Accounting Currency + * @return currency or 0 + */ + public int getC_Currency_ID() + { + if (m_info == null) + getInfo(); + if (m_info != null) + return m_info.getC_Currency_ID(); + return 0; + } // getC_Currency_ID + + /** + * Get Language + * @return client language + */ + public Language getLanguage() + { + if (m_language == null) + { + m_language = Language.getLanguage(getAD_Language()); + Env.verifyLanguage (getCtx(), m_language); + } + return m_language; + } // getLanguage + + + /** + * Set AD_Language + * @param AD_Language new language + */ + public void setAD_Language (String AD_Language) + { + m_language = null; + super.setAD_Language (AD_Language); + } // setAD_Language + + /** + * Get AD_Language + * @return Language + */ + public String getAD_Language () + { + String s = super.getAD_Language (); + if (s == null) + return Language.getBaseAD_Language(); + return s; + } // getAD_Language + + /** + * Get Locale + * @return locale + */ + public Locale getLocale() + { + Language lang = getLanguage(); + if (lang != null) + return lang.getLocale(); + return Locale.getDefault(); + } // getLocale + + + /************************************************************************** + * Create Trees and Setup Client Info + * @param language language + * @return true if created + */ + public boolean setupClientInfo (String language) + { + // Create Trees + String sql = null; + if (Env.isBaseLanguage (language, "AD_Ref_List")) // Get TreeTypes & Name + sql = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=120 AND IsActive='Y'"; + else + sql = "SELECT l.Value, t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t " + + "WHERE l.AD_Reference_ID=120 AND l.AD_Ref_List_ID=t.AD_Ref_List_ID AND l.IsActive='Y'"; + + // Tree IDs + int AD_Tree_Org_ID=0, AD_Tree_BPartner_ID=0, AD_Tree_Project_ID=0, + AD_Tree_SalesRegion_ID=0, AD_Tree_Product_ID=0, + AD_Tree_Campaign_ID=0, AD_Tree_Activity_ID=0; + + boolean success = false; + try + { + PreparedStatement stmt = DB.prepareStatement(sql, get_TrxName()); + ResultSet rs = stmt.executeQuery(); + MTree_Base tree = null; + while (rs.next()) + { + String value = rs.getString(1); + String name = getName() + " " + rs.getString(2); + // + if (value.equals(MTree_Base.TREETYPE_Organization)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_Org_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_BPartner)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_BPartner_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_Project)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_Project_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_SalesRegion)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_SalesRegion_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_Product)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_Product_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_ElementValue)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + m_AD_Tree_Account_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_Campaign)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_Campaign_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_Activity)) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + AD_Tree_Activity_ID = tree.getAD_Tree_ID(); + } + else if (value.equals(MTree_Base.TREETYPE_Menu)) // No Menu + success = true; + else // PC (Product Category), BB (BOM) + { + tree = new MTree_Base (this, name, value); + success = tree.save(); + } + if (!success) + { + log.log(Level.SEVERE, "Tree NOT created: " + name); + break; + } + } + rs.close(); + stmt.close(); + } + catch (SQLException e1) + { + log.log(Level.SEVERE, "Trees", e1); + success = false; + } + + if (!success) + return false; + + // Create ClientInfo + MClientInfo clientInfo = new MClientInfo (this, + AD_Tree_Org_ID, AD_Tree_BPartner_ID, AD_Tree_Project_ID, + AD_Tree_SalesRegion_ID, AD_Tree_Product_ID, + AD_Tree_Campaign_ID, AD_Tree_Activity_ID, get_TrxName()); + success = clientInfo.save(); + return success; + } // createTrees + + /** + * Get AD_Tree_Account_ID created in setup client info + * @return Account Tree ID + */ + public int getSetup_AD_Tree_Account_ID() + { + return m_AD_Tree_Account_ID; + } // getSetup_AD_Tree_Account_ID + + /** + * Is Auto Archive on + * @return true if auto archive + */ + public boolean isAutoArchive() + { + String aa = getAutoArchive(); + return aa != null && !aa.equals(AUTOARCHIVE_None); + } // isAutoArchive + + + /** + * Update Trl Tables automatically? + * @param TableName table name + * @return true if automatically translated + */ + public boolean isAutoUpdateTrl (String TableName) + { + if (super.isMultiLingualDocument()) + return false; + if (TableName == null) + return false; + // Not Multi-Lingual Documents - only Doc Related + if (TableName.startsWith("AD")) + return false; + return true; + } // isMultiLingualDocument + + /** + * Get Primary Accounting Schema + * @return Acct Schema or null + */ + public MAcctSchema getAcctSchema() + { + if (m_info == null) + m_info = MClientInfo.get (getCtx(), getAD_Client_ID(), get_TrxName()); + if (m_info != null) + { + int C_AcctSchema_ID = m_info.getC_AcctSchema1_ID(); + if (C_AcctSchema_ID != 0) + return MAcctSchema.get(getCtx(), C_AcctSchema_ID); + } + return null; + } // getMClientInfo + + /** + * Save + * @return true if saved + */ + public boolean save () + { + if (get_ID() == 0 && !m_createNew) + return saveUpdate(); + return super.save (); + } // save + + + /************************************************************************** + * Test EMail + * @return OK or error + */ + public String testEMail() + { + if (getRequestEMail() == null || getRequestEMail().length() == 0) + return "No Request EMail for " + getName(); + // + EMail email = createEMail (getRequestEMail(), + "Adempiere EMail Test", + "Adempiere EMail Test: " + toString()); + if (email == null) + return "Could not create EMail: " + getName(); + try + { + String msg = email.send(); + if (EMail.SENT_OK.equals (msg)) + { + log.info("Sent Test EMail to " + getRequestEMail()); + return "OK"; + } + else + { + log.warning("Could NOT send Test EMail from " + + getSMTPHost() + ": " + getRequestEMail() + + " (" + getRequestUser() + + ") to " + getRequestEMail() + ": " + msg); + return msg; + } + } + catch (Exception ex) + { + log.severe(getName() + " - " + ex.getLocalizedMessage()); + return ex.getLocalizedMessage(); + } + } // testEMail + + /** + * Send EMail from Request User - with trace + * @param AD_User_ID recipient + * @param subject subject + * @param message message + * @param attachment optional attachment + * @return true if sent + */ + public boolean sendEMail (int AD_User_ID, + String subject, String message, File attachment) + { + MUser to = MUser.get(getCtx(), AD_User_ID); + String toEMail = to.getEMail(); + if (toEMail == null || toEMail.length() == 0) + { + log.warning("No EMail for recipient: " + to); + return false; + } + EMail email = createEMail(null, to, subject, message); + if (email == null) + return false; + if (attachment != null) + email.addAttachment(attachment); + try + { + return sendEmailNow(null, to, email); + } + catch (Exception ex) + { + log.severe(getName() + " - " + ex.getLocalizedMessage()); + return false; + } + } // sendEMail + + /** + * Send EMail from Request User - no trace + * @param to recipient email address + * @param subject subject + * @param message message + * @param attachment optional attachment + * @return true if sent + */ + public boolean sendEMail (String to, + String subject, String message, File attachment) + { + EMail email = createEMail(to, subject, message); + if (email == null) + return false; + if (attachment != null) + email.addAttachment(attachment); + try + { + String msg = email.send(); + if (EMail.SENT_OK.equals (msg)) + { + log.info("Sent EMail " + subject + " to " + to); + return true; + } + else + { + log.warning("Could NOT Send Email: " + subject + + " to " + to + ": " + msg + + " (" + getName() + ")"); + return false; + } + } + catch (Exception ex) + { + log.severe(getName() + " - " + ex.getLocalizedMessage()); + return false; + } + } // sendEMail + + + /** + * Send EMail from User + * @param from sender + * @param to recipient + * @param subject subject + * @param message message + * @param attachment optional attachment + * @return true if sent + */ + public boolean sendEMail (MUser from, MUser to, + String subject, String message, File attachment) + { + EMail email = createEMail(from, to, subject, message); + if (email == null) + return false; + if (attachment != null) + email.addAttachment(attachment); + InternetAddress emailFrom = email.getFrom(); + try + { + return sendEmailNow(from, to, email); + } + catch (Exception ex) + { + log.severe(getName() + " - from " + emailFrom + + " to " + to + ": " + ex.getLocalizedMessage()); + return false; + } + } // sendEMail + + /** + * Send Email Now + * @param from optional from user + * @param to to user + * @param email email + * @return true if sent + */ + private boolean sendEmailNow(MUser from, MUser to, EMail email) + { + String msg = email.send(); + // + X_AD_UserMail um = new X_AD_UserMail(getCtx(), 0, null); + um.setClientOrg(this); + um.setAD_User_ID(to.getAD_User_ID()); + um.setSubject(email.getSubject()); + um.setMailText(email.getMessageCRLF()); + if (email.isSentOK()) + um.setMessageID(email.getMessageID()); + else + { + um.setMessageID(email.getSentMsg()); + um.setIsDelivered(X_AD_UserMail.ISDELIVERED_No); + } + um.save(); + + // + if (email.isSentOK()) + { + if (from != null) + log.info("Sent Email: " + email.getSubject() + + " from " + from.getEMail() + + " to " + to.getEMail()); + else + log.info("Sent Email: " + email.getSubject() + + " to " + to.getEMail()); + return true; + } + else + { + if (from != null) + log.warning("Could NOT Send Email: " + email.getSubject() + + " from " + from.getEMail() + + " to " + to.getEMail() + ": " + msg + + " (" + getName() + ")"); + else + log.warning("Could NOT Send Email: " + email.getSubject() + + " to " + to.getEMail() + ": " + msg + + " (" + getName() + ")"); + return false; + } + } // sendEmailNow + + /************ + * Create EMail from Request User + * @param to recipient + * @param subject sunject + * @param message nessage + * @return EMail + */ + public EMail createEMail (String to, + String subject, String message) + { + if (to == null || to.length() == 0) + { + log.warning("No To"); + return null; + } + // + EMail email = null; + if (isServerEMail() && Ini.isClient()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + email = server.createEMail(getCtx(), getAD_Client_ID(), + to, subject, message); + } + else + log.log(Level.WARNING, "No AppsServer"); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, getName() + " - AppsServer error", ex); + } + } + if (email == null) + email = new EMail (this, + getRequestEMail(), to, + subject, message); + if (isSmtpAuthorization()) + email.createAuthenticator (getRequestUser(), getRequestUserPW()); + return email; + } // createEMail + + /** + * Create EMail from User + * @param from optional sender + * @param to recipient + * @param subject sunject + * @param message nessage + * @return EMail + */ + public EMail createEMail (MUser from, MUser to, + String subject, String message) + { + if (to == null) + { + log.warning("No To user"); + return null; + } + if (to.getEMail() == null || to.getEMail().length() == 0) + { + log.warning("No To address: " + to); + return null; + } + return createEMail (from, to.getEMail(), subject, message); + } // createEMail + + /** + * Create EMail from User + * @param from optional sender + * @param to recipient + * @param subject sunject + * @param message nessage + * @return EMail + */ + public EMail createEMail (MUser from, String to, + String subject, String message) + { + if (to == null || to.length() == 0) + { + log.warning("No To address"); + return null; + } + // No From - send from Request + if (from == null) + return createEMail (to, subject, message); + // No From details - Error + if (from.getEMail() == null + || from.getEMailUser() == null || from.getEMailUserPW() == null) + { + log.warning("From EMail incomplete: " + from + " (" + getName() + ")"); + return null; + } + // + EMail email = null; + if (isServerEMail() && Ini.isClient()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + email = server.createEMail(getCtx(), getAD_Client_ID(), + from.getAD_User_ID(), + to, subject, message); + } + else + log.log(Level.WARNING, "No AppsServer"); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, getName() + " - AppsServer error", ex); + } + } + if (email == null) + email = new EMail (this, + from.getEMail(), + to, + subject, + message); + if (isSmtpAuthorization()) + email.createAuthenticator (from.getEMailUser(), from.getEMailUserPW()); + return email; + } // createEMail + +} // MClient diff --git a/dbPort/src/org/compiere/model/MClientInfo.java b/dbPort/src/org/compiere/model/MClientInfo.java new file mode 100644 index 0000000000..86154ece9b --- /dev/null +++ b/dbPort/src/org/compiere/model/MClientInfo.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.util.*; +import java.sql.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Client Info Model + * + * @author Jorg Janke + * @version $Id: MClientInfo.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MClientInfo extends X_AD_ClientInfo +{ + /** + * Get Client Info + * @param ctx context + * @param AD_Client_ID id + * @return Client Info + */ + public static MClientInfo get (Properties ctx, int AD_Client_ID) + { + return get(ctx, AD_Client_ID, null); + } // get + + /** + * Get Client Info + * @param ctx context + * @param AD_Client_ID id + * @param trxName optional trx + * @return Client Info + */ + public static MClientInfo get (Properties ctx, int AD_Client_ID, String trxName) + { + Integer key = new Integer (AD_Client_ID); + MClientInfo info = (MClientInfo)s_cache.get(key); + if (info != null) + return info; + // + String sql = "SELECT * FROM AD_ClientInfo WHERE AD_Client_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, AD_Client_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + info = new MClientInfo (ctx, rs, null); + if (trxName == null) + s_cache.put (key, info); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, sql, ex); + } + try + { + if (pstmt != null) + pstmt.close (); + } + catch (SQLException ex1) + { + } + pstmt = null; + // + return info; + } // get + + /** + * Get optionally cached client + * @param ctx context + * @return client + */ + public static MClientInfo get (Properties ctx) + { + return get (ctx, Env.getAD_Client_ID(ctx), null); + } // get + + /** Cache */ + private static CCache s_cache = new CCache("AD_ClientInfo", 2); + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MClientInfo.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MClientInfo (Properties ctx, int ignored, String trxName) + { + super (ctx, ignored, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MClientInfo + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MClientInfo (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MClientInfo + + /** + * Parent Constructor + * @param client client + * @param AD_Tree_Org_ID org tree + * @param AD_Tree_BPartner_ID bp tree + * @param AD_Tree_Project_ID project tree + * @param AD_Tree_SalesRegion_ID sr tree + * @param AD_Tree_Product_ID product tree + * @param AD_Tree_Campaign_ID campaign tree + * @param AD_Tree_Activity_ID activity tree + * @param trxName transaction + */ + public MClientInfo (MClient client, int AD_Tree_Org_ID, int AD_Tree_BPartner_ID, + int AD_Tree_Project_ID, int AD_Tree_SalesRegion_ID, int AD_Tree_Product_ID, + int AD_Tree_Campaign_ID, int AD_Tree_Activity_ID, String trxName) + { + super (client.getCtx(), 0, trxName); + setAD_Client_ID(client.getAD_Client_ID()); // to make sure + setAD_Org_ID(0); + setIsDiscountLineAmt (false); + // + setAD_Tree_Menu_ID(10); // HARDCODED + // + setAD_Tree_Org_ID(AD_Tree_Org_ID); + setAD_Tree_BPartner_ID(AD_Tree_BPartner_ID); + setAD_Tree_Project_ID(AD_Tree_Project_ID); + setAD_Tree_SalesRegion_ID(AD_Tree_SalesRegion_ID); + setAD_Tree_Product_ID(AD_Tree_Product_ID); + setAD_Tree_Campaign_ID(AD_Tree_Campaign_ID); + setAD_Tree_Activity_ID(AD_Tree_Activity_ID); + // + m_createNew = true; + } // MClientInfo + + + /** Account Schema */ + private MAcctSchema m_acctSchema = null; + /** New Record */ + private boolean m_createNew = false; + + /** + * Get primary Acct Schema + * @return acct schema + */ + public MAcctSchema getMAcctSchema1() + { + if (m_acctSchema == null && getC_AcctSchema1_ID() != 0) + m_acctSchema = new MAcctSchema (getCtx(), getC_AcctSchema1_ID(), null); + return m_acctSchema; + } // getMAcctSchema1 + + /** + * Get Default Accounting Currency + * @return currency or 0 + */ + public int getC_Currency_ID() + { + if (m_acctSchema == null) + getMAcctSchema1(); + if (m_acctSchema != null) + return m_acctSchema.getC_Currency_ID(); + return 0; + } // getC_Currency_ID + + + /** + * Overwrite Save + * @overwrite + * @return true if saved + */ + public boolean save () + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + if (m_createNew) + return super.save (); + return saveUpdate(); + } // save + +} // MClientInfo diff --git a/dbPort/src/org/compiere/model/MClientShare.java b/dbPort/src/org/compiere/model/MClientShare.java new file mode 100644 index 0000000000..11606651d0 --- /dev/null +++ b/dbPort/src/org/compiere/model/MClientShare.java @@ -0,0 +1,291 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.util.*; + +/** + * Client Share Info + * + * @author Jorg Janke + * @version $Id: MClientShare.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MClientShare extends X_AD_ClientShare +{ + /** + * Is Table Client Level Only + * @param AD_Client_ID client + * @param AD_Table_ID table + * @return true if client level only (default false) + */ + public static boolean isClientLevelOnly (int AD_Client_ID, int AD_Table_ID) + { + Boolean share = isShared(AD_Client_ID, AD_Table_ID); + if (share != null) + return share.booleanValue(); + return false; + } // isClientLevel + + /** + * Is Table Org Level Only + * @param AD_Client_ID client + * @param AD_Table_ID table + * @return true if Org level only (default false) + */ + public static boolean isOrgLevelOnly (int AD_Client_ID, int AD_Table_ID) + { + Boolean share = isShared(AD_Client_ID, AD_Table_ID); + if (share != null) + return !share.booleanValue(); + return false; + } // isOrgLevel + + /** + * Is Table Shared for Client + * @param AD_Client_ID client + * @param AD_Table_ID table + * @return info or null + */ + private static Boolean isShared (int AD_Client_ID, int AD_Table_ID) + { + // Load + if (s_shares.isEmpty()) + { + String sql = "SELECT AD_Client_ID, AD_Table_ID, ShareType " + + "FROM AD_ClientShare WHERE ShareType<>'x' AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + int Client_ID = rs.getInt(1); + int table_ID = rs.getInt(2); + String key = Client_ID + "_" + table_ID; + String ShareType = rs.getString(3); + if (ShareType.equals(SHARETYPE_ClientAllShared)) + s_shares.put(key, Boolean.TRUE); + else if (ShareType.equals(SHARETYPE_OrgNotShared)) + s_shares.put(key, Boolean.FALSE); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (s_shares.isEmpty()) // put in something + s_shares.put("0_0", Boolean.TRUE); + } // load + String key = AD_Client_ID + "_" + AD_Table_ID; + return s_shares.get(key); + } // load + + /** Shared Info */ + private static CCache s_shares + = new CCache("AD_ClientShare", 10, 120); // 2h + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MClientShare.class); + + /************************************************************************** + * Default Constructor + * @param ctx context + * @param AD_ClientShare_ID id + * @param trxName trx + */ + public MClientShare (Properties ctx, int AD_ClientShare_ID, String trxName) + { + super (ctx, AD_ClientShare_ID, trxName); + } // MClientShare + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MClientShare (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MClientShare + + /** The Table */ + private MTable m_table = null; + + /** + * Is Client Level Only + * @return true if client level only (shared) + */ + public boolean isClientLevelOnly() + { + return getShareType().equals(SHARETYPE_ClientAllShared); + } // isClientLevelOnly + + /** + * Is Org Level Only + * @return true if org level only (not shared) + */ + public boolean isOrgLevelOnly() + { + return getShareType().equals(SHARETYPE_OrgNotShared); + } // isOrgLevelOnly + + /** + * Get Table model + * @return table + */ + public MTable getTable() + { + if (m_table == null) + m_table = MTable.get(getCtx(), getAD_Table_ID()); + return m_table; + } // getTable + + /** + * Get Table Name + * @return table name + */ + public String getTableName() + { + return getTable().getTableName(); + } // getTableName + + /** + * After Save + * @param newRecord new + * @param success success + * @return true + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (isActive()) + { + setDataToLevel(); + listChildRecords(); + } + return true; + } // afterSave + + /** + * Set Data To Level + * @return info + */ + public String setDataToLevel() + { + String info = "-"; + if (isClientLevelOnly()) + { + StringBuffer sql = new StringBuffer("UPDATE ") + .append(getTableName()) + .append(" SET AD_Org_ID=0 WHERE AD_Org_ID<>0 AND AD_Client_ID=?"); + int no = DB.executeUpdate(sql.toString(), getAD_Client_ID(), get_TrxName()); + info = getTableName() + " set to Shared #" + no; + log.info(info); + } + else if (isOrgLevelOnly()) + { + StringBuffer sql = new StringBuffer("SELECT COUNT(*) FROM ") + .append(getTableName()) + .append(" WHERE AD_Org_ID=0 WHERE AD_Client_ID=?"); + int no = DB.getSQLValue(get_TrxName(), sql.toString(), getAD_Client_ID()); + info = getTableName() + " Shared records #" + no; + log.info(info); + } + return info; + } // setDataToLevel + + /** + * List Child Tables + * @return child tables + */ + public String listChildRecords() + { + StringBuffer info = new StringBuffer(); + String sql = "SELECT AD_Table_ID, TableName " + + "FROM AD_Table t " + + "WHERE AccessLevel=3 AND IsView='N'" + + " AND EXISTS (SELECT * FROM AD_Column c " + + "WHERE t.AD_Table_ID=c.AD_Table_ID" + + " AND c.IsParent='Y'" + + " AND c.ColumnName=(SELECT ColumnName FROM AD_Column cc " + + "WHERE cc.IsKey='Y' AND cc.AD_Table_ID=?))"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getAD_Table_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + int AD_Table_ID = rs.getInt(1); + String TableName = rs.getString(2); + if (info.length() != 0) + info.append(", "); + info.append(TableName); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + log.info(info.toString()); + return info.toString(); + } // listChildRecords + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + +} // MClientShare diff --git a/dbPort/src/org/compiere/model/MColumn.java b/dbPort/src/org/compiere/model/MColumn.java new file mode 100644 index 0000000000..d75039594a --- /dev/null +++ b/dbPort/src/org/compiere/model/MColumn.java @@ -0,0 +1,401 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Persistent Column Model + * + * @author Jorg Janke + * @version $Id: MColumn.java,v 1.6 2006/08/09 05:23:49 jjanke Exp $ + */ +public class MColumn extends X_AD_Column +{ + /** + * Get M_Column from Cache + * @param ctx context + * @param AD_Column_ID id + * @return M_Column + */ + public static MColumn get (Properties ctx, int AD_Column_ID) + { + Integer key = new Integer (AD_Column_ID); + MColumn retValue = (MColumn) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MColumn (ctx, AD_Column_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** + * Get Column Name + * @param ctx context + * @param AD_Column_ID id + * @return Column Name or null + */ + public static String getColumnName (Properties ctx, int AD_Column_ID) + { + MColumn col = MColumn.get(ctx, AD_Column_ID); + if (col.get_ID() == 0) + return null; + return col.getColumnName(); + } // getColumnName + + /** Cache */ + private static CCache s_cache = new CCache("AD_Column", 20); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Column_ID + * @param trxName transaction + */ + public MColumn (Properties ctx, int AD_Column_ID, String trxName) + { + super (ctx, AD_Column_ID, trxName); + if (AD_Column_ID == 0) + { + // setAD_Element_ID (0); + // setAD_Reference_ID (0); + // setColumnName (null); + // setName (null); + // setEntityType (null); // U + setIsAlwaysUpdateable (false); // N + setIsEncrypted (false); + setIsIdentifier (false); + setIsKey (false); + setIsMandatory (false); + setIsParent (false); + setIsSelectionColumn (false); + setIsTranslated (false); + setIsUpdateable (true); // Y + setVersion (Env.ZERO); + } + } // M_Column + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MColumn (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // M_Column + + /** + * Parent Constructor + * @param parent table + */ + public MColumn (MTable parent) + { + this (parent.getCtx(), 0, parent.get_TrxName()); + setClientOrg(parent); + setAD_Table_ID (parent.getAD_Table_ID()); + setEntityType(parent.getEntityType()); + } // M_Column + + + /** + * Is Standard Column + * @return true for AD_Client_ID, etc. + */ + public boolean isStandardColumn() + { + String columnName = getColumnName(); + if (columnName.equals("AD_Client_ID") + || columnName.equals("AD_Org_ID") + || columnName.equals("IsActive") + || columnName.startsWith("Created") + || columnName.startsWith("Updated") ) + return true; + + return false; + } // isStandardColumn + + /** + * Is Virtual Column + * @return true if virtual column + */ + public boolean isVirtualColumn() + { + String s = getColumnSQL(); + return s != null && s.length() > 0; + } // isVirtualColumn + + /** + * Is the Column Encrypted? + * @return true if encrypted + */ + public boolean isEncrypted() + { + String s = getIsEncrypted(); + return "Y".equals(s); + } // isEncrypted + + /** + * Set Encrypted + * @param IsEncrypted encrypted + */ + public void setIsEncrypted (boolean IsEncrypted) + { + setIsEncrypted (IsEncrypted ? "Y" : "N"); + } // setIsEncrypted + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getFieldLength() == 0 // LOB can be 0 + && !DisplayType.isLOB(getAD_Reference_ID())) + { + log.saveError("FillMandatory", Msg.getElement(getCtx(), "FieldLength")); + return false; + } + + /** Views are not updateable + UPDATE AD_Column c + SET IsUpdateable='N', IsAlwaysUpdateable='N' + WHERE AD_Table_ID IN (SELECT AD_Table_ID FROM AD_Table WHERE IsView='Y') + **/ + + // Virtual Column + if (isVirtualColumn()) + { + if (isMandatory()) + setIsMandatory(false); + if (isUpdateable()) + setIsUpdateable(false); + } + // Updateable + if (isParent() || isKey()) + setIsUpdateable(false); + if (isAlwaysUpdateable() && !isUpdateable()) + setIsAlwaysUpdateable(false); + // Encrypted + if (isEncrypted()) + { + int dt = getAD_Reference_ID(); + if (isKey() || isParent() || isStandardColumn() + || isVirtualColumn() || isIdentifier() || isTranslated() + || DisplayType.isLookup(dt) || DisplayType.isLOB(dt) + || "DocumentNo".equalsIgnoreCase(getColumnName()) + || "Value".equalsIgnoreCase(getColumnName()) + || "Name".equalsIgnoreCase(getColumnName())) + { + log.warning("Encryption not sensible - " + getColumnName()); + setIsEncrypted(false); + } + } + return true; + } // beforeSave + + + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + // Update Fields + if (!newRecord) + { + StringBuffer sql = new StringBuffer("UPDATE AD_Field SET Name=") + .append(DB.TO_STRING(getName())) + .append(", Description=").append(DB.TO_STRING(getDescription())) + .append(", Help=").append(DB.TO_STRING(getHelp())) + .append(" WHERE AD_Column_ID=").append(get_ID()) + .append(" AND IsCentrallyMaintained='Y'"); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine("afterSave - Fields updated #" + no); + } + return success; + } // afterSave + + /** + * Get SQL Add command + * @param table table + * @return sql + */ + public String getSQLAdd (MTable table) + { + StringBuffer sql = new StringBuffer ("ALTER TABLE ") + .append(table.getTableName()) + .append(" ADD ").append(getSQLDDL()); + return sql.toString(); + } // getSQLAdd + + /** + * Get SQL DDL + * @return columnName datataype .. + */ + public String getSQLDDL() + { + StringBuffer sql = new StringBuffer (getColumnName()) + .append(" ").append(getSQLDataType()); + // Default + if (getDefaultValue() != null && getDefaultValue().length() > 0 + // globalqss 2005-11-03 + && (! getDefaultValue().equals("@#AD_Org_ID@")) + && (! getDefaultValue().equals("@#AD_Client_ID@")) + && (! getDefaultValue().equals("@AD_Org_ID@")) + && (! getDefaultValue().equals("@AD_Client_ID@")) + // end globalqss 2005-11-03 + ) + { + sql.append(" DEFAULT "); + if (DisplayType.isText(getAD_Reference_ID())) + sql.append(DB.TO_STRING(getDefaultValue())); + else + sql.append(getDefaultValue()); + } + // Inline Constraint + if (getAD_Reference_ID() == DisplayType.YesNo) + sql.append(" CHECK (").append(getColumnName()).append(" IN ('Y','N'))"); + + // Null + if (isMandatory()) + sql.append(" NOT NULL"); + return sql.toString(); + } // getSQLDDL + + /** + * Get SQL Modify command + * @param table table + * @param setNullOption generate null / not null statement + * @return sql separated by ; + */ + public String getSQLModify (MTable table, boolean setNullOption) + { + StringBuffer sql = new StringBuffer(); + StringBuffer sqlBase = new StringBuffer ("ALTER TABLE ") + .append(table.getTableName()) + .append(" MODIFY ").append(getColumnName()); + + // Default + StringBuffer sqlDefault = new StringBuffer(sqlBase) + .append(" ").append(getSQLDataType()) + .append(" DEFAULT "); + String defaultValue = getDefaultValue(); + if (defaultValue != null + && defaultValue.length() > 0 + && defaultValue.indexOf("@") == -1) // no variables + { + if (DisplayType.isText(getAD_Reference_ID()) + || getAD_Reference_ID() == DisplayType.List + || getAD_Reference_ID() == DisplayType.YesNo) + { + if (!defaultValue.startsWith("'") && !defaultValue.endsWith("'")) + defaultValue = DB.TO_STRING(defaultValue); + } + sqlDefault.append(defaultValue); + } + else + { + sqlDefault.append(" NULL "); + defaultValue = null; + } + sql.append(sqlDefault); + + // Constraint + + // Null Values + if (isMandatory() && defaultValue != null && defaultValue.length() > 0) + { + StringBuffer sqlSet = new StringBuffer("UPDATE ") + .append(table.getTableName()) + .append(" SET ").append(getColumnName()) + .append("=").append(defaultValue) + .append(" WHERE ").append(getColumnName()).append(" IS NULL"); + sql.append(DB.SQLSTATEMENT_SEPARATOR).append(sqlSet); + } + + // Null + if (setNullOption) + { + StringBuffer sqlNull = new StringBuffer(sqlBase); + if (isMandatory()) + sqlNull.append(" NOT NULL"); + else + sqlNull.append(" NULL"); + sql.append(DB.SQLSTATEMENT_SEPARATOR).append(sqlNull); + } + // + return sql.toString(); + } // getSQLModify + + /** + * Get SQL Data Type + * @return e.g. NVARCHAR2(60) + */ + private String getSQLDataType() + { + int dt = getAD_Reference_ID(); + if (DisplayType.isID(dt) || dt == DisplayType.Integer) + return "NUMBER(10)"; + if (DisplayType.isDate(dt)) + return "DATE"; + if (DisplayType.isNumeric(dt)) + return "NUMBER"; + if (dt == DisplayType.Binary) + return "BLOB"; + if (dt == DisplayType.TextLong) + return "CLOB"; + if (dt == DisplayType.YesNo) + return "CHAR(1)"; + if (dt == DisplayType.List) + return "CHAR(" + getFieldLength() + ")"; + else if (!DisplayType.isText(dt)) + log.severe("Unhandled Data Type = " + dt); + + return "NVARCHAR2(" + getFieldLength() + ")"; + } // getSQLDataType + + /** + * Get Table Constraint + * @param tableName table name + * @return table constraint + */ + public String getConstraint(String tableName) + { + if (isKey()) + return "CONSTRAINT " + tableName + "_Key PRIMARY KEY (" + getColumnName() + ")"; + /** + if (getAD_Reference_ID() == DisplayType.TableDir + || getAD_Reference_ID() == DisplayType.Search) + return "CONSTRAINT " ADTable_ADTableTrl + + " FOREIGN KEY (" + getColumnName() + ") REFERENCES " + + AD_Table(AD_Table_ID) ON DELETE CASCADE + **/ + + return ""; + } // getConstraint + +} // M_Column diff --git a/dbPort/src/org/compiere/model/MColumnAccess.java b/dbPort/src/org/compiere/model/MColumnAccess.java new file mode 100644 index 0000000000..f9c1ebabf7 --- /dev/null +++ b/dbPort/src/org/compiere/model/MColumnAccess.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Column Access Model + * + * @author Jorg Janke + * @version $Id: MColumnAccess.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MColumnAccess extends X_AD_Column_Access +{ + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MColumnAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MColumnAccess + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MColumnAccess(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MColumnAccess + + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MColumnAccess["); + sb.append("AD_Role_ID=").append(getAD_Role_ID()) + .append(",AD_Table_ID=").append(getAD_Table_ID()) + .append(",AD_Column_ID=").append(getAD_Column_ID()) + .append(",Exclude=").append(isExclude()); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Extended String Representation. + * @param ctx context + * @return extended info + */ + public String toStringX (Properties ctx) + { + String in = Msg.getMsg(ctx, "Include"); + String ex = Msg.getMsg(ctx, "Exclude"); + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(ctx, "AD_Table_ID")) + .append("=").append(getTableName(ctx)).append(", ") + .append(Msg.translate(ctx, "AD_Column_ID")) + .append("=").append(getColumnName(ctx)) + .append(" (").append(Msg.translate(ctx, "IsReadOnly")).append("=").append(isReadOnly()) + .append(") - ").append(isExclude() ? ex : in); + return sb.toString(); + } // toStringX + + /** TableName */ + private String m_tableName; + /** ColumnName */ + private String m_columnName; + + /** + * Get Table Name + * @param ctx context for translatioin + * @return table name + */ + public String getTableName (Properties ctx) + { + if (m_tableName == null) + getColumnName(ctx); + return m_tableName; + } // getTableName + + /** + * Get Column Name + * @param ctx context for translatioin + * @return column name + */ + public String getColumnName (Properties ctx) + { + if (m_columnName == null) + { + String sql = "SELECT t.TableName,c.ColumnName, t.AD_Table_ID " + + "FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) " + + "WHERE AD_Column_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Column_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + m_tableName = rs.getString(1); + m_columnName = rs.getString(2); + if (rs.getInt(3) != getAD_Table_ID()) + log.log(Level.SEVERE, "AD_Table_ID inconsistent - Access=" + getAD_Table_ID() + " - Table=" + rs.getInt(3)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // Get Clear Text + String realName = Msg.translate(ctx, m_tableName + "_ID"); + if (!realName.equals(m_tableName + "_ID")) + m_tableName = realName; + m_columnName = Msg.translate(ctx, m_columnName); + } + return m_columnName; + } // getColumnName + +} // MColumnAccess diff --git a/dbPort/src/org/compiere/model/MConversionRate.java b/dbPort/src/org/compiere/model/MConversionRate.java new file mode 100644 index 0000000000..4a3081fc43 --- /dev/null +++ b/dbPort/src/org/compiere/model/MConversionRate.java @@ -0,0 +1,345 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.*; +import java.sql.*; +import java.text.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Currency Conversion Rate Model + * + * @author Jorg Janke + * @version $Id: MConversionRate.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MConversionRate extends X_C_Conversion_Rate +{ + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MConversionRate.class); + + + /** + * Convert an amount to base Currency + * @param ctx context + * @param CurFrom_ID The C_Currency_ID FROM + * @param ConvDate conversion date - if null - use current date + * @param C_ConversionType_ID conversion rate type - if 0 - use Default + * @param Amt amount to be converted + * @param AD_Client_ID client + * @param AD_Org_ID organization + * @return converted amount + */ + public static BigDecimal convertBase (Properties ctx, + BigDecimal Amt, int CurFrom_ID, + Timestamp ConvDate, int C_ConversionType_ID, + int AD_Client_ID, int AD_Org_ID) + { + return convert (ctx, Amt, CurFrom_ID, MClient.get(ctx).getC_Currency_ID(), + ConvDate, C_ConversionType_ID, AD_Client_ID, AD_Org_ID); + } // convertBase + + + /** + * Convert an amount with today's default rate + * @param ctx context + * @param CurFrom_ID The C_Currency_ID FROM + * @param CurTo_ID The C_Currency_ID TO + * @param Amt amount to be converted + * @param AD_Client_ID client + * @param AD_Org_ID organization + * @return converted amount + */ + public static BigDecimal convert (Properties ctx, + BigDecimal Amt, int CurFrom_ID, int CurTo_ID, + int AD_Client_ID, int AD_Org_ID) + { + return convert (ctx, Amt, CurFrom_ID, CurTo_ID, null, 0, AD_Client_ID, AD_Org_ID); + } // convert + + /** + * Convert an amount + * @param ctx context + * @param CurFrom_ID The C_Currency_ID FROM + * @param CurTo_ID The C_Currency_ID TO + * @param ConvDate conversion date - if null - use current date + * @param C_ConversionType_ID conversion rate type - if 0 - use Default + * @param Amt amount to be converted + * @param AD_Client_ID client + * @param AD_Org_ID organization + * @return converted amount or null if no rate + */ + public static BigDecimal convert (Properties ctx, + BigDecimal Amt, int CurFrom_ID, int CurTo_ID, + Timestamp ConvDate, int C_ConversionType_ID, + int AD_Client_ID, int AD_Org_ID) + { + if (Amt == null) + throw new IllegalArgumentException("Required parameter missing - Amt"); + if (CurFrom_ID == CurTo_ID || Amt.equals(Env.ZERO)) + return Amt; + // Get Rate + BigDecimal retValue = getRate (CurFrom_ID, CurTo_ID, + ConvDate, C_ConversionType_ID, + AD_Client_ID, AD_Org_ID); + if (retValue == null) + return null; + + // Get Amount in Currency Precision + retValue = retValue.multiply(Amt); + int stdPrecision = MCurrency.getStdPrecision(ctx, CurTo_ID); + if (retValue.scale() > stdPrecision) + retValue = retValue.setScale(stdPrecision, BigDecimal.ROUND_HALF_UP); + + return retValue; + } // convert + + /** + * Get Currency Conversion Rate + * @param CurFrom_ID The C_Currency_ID FROM + * @param CurTo_ID The C_Currency_ID TO + * @param ConvDate The Conversion date - if null - use current date + * @param ConversionType_ID Conversion rate type - if 0 - use Default + * @param AD_Client_ID client + * @param AD_Org_ID organization + * @return currency Rate or null + */ + public static BigDecimal getRate (int CurFrom_ID, int CurTo_ID, + Timestamp ConvDate, int ConversionType_ID, int AD_Client_ID, int AD_Org_ID) + { + if (CurFrom_ID == CurTo_ID) + return Env.ONE; + // Conversion Type + int C_ConversionType_ID = ConversionType_ID; + if (C_ConversionType_ID == 0) + C_ConversionType_ID = MConversionType.getDefault(AD_Client_ID); + // Conversion Date + if (ConvDate == null) + ConvDate = new Timestamp (System.currentTimeMillis()); + + // Get Rate + String sql = "SELECT MultiplyRate " + + "FROM C_Conversion_Rate " + + "WHERE C_Currency_ID=?" // #1 + + " AND C_Currency_ID_To=?" // #2 + + " AND C_ConversionType_ID=?" // #3 + + " AND ? BETWEEN ValidFrom AND ValidTo" // #4 TRUNC (?) ORA-00932: inconsistent datatypes: expected NUMBER got TIMESTAMP + + " AND AD_Client_ID IN (0,?)" // #5 + + " AND AD_Org_ID IN (0,?) " // #6 + + "ORDER BY AD_Client_ID DESC, AD_Org_ID DESC, ValidFrom DESC"; + BigDecimal retValue = null; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, CurFrom_ID); + pstmt.setInt(2, CurTo_ID); + pstmt.setInt(3, C_ConversionType_ID); + pstmt.setTimestamp(4, ConvDate); + pstmt.setInt(5, AD_Client_ID); + pstmt.setInt(6, AD_Org_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getBigDecimal(1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "getRate", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (retValue == null) + s_log.info ("getRate - not found - CurFrom=" + CurFrom_ID + + ", CurTo=" + CurTo_ID + + ", " + ConvDate + + ", Type=" + ConversionType_ID + (ConversionType_ID==C_ConversionType_ID ? "" : "->" + C_ConversionType_ID) + + ", Client=" + AD_Client_ID + + ", Org=" + AD_Org_ID); + return retValue; + } // getRate + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_Conversion_Rate_ID id + * @param trxName transaction + */ + public MConversionRate (Properties ctx, int C_Conversion_Rate_ID, String trxName) + { + super(ctx, C_Conversion_Rate_ID, trxName); + if (C_Conversion_Rate_ID == 0) + { + // setC_Conversion_Rate_ID (0); + // setC_Currency_ID (0); + // setC_Currency_ID_To (null); + super.setDivideRate (Env.ZERO); + super.setMultiplyRate (Env.ZERO); + setValidFrom (new Timestamp(System.currentTimeMillis())); + } + } // MConversionRate + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MConversionRate (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MConversionRate + + /** + * New Constructor + * @param po parent + * @param C_ConversionType_ID conversion type + * @param C_Currency_ID currency + * @param C_Currency_ID_To currency to + * @param MultiplyRate multiply rate + * @param ValidFrom valid from + */ + public MConversionRate (PO po, + int C_ConversionType_ID, + int C_Currency_ID, int C_Currency_ID_To, + BigDecimal MultiplyRate, Timestamp ValidFrom) + { + this (po.getCtx(), 0, po.get_TrxName()); + setClientOrg(po); + setC_ConversionType_ID (C_ConversionType_ID); + setC_Currency_ID (C_Currency_ID); + setC_Currency_ID_To (C_Currency_ID_To); + // + setMultiplyRate (MultiplyRate); + setValidFrom(ValidFrom); + } // MConversionRate + + /** + * Set Multiply Rate + * Sets also Divide Rate + * @param MultiplyRate multiply rate + */ + public void setMultiplyRate (BigDecimal MultiplyRate) + { + if (MultiplyRate == null + || MultiplyRate.compareTo(Env.ZERO) == 0 + || MultiplyRate.compareTo(Env.ONE) == 0) + { + super.setDivideRate(Env.ONE); + super.setMultiplyRate(Env.ONE); + } + else + { + super.setMultiplyRate(MultiplyRate); + double dd = 1 / MultiplyRate.doubleValue(); + super.setDivideRate(new BigDecimal(dd)); + } + } // setMultiplyRate + + /** + * Set Divide Rate. + * Sets also Multiply Rate + * @param DivideRate divide rate + */ + public void setDivideRate (BigDecimal DivideRate) + { + if (DivideRate == null + || DivideRate.compareTo(Env.ZERO) == 0 + || DivideRate.compareTo(Env.ONE) == 0) + { + super.setDivideRate(Env.ONE); + super.setMultiplyRate(Env.ONE); + } + else + { + super.setDivideRate(DivideRate); + double dd = 1 / DivideRate.doubleValue(); + super.setMultiplyRate(new BigDecimal(dd)); + } + } // setDivideRate + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MConversionRate["); + sb.append(get_ID()) + .append(",Currency=").append(getC_Currency_ID()) + .append(",To=").append(getC_Currency_ID_To()) + .append(", Multiply=").append(getMultiplyRate()) + .append(",Divide=").append(getDivideRate()) + .append(", ValidFrom=").append(getValidFrom()); + sb.append("]"); + return sb.toString(); + } // toString + + + /** + * Before Save. + * - Same Currency + * - Date Range Check + * - Set To date to 2056 + * @param newRecord new + * @return true if OK to save + */ + protected boolean beforeSave (boolean newRecord) + { + // From - To is the same + if (getC_Currency_ID() == getC_Currency_ID_To()) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@C_Currency_ID@ = @C_Currency_ID@")); + return false; + } + // Nothing to convert + if (getMultiplyRate().compareTo(Env.ZERO) <= 0) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@MultiplyRate@ <= 0")); + return false; + } + + // Date Range Check + Timestamp from = getValidFrom(); + if (getValidTo() == null) + setValidTo (TimeUtil.getDay(2056, 1, 29)); // no exchange rates after my 100th birthday + Timestamp to = getValidTo(); + + if (to.before(from)) + { + SimpleDateFormat df = DisplayType.getDateFormat(DisplayType.Date); + log.saveError("Error", df.format(to) + " < " + df.format(from)); + return false; + } + + return true; + } // beforeSave + +} // MConversionRate diff --git a/dbPort/src/org/compiere/model/MConversionType.java b/dbPort/src/org/compiere/model/MConversionType.java new file mode 100644 index 0000000000..390b2d5e59 --- /dev/null +++ b/dbPort/src/org/compiere/model/MConversionType.java @@ -0,0 +1,82 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Currency Conversion Type Model + * + * @author Jorg Janke + * @version $Id: MConversionType.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MConversionType extends X_C_ConversionType +{ + /** + * Get Default Conversion Rate for Client/Org + * @param AD_Client_ID client + * @return C_ConversionType_ID or 0 if not found + */ + public static int getDefault (int AD_Client_ID) + { + // Try Cache + Integer key = new Integer (AD_Client_ID); + Integer ii = (Integer)s_cache.get(key); + if (ii != null) + return ii.intValue(); + + // Get from DB + int C_ConversionType_ID = 0; + String sql = "SELECT C_ConversionType_ID " + + "FROM C_ConversionType " + + "WHERE IsActive='Y'" + + " AND AD_Client_ID IN (0,?) " // #1 + + "ORDER BY IsDefault DESC, AD_Client_ID DESC"; + C_ConversionType_ID = DB.getSQLValue(null, sql, AD_Client_ID); + // Return + s_cache.put(key, new Integer(C_ConversionType_ID)); + return C_ConversionType_ID; + } // getDefault + + /** Cache Client-ID */ + private static CCache s_cache = new CCache("C_ConversionType", 4); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_ConversionType_ID id + * @param trxName transaction + */ + public MConversionType(Properties ctx, int C_ConversionType_ID, String trxName) + { + super(ctx, C_ConversionType_ID, trxName); + } // MConversionType + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MConversionType(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MConversionType + +} // MConversionType diff --git a/dbPort/src/org/compiere/model/MCostElement.java b/dbPort/src/org/compiere/model/MCostElement.java new file mode 100644 index 0000000000..8cebe348f4 --- /dev/null +++ b/dbPort/src/org/compiere/model/MCostElement.java @@ -0,0 +1,457 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.util.*; + +/** + * Cost Element Model + * @author Jorg Janke + * @version $Id: MCostElement.java,v 1.2 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MCostElement extends X_M_CostElement +{ + /** + * Get Material Cost Element or create it + * @param po parent + * @param CostingMethod method + * @return cost element + */ + public static MCostElement getMaterialCostElement (PO po, String CostingMethod) + { + if (CostingMethod == null || CostingMethod.length() == 0) + { + s_log.severe("No CostingMethod"); + return null; + } + // + MCostElement retValue = null; + String sql = "SELECT * FROM M_CostElement WHERE AD_Client_ID=? AND CostingMethod=? ORDER BY AD_Org_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, po.get_TrxName()); + pstmt.setInt (1, po.getAD_Client_ID()); + pstmt.setString(2, CostingMethod); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MCostElement (po.getCtx(), rs, po.get_TrxName()); + if (rs.next()) + s_log.warning("More then one Material Cost Element for CostingMethod=" + CostingMethod); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (retValue != null) + return retValue; + + // Create New + retValue = new MCostElement (po.getCtx(), 0, po.get_TrxName()); + retValue.setClientOrg(po.getAD_Client_ID(), 0); + String name = MRefList.getListName(po.getCtx(), COSTINGMETHOD_AD_Reference_ID, CostingMethod); + if (name == null || name.length() == 0) + name = CostingMethod; + retValue.setName(name); + retValue.setCostElementType(COSTELEMENTTYPE_Material); + retValue.setCostingMethod(CostingMethod); + retValue.save(); + // + return retValue; + } // getMaterialCostElement + + /** + * Get first Material Cost Element + * @param ctx context + * @param CostingMethod costing method + * @return Cost Element or null + */ + public static MCostElement getMaterialCostElement(Properties ctx, String CostingMethod) + { + MCostElement retValue = null; + String sql = "SELECT * FROM M_CostElement WHERE AD_Client_ID=? AND CostingMethod=? ORDER BY AD_Org_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, Env.getAD_Client_ID(ctx)); + pstmt.setString(2, CostingMethod); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MCostElement (ctx, rs, null); + if (rs.next()) + s_log.info("More then one Material Cost Element for CostingMethod=" + CostingMethod); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // getMaterialCostElement + + + /** + * Get active Material Cost Element for client + * @param po parent + * @return cost element array + */ + public static MCostElement[] getCostingMethods (PO po) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM M_CostElement " + + "WHERE AD_Client_ID=?" + + " AND IsActive='Y' AND CostElementType='M' AND CostingMethod IS NOT NULL"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, po.get_TrxName()); + pstmt.setInt (1, po.getAD_Client_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MCostElement (po.getCtx(), rs, po.get_TrxName())); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + MCostElement[] retValue = new MCostElement[list.size ()]; + list.toArray (retValue); + return retValue; + } // getMaterialCostElement + + + /** + * Get Cost Element from Cache + * @param ctx context + * @param M_CostElement_ID id + * @return Cost Element + */ + public static MCostElement get (Properties ctx, int M_CostElement_ID) + { + Integer key = new Integer (M_CostElement_ID); + MCostElement retValue = (MCostElement) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MCostElement (ctx, M_CostElement_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache = new CCache("M_CostElement", 20); + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MCostElement.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param M_CostElement_ID id + * @param trxName trx + */ + public MCostElement (Properties ctx, int M_CostElement_ID, String trxName) + { + super (ctx, M_CostElement_ID, trxName); + if (M_CostElement_ID == 0) + { + // setName (null); + setCostElementType (COSTELEMENTTYPE_Material); + setIsCalculated (false); + } + } // MCostElement + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MCostElement (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MCostElement + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + // Check Unique Costing Method + if (COSTELEMENTTYPE_Material.equals(getCostElementType()) + && (newRecord || is_ValueChanged("CostingMethod"))) + { + String sql = "SELECT COALESCE(MAX(M_CostElement_ID),0) FROM M_CostElement " + + "WHERE AD_Client_ID=? AND CostingMethod=?"; + int id = DB.getSQLValue(get_TrxName(), sql, getAD_Client_ID(), getCostingMethod()); + if (id > 0 && id != get_ID()) + { + log.saveError("AlreadyExists", Msg.getElement(getCtx(), "CostingMethod")); + return false; + } + } + + // Maintain Calclated + if (COSTELEMENTTYPE_Material.equals(getCostElementType())) + { + String cm = getCostingMethod(); + if (cm == null || cm.length() == 0 + || COSTINGMETHOD_StandardCosting.equals(cm)) + setIsCalculated(false); + else + setIsCalculated(true); + } + else + { + if (isCalculated()) + setIsCalculated(false); + if (getCostingMethod() != null) + setCostingMethod(null); + } + + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + + /** + * Before Delete + * @return true if can be deleted + */ + protected boolean beforeDelete () + { + String cm = getCostingMethod(); + if (cm == null + || !COSTELEMENTTYPE_Material.equals(getCostElementType())) + return true; + + // Costing Methods on AS level + MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(getCtx(), getAD_Client_ID()); + for (int i = 0; i < ass.length; i++) + { + if (ass[i].getCostingMethod().equals(getCostingMethod())) + { + log.saveError("CannotDeleteUsed", Msg.getElement(getCtx(), "C_AcctSchema_ID") + + " - " + ass[i].getName()); + return false; + } + } + + // Costing Methods on PC level + String sql = "SELECT M_Product_Category_ID FROM M_Product_Category_Acct WHERE AD_Client_ID=? AND CostingMethod=?"; + int M_Product_Category_ID = 0; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getAD_Client_ID()); + pstmt.setString (2, getCostingMethod()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + M_Product_Category_ID = rs.getInt(1); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (M_Product_Category_ID != 0) + { + log.saveError("CannotDeleteUsed", Msg.getElement(getCtx(), "M_Product_Category_ID") + + " (ID=" + M_Product_Category_ID + ")"); + return false; + } + return true; + } // beforeDelete + + /** + * Is this a Costing Method + * @return true if not Material cost or no costing method. + */ + public boolean isCostingMethod() + { + return COSTELEMENTTYPE_Material.equals(getCostElementType()) + && getCostingMethod() != null; + } // isCostingMethod + + /** + * Is Avg Invoice Costing Method + * @return true if AverageInvoice + */ + public boolean isAverageInvoice() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_AverageInvoice) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isAverageInvoice + + /** + * Is Avg PO Costing Method + * @return true if AveragePO + */ + public boolean isAveragePO() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_AveragePO) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isAveragePO + /** + * Is FiFo Costing Method + * @return true if Fifo + */ + public boolean isFifo() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_Fifo) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isFifo + /** + * Is Last Invoice Costing Method + * @return true if LastInvoice + */ + public boolean isLastInvoice() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_LastInvoice) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isLastInvoice + /** + * Is Last PO Costing Method + * @return true if LastPOPrice + */ + public boolean isLastPOPrice() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_LastPOPrice) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isLastPOPrice + /** + * Is LiFo Costing Method + * @return true if Lifo + */ + public boolean isLifo() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_Lifo) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isLiFo + /** + * Is Std Costing Method + * @return true if StandardCosting + */ + public boolean isStandardCosting() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_StandardCosting) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isStandardCosting + /** + * Is User Costing Method + * @return true if User Defined + */ + public boolean isUserDefined() + { + String cm = getCostingMethod(); + return cm != null + && cm.equals(COSTINGMETHOD_UserDefined) + && COSTELEMENTTYPE_Material.equals(getCostElementType()); + } // isAveragePO + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MCostElement["); + sb.append (get_ID ()) + .append ("-").append (getName()) + .append(",Type=").append(getCostElementType()) + .append(",Method=").append(getCostingMethod()) + .append ("]"); + return sb.toString (); + } // toString + +} // MCostElement diff --git a/dbPort/src/org/compiere/model/MCostType.java b/dbPort/src/org/compiere/model/MCostType.java new file mode 100644 index 0000000000..1ac3515616 --- /dev/null +++ b/dbPort/src/org/compiere/model/MCostType.java @@ -0,0 +1,95 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import org.compiere.util.*; + +/** + * Cost Type Model + * @author Jorg Janke + * @version $Id: MCostType.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ + */ +public class MCostType extends X_M_CostType +{ + /** + * Standard Constructor + * @param ctx context + * @param M_CostType_ID id + * @param trxName trx + */ + public MCostType (Properties ctx, int M_CostType_ID, String trxName) + { + super (ctx, M_CostType_ID, trxName); + } // MCostType + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MCostType (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MCostType + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MCostType["); + sb.append (get_ID()).append ("-").append (getName ()).append ("]"); + return sb.toString (); + } // toString + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + + /** + * Before Delete + * @return true if it can be deleted + */ + protected boolean beforeDelete () + { + MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(getCtx(), getAD_Client_ID()); + for (int i = 0; i < ass.length; i++) + { + if (ass[i].getM_CostType_ID() == getM_CostType_ID()) + { + log.saveError("CannotDelete", Msg.getElement(getCtx(), "C_AcctSchema_ID") + + " - " + ass[i].getName()); + return false; + } + } + return true; + } // beforeDelete + +} // MCostType diff --git a/dbPort/src/org/compiere/model/MCountry.java b/dbPort/src/org/compiere/model/MCountry.java new file mode 100644 index 0000000000..d81b0e651b --- /dev/null +++ b/dbPort/src/org/compiere/model/MCountry.java @@ -0,0 +1,336 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Location Country Model (Value Object) + * + * @author Jorg Janke + * @version $Id: MCountry.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public final class MCountry extends X_C_Country + implements Comparator, Serializable +{ + /** + * Get Country (cached) + * @param ctx context + * @param C_Country_ID ID + * @return Country + */ + public static MCountry get (Properties ctx, int C_Country_ID) + { + if (s_countries == null || s_countries.size() == 0) + loadAllCountries(ctx); + String key = String.valueOf(C_Country_ID); + MCountry c = (MCountry)s_countries.get(key); + if (c != null) + return c; + c = new MCountry (ctx, C_Country_ID, null); + if (c.getC_Country_ID() == C_Country_ID) + { + s_countries.put(key, c); + return c; + } + return null; + } // get + + /** + * Get Default Country + * @param ctx context + * @return Country + */ + public static MCountry getDefault (Properties ctx) + { + if (s_countries == null || s_countries.size() == 0) + loadAllCountries(ctx); + return s_default; + } // get + + /** + * Return Countries as Array + * @param ctx context + * @return MCountry Array + */ + @SuppressWarnings("unchecked") + public static MCountry[] getCountries(Properties ctx) + { + if (s_countries == null || s_countries.size() == 0) + loadAllCountries(ctx); + MCountry[] retValue = new MCountry[s_countries.size()]; + s_countries.values().toArray(retValue); + Arrays.sort(retValue, new MCountry(ctx, 0, null)); + return retValue; + } // getCountries + + /** + * Load Countries. + * Set Default Language to Client Language + * @param ctx context + */ + private static void loadAllCountries (Properties ctx) + { + MClient client = MClient.get (ctx); + MLanguage lang = MLanguage.get(ctx, client.getAD_Language()); + MCountry usa = null; + // + s_countries = new CCache("C_Country", 250); + String sql = "SELECT * FROM C_Country WHERE IsActive='Y'"; + try + { + Statement stmt = DB.createStatement(); + ResultSet rs = stmt.executeQuery(sql); + while(rs.next()) + { + MCountry c = new MCountry (ctx, rs, null); + s_countries.put(String.valueOf(c.getC_Country_ID()), c); + // Country code of Client Language + if (lang != null && lang.getCountryCode().equals(c.getCountryCode())) + s_default = c; + if (c.getC_Country_ID() == 100) // USA + usa = c; + } + rs.close(); + stmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + } + if (s_default == null) + s_default = usa; + s_log.fine("#" + s_countries.size() + + " - Default=" + s_default); + } // loadAllCountries + + /** + * Set the Language for Display (toString) + * @param AD_Language language or null + */ + public static void setDisplayLanguage (String AD_Language) + { + s_AD_Language = AD_Language; + if (Language.isBaseLanguage(AD_Language)) + s_AD_Language = null; + } // setDisplayLanguage + + /** Display Language */ + private static String s_AD_Language = null; + + /** Country Cache */ + private static CCache s_countries = null; + /** Default Country */ + private static MCountry s_default = null; + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MCountry.class); + // Default DisplaySequence */ + private static String DISPLAYSEQUENCE = "@C@, @P@"; + + + /************************************************************************* + * Create empty Country + * @param ctx context + * @param C_Country_ID ID + * @param trxName transaction + */ + public MCountry (Properties ctx, int C_Country_ID, String trxName) + { + super (ctx, C_Country_ID, trxName); + if (C_Country_ID == 0) + { + // setName (null); + // setCountryCode (null); + setDisplaySequence(DISPLAYSEQUENCE); + setHasRegion(false); + setHasPostal_Add(false); + setIsAddressLinesLocalReverse (false); + setIsAddressLinesReverse (false); + } + } // MCountry + + /** + * Create Country from current row in ResultSet + * @param ctx context + * @param rs ResultSet + * @param trxName transaction + */ + public MCountry (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MCountry + + /** Translated Name */ + private String m_trlName = null; + + /** + * Return Name - translated if DisplayLanguage is set. + * @return Name + */ + public String toString() + { + if (s_AD_Language != null) + { + String nn = getTrlName(); + if (nn != null) + return nn; + } + return getName(); + } // toString + + /** + * Get Translated Name + * @return name + */ + public String getTrlName() + { + if (m_trlName != null && s_AD_Language != null) + { + m_trlName = get_Translation("Name", s_AD_Language); + if (m_trlName == null) + s_AD_Language = null; // assume that there is no translation + } + return m_trlName; + } // getTrlName + + + + /** + * Get Display Sequence + * @return display sequence + */ + public String getDisplaySequence () + { + String ds = super.getDisplaySequence (); + if (ds == null || ds.length() == 0) + ds = DISPLAYSEQUENCE; + return ds; + } // getDisplaySequence + + /** + * Get Local Display Sequence. + * If not defined get Display Sequence + * @return local display sequence + */ + public String getDisplaySequenceLocal () + { + String ds = super.getDisplaySequenceLocal(); + if (ds == null || ds.length() == 0) + ds = getDisplaySequence(); + return ds; + } // getDisplaySequenceLocal + + /** + * Compare based on Name + * @param o1 object 1 + * @param o2 object 2 + * @return -1,0, 1 + */ + public int compare(Object o1, Object o2) + { + String s1 = o1.toString(); + if (s1 == null) + s1 = ""; + String s2 = o2.toString(); + if (s2 == null) + s2 = ""; + return s1.compareTo(s2); + } // compare + + /** + * Is the region valid in the country + * @param C_Region_ID region + * @return true if valid + */ + public boolean isValidRegion(int C_Region_ID) + { + if (C_Region_ID == 0 + || getC_Country_ID() == 0 + || !isHasRegion()) + return false; + MRegion[] regions = MRegion.getRegions(getCtx(), getC_Country_ID()); + for (int i = 0; i < regions.length; i++) + { + if (C_Region_ID == regions[i].getC_Region_ID()) + return true; + } + return false; + } // isValidRegion + + /************************************************************************** + * Insert Countries + * @param args none + */ + public static void main (String[] args) + { + /** Migration before + UPDATE C_Country SET AD_Client_ID=0, AD_Org_ID=0 WHERE AD_Client_ID<>0 OR AD_Org_ID<>0; + UPDATE C_Region SET AD_Client_ID=0, AD_Org_ID=0 WHERE AD_Client_ID<>0 OR AD_Org_ID<>0; + IDs migration for C_Location, C_City, C_Tax (C_Country, C_Region) + ** + // from http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1-semic.txt + String countries = "AFGHANISTAN;AF, ALBANIA;AL, ALGERIA;DZ, AMERICAN SAMOA;AS, ANDORRA;AD, ANGOLA;AO, ANGUILLA;AI, ANTARCTICA;AQ, ANTIGUA AND BARBUDA;AG, ARGENTINA;AR," + + "ARMENIA;AM, ARUBA;AW, AUSTRALIA;AU, AUSTRIA;AT, AZERBAIJAN;AZ, BAHAMAS;BS, BAHRAIN;BH, BANGLADESH;BD, BARBADOS;BB, BELARUS;BY, BELGIUM;BE, BELIZE;BZ," + + "BENIN;BJ, BERMUDA;BM, BHUTAN;BT, BOLIVIA;BO, BOSNIA AND HERZEGOVINA;BA, BOTSWANA;BW, BOUVET ISLAND;BV, BRAZIL;BR, BRITISH INDIAN OCEAN TERRITORY;IO, BRUNEI DARUSSALAM;BN," + + "BULGARIA;BG, BURKINA FASO;BF, BURUNDI;BI, CAMBODIA;KH, CAMEROON;CM, CANADA;CA, CAPE VERDE;CV, CAYMAN ISLANDS;KY, CENTRAL AFRICAN REPUBLIC;CF, CHAD;TD, CHILE;CL," + + "CHINA;CN, CHRISTMAS ISLAND;CX, COCOS (KEELING) ISLANDS;CC, COLOMBIA;CO, COMOROS;KM, CONGO;CG, CONGO THE DEMOCRATIC REPUBLIC OF THE;CD, COOK ISLANDS;CK," + + "COSTA RICA;CR, COTE D'IVOIRE;CI, CROATIA;HR, CUBA;CU, CYPRUS;CY, CZECH REPUBLIC;CZ, DENMARK;DK, DJIBOUTI;DJ, DOMINICA;DM, DOMINICAN REPUBLIC;DO, ECUADOR;EC," + + "EGYPT;EG, EL SALVADOR;SV, EQUATORIAL GUINEA;GQ, ERITREA;ER, ESTONIA;EE, ETHIOPIA;ET, FALKLAND ISLANDS (MALVINAS);FK, FAROE ISLANDS;FO, FIJI;FJ," + + "FINLAND;FI, FRANCE;FR, FRENCH GUIANA;GF, FRENCH POLYNESIA;PF, FRENCH SOUTHERN TERRITORIES;TF, GABON;GA, GAMBIA;GM, GEORGIA;GE, GERMANY;DE, GHANA;GH," + + "GIBRALTAR;GI, GREECE;GR, GREENLAND;GL, GRENADA;GD, GUADELOUPE;GP, GUAM;GU, GUATEMALA;GT, GUINEA;GN, GUINEA-BISSAU;GW, GUYANA;GY, HAITI;HT," + + "HEARD ISLAND AND MCDONALD ISLANDS;HM, HOLY SEE (VATICAN CITY STATE);VA, HONDURAS;HN, HONG KONG;HK, HUNGARY;HU, ICELAND;IS, INDIA;IN, INDONESIA;ID," + + "IRAN ISLAMIC REPUBLIC OF;IR, IRAQ;IQ, IRELAND;IE, ISRAEL;IL, ITALY;IT, JAMAICA;JM, JAPAN;JP, JORDAN;JO, KAZAKHSTAN;KZ, KENYA;KE, KIRIBATI;KI, KOREA DEMOCRATIC PEOPLE'S REPUBLIC OF;KP," + + "KOREA REPUBLIC OF;KR, KUWAIT;KW, KYRGYZSTAN;KG, LAO PEOPLE'S DEMOCRATIC REPUBLIC;LA, LATVIA;LV, LEBANON;LB, LESOTHO;LS, LIBERIA;LR, LIBYAN ARAB JAMAHIRIYA;LY," + + "LIECHTENSTEIN;LI, LITHUANIA;LT, LUXEMBOURG;LU, MACAO;MO, MACEDONIA FORMER YUGOSLAV REPUBLIC OF;MK, MADAGASCAR;MG, MALAWI;MW, MALAYSIA;MY, MALDIVES;MV, " + + "MALI;ML, MALTA;MT, MARSHALL ISLANDS;MH, MARTINIQUE;MQ, MAURITANIA;MR, MAURITIUS;MU, MAYOTTE;YT, MEXICO;MX, MICRONESIA FEDERATED STATES OF;FM," + + "MOLDOVA REPUBLIC OF;MD, MONACO;MC, MONGOLIA;MN, MONTSERRAT;MS, MOROCCO;MA, MOZAMBIQUE;MZ, MYANMAR;MM, NAMIBIA;NA, NAURU;NR, NEPAL;NP," + + "NETHERLANDS;NL, NETHERLANDS ANTILLES;AN, NEW CALEDONIA;NC, NEW ZEALAND;NZ, NICARAGUA;NI, NIGER;NE, NIGERIA;NG, NIUE;NU, NORFOLK ISLAND;NF," + + "NORTHERN MARIANA ISLANDS;MP, NORWAY;NO, OMAN;OM, PAKISTAN;PK, PALAU;PW, PALESTINIAN TERRITORY OCCUPIED;PS, PANAMA;PA, PAPUA NEW GUINEA;PG," + + "PARAGUAY;PY, PERU;PE, PHILIPPINES;PH, PITCAIRN;PN, POLAND;PL, PORTUGAL;PT, PUERTO RICO;PR, QATAR;QA, REUNION;RE, ROMANIA;RO, RUSSIAN FEDERATION;RU," + + "RWANDA;RW, SAINT HELENA;SH, SAINT KITTS AND NEVIS;KN, SAINT LUCIA;LC, SAINT PIERRE AND MIQUELON;PM, SAINT VINCENT AND THE GRENADINES;VC," + + "SAMOA;WS, SAN MARINO;SM, SAO TOME AND PRINCIPE;ST, SAUDI ARABIA;SA, SENEGAL;SN, SEYCHELLES;SC, SIERRA LEONE;SL, SINGAPORE;SG, SLOVAKIA;SK," + + "SLOVENIA;SI, SOLOMON ISLANDS;SB, SOMALIA;SO, SOUTH AFRICA;ZA, SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS;GS, SPAIN;ES, SRI LANKA;LK," + + "SUDAN;SD, SURINAME;SR, SVALBARD AND JAN MAYEN;SJ, SWAZILAND;SZ, SWEDEN;SE, SWITZERLAND;CH, SYRIAN ARAB REPUBLIC;SY, TAIWAN;TW," + + "TAJIKISTAN;TJ, TANZANIA UNITED REPUBLIC OF;TZ, THAILAND;TH, TIMOR-LESTE;TL, TOGO;TG, TOKELAU;TK, TONGA;TO, TRINIDAD AND TOBAGO;TT," + + "TUNISIA;TN, TURKEY;TR, TURKMENISTAN;TM, TURKS AND CAICOS ISLANDS;TC, TUVALU;TV, UGANDA;UG, UKRAINE;UA, UNITED ARAB EMIRATES;AE, UNITED KINGDOM;GB," + + "UNITED STATES;US, UNITED STATES MINOR OUTLYING ISLANDS;UM, URUGUAY;UY, UZBEKISTAN;UZ, VANUATU;VU, VENEZUELA;VE, VIET NAM;VN, VIRGIN ISLANDS BRITISH;VG," + + "VIRGIN ISLANDS U.S.;VI, WALLIS AND FUTUNA;WF, WESTERN SAHARA;EH, YEMEN;YE, YUGOSLAVIA;YU, ZAMBIA;ZM, ZIMBABWE;ZW"; + // + org.compiere.Adempiere.startupClient(); + StringTokenizer st = new StringTokenizer(countries, ",", false); + while (st.hasMoreTokens()) + { + String s = st.nextToken().trim(); + int pos = s.indexOf(";"); + String name = Util.initCap(s.substring(0,pos)); + String cc = s.substring(pos+1); + System.out.println(cc + " - " + name); + // + MCountry mc = new MCountry(Env.getCtx(), 0); + mc.setCountryCode(cc); + mc.setName(name); + mc.setDescription(name); + mc.save(); + } + **/ + } // main + +} // MCountry diff --git a/dbPort/src/org/compiere/model/MCurrency.java b/dbPort/src/org/compiere/model/MCurrency.java new file mode 100644 index 0000000000..2c12bc1b2d --- /dev/null +++ b/dbPort/src/org/compiere/model/MCurrency.java @@ -0,0 +1,415 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.util.*; +import org.compiere.util.*; + +/** + * Currency Model. + * + * @author Jorg Janke + * @version $Id: MCurrency.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MCurrency extends X_C_Currency +{ + /** + * Currency Constructor + * @param ctx context + * @param C_Currency_ID id + * @param trxName transaction + */ + public MCurrency (Properties ctx, int C_Currency_ID, String trxName) + { + super (ctx, C_Currency_ID, trxName); + if (C_Currency_ID == 0) + { + setIsEMUMember (false); + setIsEuro (false); + setStdPrecision (2); + setCostingPrecision (4); + } + } // MCurrency + + /** + * Currency Constructor + * @param ctx context + * @param ISO_Code ISO + * @param Description Name + * @param CurSymbol symbol + * @param StdPrecision prec + * @param CostingPrecision prec + * @param trxName transaction + */ + public MCurrency (Properties ctx, String ISO_Code, + String Description, String CurSymbol, int StdPrecision, int CostingPrecision, String trxName) + { + super(ctx, 0, trxName); + setISO_Code(ISO_Code); + setDescription(Description); + setCurSymbol(CurSymbol); + setStdPrecision (StdPrecision); + setCostingPrecision (CostingPrecision); + setIsEMUMember (false); + setIsEuro (false); + } // MCurrency + + + /** Store System Currencies **/ + private static CCache s_currencies = new CCache("C_Currency", 50); + + /** + * Get Currency + * @param ctx Context + * @param C_Currency_ID currency + * @return ISO Code + */ + public static MCurrency get (Properties ctx, int C_Currency_ID) + { + // Try Cache + Integer key = new Integer(C_Currency_ID); + MCurrency retValue = (MCurrency)s_currencies.get(key); + if (retValue != null) + return retValue; + + // Create it + retValue = new MCurrency(ctx, C_Currency_ID, null); + // Save in System + if (retValue.getAD_Client_ID() == 0) + s_currencies.put(key, retValue); + return retValue; + } // get + + /** + * Get Currency Iso Code. + * @param ctx Context + * @param C_Currency_ID currency + * @return ISO Code + */ + public static String getISO_Code (Properties ctx, int C_Currency_ID) + { + String contextKey = "C_Currency_" + C_Currency_ID; + String retValue = ctx.getProperty(contextKey); + if (retValue != null) + return retValue; + + // Create it + MCurrency c = get(ctx, C_Currency_ID); + retValue = c.getISO_Code(); + ctx.setProperty(contextKey, retValue); + return retValue; + } // getISO + + /** + * Get Standard Precision. + * @param ctx Context + * @param C_Currency_ID currency + * @return Standard Precision + */ + public static int getStdPrecision (Properties ctx, int C_Currency_ID) + { + MCurrency c = get(ctx, C_Currency_ID); + return c.getStdPrecision(); + } // getStdPrecision + + /** + * String Representation + * @return info + */ + public String toString() + { + return "MCurrency[" + getC_Currency_ID() + + "-" + getISO_Code() + "-" + getCurSymbol() + + "," + getDescription() + + ",Precision=" + getStdPrecision() + "/" + getCostingPrecision(); + } // toString + + + /*************************************************************************/ + + /** + * Load/link Currencies + * @param args args + * + public static void main (String[] args) + { + System.out.println("Currency"); + Adempiere.startupClient(); + // Loop through + for (int i = 0; i < s_table.length; i++) + { + /** + System.out.println(s_table[i][I_Currency] + " - " + s_table[i][I_Name]); + int prec = Integer.parseInt(s_table[i][I_Precision]); + MCurrency cur = new MCurrency(Env.getCtx(), s_table[i][I_Currency], + s_table[i][I_Name], s_table[i][I_Symbol], prec, prec+2); + cur.save(); + System.out.println(cur); + ** + String ISO = s_table[i][I_Currency]; + String Country = s_table[i][I_Country]; + String sql = "UPDATE C_Country SET C_Currency_ID=" + + "(SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code='" + ISO + "') " + + "WHERE CountryCode='" + Country + "'"; + int no = DB.executeUpdate(sql); + System.out.println(ISO + " - " + Country + " - " + no); + System.out.println(""); + } + + } // main + + + static int I_Country = 0; + static int I_Currency = 1; + static int I_Precision = 2; + static int I_Symbol = 3; + static int I_DecimalPoint = 4; + static int I_FormatIndex = 5; + static int I_Name = 6; + static String[][] s_table = new String[][] { + new String[]{"US","USD","2","$",".","0", "US Dollar"}, + new String[]{"AR","ARS","2","$",",","0", "Argentine Peso"}, + new String[]{"AS","USD","2","$",".","0","US Dollar"}, + new String[]{"CC","AUD","2","$",".","0","Australian Dollar"}, + new String[]{"CK","NZD","2","$",".","0","New Zealand Dollar"}, + new String[]{"CX","AUD","2","$",".","0","Australian Dollar"}, + new String[]{"EC","USD","2","$",".","0","US Dollar"}, + new String[]{"FM","USD","2","$",".","0","US Dollar"}, + new String[]{"GU","USD","2","$",".","0","US Dollar"}, + new String[]{"KI","AUD","2","$",".","0","Australian Dollar"}, + new String[]{"LR","LRD","2","$",".","0","Liberian Dollar"}, + new String[]{"MH","USD","2","$",".","0","US Dollar"}, + new String[]{"MP","USD","2","$",".","0","US Dollar"}, + new String[]{"MX","MXN","2","$",".","0","Mexican Peso"}, + new String[]{"NF","AUD","2","$",".","0","Australian Dollar"}, + new String[]{"NR","AUD","2","$",".","0","Australian Dollar"}, + new String[]{"NU","NZD","2","$",".","0","New Zealand Dollar"}, + new String[]{"NZ","NZD","2","$",".","0","New Zealand Dollar"}, + new String[]{"PR","USD","2","$",".","0","US Dollar"}, + new String[]{"PW","USD","2","$",".","0","US Dollar"}, + new String[]{"TC","USD","2","$",".","0","US Dollar"}, + new String[]{"TK","NZD","2","$",".","0","New Zealand Dollar"}, + new String[]{"TV","AUD","2","$",".","0","Australian Dollar"}, + new String[]{"VG","USD","2","$",".","0","US Dollar"}, + new String[]{"VI","USD","2","$",".","0","US Dollar"}, + new String[]{"UY","UYU","2","$U",",","2","Peso Uruguayo"}, + new String[]{"AM","AMD","2","",".","0","Armenian Dram"}, + new String[]{"AO","AOA","2","",".","0","Kwanza"}, + new String[]{"AZ","AZM","2","",".","0","Azerbaijanian Manat"}, + new String[]{"BO","BOB","2","",".","0","Boliviano"}, + new String[]{"CD","CDF","2","",".","0","Franc Congolais"}, + new String[]{"CZ","CZK","2","",",","3","Czech Koruna"}, + new String[]{"GE","GEL","2","",".","0","Lari"}, + new String[]{"IR","IRR","2","",".","2","Iranian Rial"}, + new String[]{"LT","LTL","2","",",","3","Lithuanian Litus"}, + new String[]{"MD","MDL","2","",".","0","Moldovan Leu"}, + new String[]{"PH","PHP","2","",".","0","Philippine Peso"}, + new String[]{"PL","PLN","2","",",","3","Zloty"}, + new String[]{"RU","RUR","2","",",","1","Russian Ruble"}, + new String[]{"SD","SDD","2","",".","0","Sudanese Dinar"}, + new String[]{"TJ","TJS","2","",".","0","Somoni"}, + new String[]{"TM","TMM","2","",".","0","Manat"}, + new String[]{"TP","TPE","0","",".","0","Timor Escudo"}, + new String[]{"UA","UAH","2","",",","3","Hryvnia"}, + new String[]{"UZ","UZS","2","",".","0","Uzbekistan Sum"}, + new String[]{"GB","GBP","2","ïŋ―",".","0","Pound Sterling"}, + new String[]{"CY","CYP","2","ïŋ―C",".","0","Cyprus Pound"}, + new String[]{"EG","EGP","2","ïŋ―E",".","2","Egyptian Pound"}, + new String[]{"FK","FKP","2","ïŋ―F",".","0","Falkland Islands Pound"}, + new String[]{"GI","GIP","2","ïŋ―G",".","0","Gibraltar Pound"}, + new String[]{"SH","SHP","2","ïŋ―S",".","0","Saint Helena Pound"}, + new String[]{"SY","SYP","2","ïŋ―S",".","2","Syrian Pound"}, + new String[]{"JP","JPY","0","ïŋ―",".","0","Yen"}, + new String[]{"GH","GHC","2","ïŋ―",".","0","Cedi"}, + new String[]{"SV","SVC","2","ïŋ―",".","0","El Salvador Colon"}, + new String[]{"AD","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"AT","EUR","2","ïŋ―",",","2","euro"}, + new String[]{"BE","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"DE","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"ES","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"FI","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"FR","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"GF","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"GP","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"GR","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"IE","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"IT","EUR","2","ïŋ―",",","2","euro"}, + new String[]{"LU","EUR","2","ïŋ―",",","3","euro"}, + new String[]{"MC","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"MQ","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"NL","EUR","2","ïŋ―",",","2","euro"}, + new String[]{"PM","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"PT","EUR","2","ïŋ―","$","3","euro"}, + new String[]{"RE","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"SM","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"VA","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"YT","EUR","2","ïŋ―",".","0","euro"}, + new String[]{"AU","AUD","2","A$",".","0","Australian Dollar"}, + new String[]{"AF","AFA","2","Af",".","0","Afghani"}, + new String[]{"AW","AWG","2","Af.",".","0","Aruban Guilder"}, + new String[]{"PA","PAB","2","B",".","0","Balboa"}, + new String[]{"BN","BND","2","B$",".","0","Brunei Dollar"}, + new String[]{"BS","BSD","2","B$",".","0","Bahamian Dollar"}, + new String[]{"BH","BHD","3","BD",".","2","Bahraini Dinar"}, + new String[]{"BM","BMD","2","Bd$",".","0","Bermudian Dollar"}, + new String[]{"BB","BBD","2","Bds$",".","0","Barbados Dollar"}, + new String[]{"BY","BYR","0","BR",",","3","Belarussian Ruble"}, + new String[]{"ET","ETB","2","Br",".","0","Ethiopian Birr"}, + new String[]{"VE","VEB","2","Bs",",","0","Bolivar"}, + new String[]{"TH","THB","2","Bt",".","0","Baht"}, + new String[]{"BZ","BZD","2","BZ$",".","0","Belize Dollar"}, + new String[]{"CA","CAD","2","C$",".","0","Canadian Dollar"}, + new String[]{"NI","NIO","2","C$",".","0","Cordoba Oro"}, + new String[]{"CV","CVE","2","C.V.Esc.",".","0","Cape Verde Escudo"}, + new String[]{"KM","KMF","0","CF",".","0","Comoro Franc"}, + new String[]{"BF","XOF","0","CFAF",".","0","CFA Franc BCEAO"}, + new String[]{"BJ","XOF","0","CFAF",".","0","CFA Franc BCEAO"}, + new String[]{"CF","XAF","0","CFAF",".","0","CFA Franc BEAC"}, + new String[]{"CG","XAF","0","CFAF",".","0","CFA Franc BEAC"}, + new String[]{"CI","XOF","0","CFAF",".","0","CFA Franc BCEA"}, + new String[]{"CM","XAF","0","CFAF",".","0","CFA Franc BEAC"}, + new String[]{"GA","XAF","0","CFAF",".","0","CFA Franc BEAC"}, + new String[]{"GQ","XAF","0","CFAF",".","0","CFA Franc BEAC"}, + new String[]{"ML","XOF","0","CFAF",".","0","CFA Franc BCEAO"}, + new String[]{"NE","XOF","0","CFAF",".","0","CFA Franc BCEAO"}, + new String[]{"SN","XOF","0","CFAF",".","0","CFA Franc BCEAO"}, + new String[]{"TD","XAF","0","CFAF",".","0","CFA Franc BEAC"}, + new String[]{"TG","XOF","0","CFAF",".","0","CFA Franc BCEAO"}, + new String[]{"NC","XPF","0","CFPF",".","0","CFP Franc"}, + new String[]{"PF","XPF","0","CFPF",".","0","CFP Franc"}, + new String[]{"WF","XPF","0","CFPF",".","0","CFP Franc"}, + new String[]{"CL","CLP","0","Ch$",",","0","Chilean Peso"}, + new String[]{"KY","KYD","2","CI$",".","0","Cayman Islands Dollar"}, + new String[]{"CO","COP","2","Col$",".","0","Colombian Peso"}, + new String[]{"KH","KHR","2","CR",".","0","Riel"}, + new String[]{"CU","CUP","2","Cu$",".","0","Cuban Peso"}, + new String[]{"GM","GMD","2","D",".","0","Dalasi"}, + new String[]{"VN","VND","2","D",",","3","Dong"}, + new String[]{"DZ","DZD","2","DA",".","2","Algerian Dinar"}, + new String[]{"ST","STD","2","Db",".","0","Dobra"}, + new String[]{"DJ","DJF","0","DF",".","0","Djibouti Franc"}, + new String[]{"AE","AED","2","Dh",".","2","UAE Dirham"}, + new String[]{"MA","MAD","2","DH",".","2","Moroccan Dirham"}, + new String[]{"YU","YUM","2","Din",".","0","Yugoslavian Dinar"}, + new String[]{"DK","DKK","2","Dkr",",","2","Danish Krone"}, + new String[]{"FO","DKK","2","Dkr",",","2","Danish Krone"}, + new String[]{"GL","DKK","2","Dkr",".","0","Danish Krone"}, + new String[]{"AG","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"AI","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"DM","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"GD","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"KN","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"LC","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"MS","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"VC","XCD","2","EC$",".","0","East Caribbean Dollar"}, + new String[]{"FJ","FJD","2","F$",".","0","Fiji Dollar"}, + new String[]{"BI","BIF","0","FBu",".","0","Burundi Franc"}, + new String[]{"MG","MGF","0","FMG",".","0","Malagasy Franc"}, + new String[]{"HU","HUF","2","Ft",",","3","Forint"}, + new String[]{"HT","HTG","2","G",".","0","Gourde"}, + new String[]{"GY","GYD","2","G$",".","0","Guyana Dollar"}, + new String[]{"HK","HKD","2","HK$",".","0","Hong Kong Dollar"}, + new String[]{"HR","HRK","2","HRK",",","2","Croatian Kuna"}, + new String[]{"IQ","IQD","3","ID",".","2","Iraqi Dinar"}, + new String[]{"IS","ISK","2","IKr",",","3","Iceland Krona"}, + new String[]{"JM","JMD","2","J$",".","0","Jamaican Dollar"}, + new String[]{"JO","JOD","3","JD",".","2","Jordanian Dinar"}, + new String[]{"MM","MMK","2","K",".","0","Kyat"}, + new String[]{"PG","PGK","2","K",".","0","Kina"}, + new String[]{"KE","KES","2","K Sh",".","0","Kenyan Shilling"}, + new String[]{"KW","KWD","3","KD",".","2","Kuwaiti Dinar"}, + new String[]{"BA","BAM","2","KM",".","0","Convertible Marks"}, + new String[]{"LA","LAK","2","KN",".","0","Kip"}, + new String[]{"ER","ERN","2","KR",".","0","Nakfa"}, + new String[]{"AL","ALL","2","L",",","1","Lek"}, + new String[]{"HN","HNL","2","L",".","0","Lempira"}, + new String[]{"RO","ROL","2","L",",","3","Leu"}, + new String[]{"SZ","SZL","2","L",".","0","Lilangeni"}, + new String[]{"LY","LYD","3","LD",".","2","Libyan Dinar"}, + new String[]{"SL","SLL","2","Le",".","0","Leone"}, + new String[]{"MT","MTL","2","Lm",".","0","Maltese Lira"}, + new String[]{"LV","LVL","2","Ls",",","3","Latvian Lats"}, + new String[]{"BG","BGL","2","Lv",",","3","Lev"}, + new String[]{"MU","MUR","2","Mau Rs",".","0","Mauritius Rupee"}, + new String[]{"MW","MWK","2","MK",".","0","Kwacha"}, + new String[]{"MK","MKD","2","MKD",".","0","Denar"}, + new String[]{"MZ","MZM","2","Mt",".","0","Metical"}, + new String[]{"AN","ANG","2","NAf.",".","0","Netherlands Antillian Guilder"}, + new String[]{"EE","EEK","2","Nfa",",","3","Kroon"}, + new String[]{"IL","ILS","2","NIS",".","2","New Israeli Sheqel"}, + new String[]{"NO","NOK","2","NKr",",","2","Norwegian Krone"}, + new String[]{"NP","NPR","2","NRs",".","0","Nepalese Rupee"}, + new String[]{"TW","TWD","2","NT$",".","0","New Taiwan Dollar"}, + new String[]{"BW","BWP","2","P",".","0","Pula"}, + new String[]{"MO","MOP","2","P",".","0","Pataca"}, + new String[]{"GT","GTQ","2","Q",".","0","Quetzal"}, + new String[]{"QA","QAR","2","QR",".","2","Qatari Rial"}, + new String[]{"LS","ZAR","2","R",".","0","Rand"}, + new String[]{"NA","ZAR","2","R",".","0","Rand"}, + new String[]{"ZA","ZAR","2","R",".","2","Rand"}, + new String[]{"BR","BRL","2","R$",",","0","Brazilian Real"}, + new String[]{"DO","DOP","2","RD$",".","0","Dominican Peso"}, + new String[]{"MV","MVR","2","Rf",".","0","Rufiyaa"}, + new String[]{"RW","RWF","0","RF",".","0","Rwanda Franc"}, + new String[]{"MY","MYR","2","RM",".","0","Malaysian Ringgit"}, + new String[]{"OM","OMR","3","RO",".","2","Rial Omani"}, + new String[]{"ID","IDR","2","Rp",",","0","Rupiah"}, + new String[]{"BT","INR","2","Rs",".","0","Indian Rupee"}, + new String[]{"IN","INR","2","Rs",".","0","Indian Rupee"}, + new String[]{"PK","PKR","2","Rs",".","0","Pakistan Rupee"}, + new String[]{"SG","SGD","2","S$",".","0","Singapore Dollar"}, + new String[]{"PE","PEN","2","S/.",",","0","Nuevo Sol"}, + new String[]{"SR","SRG","2","Sf.",".","0","Suriname Guilder"}, + new String[]{"SB","SBD","2","SI$",".","0","Solomon Islands Dollar"}, + new String[]{"SE","SEK","2","Sk",",","3","Swedish Krona"}, + new String[]{"SK","SKK","2","Sk",",","3","Slovak Koruna"}, + new String[]{"LK","LKR","2","SLRs",".","0","Sri Lanka Rupee"}, + new String[]{"SI","SIT","2","SlT",",","3","Tolar"}, + new String[]{"SO","SOS","2","So. Sh.",".","0","Somali Shilling"}, + new String[]{"SC","SCR","2","SR",".","0","Seychelles Rupee"}, + new String[]{"SA","SAR","2","SRls",".","2","Saudi Riyal"}, + new String[]{"CH","CHF","2","SwF",".","2","Swiss Franc"}, + new String[]{"LI","CHF","2","SwF",".","2","Swiss Franc"}, + new String[]{"TO","TOP","2","T$",".","0","Païŋ―anga"}, + new String[]{"TN","TND","3","TD",".","2","Tunisian Dinar"}, + new String[]{"BD","BDT","2","Tk",".","0","Taka"}, + new String[]{"TR","TRL","0","TL",",","3","Turkish Lira"}, + new String[]{"TZ","TZS","2","TSh",".","0","Tanzanian Shilling"}, + new String[]{"TT","TTD","2","TT$",".","0","Trinidad and Tobago Dollar"}, + new String[]{"MN","MNT","2","Tug",".","0","Tugrik"}, + new String[]{"MR","MRO","2","UM",".","0","Ouguiya"}, + new String[]{"UG","UGX","2","USh",".","0","Uganda Shilling"}, + new String[]{"VU","VUV","0","VT",".","0","Vatu"}, + new String[]{"KR","KRW","0","W",".","0","Won"}, + new String[]{"WS","WST","2","WS$",".","0","Tala"}, + new String[]{"CN","CNY","2","Y",".","0","Yuan Renminbi"}, + new String[]{"YE","YER","2","YRls",".","2","Yemeni Rial"}, + new String[]{"ZW","ZWD","2","Z$",".","0","Zimbabwe Dollar"}, + new String[]{"ZM","ZMK","2","ZK",".","0","Kwacha"}, + new String[]{"CR","CRC","2","",".","0","Costa Rican Colon"}, + new String[]{"GN","GNF","0","",".","0","Guinea Franc"}, + new String[]{"GW","GWP","2","",".","0","Guinea-Bissau Peso"}, + new String[]{"KG","KGS","2","",".","0","Som"}, + new String[]{"KP","KPW","2","",".","0","North Korean Won"}, + new String[]{"KZ","KZT","2","",".","0","Tenge"}, + new String[]{"LB","LBP","2","",".","2","Lebanese Pound"}, + new String[]{"NG","NGN","2","",".","0","Naira"}, + new String[]{"PY","PYG","0","",",","0","Guarani"} + }; + **/ + +} // MCurrency diff --git a/dbPort/src/org/compiere/model/MCurrencyAcct.java b/dbPort/src/org/compiere/model/MCurrencyAcct.java new file mode 100644 index 0000000000..ad527d6ceb --- /dev/null +++ b/dbPort/src/org/compiere/model/MCurrencyAcct.java @@ -0,0 +1,91 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Currency Account Model + * + * @author Jorg Janke + * @version $Id: MCurrencyAcct.java,v 1.3 2006/07/30 00:58:38 jjanke Exp $ + */ +public class MCurrencyAcct extends X_C_Currency_Acct +{ + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger(MCurrencyAcct.class); + + /** + * Get Currency Account for Currency + * @param as accounting schema default + * @param C_Currency_ID currency + * @return Currency Account or null + */ + public static MCurrencyAcct get (MAcctSchemaDefault as, int C_Currency_ID) + { + MCurrencyAcct retValue = null; + String sql = "SELECT * FROM C_Currency_Acct " + + "WHERE C_AcctSchema_ID=? AND C_Currency_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, as.getC_AcctSchema_ID()); + pstmt.setInt(2, C_Currency_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + retValue = new MCurrencyAcct (as.getCtx(), rs, null); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + + /************************************************************************** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MCurrencyAcct(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MCurrencyAcct + +} // MCurrencyAcct diff --git a/dbPort/src/org/compiere/model/MDocType.java b/dbPort/src/org/compiere/model/MDocType.java new file mode 100644 index 0000000000..cbdd77c489 --- /dev/null +++ b/dbPort/src/org/compiere/model/MDocType.java @@ -0,0 +1,297 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Document Type Model + * + * @author Jorg Janke + * @version $Id: MDocType.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MDocType extends X_C_DocType +{ + /** + * Get Client Document Type with DocBaseType + * @param ctx context + * @param DocBaseType base document type + * @return array of doc types + */ + static public MDocType[] getOfDocBaseType (Properties ctx, String DocBaseType) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_DocType WHERE AD_Client_ID=? AND DocBaseType=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, Env.getAD_Client_ID(ctx)); + pstmt.setString(2, DocBaseType); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MDocType(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + MDocType[] retValue = new MDocType[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfDocBaseType + + /** + * Get Client Document Types + * @param ctx context + * @return array of doc types + */ + static public MDocType[] getOfClient (Properties ctx) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM C_DocType WHERE AD_Client_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, Env.getAD_Client_ID(ctx)); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MDocType(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + MDocType[] retValue = new MDocType[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfClient + + /** + * Get Document Type (cached) + * @param ctx context + * @param C_DocType_ID id + * @return document type + */ + static public MDocType get (Properties ctx, int C_DocType_ID) + { + Integer key = new Integer(C_DocType_ID); + MDocType retValue = (MDocType)s_cache.get(key); + if (retValue == null) + { + retValue = new MDocType (ctx, C_DocType_ID, null); + s_cache.put(key, retValue); + } + return retValue; + } // get + + /** Cache */ + static private CCache s_cache = new CCache("C_DocType", 20); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MDocType.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_DocType_ID id + * @param trxName transaction + */ + public MDocType(Properties ctx, int C_DocType_ID, String trxName) + { + super(ctx, C_DocType_ID, trxName); + if (C_DocType_ID == 0) + { + // setName (null); + // setPrintName (null); + // setDocBaseType (null); + // setGL_Category_ID (0); + setDocumentCopies (0); + setHasCharges (false); + setIsDefault (false); + setIsDocNoControlled (false); + setIsSOTrx (false); + setIsPickQAConfirm(false); + setIsShipConfirm(false); + setIsSplitWhenDifference(false); + // + setIsCreateCounter(true); + setIsDefaultCounterDoc(false); + setIsIndexed(true); + } + } // MDocType + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MDocType(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MDocType + + /** + * New Constructor + * @param ctx context + * @param DocBaseType document base type + * @param Name name + * @param trxName transaction + */ + public MDocType (Properties ctx, String DocBaseType, String Name, String trxName) + { + this (ctx, 0, trxName); + setAD_Org_ID(0); + setDocBaseType (DocBaseType); + setName (Name); + setPrintName (Name); + setGL_Category_ID (); + } // MDocType + + /** + * Set Default GL Category + */ + public void setGL_Category_ID() + { + String sql = "SELECT * FROM GL_Category WHERE AD_Client_ID=? AND IsDefault='Y'"; + int GL_Category_ID = DB.getSQLValue(get_TrxName(), sql, getAD_Client_ID()); + if (GL_Category_ID == 0) + { + sql = "SELECT * FROM GL_Category WHERE AD_Client_ID=?"; + GL_Category_ID = DB.getSQLValue(get_TrxName(), sql, getAD_Client_ID()); + } + setGL_Category_ID(GL_Category_ID); + } // setGL_Category_ID + + + /** + * Set SOTrx based on document base type + */ + public void setIsSOTrx () + { + boolean isSOTrx = DOCBASETYPE_SalesOrder.equals(getDocBaseType()) + || DOCBASETYPE_MaterialDelivery.equals(getDocBaseType()) + || getDocBaseType().startsWith("AR"); + super.setIsSOTrx (isSOTrx); + } // setIsSOTrx + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MDocType["); + sb.append(get_ID()).append("-").append(getName()) + .append(",DocNoSequence_ID=").append(getDocNoSequence_ID()) + .append("]"); + return sb.toString(); + } // toString + + /** + * Is this a Quotation (Binding) + * @return true if Quotation + */ + public boolean isQuotation() + { + return DOCSUBTYPESO_Quotation.equals(getDocSubTypeSO()) + && DOCBASETYPE_SalesOrder.equals(getDocBaseType()); + } // isQuotation + + /** + * Is this a Proposal (Not binding) + * @return true if proposal + */ + public boolean isProposal() + { + return DOCSUBTYPESO_Proposal.equals(getDocSubTypeSO()) + && DOCBASETYPE_SalesOrder.equals(getDocBaseType()); + } // isProposal + + /** + * Is this a Proposal or Quotation + * @return true if proposal or quotation + */ + public boolean isOffer() + { + return (DOCSUBTYPESO_Proposal.equals(getDocSubTypeSO()) + || DOCSUBTYPESO_Quotation.equals(getDocSubTypeSO())) + && DOCBASETYPE_SalesOrder.equals(getDocBaseType()); + } // isOffer + + + /** + * Get Print Name + * @param AD_Language language + * @return print Name if available translated + */ + public String getPrintName (String AD_Language) + { + if (AD_Language == null || AD_Language.length() == 0) + return super.getPrintName(); + String retValue = get_Translation ("PrintName", AD_Language); + if (retValue != null) + return retValue; + return super.getPrintName(); + } // getPrintName + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + +} // MDocType diff --git a/dbPort/src/org/compiere/model/MElement.java b/dbPort/src/org/compiere/model/MElement.java new file mode 100644 index 0000000000..25e4015eb6 --- /dev/null +++ b/dbPort/src/org/compiere/model/MElement.java @@ -0,0 +1,132 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Accounting Element Model. + * + * @author Jorg Janke + * @version $Id: MElement.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MElement extends X_C_Element +{ + /** + * Standard Constructor + * @param ctx context + * @param C_Element_ID id + * @param trxName transaction + */ + public MElement (Properties ctx, int C_Element_ID, String trxName) + { + super(ctx, C_Element_ID, trxName); + if (C_Element_ID == 0) + { + // setName (null); + // setAD_Tree_ID (0); + // setElementType (null); // A + setIsBalancing (false); + setIsNaturalAccount (false); + } + } // MElement + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MElement (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MElement + + /** + * Full Constructor + * @param client client + * @param Name name + * @param ElementType type + * @param AD_Tree_ID tree + */ + public MElement (MClient client, String Name, String ElementType, int AD_Tree_ID) + { + this (client.getCtx(), 0, client.get_TrxName()); + setClientOrg(client); + setName (Name); + setElementType (ElementType); // A + setAD_Tree_ID (AD_Tree_ID); + setIsNaturalAccount(ELEMENTTYPE_Account.equals(ElementType)); + } // MElement + + /** Tree Used */ + private X_AD_Tree m_tree = null; + + /** + * Get Tree + * @return tree + */ + public X_AD_Tree getTree () + { + if (m_tree == null) + m_tree = new X_AD_Tree (getCtx(), getAD_Tree_ID(), get_TrxName()); + return m_tree; + } // getTree + + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + String elementType = getElementType(); + // Natural Account + if (ELEMENTTYPE_UserDefined.equals(elementType) && isNaturalAccount()) + setIsNaturalAccount(false); + // Tree validation + X_AD_Tree tree = getTree(); + if (tree == null) + return false; + String treeType = tree.getTreeType(); + if (ELEMENTTYPE_UserDefined.equals(elementType)) + { + if (X_AD_Tree.TREETYPE_User1.equals(treeType) || X_AD_Tree.TREETYPE_User2.equals(treeType)) + ; + else + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@TreeType@ <> @ElementType@ (U)"), false); + return false; + } + } + else + { + if (!X_AD_Tree.TREETYPE_ElementValue.equals(treeType)) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@TreeType@ <> @ElementType@ (A)"), false); + return false; + } + } + return true; + } // beforeSave + +} // MElement diff --git a/dbPort/src/org/compiere/model/MElementValue.java b/dbPort/src/org/compiere/model/MElementValue.java new file mode 100644 index 0000000000..9be8a91a9c --- /dev/null +++ b/dbPort/src/org/compiere/model/MElementValue.java @@ -0,0 +1,254 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Natural Account + * + * @author Jorg Janke + * @version $Id: MElementValue.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MElementValue extends X_C_ElementValue +{ + /** + * Standard Constructor + * @param ctx context + * @param C_ElementValue_ID ID or 0 for new + * @param trxName transaction + */ + public MElementValue(Properties ctx, int C_ElementValue_ID, String trxName) + { + super(ctx, C_ElementValue_ID, trxName); + if (C_ElementValue_ID == 0) + { + // setC_Element_ID (0); // Parent + // setName (null); + // setValue (null); + setIsSummary (false); + setAccountSign (ACCOUNTSIGN_Natural); + setAccountType (ACCOUNTTYPE_Expense); + setIsDocControlled(false); + setIsForeignCurrency(false); + setIsBankAccount(false); + // + setPostActual (true); + setPostBudget (true); + setPostEncumbrance (true); + setPostStatistical (true); + } + } // MElementValue + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MElementValue(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MElementValue + + /** + * Full Constructor + * @param ctx context + * @param Value value + * @param Name name + * @param Description description + * @param AccountType account type + * @param AccountSign account sign + * @param IsDocControlled doc controlled + * @param IsSummary summary + * @param trxName transaction + */ + public MElementValue (Properties ctx, String Value, String Name, String Description, + String AccountType, String AccountSign, + boolean IsDocControlled, boolean IsSummary, String trxName) + { + this (ctx, 0, trxName); + setValue(Value); + setName(Name); + setDescription(Description); + setAccountType(AccountType); + setAccountSign(AccountSign); + setIsDocControlled(IsDocControlled); + setIsSummary(IsSummary); + } // MElementValue + + /** + * Import Constructor + * @param imp import + */ + public MElementValue (X_I_ElementValue imp) + { + this (imp.getCtx(), 0, imp.get_TrxName()); + setClientOrg(imp); + set(imp); + } // MElementValue + + /** + * Set/Update Settings from import + * @param imp import + */ + public void set (X_I_ElementValue imp) + { + setValue(imp.getValue()); + setName(imp.getName()); + setDescription(imp.getDescription()); + setAccountType(imp.getAccountType()); + setAccountSign(imp.getAccountSign()); + setIsSummary(imp.isSummary()); + setIsDocControlled(imp.isDocControlled()); + setC_Element_ID(imp.getC_Element_ID()); + // + setPostActual(imp.isPostActual()); + setPostBudget(imp.isPostBudget()); + setPostEncumbrance(imp.isPostEncumbrance()); + setPostStatistical(imp.isPostStatistical()); + // + // setC_BankAccount_ID(imp.getC_BankAccount_ID()); + // setIsForeignCurrency(imp.isForeignCurrency()); + // setC_Currency_ID(imp.getC_Currency_ID()); + // setIsBankAccount(imp.isIsBankAccount()); + // setValidFrom(null); + // setValidTo(null); + } // set + + + + /** + * Is this a Balance Sheet Account + * @return boolean + */ + public boolean isBalanceSheet() + { + String accountType = getAccountType(); + return (ACCOUNTTYPE_Asset.equals(accountType) + || ACCOUNTTYPE_Liability.equals(accountType) + || ACCOUNTTYPE_OwnerSEquity.equals(accountType)); + } // isBalanceSheet + + /** + * Is this an Activa Account + * @return boolean + */ + public boolean isActiva() + { + return ACCOUNTTYPE_Asset.equals(getAccountType()); + } // isActive + + /** + * Is this a Passiva Account + * @return boolean + */ + public boolean isPassiva() + { + String accountType = getAccountType(); + return (ACCOUNTTYPE_Liability.equals(accountType) + || ACCOUNTTYPE_OwnerSEquity.equals(accountType)); + } // isPassiva + + /** + * User String Representation + * @return info value - name + */ + public String toString () + { + StringBuffer sb = new StringBuffer (); + sb.append(getValue()).append(" - ").append(getName()); + return sb.toString (); + } // toString + + /** + * Extended String Representation + * @return info + */ + public String toStringX () + { + StringBuffer sb = new StringBuffer ("MElementValue["); + sb.append(get_ID()).append(",").append(getValue()).append(" - ").append(getName()) + .append ("]"); + return sb.toString (); + } // toStringX + + + + /** + * Before Save + * @param newRecord + * @return true if ir can be saved + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + // + if (!newRecord && isSummary() + && is_ValueChanged("IsSummary")) + { + String sql = "SELECT COUNT(*) FROM Fact_Acct WHERE Account_ID=?"; + int no = DB.getSQLValue(get_TrxName(), sql, getC_ElementValue_ID()); + if (no != 0) + { + log.saveError("Error", "Already posted to"); + return false; + } + } + return true; + } // beforeSave + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord) + insert_Tree(MTree_Base.TREETYPE_ElementValue, getC_Element_ID()); + + // Value/Name change + if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) + { + MAccount.updateValueDescription(getCtx(), "Account_ID=" + getC_ElementValue_ID(),get_TrxName()); + if ("Y".equals(Env.getContext(getCtx(), "$Element_U1"))) + MAccount.updateValueDescription(getCtx(), "User1_ID=" + getC_ElementValue_ID(),get_TrxName()); + if ("Y".equals(Env.getContext(getCtx(), "$Element_U2"))) + MAccount.updateValueDescription(getCtx(), "User2_ID=" + getC_ElementValue_ID(),get_TrxName()); + } + + return success; + } // afterSave + + /** + * After Delete + * @param success + * @return deleted + */ + protected boolean afterDelete (boolean success) + { + if (success) + delete_Tree(MTree_Base.TREETYPE_ElementValue); + return success; + } // afterDelete + +} // MElementValue diff --git a/dbPort/src/org/compiere/model/MField.java b/dbPort/src/org/compiere/model/MField.java new file mode 100644 index 0000000000..43d05d1db4 --- /dev/null +++ b/dbPort/src/org/compiere/model/MField.java @@ -0,0 +1,108 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + + +/** + * Field Model + * + * @author Jorg Janke + * @version $Id: MField.java,v 1.2 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MField extends X_AD_Field +{ + + /** + * Standard Constructor + * @param ctx context + * @param AD_Field_ID id + * @param trxName transaction + */ + public MField (Properties ctx, int AD_Field_ID, String trxName) + { + super (ctx, AD_Field_ID, trxName); + if (AD_Field_ID == 0) + { + // setAD_Tab_ID (0); // parent + // setAD_Column_ID (0); + // setName (null); + setEntityType (ENTITYTYPE_UserMaintained); // U + setIsCentrallyMaintained (true); // Y + setIsDisplayed (true); // Y + setIsEncrypted (false); + setIsFieldOnly (false); + setIsHeading (false); + setIsReadOnly (false); + setIsSameLine (false); + // setObscureType(OBSCURETYPE_ObscureDigitsButLast4); + } + } // MField + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MField (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MField + + /** + * Parent Constructor + * @param parent parent + */ + public MField (MTab parent) + { + this (parent.getCtx(), 0, parent.get_TrxName()); + setClientOrg(parent); + setAD_Tab_ID(parent.getAD_Tab_ID()); + } // MField + + /** + * Copy Constructor + * @param parent parent + * @param from copy from + */ + public MField (MTab parent, MField from) + { + this (parent.getCtx(), 0, parent.get_TrxName()); + copyValues(from, this); + setClientOrg(parent); + setAD_Tab_ID(parent.getAD_Tab_ID()); + setEntityType(parent.getEntityType()); + } // M_Field + + /** + * Set Column Values + * @param column column + */ + public void setColumn (MColumn column) + { + setAD_Column_ID (column.getAD_Column_ID()); + setName (column.getName()); + setDescription(column.getDescription()); + setHelp(column.getHelp()); + setDisplayLength(column.getFieldLength()); + setEntityType(column.getEntityType()); + } // setColumn + +} // MField diff --git a/dbPort/src/org/compiere/model/MIssue.java b/dbPort/src/org/compiere/model/MIssue.java new file mode 100644 index 0000000000..60019220bc --- /dev/null +++ b/dbPort/src/org/compiere/model/MIssue.java @@ -0,0 +1,530 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.net.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.*; +import org.compiere.util.*; + +/** + * Issue Report Model + * + * @author Jorg Janke + * @version $Id: MIssue.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MIssue extends X_AD_Issue +{ + /** + * Create and report issue + * @param record log record + * @return reported issue or null + */ + public static MIssue create (LogRecord record) + { + s_log.config(record.getMessage()); + MSystem system = MSystem.get(Env.getCtx()); + if (!DB.isConnected() + || !system.isAutoErrorReport()) + return null; + // + MIssue issue = new MIssue(record); + String error = issue.report(); + issue.save(); + if (error != null) + return null; + return issue; + } // create + + /** + * Create from decoded hash map string + * @param ctx context + * @param hexInput hex string + * @return issue + */ + @SuppressWarnings("unchecked") + public static MIssue create (Properties ctx, String hexInput) + { + HashMap hmIn = null; + try // encode in report + { + byte[] byteArray = Secure.convertHexString(hexInput); + ByteArrayInputStream bIn = new ByteArrayInputStream(byteArray); + ObjectInputStream oIn = new ObjectInputStream(bIn); + hmIn = (HashMap)oIn.readObject(); + + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "",e); + return null; + } + + MIssue issue = new MIssue(ctx, (HashMap)hmIn); + return issue; + } // create + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MIssue.class); + + /** Answer Delimiter */ + public static String DELIMITER = "|"; + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Issue_ID issue + * @param trxName transaction + */ + public MIssue (Properties ctx, int AD_Issue_ID, String trxName) + { + super (ctx, AD_Issue_ID, trxName); + if (AD_Issue_ID == 0) + { + setProcessed (false); // N + setSystemStatus(SYSTEMSTATUS_Evaluation); + try + { + init(ctx); + } + catch (Exception e) + { + e.getStackTrace(); + } + } + } // MIssue + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MIssue (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MIssue + + /** + * Log Record Constructor + * @param record + */ + public MIssue (LogRecord record) + { + this (Env.getCtx(), 0, null); + String summary = record.getMessage(); + setSourceClassName(record.getSourceClassName()); + setSourceMethodName(record.getSourceMethodName()); + setLoggerName(record.getLoggerName()); + Throwable t = record.getThrown(); + if (t != null) + { + if (summary != null && summary.length() > 0) + summary = t.toString() + " " + summary; + if (summary == null || summary.length() == 0) + summary = t.toString(); + // + StringBuffer error = new StringBuffer(); + StackTraceElement[] tes = t.getStackTrace(); + int count = 0; + for (int i = 0; i < tes.length; i++) + { + StackTraceElement element = tes[i]; + String s = element.toString(); + if (s.indexOf("adempiere") != -1) + { + error.append(s).append("\n"); + if (count == 0) + { + String source = element.getClassName() + + "." + element.getMethodName(); + setSourceClassName(source); + setLineNo(element.getLineNumber()); + } + count++; + } + if (count > 5 || error.length() > 2000) + break; + } + setErrorTrace(error.toString()); + // Stack + CharArrayWriter cWriter = new CharArrayWriter(); + PrintWriter pWriter = new PrintWriter(cWriter); + t.printStackTrace(pWriter); + setStackTrace(cWriter.toString()); + } + if (summary == null || summary.length() == 0) + summary = "??"; + setIssueSummary(summary); + setRecord_ID(1); + } // MIssue + + /** + * HashMap Constructor + * @param ctx context + * @param hmIn hash map + */ + public MIssue (Properties ctx, HashMap hmIn) + { + super (ctx, 0, null); + load(hmIn); + setRecord_ID(0); + } // MIssue + + /** + * Initialize + * @param ctx context + * @throws Exception + */ + private void init(Properties ctx) throws Exception + { + MSystem system = MSystem.get(ctx); + setName(system.getName()); + setUserName(system.getUserName()); + setDBAddress(system.getDBAddress()); + setSystemStatus(system.getSystemStatus()); + setReleaseNo(system.getReleaseNo()); // DB + setVersion(Adempiere.DATE_VERSION); // Code + setDatabaseInfo(DB.getDatabaseInfo()); + setOperatingSystemInfo(Adempiere.getOSInfo()); + setJavaInfo(Adempiere.getJavaInfo()); + setReleaseTag(Adempiere.getImplementationVersion()); + setLocal_Host(InetAddress.getLocalHost().toString()); + if (system.isAllowStatistics()) + { + setStatisticsInfo(system.getStatisticsInfo(true)); + setProfileInfo(system.getProfileInfo(true)); + } + } // init + + /** Length of Info Fields */ + private static final int INFOLENGTH = 2000; + + /** + * Set Issue Summary. + * Truncate it to 2000 char + * @param IssueSummary summary + */ + public void setIssueSummary (String IssueSummary) + { + if (IssueSummary == null) + return; + IssueSummary = IssueSummary.replace("java.lang.", ""); + IssueSummary = IssueSummary.replace("java.sql.", ""); + if (IssueSummary.length() > INFOLENGTH) + IssueSummary = IssueSummary.substring(0,INFOLENGTH-1); + super.setIssueSummary (IssueSummary); + } // setIssueSummary + + /** + * Set Stack Trace. + * Truncate it to 2000 char + * @param StackTrace trace + */ + public void setStackTrace (String StackTrace) + { + if (StackTrace == null) + return; + StackTrace = StackTrace.replace("java.lang.", ""); + StackTrace = StackTrace.replace("java.sql.", ""); + if (StackTrace.length() > INFOLENGTH) + StackTrace = StackTrace.substring(0,INFOLENGTH-1); + super.setStackTrace (StackTrace); + } // setStackTrace + + + /** + * Set Error Trace. + * Truncate it to 2000 char + * @param ErrorTrace trace + */ + public void setErrorTrace (String ErrorTrace) + { + if (ErrorTrace == null) + return; + ErrorTrace = ErrorTrace.replace("java.lang.", ""); + ErrorTrace = ErrorTrace.replace("java.sql.", ""); + if (ErrorTrace.length() > INFOLENGTH) + ErrorTrace = ErrorTrace.substring(0,INFOLENGTH-1); + super.setErrorTrace (ErrorTrace); + } // setErrorTrace + + /** + * Add Comments + * @param Comments + */ + public void addComments (String Comments) + { + if (Comments == null || Comments.length() == 0) + return; + String old = getComments(); + if (old == null || old.length() == 0) + setComments (Comments); + else if (!old.equals(Comments) + && old.indexOf(Comments) == -1) // something new + setComments (Comments + " | " + old); + } // addComments + + /** + * Set Comments. + * Truncate it to 2000 char + * @param Comments + */ + public void setComments (String Comments) + { + if (Comments == null) + return; + if (Comments.length() > INFOLENGTH) + Comments = Comments.substring(0,INFOLENGTH-1); + super.setComments (Comments); + } // setComments + + /** + * Set ResponseText. + * Truncate it to 2000 char + * @param ResponseText + */ + public void setResponseText (String ResponseText) + { + if (ResponseText == null) + return; + if (ResponseText.length() > INFOLENGTH) + ResponseText = ResponseText.substring(0,INFOLENGTH-1); + super.setResponseText(ResponseText); + } // setResponseText + + /** + * Process Request. + * @return answer + */ + public String process() + { + MIssueProject.get(this); // sets also Asset + MIssueSystem.get(this); + MIssueUser.get(this); + // + // setR_IssueKnown_ID(0); + // setR_Request_ID(0); + return createAnswer(); + } // process + + /** + * Create Answer to send to User + * @return answer + */ + public String createAnswer() + { + StringBuffer sb = new StringBuffer(); + if (getA_Asset_ID() != 0) + sb.append("Sign up for support at http://www.adempiere.org to receive answers."); + else + { + if (getR_IssueKnown_ID() != 0) + sb.append("Known Issue\n"); + if (getR_Request_ID() != 0) + sb.append("Request: ") + .append(getRequest().getDocumentNo()) + .append("\n"); + } + return sb.toString(); + } // createAnswer + + /** + * Get Request + * @return request or null + */ + public X_R_Request getRequest() + { + if (getR_Request_ID() == 0) + return null; + return new X_R_Request(getCtx(), getR_Request_ID(), null); + } // getRequestDocumentNo + + /** + * Get Request Document No + * @return request Document No + */ + public String getRequestDocumentNo() + { + if (getR_Request_ID() == 0) + return ""; + X_R_Request r = getRequest(); + return r.getDocumentNo(); + } // getRequestDocumentNo + + /** + * Get System Status + * @return system status + */ + public String getSystemStatus () + { + String s = super.getSystemStatus (); + if (s == null || s.length() == 0) + s = SYSTEMSTATUS_Evaluation; + return s; + } // getSystemStatus + + + /************************************************************************** + * Report/Update Issue. + * @return error message + */ + public String report() + { + if (true) + return "-"; + StringBuffer parameter = new StringBuffer("?"); + if (getRecord_ID() == 0) // don't report + return "ID=0"; + if (getRecord_ID() == 1) // new + { + parameter.append("ISSUE="); + HashMap htOut = get_HashMap(); + try // deserializing in create + { + ByteArrayOutputStream bOut = new ByteArrayOutputStream(); + ObjectOutput oOut = new ObjectOutputStream(bOut); + oOut.writeObject(htOut); + oOut.flush(); + String hexString = Secure.convertToHexString(bOut.toByteArray()); + parameter.append(hexString); + } + catch (Exception e) + { + log.severe(e.getLocalizedMessage()); + return "New-" + e.getLocalizedMessage(); + } + } + else // existing + { + try + { + parameter.append("RECORDID=").append(getRecord_ID()); + parameter.append("&DBADDRESS=").append(URLEncoder.encode(getDBAddress(), "UTF-8")); + parameter.append("&COMMENTS=").append(URLEncoder.encode(getComments(), "UTF-8")); + } + catch (Exception e) + { + log.severe(e.getLocalizedMessage()); + return "Update-" + e.getLocalizedMessage(); + } + } + + InputStreamReader in = null; + String target = "http://dev1/wstore/issueReportServlet"; + try // Send GET Request + { + StringBuffer urlString = new StringBuffer(target) + .append(parameter); + URL url = new URL (urlString.toString()); + URLConnection uc = url.openConnection(); + in = new InputStreamReader(uc.getInputStream()); + } + catch (Exception e) + { + String msg = "Cannot connect to http://" + target; + if (e instanceof FileNotFoundException || e instanceof ConnectException) + msg += "\nServer temporarily down - Please try again later"; + else + { + msg += "\nCheck connection - " + e.getLocalizedMessage(); + log.log(Level.FINE, msg); + } + return msg; + } + return readResponse(in); + } // report + + /** + * Read Response + * @param in input stream + * @return error message + */ + private String readResponse(InputStreamReader in) + { + StringBuffer sb = new StringBuffer(); + int Record_ID = 0; + String ResponseText = null; + String RequestDocumentNo = null; + try // Get Answer + { + int c; + while ((c = in.read()) != -1) + sb.append((char)c); + in.close(); + log.fine(sb.toString()); + String clear = URLDecoder.decode(sb.toString(), "UTF-8"); + log.fine(clear); + // Interpret Data + StringTokenizer st = new StringTokenizer(clear, DELIMITER); + while (st.hasMoreElements()) + { + String pair = st.nextToken(); + try + { + int index = pair.indexOf("="); + if (pair.startsWith("RECORDID=")) + { + String info = pair.substring(index+1); + Record_ID = Integer.parseInt(info); + } + else if (pair.startsWith("RESPONSE=")) + ResponseText = pair.substring(index+1); + else if (pair.startsWith("DOCUMENTNO=")) + RequestDocumentNo = pair.substring(index+1); + } + catch (Exception e) + { + log.warning(pair + " - " + e.getMessage()); + } + } + } + catch (Exception ex) + { + log.log(Level.FINE, "", ex); + return "Reading-" + ex.getLocalizedMessage(); + } + + if (Record_ID != 0) + setRecord_ID(Record_ID); + if (ResponseText != null) + setResponseText(ResponseText); + if (RequestDocumentNo != null) + setRequestDocumentNo(RequestDocumentNo); + return null; + } // readResponse + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MIssue["); + sb.append (get_ID()) + .append ("-").append (getIssueSummary()) + .append (",Record=").append (getRecord_ID()) + .append ("]"); + return sb.toString (); + } // toString + + +} // MIssue diff --git a/dbPort/src/org/compiere/model/MIssueProject.java b/dbPort/src/org/compiere/model/MIssueProject.java new file mode 100644 index 0000000000..1b574a301a --- /dev/null +++ b/dbPort/src/org/compiere/model/MIssueProject.java @@ -0,0 +1,151 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Issue Project (and Asset Link) + * + * @author Jorg Janke + * @version $Id: MIssueProject.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MIssueProject extends X_R_IssueProject +{ + /** + * Get/Set Project + * @param issue issue + * @return project + */ + static public MIssueProject get (MIssue issue) + { + if (issue.getName() == null) + return null; + MIssueProject pj = null; + String sql = "SELECT * FROM R_IssueProject WHERE Name=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, issue.getName()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + pj = new MIssueProject(issue.getCtx(), rs, null); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // New + if (pj == null) + { + pj = new MIssueProject(issue.getCtx(), 0, null); + pj.setName(issue.getName()); + pj.setA_Asset_ID(issue); + } + pj.setSystemStatus(issue.getSystemStatus()); + pj.setStatisticsInfo(issue.getStatisticsInfo()); + pj.setProfileInfo(issue.getProfileInfo()); + if (!pj.save()) + return null; + + // Set + issue.setR_IssueProject_ID(pj.getR_IssueProject_ID()); + if (pj.getA_Asset_ID() != 0) + issue.setA_Asset_ID(pj.getA_Asset_ID()); + return pj; + } // get + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MIssueProject.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param R_IssueProject_ID id + * @param trxName trx + */ + public MIssueProject (Properties ctx, int R_IssueProject_ID, String trxName) + { + super (ctx, R_IssueProject_ID, trxName); + } // MIssueProject + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MIssueProject (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MIssueProject + + /** + * Set A_Asset_ID + * @param issue issue + */ + public void setA_Asset_ID (MIssue issue) + { + int A_Asset_ID = 0; + String sql = "SELECT * FROM A_Asset a " + + "WHERE EXISTS (SELECT * FROM A_Asset_Group ag " // Tracking Assets + + "WHERE a.A_Asset_Group_ID=ag.A_Asset_Group_ID AND ag.IsTrackIssues='Y')" + + " AND EXISTS (SELECT * FROM AD_User u " + + "WHERE (a.C_BPartner_ID=u.C_BPartner_ID OR a.C_BPartnerSR_ID=u.C_BPartner_ID)" + + " AND u.EMail=?)" // #1 EMail + + " AND (SerNo IS NULL OR SerNo=?)"; // #2 Name + + + + + super.setA_Asset_ID (A_Asset_ID); + } // setA_Asset_ID + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MIssueProject["); + sb.append (get_ID()) + .append ("-").append (getName()) + .append(",A_Asset_ID=").append(getA_Asset_ID()) + .append(",C_Project_ID=").append(getC_Project_ID()) + .append ("]"); + return sb.toString (); + } // toString + +} // MIssueProject diff --git a/dbPort/src/org/compiere/model/MIssueSystem.java b/dbPort/src/org/compiere/model/MIssueSystem.java new file mode 100644 index 0000000000..dac61725d2 --- /dev/null +++ b/dbPort/src/org/compiere/model/MIssueSystem.java @@ -0,0 +1,132 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Issue System Model + * + * @author Jorg Janke + * @version $Id: MIssueSystem.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MIssueSystem extends X_R_IssueSystem +{ + /** + * Get/Set System + * @param issue issue + * @return system + */ + static public MIssueSystem get (MIssue issue) + { + if (issue.getDBAddress() == null) + return null; + MIssueSystem system = null; + PreparedStatement pstmt = null; + String sql = "SELECT * FROM R_IssueSystem WHERE DBAddress=?"; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, issue.getDBAddress()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + system = new MIssueSystem(issue.getCtx(), rs, null); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // New + if (system == null) + { + system = new MIssueSystem(issue.getCtx(), 0, null); + system.setDBAddress(issue.getDBAddress()); + system.setA_Asset_ID(issue.getA_Asset_ID()); + } + system.setSystemStatus(issue.getSystemStatus()); + system.setStatisticsInfo(issue.getStatisticsInfo()); + system.setProfileInfo(issue.getProfileInfo()); + if (issue.getA_Asset_ID() != 0 + && system.getA_Asset_ID() != issue.getA_Asset_ID()) + system.setA_Asset_ID(issue.getA_Asset_ID()); + // + if (!system.save()) + return null; + + // Set + issue.setR_IssueSystem_ID(system.getR_IssueSystem_ID()); + if (system.getA_Asset_ID() != 0) + issue.setA_Asset_ID(system.getA_Asset_ID()); + return system; + } // get + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MIssueSystem.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param R_IssueSystem_ID id + * @param trxName trx + */ + public MIssueSystem (Properties ctx, int R_IssueSystem_ID, String trxName) + { + super (ctx, R_IssueSystem_ID, trxName); + } // MIssueSystem + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MIssueSystem (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MIssueSystem + + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MIssueSystem["); + sb.append(get_ID()) + .append ("-").append (getDBAddress()) + .append(",A_Asset_ID=").append(getA_Asset_ID()) + .append ("]"); + return sb.toString (); + } // toString +} // MIssueSystem diff --git a/dbPort/src/org/compiere/model/MIssueUser.java b/dbPort/src/org/compiere/model/MIssueUser.java new file mode 100644 index 0000000000..40a218189e --- /dev/null +++ b/dbPort/src/org/compiere/model/MIssueUser.java @@ -0,0 +1,135 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Issue User Model + * + * @author Jorg Janke + * @version $Id: MIssueUser.java,v 1.2 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MIssueUser extends X_R_IssueUser +{ + /** + * Get/Set User for Issue + * @param issue issue + * @return User + */ + static public MIssueUser get (MIssue issue) + { + if (issue.getUserName() == null) + return null; + MIssueUser user = null; + // Find Issue User + String sql = "SELECT * FROM R_IssueUser WHERE UserName=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, issue.getUserName()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + user = new MIssueUser (issue.getCtx(), rs, null); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // New + if (user == null) + { + user = new MIssueUser(issue.getCtx(), 0, null); + user.setUserName(issue.getUserName()); + user.setAD_User_ID(); + if (!user.save()) + return null; + } + + issue.setR_IssueUser_ID(user.getR_IssueUser_ID()); + return user; + } // MIssueUser + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MIssueUser.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param R_IssueUser_ID id + * @param trxName trx + */ + public MIssueUser (Properties ctx, int R_IssueUser_ID, String trxName) + { + super (ctx, R_IssueUser_ID, trxName); + } // MIssueUser + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName trx + */ + public MIssueUser (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + } // MIssueUser + + + /** + * Set AD_User_ID + */ + public void setAD_User_ID () + { + int AD_User_ID = DB.getSQLValue(null, + "SELECT AD_User_ID FROM AD_User WHERE EMail=?", getUserName()); + if (AD_User_ID != 0) + super.setAD_User_ID (AD_User_ID); + } // setAD_User_ID + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MIssueUser["); + sb.append (get_ID()) + .append ("-").append(getUserName()) + .append(",AD_User_ID=").append(getAD_User_ID()) + .append ("]"); + return sb.toString (); + } // toString +} // MIssueUser diff --git a/dbPort/src/org/compiere/model/MLanguage.java b/dbPort/src/org/compiere/model/MLanguage.java new file mode 100644 index 0000000000..ec4b1e1a78 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLanguage.java @@ -0,0 +1,533 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.text.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.*; +import org.compiere.util.*; + +/** + * Language Model + * + * @author Jorg Janke + * @version $Id: MLanguage.java,v 1.4 2006/07/30 00:58:36 jjanke Exp $ + */ +public class MLanguage extends X_AD_Language +{ + + /** + * Get Language Model from Language + * @param ctx context + * @param lang language + * @return language + */ + public static MLanguage get (Properties ctx, Language lang) + { + return get (ctx, lang.getAD_Language()); + } // getMLanguage + + /** + * Get Language Model from AD_Language + * @param ctx context + * @param AD_Language language e.g. en_US + * @return language or null + */ + public static MLanguage get (Properties ctx, String AD_Language) + { + MLanguage lang = null; + String sql = "SELECT * FROM AD_Language WHERE AD_Language=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, AD_Language); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + lang = new MLanguage (ctx, rs, null); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, "get", ex); + } + try + { + if (pstmt != null) + pstmt.close(); + } + catch (SQLException ex1) + { + } + pstmt = null; + return lang; + } // get + + /** + * Load Languages (variants) with Language + * @param ctx context + * @param LanguageISO language (2 letter) e.g. en + * @return language + */ + public static MLanguage[] getWithLanguage (Properties ctx, String LanguageISO) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_Language WHERE LanguageISO=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, LanguageISO); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MLanguage (ctx, rs, null)); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, sql, ex); + } + try + { + if (pstmt != null) + pstmt.close(); + } + catch (SQLException ex1) + { + } + pstmt = null; + // + MLanguage[] languages = new MLanguage[list.size()]; + list.toArray(languages); + return languages; + } // get + + /** + * Maintain all active languages + * @param ctx context + */ + public static void maintain (Properties ctx) + { + String sql = "SELECT * FROM AD_Language " + + "WHERE IsSystemLanguage='Y' AND IsBaseLanguage='N' AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + MLanguage language = new MLanguage (ctx, rs, null); + language.maintain(true); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // maintain + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MLanguage.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Language_ID id + * @param trxName transaction + */ + public MLanguage (Properties ctx, int AD_Language_ID, String trxName) + { + super (ctx, AD_Language_ID, trxName); + } // MLanguage + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MLanguage (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MLanguage + + /** + * Create Language + * @param ctx context + * @param AD_Language language code + * @param Name name + * @param CountryCode country code + * @param LanguageISO language code + * @param trxName transaction + */ + private MLanguage (Properties ctx, String AD_Language, String Name, + String CountryCode, String LanguageISO, String trxName) + { + super(ctx, 0, trxName); + setAD_Language (AD_Language); // en_US + setIsBaseLanguage (false); + setIsSystemLanguage (false); + setName (Name); + setCountryCode(CountryCode); // US + setLanguageISO(LanguageISO); // en + String sql = "SELECT NVL(MAX(AD_Language_ID),0)+1 AS DefaultValue FROM AD_Language"; + setAD_Language_ID(DB.getSQLValue(trxName, sql)); + } // MLanguage + + /** Locale */ + private Locale m_locale = null; + /** Date Format */ + private SimpleDateFormat m_dateFormat = null; + + /** + * String Representation + * @return info + */ + public String toString() + { + return "MLanguage[" + getAD_Language() + "-" + getName() + + ",Language=" + getLanguageISO() + ",Country=" + getCountryCode() + + "]"; + } // toString + + /** + * Get Locale + * @return Locale + */ + public Locale getLocale() + { + if (m_locale == null) + m_locale = new Locale (getLanguageISO(), getCountryCode()); + return m_locale; + } // getLocale + + + /** + * Get (Short) Date Format. + * The date format must parseable by org.compiere.grid.ed.MDocDate + * i.e. leading zero for date and month + * @return date format MM/dd/yyyy - dd.MM.yyyy + */ + public SimpleDateFormat getDateFormat() + { + if (m_dateFormat != null) + return m_dateFormat; + + if (getDatePattern() != null) + { + m_dateFormat = (SimpleDateFormat)DateFormat.getDateInstance + (DateFormat.SHORT, getLocale()); + try + { + m_dateFormat.applyPattern(getDatePattern()); + } + catch (Exception e) + { + log.severe(getDatePattern() + " - " + e); + m_dateFormat = null; + } + } + + if (m_dateFormat == null) + { + // Fix Locale Date format + m_dateFormat = (SimpleDateFormat)DateFormat.getDateInstance + (DateFormat.SHORT, getLocale()); + String sFormat = m_dateFormat.toPattern(); + // some short formats have only one M and d (e.g. ths US) + if (sFormat.indexOf("MM") == -1 && sFormat.indexOf("dd") == -1) + { + String nFormat = ""; + for (int i = 0; i < sFormat.length(); i++) + { + if (sFormat.charAt(i) == 'M') + nFormat += "MM"; + else if (sFormat.charAt(i) == 'd') + nFormat += "dd"; + else + nFormat += sFormat.charAt(i); + } + // System.out.println(sFormat + " => " + nFormat); + m_dateFormat.applyPattern(nFormat); + } + // Unknown short format => use JDBC + if (m_dateFormat.toPattern().length() != 8) + m_dateFormat.applyPattern("yyyy-MM-dd"); + + // 4 digit year + if (m_dateFormat.toPattern().indexOf("yyyy") == -1) + { + sFormat = m_dateFormat.toPattern(); + String nFormat = ""; + for (int i = 0; i < sFormat.length(); i++) + { + if (sFormat.charAt(i) == 'y') + nFormat += "yy"; + else + nFormat += sFormat.charAt(i); + } + m_dateFormat.applyPattern(nFormat); + } + } + // + m_dateFormat.setLenient(true); + return m_dateFormat; + } // getDateFormat + + + /** + * Before Save + * @param newRecord new + * @return true/false + */ + protected boolean beforeSave (boolean newRecord) + { + if (is_ValueChanged("DatePattern") && getDatePattern() != null) + { + String dp = getDatePattern(); + if (dp.indexOf("MM") == -1) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @DatePattern@ - No Month (MM)")); + return false; + } + if (dp.indexOf("dd") == -1) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @DatePattern@ - No Day (dd)")); + return false; + } + if (dp.indexOf("yy") == -1) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @DatePattern@ - No Year (yy)")); + return false; + } + + m_dateFormat = (SimpleDateFormat)DateFormat.getDateInstance + (DateFormat.SHORT, getLocale()); + try + { + m_dateFormat.applyPattern(dp); + } + catch (Exception e) + { + log.saveError("Error", Msg.parseTranslation(getCtx(), "@Error@ @DatePattern@ - " + e.getMessage())); + m_dateFormat = null; + return false; + } + } + return true; + } // beforeSae + + /** + * AfterSave + * @param newRecord new + * @param success success + * @return true if saved + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + int no = TranslationTable.getActiveLanguages(true); + log.fine("Active Languages=" + no); + return true; + } // afterSave + + + /************************************************************************** + * Maintain Translation + * @param add if true add missing records - otherwise delete + * @return number of records deleted/inserted + */ + public int maintain (boolean add) + { + String sql = "SELECT TableName FROM AD_Table WHERE TableName LIKE '%_Trl' ORDER BY 1"; + PreparedStatement pstmt = null; + int retNo = 0; + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + if (add) + retNo += addTable (rs.getString(1)); + else + retNo += deleteTable (rs.getString(1)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retNo; + } // maintain + + /** + * Delete Translation + * @param tableName table name + * @return number of records deleted + */ + private int deleteTable (String tableName) + { + String sql = "DELETE " + tableName + + " WHERE AD_Language='" + getAD_Language() + "'"; + int no = DB.executeUpdate(sql, get_TrxName()); + log.fine(tableName + " #" + no); + return no; + } // deleteTable + + /** + * Add Translation to table + * @param tableName table name + * @return number of records inserted + */ + private int addTable (String tableName) + { + String baseTable = tableName.substring(0, tableName.length()-4); + String sql = "SELECT c.ColumnName " + + "FROM AD_Column c" + + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) " + + "WHERE t.TableName=?" + + " AND c.IsTranslated='Y' AND c.IsActive='Y' " + + "ORDER BY 1"; + ArrayList columns = new ArrayList(5); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, baseTable); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + columns.add(rs.getString(1)); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // Columns + if (columns.size() == 0) + { + log.log(Level.SEVERE, "No Columns found for " + baseTable); + return 0; + } + StringBuffer cols = new StringBuffer(); + for (int i = 0; i < columns.size(); i++) + cols.append(",").append(columns.get(i)); + + // Insert Statement + int AD_User_ID = Env.getAD_User_ID(getCtx()); + String keyColumn = baseTable + "_ID"; + String insert = "INSERT INTO " + tableName + + "(AD_Language,IsTranslated, AD_Client_ID,AD_Org_ID, " + + "Createdby,UpdatedBy, " + + keyColumn + cols + ") " + + "SELECT '" + getAD_Language() + "','N', AD_Client_ID,AD_Org_ID, " + + AD_User_ID + "," + AD_User_ID + ", " + + keyColumn + cols + + " FROM " + baseTable + + " WHERE " + keyColumn + " NOT IN (SELECT " + keyColumn + + " FROM " + tableName + + " WHERE AD_Language='" + getAD_Language() + "')"; + // + " WHERE (" + keyColumn + ",'" + getAD_Language()+ "') NOT IN (SELECT " + // + keyColumn + ",AD_Language FROM " + tableName + ")"; + int no = DB.executeUpdate(insert, get_TrxName()); + log.fine(tableName + " #" + no); + return no; + } // addTable + + + /************************************************************************** + * Setup + * @param args args + */ + public static void main(String[] args) + { + System.out.println("Language"); + Adempiere.startup(true); + + System.out.println(MLanguage.get(Env.getCtx(), "de_DE")); + System.out.println(MLanguage.get(Env.getCtx(), "en_US")); + + /** + Locale[] locales = Locale.getAvailableLocales(); + for (int i = 0; i < locales.length; i++) + { + Locale loc = locales[i]; + if (loc.getVariant() != null && loc.getVariant().length() != 0) + continue; + if (loc.getCountry() != null && loc.getCountry().length() != 0) + continue; + + System.out.println(loc.toString() + + " - " + loc.getDisplayName() + + " + " + loc.getCountry() + + " + " + loc.getLanguage() + ); + MLanguage lang = new MLanguage (Env.getCtx(), loc.toString(), + loc.getDisplayName(), loc.getCountry(), loc.getLanguage()); + lang.save(); + System.out.println(lang); + } + /**/ + } // main + +} // MLanguage diff --git a/dbPort/src/org/compiere/model/MLocation.java b/dbPort/src/org/compiere/model/MLocation.java new file mode 100644 index 0000000000..49d9743e5c --- /dev/null +++ b/dbPort/src/org/compiere/model/MLocation.java @@ -0,0 +1,591 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Loaction (Address) + * + * @author Jorg Janke + * @version $Id: MLocation.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MLocation extends X_C_Location implements Comparator +{ + /** + * Get Location from Cache + * @param ctx context + * @param C_Location_ID id + * @param trxName transaction + * @return MLocation + */ + public static MLocation get (Properties ctx, int C_Location_ID, String trxName) + { + // New + if (C_Location_ID == 0) + return new MLocation(ctx, C_Location_ID, trxName); + // + Integer key = new Integer (C_Location_ID); + MLocation retValue = (MLocation) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MLocation (ctx, C_Location_ID, trxName); + if (retValue.get_ID () != 0) // found + { + s_cache.put (key, retValue); + return retValue; + } + return null; // not found + } // get + + /** + * Load Location with ID if Business Partner Location + * @param ctx context + * @param C_BPartner_Location_ID Business Partner Location + * @param trxName transaction + * @return loaction or null + */ + public static MLocation getBPLocation (Properties ctx, int C_BPartner_Location_ID, String trxName) + { + if (C_BPartner_Location_ID == 0) // load default + return null; + + MLocation loc = null; + String sql = "SELECT * FROM C_Location l " + + "WHERE C_Location_ID=(SELECT C_Location_ID FROM C_BPartner_Location WHERE C_BPartner_Location_ID=?)"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, C_BPartner_Location_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + loc = new MLocation (ctx, rs, trxName); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql + " - " + C_BPartner_Location_ID, e); + loc = null; + } + return loc; + } // getBPLocation + + /** Cache */ + private static CCache s_cache = new CCache("C_Location", 100, 30); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger(MLocation.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param C_Location_ID id + * @param trxName transaction + */ + public MLocation (Properties ctx, int C_Location_ID, String trxName) + { + super (ctx, C_Location_ID, trxName); + if (C_Location_ID == 0) + { + MCountry defaultCountry = MCountry.getDefault(getCtx()); + setCountry(defaultCountry); + MRegion defaultRegion = MRegion.getDefault(getCtx()); + if (defaultRegion != null + && defaultRegion.getC_Country_ID() == defaultCountry.getC_Country_ID()) + setRegion(defaultRegion); + } + } // MLocation + + /** + * Parent Constructor + * @param country mandatory country + * @param region optional region + */ + public MLocation (MCountry country, MRegion region) + { + super (country.getCtx(), 0, country.get_TrxName()); + setCountry (country); + setRegion (region); + } // MLocation + + /** + * Full Constructor + * @param ctx context + * @param C_Country_ID country + * @param C_Region_ID region + * @param city city + * @param trxName transaction + */ + public MLocation (Properties ctx, int C_Country_ID, int C_Region_ID, String city, String trxName) + { + super(ctx, 0, trxName); + setC_Country_ID(C_Country_ID); + setC_Region_ID(C_Region_ID); + setCity(city); + } // MLocation + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MLocation (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MLocation + + private MCountry m_c = null; + private MRegion m_r = null; + + /** + * Set Country + * @param country + */ + public void setCountry (MCountry country) + { + if (country != null) + m_c = country; + else + m_c = MCountry.getDefault(getCtx()); + super.setC_Country_ID (m_c.getC_Country_ID()); + } // setCountry + + /** + * Set C_Country_ID + * @param C_Country_ID id + */ + public void setC_Country_ID (int C_Country_ID) + { + if (getC_Country_ID() != C_Country_ID) + setRegion(null); + setCountry (MCountry.get(getCtx(), C_Country_ID)); + } // setCountry + + /** + * Get Country + * @return country + */ + public MCountry getCountry() + { + if (m_c == null) + { + if (getC_Country_ID() != 0) + m_c = MCountry.get(getCtx(), getC_Country_ID()); + else + m_c = MCountry.getDefault(getCtx()); + } + return m_c; + } // getCountry + + /** + * Get Country Name + * @return Country Name + */ + public String getCountryName() + { + return getCountry().getName(); + } // getCountryName + + /** + * Get Country Line + * @param local if true only foreign country is returned + * @return country or null + */ + public String getCountry (boolean local) + { + if (local + && getC_Country_ID() == MCountry.getDefault(getCtx()).getC_Country_ID()) + return null; + return getCountryName(); + } // getCountry + + + /** + * Set Region + * @param region + */ + public void setRegion (MRegion region) + { + m_r = region; + if (region == null) + super.setC_Region_ID(0); + else + { + super.setC_Region_ID(m_r.getC_Region_ID()); + if (m_r.getC_Country_ID() != getC_Country_ID()) + { + log.info("Region(" + region + ") C_Country_ID=" + region.getC_Country_ID() + + " - From C_Country_ID=" + getC_Country_ID()); + setC_Country_ID(region.getC_Country_ID()); + } + } + } // setRegion + + /** + * Set C_Region_ID + * @param C_Region_ID region + */ + public void setC_Region_ID (int C_Region_ID) + { + if (C_Region_ID == 0) + setRegion(null); + // Country defined + else if (getC_Country_ID() != 0) + { + MCountry cc = getCountry(); + if (cc.isValidRegion(C_Region_ID)) + super.setC_Region_ID(C_Region_ID); + else + setRegion(null); + } + else + setRegion (MRegion.get(getCtx(), C_Region_ID)); + } // setC_Region_ID + + /** + * Get Region + * @return region + */ + public MRegion getRegion() + { + if (m_r == null && getC_Region_ID() != 0) + m_r = MRegion.get(getCtx(), getC_Region_ID()); + return m_r; + } // getRegion + + /** + * Get (local) Region Name + * @return region Name or "" + */ + public String getRegionName() + { + return getRegionName(false); + } // getRegionName + + /** + * Get Region Name + * @param getFromRegion get from region (not locally) + * @return region Name or "" + */ + public String getRegionName (boolean getFromRegion) + { + if (getFromRegion && getCountry().isHasRegion() + && getRegion() != null) + { + super.setRegionName(""); // avoid duplicates + return getRegion().getName(); + } + // + String regionName = super.getRegionName(); + if (regionName == null) + regionName = ""; + return regionName; + } // getRegionName + + + /** + * Compares to current record + * @param C_Country_ID if 0 ignored + * @param C_Region_ID if 0 ignored + * @param Postal match postal + * @param Postal_Add match postal add + * @param City match city + * @param Address1 match address 1 + * @param Address2 match addtess 2 + * @return true if equals + */ + public boolean equals (int C_Country_ID, int C_Region_ID, + String Postal, String Postal_Add, String City, String Address1, String Address2) + { + if (C_Country_ID != 0 && getC_Country_ID() != C_Country_ID) + return false; + if (C_Region_ID != 0 && getC_Region_ID() != C_Region_ID) + return false; + // must match + if (!equalsNull(Postal, getPostal())) + return false; + if (!equalsNull(Postal_Add, getPostal_Add())) + return false; + if (!equalsNull(City, getCity())) + return false; + if (!equalsNull(Address1, getAddress1())) + return false; + if (!equalsNull(Address2, getAddress2())) + return false; + return true; + } // equals + + /** + * Equals if "" or Null + * @param c1 c1 + * @param c2 c2 + * @return true if equal (ignore case) + */ + private boolean equalsNull (String c1, String c2) + { + if (c1 == null) + c1 = ""; + if (c2 == null) + c2 = ""; + return c1.equalsIgnoreCase(c2); + } // equalsNull + + /** + * Equals + * @param cmp comperator + * @return true if ID the same + */ + public boolean equals (Object cmp) + { + if (cmp == null) + return false; + if (cmp.getClass().equals(this.getClass())) + return ((PO)cmp).get_ID() == get_ID(); + return equals(cmp); + } // equals + + /** + * Print Address Reverse Order + * @return true if reverse depending on country + */ + public boolean isAddressLinesReverse() + { + // Local + if (getC_Country_ID() == MCountry.getDefault(getCtx()).getC_Country_ID()) + return getCountry().isAddressLinesLocalReverse(); + return getCountry().isAddressLinesReverse(); + } // isAddressLinesReverse + + + /** + * Get formatted City Region Postal line + * @return City, Region Postal + */ + public String getCityRegionPostal() + { + return parseCRP (getCountry()); + } // getCityRegionPostal + + /** + * Parse according Ctiy/Postal/Region according to displaySequence. + * @C@ - City @R@ - Region @P@ - Postal @A@ - PostalAdd + * @param c country + * @return parsed String + */ + private String parseCRP (MCountry c) + { + if (c == null) + return "CountryNotFound"; + + boolean local = getC_Country_ID() == MCountry.getDefault(getCtx()).getC_Country_ID(); + String inStr = local ? c.getDisplaySequenceLocal() : c.getDisplaySequence(); + StringBuffer outStr = new StringBuffer(); + + String token; + int i = inStr.indexOf("@"); + while (i != -1) + { + outStr.append (inStr.substring(0, i)); // up to @ + inStr = inStr.substring(i+1, inStr.length()); // from first @ + + int j = inStr.indexOf("@"); // next @ + if (j < 0) + { + token = ""; // no second tag + j = i+1; + } + else + token = inStr.substring(0, j); + // Tokens + if (token.equals("C")) + { + if (getCity() != null) + outStr.append(getCity()); + } + else if (token.equals("R")) + { + if (getRegion() != null) // we have a region + outStr.append(getRegion().getName()); + else if (super.getRegionName() != null && super.getRegionName().length() > 0) + outStr.append(super.getRegionName()); // local region name + } + else if (token.equals("P")) + { + if (getPostal() != null) + outStr.append(getPostal()); + } + else if (token.equals("A")) + { + String add = getPostal_Add(); + if (add != null && add.length() > 0) + outStr.append("-").append(add); + } + else + outStr.append("@").append(token).append("@"); + + inStr = inStr.substring(j+1, inStr.length()); // from second @ + i = inStr.indexOf("@"); + } + outStr.append(inStr); // add the rest of the string + + // Print Region Name if entered and not part of pattern + if (c.getDisplaySequence().indexOf("@R@") == -1 + && super.getRegionName() != null && super.getRegionName().length() > 0) + outStr.append(" ").append(super.getRegionName()); + + String retValue = Util.replace(outStr.toString(), "\\n", "\n"); + log.finest("parseCRP - " + c.getDisplaySequence() + " -> " + retValue); + return retValue; + } // parseContext + + + /************************************************************************** + * Return printable String representation + * @return String + */ + public String toString() + { + StringBuffer retStr = new StringBuffer(); + if (isAddressLinesReverse()) + { + // City, Region, Postal + retStr.append(", ").append(parseCRP (getCountry())); + if (getAddress4() != null && getAddress4().length() > 0) + retStr.append(", ").append(getAddress4()); + if (getAddress3() != null && getAddress3().length() > 0) + retStr.append(", ").append(getAddress3()); + if (getAddress2() != null && getAddress2().length() > 0) + retStr.append(", ").append(getAddress2()); + if (getAddress1() != null) + retStr.append(getAddress1()); + } + else + { + if (getAddress1() != null) + retStr.append(getAddress1()); + if (getAddress2() != null && getAddress2().length() > 0) + retStr.append(", ").append(getAddress2()); + if (getAddress3() != null && getAddress3().length() > 0) + retStr.append(", ").append(getAddress3()); + if (getAddress4() != null && getAddress4().length() > 0) + retStr.append(", ").append(getAddress4()); + // City, Region, Postal + retStr.append(", ").append(parseCRP (getCountry())); + // Add Country would come here + } + return retStr.toString(); + } // toString + + /** + * Return String representation with CR at line end + * @return String + */ + public String toStringCR() + { + StringBuffer retStr = new StringBuffer(); + if (isAddressLinesReverse()) + { + // City, Region, Postal + retStr.append(parseCRP (getCountry())); + if (getAddress4() != null && getAddress4().length() > 0) + retStr.append("\n").append(getAddress4()); + if (getAddress3() != null && getAddress3().length() > 0) + retStr.append("\n").append(getAddress3()); + if (getAddress2() != null && getAddress2().length() > 0) + retStr.append("\n").append(getAddress2()); + if (getAddress1() != null) + retStr.append("\n").append(getAddress1()); + } + else + { + if (getAddress1() != null) + retStr.append(getAddress1()); + if (getAddress2() != null && getAddress2().length() > 0) + retStr.append("\n").append(getAddress2()); + if (getAddress3() != null && getAddress3().length() > 0) + retStr.append("\n").append(getAddress3()); + if (getAddress4() != null && getAddress4().length() > 0) + retStr.append("\n").append(getAddress4()); + // City, Region, Postal + retStr.append("\n").append(parseCRP (getCountry())); + // Add Country would come here + } + return retStr.toString(); + } // toStringCR + + /** + * Return detailed String representation + * @return String + */ + public String toStringX() + { + StringBuffer sb = new StringBuffer("MLocation=["); + sb.append(get_ID()) + .append(",C_Country_ID=").append(getC_Country_ID()) + .append(",C_Region_ID=").append(getC_Region_ID()) + .append(",Postal=").append(getPostal()) + .append ("]"); + return sb.toString(); + } // toStringX + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + // Region Check + if (getC_Region_ID() != 0) + { + if (m_c == null || m_c.getC_Country_ID() != getC_Country_ID()) + getCountry(); + if (!m_c.isHasRegion()) + setC_Region_ID(0); + } + + return true; + } // geforeSave + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + // Value/Name change in Account + if (!newRecord + && ("Y".equals(Env.getContext(getCtx(), "$Element_LF")) + || "Y".equals(Env.getContext(getCtx(), "$Element_LT"))) + && (is_ValueChanged("Postal") || is_ValueChanged("City")) + ) + MAccount.updateValueDescription(getCtx(), + "(C_LocFrom_ID=" + getC_Location_ID() + + " OR C_LocTo_ID=" + getC_Location_ID() + ")", get_TrxName()); + return success; + } // afterSave + +} // MLocation diff --git a/dbPort/src/org/compiere/model/MLocationLookup.java b/dbPort/src/org/compiere/model/MLocationLookup.java new file mode 100644 index 0000000000..654b24d7f7 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLocationLookup.java @@ -0,0 +1,143 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Address Loaction Lookup Model. + * + * @author Jorg Janke + * @version $Id: MLocationLookup.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public final class MLocationLookup extends Lookup + implements Serializable +{ + /** + * Constructor + * @param ctx context + * @param WindowNo window no (to derive AD_Client/Org for new records) + */ + public MLocationLookup(Properties ctx, int WindowNo) + { + super (DisplayType.TableDir, WindowNo); + m_ctx = ctx; + } // MLocation + + /** Context */ + private Properties m_ctx; + + /** + * Get Display for Value (not cached) + * @param value Location_ID + * @return String Value + */ + public String getDisplay (Object value) + { + if (value == null) + return null; + MLocation loc = getLocation (value, null); + if (loc == null) + return "<" + value.toString() + ">"; + return loc.toString(); + } // getDisplay + + /** + * Get Object of Key Value + * @param value value + * @return Object or null + */ + public NamePair get (Object value) + { + if (value == null) + return null; + MLocation loc = getLocation (value, null); + if (loc == null) + return null; + return new KeyNamePair (loc.getC_Location_ID(), loc.toString()); + } // get + + /** + * The Lookup contains the key + * @param key Location_ID + * @return true if key known + */ + public boolean containsKey (Object key) + { + return getLocation(key, null) == null; + } // containsKey + + + /************************************************************************** + * Get Location + * @param key ID as string or integer + * @param trxName transaction + * @return Location + */ + public MLocation getLocation (Object key, String trxName) + { + if (key == null) + return null; + int C_Location_ID = 0; + if (key instanceof Integer) + C_Location_ID = ((Integer)key).intValue(); + else if (key != null) + C_Location_ID = Integer.parseInt(key.toString()); + // + return getLocation(C_Location_ID, trxName); + } // getLocation + + /** + * Get Location + * @param C_Location_ID id + * @param trxName transaction + * @return Location + */ + public MLocation getLocation (int C_Location_ID, String trxName) + { + return MLocation.get(m_ctx, C_Location_ID, trxName); + } // getC_Location_ID + + /** + * Get underlying fully qualified Table.Column Name. + * Used for VLookup.actionButton (Zoom) + * @return column name + */ + public String getColumnName() + { + return "C_Location_ID"; + } // getColumnName + + /** + * Return data as sorted Array - not implemented + * @param mandatory mandatory + * @param onlyValidated only validated + * @param onlyActive only active + * @param temporary force load for temporary display + * @return null + */ + public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary) + { + log.log(Level.SEVERE, "not implemented"); + return null; + } // getArray + +} // MLocation diff --git a/dbPort/src/org/compiere/model/MLocator.java b/dbPort/src/org/compiere/model/MLocator.java new file mode 100644 index 0000000000..ae1c69c442 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLocator.java @@ -0,0 +1,307 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Warehouse Locator Object + * + * @author Jorg Janke + * @version $Id: MLocator.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MLocator extends X_M_Locator +{ + /** + * Get oldest Default Locator of warehouse with locator + * @param ctx context + * @param M_Locator_ID locator + * @return locator or null + */ + public static MLocator getDefault (Properties ctx, int M_Locator_ID) + { + String trxName = null; + MLocator retValue = null; + String sql = "SELECT * FROM M_Locator l " + + "WHERE IsDefault='Y'" + + " AND EXISTS (SELECT * FROM M_Locator lx " + + "WHERE l.M_Warehouse_ID=lx.M_Warehouse_ID AND lx.M_Locator_ID=?) " + + "ORDER BY Created"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, M_Locator_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + retValue = new MLocator (ctx, rs, trxName); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + return retValue; + } // getDefault + + + /** + * Get the Locator with the combination or create new one + * @param ctx Context + * @param M_Warehouse_ID warehouse + * @param Value value + * @param X x + * @param Y y + * @param Z z + * @return locator + */ + public static MLocator get (Properties ctx, int M_Warehouse_ID, String Value, + String X, String Y, String Z) + { + MLocator retValue = null; + String sql = "SELECT * FROM M_Locator WHERE M_Warehouse_ID=? AND X=? AND Y=? AND Z=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, M_Warehouse_ID); + pstmt.setString(2, X); + pstmt.setString(3, Y); + pstmt.setString(4, Z); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = new MLocator (ctx, rs, null); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, "get", ex); + } + try + { + if (pstmt != null) + pstmt.close(); + } + catch (SQLException ex1) + { + } + pstmt = null; + // + if (retValue == null) + { + MWarehouse wh = MWarehouse.get (ctx, M_Warehouse_ID); + retValue = new MLocator (wh, Value); + retValue.setXYZ(X, Y, Z); + retValue.save(); + } + return retValue; + } // get + + /** + * Get Locator from Cache + * @param ctx context + * @param M_Locator_ID id + * @return MLocator + */ + public static MLocator get (Properties ctx, int M_Locator_ID) + { + if (s_cache == null) + s_cache = new CCache("M_Locator", 20); + Integer key = new Integer (M_Locator_ID); + MLocator retValue = (MLocator) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MLocator (ctx, M_Locator_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache; + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MLocator.class); + + + /************************************************************************** + * Standard Locator Constructor + * @param ctx Context + * @param M_Locator_ID id + * @param trxName transaction + */ + public MLocator (Properties ctx, int M_Locator_ID, String trxName) + { + super (ctx, M_Locator_ID, trxName); + if (M_Locator_ID == 0) + { + // setM_Locator_ID (0); // PK + // setM_Warehouse_ID (0); // Parent + setIsDefault (false); + setPriorityNo (50); + // setValue (null); + // setX (null); + // setY (null); + // setZ (null); + } + } // MLocator + + /** + * New Locator Constructor with XYZ=000 + * @param warehouse parent + * @param Value value + */ + public MLocator (MWarehouse warehouse, String Value) + { + this (warehouse.getCtx(), 0, warehouse.get_TrxName()); + setClientOrg(warehouse); + setM_Warehouse_ID (warehouse.getM_Warehouse_ID()); // Parent + setValue (Value); + setXYZ("0","0","0"); + } // MLocator + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MLocator (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MLocator + + /** + * Get String Representation + * @return Value + */ + public String toString() + { + return getValue(); + } // getValue + + /** + * Set Location + * @param X x + * @param Y y + * @param Z z + */ + public void setXYZ (String X, String Y, String Z) + { + setX (X); + setY (Y); + setZ (Z); + } // setXYZ + + + /** + * Get Warehouse Name + * @return name + */ + public String getWarehouseName() + { + MWarehouse wh = MWarehouse.get(getCtx(), getM_Warehouse_ID()); + if (wh.get_ID() == 0) + return "<" + getM_Warehouse_ID() + ">"; + return wh.getName(); + } // getWarehouseName + + /** + * Can Locator Store Product + * @param M_Product_ID id + * @return true if can be stored + */ + public boolean isCanStoreProduct (int M_Product_ID) + { + // Default Locator + if (M_Product_ID == 0 || isDefault()) + return true; + + int count = 0; + PreparedStatement pstmt = null; + // Already Stored + String sql = "SELECT COUNT(*) FROM M_Storage s WHERE s.M_Locator_ID=? AND s.M_Product_ID=?"; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getM_Locator_ID()); + pstmt.setInt (2, M_Product_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + count = rs.getInt(1); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + // Default Product Locator + if (count == 0) + { + sql = "SELECT COUNT(*) FROM M_Product s WHERE s.M_Locator_ID=? AND s.M_Product_ID=?"; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getM_Locator_ID()); + pstmt.setInt (2, M_Product_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + count = rs.getInt(1); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + return count != 0; + } // isCanStoreProduct + +} // MLocator diff --git a/dbPort/src/org/compiere/model/MLocatorLookup.java b/dbPort/src/org/compiere/model/MLocatorLookup.java new file mode 100644 index 0000000000..18eff7b998 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLocatorLookup.java @@ -0,0 +1,438 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Warehouse Locator Lookup Model. + * (Lookup Model is model.Lookup.java) + * + * @author Jorg Janke + * @version $Id: MLocatorLookup.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public final class MLocatorLookup extends Lookup implements Serializable +{ + /** + * Constructor + * @param ctx context + * @param WindowNo window no + */ + public MLocatorLookup(Properties ctx, int WindowNo) + { + super (DisplayType.TableDir, WindowNo); + m_ctx = ctx; + // + m_loader = new Loader(); + m_loader.start(); + } // MLocator + + /** Context */ + private Properties m_ctx; + protected int C_Locator_ID; + private Loader m_loader; + + /** Only Warehouse */ + private int m_only_Warehouse_ID = 0; + /** Only Product */ + private int m_only_Product_ID = 0; + + /** Storage of data MLookups */ + private volatile LinkedHashMap m_lookup = new LinkedHashMap(); + /** Max Locators per Lookup */ + private static int s_maxRows = 200; // how many rows to read + + /** + * Dispose + */ + public void dispose() + { + log.fine("C_Locator_ID=" + C_Locator_ID); + if (m_loader != null) + { + while (m_loader.isAlive()) + m_loader.interrupt(); + } + m_loader = null; + if (m_lookup != null) + m_lookup.clear(); + m_lookup = null; + // + super.dispose(); + } // dispose + + /** + * Set Warehouse restriction + * @param only_Warehouse_ID warehouse + */ + public void setOnly_Warehouse_ID (int only_Warehouse_ID) + { + m_only_Warehouse_ID = only_Warehouse_ID; + } // setOnly_Warehouse_ID + + /** + * Get Only Wahrehouse + * @return warehouse + */ + public int getOnly_Warehouse_ID() + { + return m_only_Warehouse_ID; + } // getOnly_Warehouse_ID + + /** + * Set Product restriction + * @param only_Product_ID Product + */ + public void setOnly_Product_ID (int only_Product_ID) + { + m_only_Product_ID = only_Product_ID; + } // setOnly_Product_ID + + /** + * Get Only Product + * @return Product + */ + public int getOnly_Product_ID() + { + return m_only_Product_ID; + } // getOnly_Product_ID + + /** + * Wait until async Load Complete + */ + public void loadComplete() + { + if (m_loader != null) + { + try + { + m_loader.join(); + } + catch (InterruptedException ie) + { + log.log(Level.SEVERE, "Join interrupted", ie); + } + } + } // loadComplete + + /** + * Get value + * @param key key + * @return value value + */ + public NamePair get (Object key) + { + if (key == null) + return null; + + // try cache + MLocator loc = (MLocator) m_lookup.get(key); + if (loc != null) + return new KeyNamePair (loc.getM_Locator_ID(), loc.toString()); + + // Not found and waiting for loader + if (m_loader.isAlive()) + { + log.fine("Waiting for Loader"); + loadComplete(); + // is most current + loc = (MLocator) m_lookup.get(key); + } + if (loc != null) + return new KeyNamePair (loc.getM_Locator_ID(), loc.toString()); + + // Try to get it directly + return getDirect(key, true, null); + } // get + + /** + * Get Display value + * @param value value + * @return String to display + */ + public String getDisplay (Object value) + { + if (value == null) + return ""; + // + NamePair display = get (value); + if (display == null) + return "<" + value.toString() + ">"; + return display.toString(); + } // getDisplay + + /** + * The Lookup contains the key + * @param key key + * @return true, if lookup contains key + */ + public boolean containsKey (Object key) + { + return m_lookup.containsKey(key); + } // containsKey + + /** + * Get Data Direct from Table + * @param keyValue integer key value + * @param saveInCache save in cache + * @param trxName transaction + * @return Object directly loaded + */ + public NamePair getDirect (Object keyValue, boolean saveInCache, String trxName) + { + MLocator loc = getMLocator (keyValue, trxName); + if (loc == null) + return null; + // + int key = loc.getM_Locator_ID(); + if (saveInCache) + m_lookup.put(new Integer(key), loc); + NamePair retValue = new KeyNamePair(key, loc.toString()); + return retValue; + } // getDirect + + /** + * Get Data Direct from Table + * @param keyValue integer key value + * @param trxName transaction + * @return Object directly loaded + */ + public MLocator getMLocator (Object keyValue, String trxName) + { + // log.fine( "MLocatorLookup.getDirect " + keyValue.getClass() + "=" + keyValue); + int M_Locator_ID = -1; + try + { + M_Locator_ID = Integer.parseInt(keyValue.toString()); + } + catch (Exception e) + {} + if (M_Locator_ID == -1) + { + log.log(Level.SEVERE, "Invalid key=" + keyValue); + return null; + } + // + return new MLocator (m_ctx, M_Locator_ID, trxName); + } // getMLocator + + /** + * @return a string representation of the object. + */ + public String toString() + { + return "MLocatorLookup[Size=" + m_lookup.size() + "]"; + } // toString + + + /** + * Is Locator with key valid (Warehouse) + * @param key key + * @return true if valid + */ + public boolean isValid (Object key) + { + if (key == null) + return true; + // try cache + MLocator loc = (MLocator) m_lookup.get(key); + if (loc == null) + loc = getMLocator(key, null); + return isValid(loc); + } // isValid + + /** + * Is Locator with key valid (Warehouse) + * @param locator locator + * @return true if valid + */ + public boolean isValid (MLocator locator) + { + if (locator == null || getOnly_Warehouse_ID() == 0) + return true; + // Warehouse OK - Product check + if (getOnly_Warehouse_ID() == locator.getM_Warehouse_ID()) + return locator.isCanStoreProduct(getOnly_Product_ID()); + return false; + } // isValid + + + /************************************************************************** + * Loader + */ + class Loader extends Thread implements Serializable + { + /** + * Loader + */ + public Loader() + { + super("MLocatorLookup"); + } // Loader + + /** + * Load Lookup + */ + public void run() + { + // log.config("MLocatorLookup Loader.run " + m_AD_Column_ID); + // Set Info - see VLocator.actionText + StringBuffer sql = new StringBuffer("SELECT * FROM M_Locator ") + .append(" WHERE IsActive='Y'"); + if (getOnly_Warehouse_ID() != 0) + sql.append(" AND M_Warehouse_ID=?"); + if (getOnly_Product_ID() != 0) + sql.append(" AND (IsDefault='Y' ") // Default Locator + .append("OR EXISTS (SELECT * FROM M_Product p ") // Product Locator + .append("WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?)") + .append("OR EXISTS (SELECT * FROM M_Storage s ") // Storage Locator + .append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))"); + String finalSql = MRole.getDefault(m_ctx, false).addAccessSQL( + sql.toString(), "M_Locator", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); + if (isInterrupted()) + { + log.log(Level.SEVERE, "Interrupted"); + return; + } + + // Reset + m_lookup.clear(); + int rows = 0; + try + { + PreparedStatement pstmt = DB.prepareStatement(finalSql, null); + int index = 1; + if (getOnly_Warehouse_ID() != 0) + pstmt.setInt(index++, getOnly_Warehouse_ID()); + if (getOnly_Product_ID() != 0) + { + pstmt.setInt(index++, getOnly_Product_ID()); + pstmt.setInt(index++, getOnly_Product_ID()); + } + ResultSet rs = pstmt.executeQuery(); + // + while (rs.next()) + { + // Max out + if (rows++ > s_maxRows) + { + log.warning("Over Max Rows - " + rows); + break; + } + MLocator loc = new MLocator(m_ctx, rs, null); + int M_Locator_ID = loc.getM_Locator_ID(); + m_lookup.put(new Integer(M_Locator_ID), loc); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, finalSql, e); + } + log.fine("Complete #" + m_lookup.size()); + if (m_lookup.size() == 0) + log.finer(finalSql); + } // run + } // Loader + + /** + * Return info as ArrayList containing Locator, waits for the loader to finish + * @return Collection of lookup values + */ + public Collection getData () + { + if (m_loader.isAlive()) + { + log.fine("Waiting for Loader"); + try + { + m_loader.join(); + } + catch (InterruptedException ie) + { + log.severe ("Join interrupted - " + ie.getMessage()); + } + } + return m_lookup.values(); + } // getData + + /** + * Return data as sorted ArrayList + * @param mandatory mandatory + * @param onlyValidated only validated + * @param onlyActive only active + * @param temporary force load for temporary display + * @return ArrayList of lookup values + */ + public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary) + { + // create list + Collection collection = getData(); + ArrayList list = new ArrayList(collection.size()); + Iterator it = collection.iterator(); + while (it.hasNext()) + { + MLocator loc = (MLocator)it.next(); + if (isValid(loc)) // only valid warehouses + list.add(loc); + } + + /** Sort Data + MLocator l = new MLocator (m_ctx, 0); + if (!mandatory) + list.add (l); + Collections.sort (list, l); + **/ + return list; + } // getArray + + + /** + * Refresh Values + * @return new size of lookup + */ + public int refresh() + { + log.fine("start"); + m_loader = new Loader(); + m_loader.start(); + try + { + m_loader.join(); + } + catch (InterruptedException ie) + { + } + log.info("#" + m_lookup.size()); + return m_lookup.size(); + } // refresh + + /** + * Get underlying fully qualified Table.Column Name + * @return Table.ColumnName + */ + public String getColumnName() + { + return "M_Locator.M_Locator_ID"; + } // getColumnName + +} // MLocatorLookup diff --git a/dbPort/src/org/compiere/model/MLookup.java b/dbPort/src/org/compiere/model/MLookup.java new file mode 100644 index 0000000000..7b54d9b442 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLookup.java @@ -0,0 +1,712 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.util.*; + +/** + * An intelligent MutableComboBoxModel, which determines what can be cached. + *
+ *      Validated   - SQL is final / not dynamic
+ *      AllLoaded   - All Records are loaded
+ *
+ *		Get Info about Lookup
+ *		-	SQL
+ *		-	KeyColumn
+ *		-	Zoom Target
+ *  
+ * @author Jorg Janke + * @version $Id: MLookup.java,v 1.4 2006/10/07 00:58:57 jjanke Exp $ + */ +public final class MLookup extends Lookup implements Serializable +{ + /** + * MLookup Constructor + * @param info info + * @param TabNo tab no + */ + public MLookup (MLookupInfo info, int TabNo) + { + super(info.DisplayType, info.WindowNo); + m_info = info; + log.fine(m_info.KeyColumn); + + // load into local lookup, if already cached + if (MLookupCache.loadFromCache (m_info, m_lookup)) + return; + + // Don't load Search or CreatedBy/UpdatedBy + if (m_info.DisplayType == DisplayType.Search + || m_info.IsCreadedUpdatedBy) + return; + // Don't load Parents/Keys + if (m_info.IsParent || m_info.IsKey) + { + m_hasInactive = true; // creates focus listener for dynamic loading + return; // required when parent needs to be selected (e.g. price from product) + } + // + m_loader = new MLoader(); + // if (TabNo != 0) + // m_loader.setPriority(Thread.NORM_PRIORITY - 1); + m_loader.start(); + // m_loader.run(); // test sync call + } // MLookup + + /** Inactive Marker Start */ + public static final String INACTIVE_S = "~"; + /** Inactive Marker End */ + public static final String INACTIVE_E = "~"; + /** Number of max rows to load */ + private static final int MAX_ROWS = 1000; // i.e. Drop Down has max 500 items + /** Indicator for Null */ + private static Integer MINUS_ONE = new Integer(-1); + + + /** The Lookup Info Value Object */ + private MLookupInfo m_info = null; + + /** Storage of data Key-NamePair */ + private volatile LinkedHashMap m_lookup = new LinkedHashMap(); + /** The Data Loader */ + private MLoader m_loader; + // + + /** All Data loaded */ + private boolean m_allLoaded = false; + /** Inactive records exists */ + private boolean m_hasInactive = false; + + /* Refreshing - disable cashing */ + private boolean m_refreshing = false; + /** Next Read for Parent */ + private long m_nextRead = 0; + + /** + * Dispose + */ + public void dispose() + { + if (m_info != null) + log.fine(m_info.KeyColumn + ": dispose"); + if (m_loader != null && m_loader.isAlive()) + m_loader.interrupt(); + m_loader = null; + // + if (m_lookup != null) + m_lookup.clear(); + m_lookup = null; + if (m_lookupDirect != null) + m_lookupDirect.clear(); + m_lookupDirect = null; + // + m_info = null; + // + super.dispose(); + } // dispose + + /** + * Wait until async Load Complete + */ + public void loadComplete() + { + if (m_loader != null && m_loader.isAlive()) + { + try + { + m_loader.join(); + m_loader = null; + } + catch (InterruptedException ie) + { + log.log(Level.SEVERE, m_info.KeyColumn + ": Interrupted", ie); + } + } + } // loadComplete + + /** + * Get value (name) for key. + * If not found return null; + * @param key key (Integer for Keys or String for Lists) + * @return value + */ + public NamePair get (Object key) + { + if (key == null || MINUS_ONE.equals(key)) // indicator for null + return null; + + if (m_info.IsParent && m_nextRead < System.currentTimeMillis()) + { + m_lookup.clear(); + if (m_lookupDirect != null) + m_lookupDirect.clear(); + m_nextRead = System.currentTimeMillis() + 500; // 1/2 sec + } + + // try cache + NamePair retValue = (NamePair)m_lookup.get(key); + if (retValue != null) + return retValue; + + // Not found and waiting for loader + if (m_loader != null && m_loader.isAlive()) + { + log.finer((m_info.KeyColumn==null ? "ID="+m_info.Column_ID : m_info.KeyColumn) + ": waiting for Loader"); + loadComplete(); + // is most current + retValue = (NamePair)m_lookup.get(key); + if (retValue != null) + return retValue; + } + + // Always check for parents - not if we SQL was validated and completely loaded + if (!m_info.IsParent && m_info.IsValidated && m_allLoaded) + { + log.finer(m_info.KeyColumn + ": - " + key // + "(" + key.getClass() + + "; Size=" + m_lookup.size()); + // log.finest( m_lookup.keySet().toString(), "ContainsKey = " + m_lookup.containsKey(key)); + // also for new values and inactive ones + return getDirect(key, false, true); // cache locally + } + + log.finest (m_info.KeyColumn + ": " + key + + "; Size=" + m_lookup.size() + "; Validated=" + m_info.IsValidated + + "; All Loaded=" + m_allLoaded + "; HasInactive=" + m_hasInactive); + // never loaded + if (!m_allLoaded + && m_lookup.size() == 0 + && !m_info.IsCreadedUpdatedBy + && !m_info.IsParent + && m_info.DisplayType != DisplayType.Search) + { + m_loader = new MLoader(); + m_loader.run(); // sync! + retValue = (NamePair)m_lookup.get(key); + if (retValue != null) + return retValue; + } + // Try to get it directly + boolean cacheLocal = m_info.IsValidated ; + return getDirect(key, false, cacheLocal); // do NOT cache + } // get + + /** + * Get Display value (name). + * If not found return key embedded in inactive signs. + * @param key key + * @return value + */ + public String getDisplay (Object key) + { + if (key == null) + return ""; + // + Object display = get (key); + if (display == null) + return "<" + key.toString() + ">"; + return display.toString(); + } // getDisplay + + /** + * The Lookup contains the key + * @param key key + * @return true if key is known + */ + public boolean containsKey (Object key) + { + return m_lookup.containsKey(key); + } // containsKey + + /** + * @return a string representation of the object. + */ + public String toString() + { + return "MLookup[" + m_info.KeyColumn + ",Column_ID=" + m_info.Column_ID + + ",Size=" + m_lookup.size() + ",Validated=" + isValidated() + + "-" + getValidation() + + "]"; + } // toString + + /** + * Indicates whether some other object is "equal to" this one. + * @param obj the reference object with which to compare. + * @return true if this object is the same as the obj + * argument; false otherwise. + */ + public boolean equals(Object obj) + { + if (obj instanceof MLookup) + { + MLookup ll = (MLookup)obj; + if (ll.m_info.Column_ID == this.m_info.Column_ID) + return true; + } + return false; + } // equals + + /** + * Return Size + * @return size + */ + public int size() + { + return m_lookup.size(); + } // size + + /** + * Is it all loaded + * @return true, if all loaded + */ + public boolean isAllLoaded() + { + return m_allLoaded; + } // isAllLoaded + + /** + * Is the List fully Validated + * @return true, if validated + */ + public boolean isValidated() + { + if (m_info == null) + return false; + return m_info.IsValidated; + } // isValidated + + /** + * Get Validation SQL + * @return Validation SQL + */ + public String getValidation() + { + return m_info.ValidationCode; + } // getValidation + + /** + * Get Reference Value + * @return Reference Value + */ + public int getAD_Reference_Value_ID() + { + return m_info.AD_Reference_Value_ID; + } // getAD_Reference_Value_ID + + + /** + * Has inactive elements in list + * @return true, if list contains inactive values + */ + public boolean hasInactive() + { + return m_hasInactive; + } // hasInactive + + /** + * Return info as ArrayList containing Value/KeyNamePair + * @param onlyValidated only validated + * @param loadParent get Data even for parent lookups + * @return List + */ + private ArrayList getData (boolean onlyValidated, boolean loadParent) + { + if (m_loader != null && m_loader.isAlive()) + { + log.fine((m_info.KeyColumn==null ? "ID="+m_info.Column_ID : m_info.KeyColumn) + + ": waiting for Loader"); + loadComplete(); + } + + // Never Loaded (correctly) + if (!m_allLoaded || m_lookup.size() == 0) + refresh (loadParent); + + // already validation included + if (m_info.IsValidated) + return new ArrayList(m_lookup.values()); + + if (!m_info.IsValidated && onlyValidated) + { + refresh (loadParent); + log.fine(m_info.KeyColumn + ": Validated - #" + m_lookup.size()); + } + + return new ArrayList(m_lookup.values()); + } // getData + + /** + * Return data as Array containing Value/KeyNamePair + * @param mandatory if not mandatory, an additional empty value is inserted + * @param onlyValidated only validated + * @param onlyActive only active + * @param temporary force load for temporary display + * @return list + */ + public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary) + { + // create list + ArrayList list = getData (onlyValidated, temporary); + + // Remove inactive choices + if (onlyActive && m_hasInactive) + { + // list from the back + for (int i = list.size(); i > 0; i--) + { + Object o = list.get(i-1); + if (o != null) + { + String s = o.toString(); + if (s.startsWith(INACTIVE_S) && s.endsWith(INACTIVE_E)) + list.remove(i-1); + } + } + } + + // Add Optional (empty) selection + if (!mandatory) + { + NamePair p = null; + if (m_info.KeyColumn != null && m_info.KeyColumn.endsWith("_ID")) + p = new KeyNamePair (-1, ""); + else + p = new ValueNamePair ("", ""); + list.add(0, p); + } + + return list; + } // getData + + /** Save getDirect last return value */ + private HashMap m_lookupDirect = null; + /** Save last unsuccessful */ + private Object m_directNullKey = null; + + /** + * Get Data Direct from Table. + * @param key key + * @param saveInCache save in cache for r/w + * @param cacheLocal cache locally for r/o + * @return value + */ + public NamePair getDirect (Object key, boolean saveInCache, boolean cacheLocal) + { + // Nothing to query + if (key == null || m_info.QueryDirect == null || m_info.QueryDirect.length() == 0) + return null; + if (key.equals(m_directNullKey)) + return null; + // + NamePair directValue = null; + if (m_lookupDirect != null) // Lookup cache + { + directValue = (NamePair)m_lookupDirect.get(key); + if (directValue != null) + return directValue; + } + log.finer(m_info.KeyColumn + ": " + key + + ", SaveInCache=" + saveInCache + ",Local=" + cacheLocal); + boolean isNumber = m_info.KeyColumn.endsWith("_ID"); + try + { + // SELECT Key, Value, Name FROM ... + PreparedStatement pstmt = DB.prepareStatement(m_info.QueryDirect, null); + if (isNumber) + pstmt.setInt(1, Integer.parseInt(key.toString())); + else + pstmt.setString(1, key.toString()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + String name = rs.getString(3); + if (isNumber) + { + int keyValue = rs.getInt(1); + KeyNamePair p = new KeyNamePair(keyValue, name); + if (saveInCache) // save if + m_lookup.put(new Integer(keyValue), p); + directValue = p; + } + else + { + String value = rs.getString(2); + ValueNamePair p = new ValueNamePair(value, name); + if (saveInCache) // save if + m_lookup.put(value, p); + directValue = p; + } + if (rs.next()) + log.log(Level.SEVERE, m_info.KeyColumn + ": Not unique (first returned) for " + + key + " SQL=" + m_info.QueryDirect); + } + else + { + m_directNullKey = key; + directValue = null; + } + + rs.close(); + pstmt.close(); + if (CLogMgt.isLevelFinest()) + log.finest(m_info.KeyColumn + ": " + directValue + " - " + m_info); + } + catch (Exception e) + { + log.log(Level.SEVERE, m_info.KeyColumn + ": SQL=" + m_info.QueryDirect + "; Key=" + key, e); + directValue = null; + } + // Cache Local if not added to R/W cache + if (cacheLocal && !saveInCache && directValue != null) + { + if (m_lookupDirect == null) + m_lookupDirect = new HashMap(); + m_lookupDirect.put(key, directValue); + } + m_hasInactive = true; + return directValue; + } // getDirect + + /** + * Get Zoom + * @return Zoom AD_Window_ID + */ + public int getZoom() + { + return m_info.ZoomWindow; + } // getZoom + + /** + * Get Zoom + * @param query query + * @return Zoom Window + */ + public int getZoom(MQuery query) + { + if (m_info.ZoomWindowPO == 0 || query == null) + return m_info.ZoomWindow; + // Need to check SO/PO + boolean isSOTrx = DB.isSOTrx(m_info.TableName, query.getWhereClause(false)); + // + if (!isSOTrx) + return m_info.ZoomWindowPO; + return m_info.ZoomWindow; + } // getZoom + + /** + * Get Zoom Query String + * @return Zoom SQL Where Clause + */ + public MQuery getZoomQuery() + { + return m_info.ZoomQuery; + } // getZoom + + /** + * Get underlying fully qualified Table.Column Name + * @return Key Column + */ + public String getColumnName() + { + return m_info.KeyColumn; + } // g2etColumnName + + /** + * Refresh & return number of items read. + * Get get data of parent lookups + * @return no of items read + */ + public int refresh () + { + return refresh(true); + } // refresh + + /** + * Refresh & return number of items read + * @param loadParent get data of parent lookups + * @return no of items read + */ + public int refresh (boolean loadParent) + { + if (!loadParent && m_info.IsParent) + return 0; + // Don't load Search or CreatedBy/UpdatedBy + if (m_info.DisplayType == DisplayType.Search + || m_info.IsCreadedUpdatedBy) + return 0; + log.fine(m_info.KeyColumn + ": start"); + m_refreshing = true; + m_loader = new MLoader(); + m_loader.start(); + // m_loader.run(); // test sync call + loadComplete(); + log.fine(m_info.KeyColumn + ": #" + m_lookup.size()); + m_refreshing = false; + return m_lookup.size(); + } // refresh + + /** + * Remove All cached Elements + * @see org.compiere.model.Lookup#removeAllElements() + */ + @Override + public void removeAllElements() + { + super.removeAllElements (); + m_lookup.clear(); + if (m_lookupDirect != null) + m_lookupDirect.clear(); + } // removeAllElements + + /************************************************************************** + * MLookup Loader + */ + class MLoader extends Thread implements Serializable + { + /** + * MLoader Constructor + */ + public MLoader() + { + super("MLoader-" + m_info.KeyColumn); + // if (m_info.KeyColumn.indexOf("C_InvoiceLine_ID") != -1) + // log.info(m_info.KeyColumn); + } // Loader + + private long m_startTime = System.currentTimeMillis(); + + /** + * Load Lookup + */ + public void run() + { + long startTime = System.currentTimeMillis(); + MLookupCache.loadStart (m_info); + String sql = m_info.Query; + + // not validated + if (!m_info.IsValidated) + { + String validation = Env.parseContext(m_info.ctx, m_info.WindowNo, m_info.ValidationCode, false); + if (validation.length() == 0 && m_info.ValidationCode.length() > 0) + { + log.fine(m_info.KeyColumn + ": Loader NOT Validated: " + m_info.ValidationCode); + return; + } + else + { + log.fine(m_info.KeyColumn + ": Loader Validated: " + validation); + int posFrom = sql.lastIndexOf(" FROM "); + boolean hasWhere = sql.indexOf(" WHERE ", posFrom) != -1; + // + int posOrder = sql.lastIndexOf(" ORDER BY "); + if (posOrder != -1) + sql = sql.substring(0, posOrder) + + (hasWhere ? " AND " : " WHERE ") + + validation + + sql.substring(posOrder); + else + sql += (hasWhere ? " AND " : " WHERE ") + + + validation; + if (CLogMgt.isLevelFinest()) + log.fine(m_info.KeyColumn + ": Validation=" + validation); + } + } + // check + if (isInterrupted()) + { + log.log(Level.WARNING, m_info.KeyColumn + ": Loader interrupted"); + return; + } + // + if (CLogMgt.isLevelFiner()) + Env.setContext(m_info.ctx, Env.WINDOW_MLOOKUP, m_info.Column_ID, m_info.KeyColumn, sql); + if (CLogMgt.isLevelFinest()) + log.fine(m_info.KeyColumn + ": " + sql); + + // Reset + m_lookup.clear(); + boolean isNumber = m_info.KeyColumn.endsWith("_ID"); + m_hasInactive = false; + int rows = 0; + try + { + // SELECT Key, Value, Name, IsActive FROM ... + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + + // Get first ... rows + m_allLoaded = true; + while (rs.next()) + { + if (rows++ > MAX_ROWS) + { + log.warning(m_info.KeyColumn + ": Loader - Too many records"); + m_allLoaded = false; + break; + } + // check for interrupted every 10 rows + if (rows % 20 == 0 && isInterrupted()) + break; + + // load data + String name = rs.getString(3); + boolean isActive = rs.getString(4).equals("Y"); + if (!isActive) + { + name = INACTIVE_S + name + INACTIVE_E; + m_hasInactive = true; + } + if (isNumber) + { + int key = rs.getInt(1); + KeyNamePair p = new KeyNamePair(key, name); + m_lookup.put(new Integer(key), p); + } + else + { + String value = rs.getString(2); + ValueNamePair p = new ValueNamePair(value, name); + m_lookup.put(value, p); + } + // log.fine( m_info.KeyColumn + ": " + name); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, m_info.KeyColumn + ": Loader - " + sql, e); + } + int size = m_lookup.size(); + log.finer(m_info.KeyColumn + + " (" + m_info.Column_ID + "):" + // + " ID=" + m_info.AD_Column_ID + " " + + + " - Loader complete #" + size + " - all=" + m_allLoaded + + " - ms=" + String.valueOf(System.currentTimeMillis()-m_startTime) + + " (" + String.valueOf(System.currentTimeMillis()-startTime) + ")"); + // if (m_allLoaded) + MLookupCache.loadEnd (m_info, m_lookup); + } // run + } // Loader + +} // MLookup diff --git a/dbPort/src/org/compiere/model/MLookupCache.java b/dbPort/src/org/compiere/model/MLookupCache.java new file mode 100644 index 0000000000..8df4eed340 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLookupCache.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.util.*; +import org.compiere.util.*; + +/** + * MLookup Data Cache. + * - not synchronized on purpose - + * Called from MLookup. + * Only caches multiple use for a single window! + * @author Jorg Janke + * @version $Id: MLookupCache.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MLookupCache +{ + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger(MLookupCache.class); + /** Static Lookup data with MLookupInfo -> HashMap */ + private static CCache s_loadedLookups = new CCache("MLookupCache", 50); + + /** + * MLookup Loader starts loading - ignore for now + * + * @param info MLookupInfo + */ + protected static void loadStart (MLookupInfo info) + { + } // loadStart + + /** + * MLookup Loader ends loading, so add it to cache + * + * @param info + * @param lookup + */ + protected static void loadEnd (MLookupInfo info, HashMap lookup) + { + if (info.IsValidated && lookup.size() > 0) + s_loadedLookups.put(getKey(info), lookup); + } // loadEnd + + /** + * Get Storage Key + * @param info lookup info + * @return key + */ + private static String getKey (MLookupInfo info) + { + if (info == null) + return String.valueOf(System.currentTimeMillis()); + // + StringBuffer sb = new StringBuffer(); + sb.append(info.WindowNo).append(":") + // .append(info.Column_ID) + .append(info.KeyColumn) + .append(info.AD_Reference_Value_ID) + .append(info.Query) + .append(info.ValidationCode); + // does not include ctx + return sb.toString(); + } // getKey + + + /** + * Load from Cache if applicable + * Called from MLookup constructor + * + * @param info MLookupInfo to search + * @param lookupTarget Target HashMap + * @return true, if lookup found + */ + protected static boolean loadFromCache (MLookupInfo info, HashMap lookupTarget) + { + String key = getKey(info); + HashMap cache = (HashMap)s_loadedLookups.get(key); + if (cache == null) + return false; + // Nothing cached + if (cache.size() == 0) + { + s_loadedLookups.remove(key); + return false; + } + + // Copy Asynchronously to speed things up + // if (cache.size() > ?) copyAsync + + // copy cache + // we can use iterator, as the lookup loading is complete (i.e. no additional entries) + Iterator iterator = cache.keySet().iterator(); + while (iterator.hasNext()) + { + Object cacheKey = iterator.next(); + Object cacheData = cache.get(cacheKey); + lookupTarget.put(cacheKey, cacheData); + } + + s_log.fine("#" + lookupTarget.size()); + return true; + } // loadFromCache + + /** + * Clear Static Lookup Cache for Window + * @param WindowNo WindowNo of Cache entries to delete + */ + public static void cacheReset (int WindowNo) + { + String key = String.valueOf(WindowNo) + ":"; + int startNo = s_loadedLookups.size(); + // find keys of Lookups to delete + ArrayList toDelete = new ArrayList(); + Iterator iterator = s_loadedLookups.keySet().iterator(); + while (iterator.hasNext()) + { + String info = (String)iterator.next(); + if (info != null && info.startsWith(key)) + toDelete.add(info); + } + + // Do the actual delete + for (int i = 0; i < toDelete.size(); i++) + s_loadedLookups.remove(toDelete.get(i)); + int endNo = s_loadedLookups.size(); + s_log.fine("WindowNo=" + WindowNo + + " - " + startNo + " -> " + endNo); + } // cacheReset + + + /************************************************************************** + * Private constructor + */ + private MLookupCache() + { + } // MLookupCache + +} // MLookupCache diff --git a/dbPort/src/org/compiere/model/MLookupFactory.java b/dbPort/src/org/compiere/model/MLookupFactory.java new file mode 100644 index 0000000000..c7ffca1bf7 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLookupFactory.java @@ -0,0 +1,773 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Create MLookups + * + * @author Jorg Janke + * @version $Id: MLookupFactory.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MLookupFactory +{ + /** Logging */ + private static CLogger s_log = CLogger.getCLogger(MLookupFactory.class); + /** Table Reference Cache */ + private static CCache s_cacheRefTable = new CCache("AD_Ref_Table", 30, 60); // 1h + + + /** + * Create MLookup + * + * @param ctx context for access + * @param WindowNo window no + * @param AD_Reference_ID display type + * @param Column_ID AD_Column_ID or AD_Process_Para_ID + * @param language report language + * @param ColumnName key column name + * @param AD_Reference_Value_ID AD_Reference (List, Table) + * @param IsParent parent (prevents query to directly access value) + * @param ValidationCode optional SQL validation + * @throws Exception if Lookup could not be created + * @return MLookup + */ + public static MLookup get (Properties ctx, int WindowNo, int Column_ID, int AD_Reference_ID, + Language language, String ColumnName, int AD_Reference_Value_ID, + boolean IsParent, String ValidationCode) + throws Exception + { + MLookupInfo info = getLookupInfo (ctx, WindowNo, Column_ID, AD_Reference_ID, + language, ColumnName, AD_Reference_Value_ID, IsParent, ValidationCode); + if (info == null) + throw new Exception ("MLookup.create - no LookupInfo"); + return new MLookup(info, 0); + } // create + + /** + * Create MLookup + * + * @param ctx context for access + * @param WindowNo window no + * @param TabNo TabNo + * @param Column_ID AD_Column_ID or AD_Process_Para_ID + * @param AD_Reference_ID display type + * @return MLookup + */ + public static MLookup get (Properties ctx, int WindowNo, int TabNo, int Column_ID, int AD_Reference_ID) + { + String ColumnName = ""; + int AD_Reference_Value_ID = 0; + boolean IsParent = false; + String ValidationCode = ""; + // + String sql = "SELECT c.ColumnName, c.AD_Reference_Value_ID, c.IsParent, vr.Code " + + "FROM AD_Column c" + + " LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " + + "WHERE c.AD_Column_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, Column_ID); + // + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + ColumnName = rs.getString(1); + AD_Reference_Value_ID = rs.getInt(2); + IsParent = "Y".equals(rs.getString(3)); + ValidationCode = rs.getString(4); + } + else + s_log.log(Level.SEVERE, "Column Not Found - AD_Column_ID=" + Column_ID); + rs.close(); + // + pstmt.close(); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, "create", ex); + } + try + { + if (pstmt != null) + pstmt.close(); + } + catch (SQLException ex1) + { + } + pstmt = null; + // + MLookupInfo info = getLookupInfo (ctx, WindowNo, Column_ID, AD_Reference_ID, + Env.getLanguage(ctx), ColumnName, AD_Reference_Value_ID, IsParent, ValidationCode); + return new MLookup(info, TabNo); + } // get + + + /************************************************************************** + * Get Information for Lookups based on Column_ID for Table Columns or Process Parameters. + * + * The SQL returns three columns: + *
+	 *		Key, Value, Name, IsActive	(where either key or value is null)
+	 *  
+ * @param ctx context for access + * @param language report language + * @param WindowNo window no + * @param Column_ID AD_Column_ID or AD_Process_Para_ID + * @param ColumnName key column name + * @param AD_Reference_ID display type + * @param AD_Reference_Value_ID AD_Reference (List, Table) + * @param IsParent parent (prevents query to directly access value) + * @param ValidationCode optional SQL validation + * @return lookup info structure + */ + static public MLookupInfo getLookupInfo (Properties ctx, int WindowNo, + int Column_ID, int AD_Reference_ID, + Language language, String ColumnName, int AD_Reference_Value_ID, + boolean IsParent, String ValidationCode) + { + MLookupInfo info = null; + boolean needToAddSecurity = true; + // List + if (AD_Reference_ID == DisplayType.List) // 17 + { + info = getLookup_List(language, AD_Reference_Value_ID); + needToAddSecurity = false; + } + // Table or Search with Reference_Value + else if ((AD_Reference_ID == DisplayType.Table || AD_Reference_ID == DisplayType.Search) + && AD_Reference_Value_ID != 0) + { + info = getLookup_Table (ctx, language, WindowNo, AD_Reference_Value_ID); + } + // TableDir, Search, ID, ... + else + { + info = getLookup_TableDir (ctx, language, WindowNo, ColumnName); + } + // do we have basic info? + if (info == null) + { + s_log.severe ("No SQL - " + ColumnName); + return null; + } + // remaining values + info.ctx = ctx; + info.WindowNo = WindowNo; + info.Column_ID = Column_ID; + info.DisplayType = AD_Reference_ID; + info.AD_Reference_Value_ID = AD_Reference_Value_ID; + info.IsParent = IsParent; + info.ValidationCode = ValidationCode; + if (info.ValidationCode == null) + info.ValidationCode = ""; + + // Variables in SQL WHERE + if (info.Query.indexOf("@") != -1) + { + // String newSQL = Env.parseContext(ctx, WindowNo, info.Query, false); + String newSQL = Env.parseContext(ctx, 0, info.Query, false); // only global + if (newSQL.length() == 0) + { + s_log.severe ("SQL parse error: " + info.Query); + return null; + } + info.Query = newSQL; + } + + // Direct Query - NO Validation/Security + int posOrder = info.Query.lastIndexOf(" ORDER BY "); + boolean hasWhere = info.Query.lastIndexOf(" WHERE ") != -1; + if (hasWhere) // might be for a select sub-query + { + // SELECT (SELECT .. FROM .. WHERE ..) FROM .. + // SELECT .. FROM .. WHERE EXISTS (SELECT .. FROM .. WHERE ..) + AccessSqlParser asp = new AccessSqlParser(info.Query); + String mainQuery = asp.getMainSql(); + hasWhere = mainQuery.indexOf(" WHERE ") != -1; + } + if (posOrder == -1) + info.QueryDirect = info.Query + + (hasWhere ? " AND " : " WHERE ") + info.KeyColumn + "=?"; + else + info.QueryDirect = info.Query.substring(0, posOrder) + + (hasWhere ? " AND " : " WHERE ") + info.KeyColumn + "=?"; + + // Validation + String local_validationCode = ""; + if (info.ValidationCode.length() == 0) + info.IsValidated = true; + else + { + local_validationCode = Env.parseContext (ctx, WindowNo, info.ValidationCode, true); + if (local_validationCode.length() == 0) // returns "" if not all variables were parsed + info.IsValidated = false; + else + info.IsValidated = true; + } + + // Add Local Validation + if (local_validationCode.length() != 0) + { + info.Query = info.Query.substring(0, posOrder) + + (hasWhere ? " AND " : " WHERE ") + local_validationCode + + info.Query.substring(posOrder); + } + + // Add Security + if (needToAddSecurity) + info.Query = MRole.getDefault(ctx, false).addAccessSQL(info.Query, + info.TableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); + // + // s_log.finest("Query: " + info.Query); + // s_log.finest("Direct: " + info.QueryDirect); + return info; + } // createLookupInfo + + + /************************************************************************** + * Get Lookup SQL for Lists + * @param language report language + * @param AD_Reference_Value_ID reference value + * @return SELECT NULL, Value, Name, IsActive FROM AD_Ref_List + */ + static public MLookupInfo getLookup_List(Language language, int AD_Reference_Value_ID) + { + StringBuffer realSQL = new StringBuffer ("SELECT NULL, AD_Ref_List.Value,"); + if (Env.isBaseLanguage(language, "AD_Ref_List")) + realSQL.append("AD_Ref_List.Name,AD_Ref_List.IsActive FROM AD_Ref_List"); + else + realSQL.append("trl.Name, AD_Ref_List.IsActive " + + "FROM AD_Ref_List INNER JOIN AD_Ref_List_Trl trl " + + " ON (AD_Ref_List.AD_Ref_List_ID=trl.AD_Ref_List_ID AND trl.AD_Language='") + .append(language.getAD_Language()).append("')"); + realSQL.append(" WHERE AD_Ref_List.AD_Reference_ID=").append(AD_Reference_Value_ID); + realSQL.append(" ORDER BY 2"); + // + return new MLookupInfo(realSQL.toString(), "AD_Ref_List", "AD_Ref_List.Value", + 101,101, MQuery.getEqualQuery("AD_Reference_ID", AD_Reference_Value_ID)); // Zoom Window+Query + } // getLookup_List + + /** + * Get Lookup SQL for List + * @param language report Language + * @param AD_Reference_Value_ID reference value + * @param linkColumnName link column name + * @return SELECT Name FROM AD_Ref_List WHERE AD_Reference_ID=x AND Value=linkColumn + */ + static public String getLookup_ListEmbed(Language language, + int AD_Reference_Value_ID, String linkColumnName) + { + StringBuffer realSQL = new StringBuffer ("SELECT "); + if (Env.isBaseLanguage(language, "AD_Ref_List")) + realSQL.append("AD_Ref_List.Name FROM AD_Ref_List"); + else + realSQL.append("trl.Name " + + "FROM AD_Ref_List INNER JOIN AD_Ref_List_Trl trl " + + " ON (AD_Ref_List.AD_Ref_List_ID=trl.AD_Ref_List_ID AND trl.AD_Language='") + .append(language.getAD_Language()).append("')"); + realSQL.append(" WHERE AD_Ref_List.AD_Reference_ID=").append(AD_Reference_Value_ID) + .append(" AND AD_Ref_List.Value=").append(linkColumnName); + + // + return realSQL.toString(); + } // getLookup_ListEmbed + + /*************************************************************************** + * Get Lookup SQL for Table Lookup + * @param ctx context for access and dynamic access + * @param language report language + * @param WindowNo window no + * @param AD_Reference_Value_ID reference value + * @return SELECT Key, NULL, Name, IsActive FROM Table - if KeyColumn end with _ID + * otherwise SELECT NULL, Key, Name, IsActive FROM Table + */ + static private MLookupInfo getLookup_Table (Properties ctx, Language language, + int WindowNo, int AD_Reference_Value_ID) + { + // Try cache - assume no language change + String key = String.valueOf(AD_Reference_Value_ID); + MLookupInfo retValue = (MLookupInfo)s_cacheRefTable.get(key); + if (retValue != null) + { + s_log.finest("Cache: " + retValue); + return retValue.cloneIt(); + } + // + String sql0 = "SELECT t.TableName,ck.ColumnName AS KeyColumn," // 1..2 + + "cd.ColumnName AS DisplayColumn,rt.IsValueDisplayed,cd.IsTranslated," // 3..5 + + "rt.WhereClause,rt.OrderByClause,t.AD_Window_ID,t.PO_Window_ID, " // 6..9 + + "t.AD_Table_ID " // 10 + + "FROM AD_Ref_Table rt" + + " INNER JOIN AD_Table t ON (rt.AD_Table_ID=t.AD_Table_ID)" + + " INNER JOIN AD_Column ck ON (rt.AD_Key=ck.AD_Column_ID)" + + " INNER JOIN AD_Column cd ON (rt.AD_Display=cd.AD_Column_ID) " + + "WHERE rt.AD_Reference_ID=?" + + " AND rt.IsActive='Y' AND t.IsActive='Y'"; + // + String KeyColumn = null, DisplayColumn = null, TableName = null, WhereClause = null, OrderByClause = null; + boolean IsTranslated = false, isValueDisplayed = false; + boolean isSOTrx = !"N".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")); + int ZoomWindow = 0; + int ZoomWindowPO = 0; + int AD_Table_ID = 0; + boolean loaded = false; + + try + { + PreparedStatement pstmt = DB.prepareStatement(sql0, null); + pstmt.setInt(1, AD_Reference_Value_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + TableName = rs.getString(1); + KeyColumn = rs.getString(2); + DisplayColumn = rs.getString(3); + isValueDisplayed = "Y".equals(rs.getString(4)); + IsTranslated = "Y".equals(rs.getString(5)); + WhereClause = rs.getString(6); + OrderByClause = rs.getString(7); + ZoomWindow = rs.getInt(8); + ZoomWindowPO = rs.getInt(9); + AD_Table_ID = rs.getInt(10); + loaded = true; + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql0, e); + return null; + } + if (!loaded) + { + s_log.log(Level.SEVERE, "No Table Reference Table ID=" + AD_Reference_Value_ID); + return null; + } + + StringBuffer realSQL = new StringBuffer("SELECT "); + if (!KeyColumn.endsWith("_ID")) + realSQL.append("NULL,"); + + // Translated + if (IsTranslated && !Env.isBaseLanguage(language, TableName)) + { + realSQL.append(TableName).append(".").append(KeyColumn).append(","); + if (KeyColumn.endsWith("_ID")) + realSQL.append("NULL,"); + if (isValueDisplayed) + realSQL.append(TableName).append(".Value || '-' || "); + realSQL.append(TableName).append("_Trl.").append(DisplayColumn) + .append(",").append(TableName).append(".IsActive"); + realSQL.append(" FROM ").append(TableName) + .append(" INNER JOIN ").append(TableName).append("_TRL ON (") + .append(TableName).append(".").append(KeyColumn) + .append("=").append(TableName).append("_Trl.").append(KeyColumn) + .append(" AND ").append(TableName).append("_Trl.AD_Language='") + .append(language.getAD_Language()).append("')"); + } + // Not Translated + else + { + realSQL.append(TableName).append(".").append(KeyColumn).append(","); + if (KeyColumn.endsWith("_ID")) + realSQL.append("NULL,"); + if (isValueDisplayed) + realSQL.append(TableName).append(".Value || '-' || "); + realSQL.append(TableName).append(".").append(DisplayColumn); + realSQL.append(",").append(TableName).append(".IsActive"); + realSQL.append(" FROM ").append(TableName); + } + + // add WHERE clause + MQuery zoomQuery = null; + if (WhereClause != null) + { + String where = WhereClause; + if (where.indexOf("@") != -1) + where = Env.parseContext(ctx, WindowNo, where, false); + if (where.length() == 0 && WhereClause.length() != 0) + s_log.severe ("Could not resolve: " + WhereClause); + + // We have no context + if (where.length() != 0) + { + realSQL.append(" WHERE ").append(where); + if (where.indexOf(".") == -1) + s_log.log(Level.SEVERE, "getLookup_Table - " + TableName + + ": WHERE should be fully qualified: " + WhereClause); + zoomQuery = new MQuery (TableName); + zoomQuery.addRestriction(where); + } + } + + // Order By qualified term or by Name + if (OrderByClause != null) + { + realSQL.append(" ORDER BY ").append(OrderByClause); + if (OrderByClause.indexOf(".") == -1) + s_log.log(Level.SEVERE, "getLookup_Table - " + TableName + + ": ORDER BY must fully qualified: " + OrderByClause); + } + else + realSQL.append(" ORDER BY 3"); + + s_log.finest("AD_Reference_Value_ID=" + AD_Reference_Value_ID + " - " + realSQL); + retValue = new MLookupInfo (realSQL.toString(), TableName, + TableName + "." + KeyColumn, ZoomWindow, ZoomWindowPO, zoomQuery); + s_cacheRefTable.put(key, retValue.cloneIt()); + return retValue; + } // getLookup_Table + + /** + * Get Embedded Lookup SQL for Table Lookup + * @param language report language + * @param BaseColumn base column name + * @param BaseTable base table name + * @param AD_Reference_Value_ID reference value + * @return SELECT Name FROM Table + */ + static public String getLookup_TableEmbed (Language language, + String BaseColumn, String BaseTable, int AD_Reference_Value_ID) + { + String sql = "SELECT t.TableName,ck.ColumnName AS KeyColumn," + + "cd.ColumnName AS DisplayColumn,rt.isValueDisplayed,cd.IsTranslated " + + "FROM AD_Ref_Table rt" + + " INNER JOIN AD_Table t ON (rt.AD_Table_ID=t.AD_Table_ID)" + + " INNER JOIN AD_Column ck ON (rt.AD_Key=ck.AD_Column_ID)" + + " INNER JOIN AD_Column cd ON (rt.AD_Display=cd.AD_Column_ID) " + + "WHERE rt.AD_Reference_ID=?" + + " AND rt.IsActive='Y' AND t.IsActive='Y'"; + // + String KeyColumn, DisplayColumn, TableName; + boolean IsTranslated, isValueDisplayed; + + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Reference_Value_ID); + ResultSet rs = pstmt.executeQuery(); + if (!rs.next()) + { + s_log.log(Level.SEVERE, "Cannot find Reference Table, ID=" + AD_Reference_Value_ID + + ", Base=" + BaseTable + "." + BaseColumn); + rs.close(); + pstmt.close(); + return null; + } + + TableName = rs.getString(1); + KeyColumn = rs.getString(2); + DisplayColumn = rs.getString(3); + isValueDisplayed = rs.getString(4).equals("Y"); + IsTranslated = rs.getString(5).equals("Y"); + + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + return null; + } + + StringBuffer embedSQL = new StringBuffer("SELECT "); + + // Translated + if (IsTranslated && !Env.isBaseLanguage(language, TableName)) + { + if (isValueDisplayed) + embedSQL.append(TableName).append(".Value||'-'||"); + embedSQL.append(TableName).append("_Trl.").append(DisplayColumn); + // + embedSQL.append(" FROM ").append(TableName) + .append(" INNER JOIN ").append(TableName).append("_TRL ON (") + .append(TableName).append(".").append(KeyColumn) + .append("=").append(TableName).append("_Trl.").append(KeyColumn) + .append(" AND ").append(TableName).append("_Trl.AD_Language='") + .append(language.getAD_Language()).append("')"); + } + // Not Translated + else + { + if (isValueDisplayed) + embedSQL.append(TableName).append(".Value||'-'||"); + embedSQL.append(TableName).append(".").append(DisplayColumn); + // + embedSQL.append(" FROM ").append(TableName); + } + + embedSQL.append(" WHERE ").append(BaseTable).append(".").append(BaseColumn); + embedSQL.append("=").append(TableName).append(".").append(KeyColumn); + + return embedSQL.toString(); + } // getLookup_TableEmbed + + + /************************************************************************** + * Get Lookup SQL for direct Table Lookup + * @param ctx context for access + * @param language report language + * @param ColumnName column name + * @param WindowNo Window (for SOTrx) + * @return SELECT Key, NULL, Name, IsActive from Table (fully qualified) + */ + static private MLookupInfo getLookup_TableDir (Properties ctx, Language language, + int WindowNo, String ColumnName) + { + if (!ColumnName.endsWith("_ID")) + { + s_log.log(Level.SEVERE, "Key does not end with '_ID': " + ColumnName); + return null; + } + + // Hardcoded BPartner Org + if (ColumnName.equals("AD_OrgBP_ID")) + ColumnName = "AD_Org_ID"; + + String TableName = ColumnName.substring(0,ColumnName.length()-3); + boolean isSOTrx = !"N".equals(Env.getContext(ctx, WindowNo, "IsSOTrx")); + int ZoomWindow = 0; + int ZoomWindowPO = 0; + + // get display column names + String sql0 = "SELECT c.ColumnName,c.IsTranslated,c.AD_Reference_ID," + + "c.AD_Reference_Value_ID,t.AD_Window_ID,t.PO_Window_ID " + + "FROM AD_Table t" + + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) " + + "WHERE TableName=?" + + " AND c.IsIdentifier='Y' " + + "ORDER BY c.SeqNo"; + // + String KeyColumn = ColumnName; + // + ArrayList list = new ArrayList(); + boolean isTranslated = false; + // + try + { + PreparedStatement pstmt = DB.prepareStatement(sql0, null); + pstmt.setString(1, TableName); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + LookupDisplayColumn ldc = new LookupDisplayColumn (rs.getString(1), + "Y".equals(rs.getString(2)), rs.getInt(3), rs.getInt(4)); + list.add (ldc); + // s_log.fine("getLookup_TableDir: " + ColumnName + " - " + ldc); + // + if (!isTranslated && ldc.IsTranslated) + isTranslated = true; + ZoomWindow = rs.getInt(5); + ZoomWindowPO = rs.getInt(6); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql0, e); + return null; + } + // Do we have columns ? + if (list.size() == 0) + { + s_log.log(Level.SEVERE, "No Identifier records found: " + ColumnName); + return null; + } + + StringBuffer realSQL = new StringBuffer("SELECT "); + realSQL.append(TableName).append(".").append(KeyColumn).append(",NULL,"); + + StringBuffer displayColumn = new StringBuffer(); + int size = list.size(); + // Get Display Column + for (int i = 0; i < size; i++) + { + if (i > 0) + displayColumn.append(" ||'_'|| " ); + LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i); + + // translated + if (ldc.IsTranslated && !Env.isBaseLanguage(language, TableName)) + displayColumn.append(TableName).append("_Trl.").append(ldc.ColumnName); + // date + else if (DisplayType.isDate(ldc.DisplayType)) + { + displayColumn.append(DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language())); + } + // TableDir + else if ((ldc.DisplayType == DisplayType.TableDir || ldc.DisplayType == DisplayType.Search) + && ldc.ColumnName.endsWith("_ID")) + { + String embeddedSQL = getLookup_TableDirEmbed(language, ldc.ColumnName, TableName); + if (embeddedSQL != null) + displayColumn.append("(").append(embeddedSQL).append(")"); + } + // Table + else if (ldc.DisplayType == DisplayType.Table && ldc.AD_Reference_ID != 0) + { + String embeddedSQL = getLookup_TableEmbed (language, ldc.ColumnName, TableName, ldc.AD_Reference_ID); + if (embeddedSQL != null) + displayColumn.append("(").append(embeddedSQL).append(")"); + } + // number + else if (DisplayType.isNumeric(ldc.DisplayType)) + { + displayColumn.append(DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language())); + } + // String + else + displayColumn.append(TableName).append(".").append(ldc.ColumnName); + } + realSQL.append(displayColumn.toString()); + realSQL.append(",").append(TableName).append(".IsActive"); + + // Translation + if (isTranslated && !Env.isBaseLanguage(language, TableName)) + { + realSQL.append(" FROM ").append(TableName) + .append(" INNER JOIN ").append(TableName).append("_TRL ON (") + .append(TableName).append(".").append(KeyColumn) + .append("=").append(TableName).append("_Trl.").append(KeyColumn) + .append(" AND ").append(TableName).append("_Trl.AD_Language='") + .append(language.getAD_Language()).append("')"); + } + else // no translation + { + realSQL.append(" FROM ").append(TableName); + } + + // Order by Display + realSQL.append(" ORDER BY 3"); + MQuery zoomQuery = null; // corrected in VLookup + + if (CLogMgt.isLevelFinest()) + s_log.fine("ColumnName=" + ColumnName + " - " + realSQL); + MLookupInfo lInfo = new MLookupInfo(realSQL.toString(), TableName, + TableName + "." + KeyColumn, ZoomWindow, ZoomWindowPO, zoomQuery); + return lInfo; + } // getLookup_TableDir + + + /** + * Get embedded SQL for TableDir Lookup (no translation) + * + * @param language report language + * @param ColumnName column name + * @param BaseTable base table + * @return SELECT Column FROM TableName WHERE BaseTable.ColumnName=TableName.ColumnName + */ + static public String getLookup_TableDirEmbed (Language language, String ColumnName, String BaseTable) + { + return getLookup_TableDirEmbed (language, ColumnName, BaseTable, ColumnName); + } // getLookup_TableDirEmbed + + /** + * Get embedded SQL for TableDir Lookup (no translation) + * + * @param language report language + * @param ColumnName column name + * @param BaseTable base table + * @param BaseColumn base column + * @return SELECT Column FROM TableName WHERE BaseTable.BaseColumn=TableName.ColumnName + */ + static public String getLookup_TableDirEmbed (Language language, + String ColumnName, String BaseTable, String BaseColumn) + { + String TableName = ColumnName.substring(0,ColumnName.length()-3); + + // get display column name (first identifier column) + String sql = "SELECT c.ColumnName,c.IsTranslated,c.AD_Reference_ID,c.AD_Reference_Value_ID " + + "FROM AD_Table t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) " + + "WHERE TableName=?" + + " AND c.IsIdentifier='Y' " + + "ORDER BY c.SeqNo"; + // + ArrayList list = new ArrayList(); + // + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, TableName); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + LookupDisplayColumn ldc = new LookupDisplayColumn (rs.getString(1), + "Y".equals(rs.getString(2)), rs.getInt(3), rs.getInt(4)); + list.add (ldc); + // s_log.fine("getLookup_TableDirEmbed: " + ColumnName + " - " + ldc); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + return ""; + } + // Do we have columns ? + if (list.size() == 0) + { + s_log.log(Level.SEVERE, "No Identifier records found: " + ColumnName); + return ""; + } + + // + StringBuffer embedSQL = new StringBuffer("SELECT "); + + int size = list.size(); + for (int i = 0; i < size; i++) + { + if (i > 0) + embedSQL.append("||' - '||" ); + LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i); + + // date, number + if (DisplayType.isDate(ldc.DisplayType) || DisplayType.isNumeric(ldc.DisplayType)) + { + embedSQL.append(DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language())); + } + // TableDir + else if ((ldc.DisplayType == DisplayType.TableDir || ldc.DisplayType == DisplayType.Search) + && ldc.ColumnName.endsWith("_ID")) + { + String embeddedSQL = getLookup_TableDirEmbed(language, ldc.ColumnName, TableName); + embedSQL.append("(").append(embeddedSQL).append(")"); + } + // String + else + embedSQL.append(TableName).append(".").append(ldc.ColumnName); + } + + embedSQL.append(" FROM ").append(TableName); + embedSQL.append(" WHERE ").append(BaseTable).append(".").append(BaseColumn); + embedSQL.append("=").append(TableName).append(".").append(ColumnName); + // + return embedSQL.toString(); + } // getLookup_TableDirEmbed + +} // MLookupFactory + diff --git a/dbPort/src/org/compiere/model/MLookupInfo.java b/dbPort/src/org/compiere/model/MLookupInfo.java new file mode 100644 index 0000000000..e683fc19c4 --- /dev/null +++ b/dbPort/src/org/compiere/model/MLookupInfo.java @@ -0,0 +1,216 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Info Class for Lookup SQL (ValueObject) + * + * @author Jorg Janke + * @version $Id: MLookupInfo.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MLookupInfo implements Serializable, Cloneable +{ + /** + * Constructor. + * (called from MLookupFactory) + * @param sqlQuery SQL query + * @param tableName table name + * @param keyColumn key column + * @param zoomWindow zoom window + * @param zoomWindowPO PO zoom window + * @param zoomQuery zoom query + */ + public MLookupInfo (String sqlQuery, String tableName, String keyColumn, + int zoomWindow, int zoomWindowPO, MQuery zoomQuery) + { + if (sqlQuery == null) + throw new IllegalArgumentException("SqlQuery is null"); + Query = sqlQuery; + if (keyColumn == null) + throw new IllegalArgumentException("KeyColumn is null"); + TableName = tableName; + KeyColumn = keyColumn; + ZoomWindow = zoomWindow; + ZoomWindowPO = zoomWindowPO; + ZoomQuery = zoomQuery; + } // MLookupInfo + + static final long serialVersionUID = -7958664359250070233L; + + /** SQL Query */ + public String Query = null; + /** Table Name */ + public String TableName = ""; + /** Key Column */ + public String KeyColumn = ""; + /** Zoom Window */ + public int ZoomWindow; + /** Zoom Window */ + public int ZoomWindowPO; + /** Zoom Query */ + public MQuery ZoomQuery = null; + + /** Direct Access Query */ + public String QueryDirect = ""; + /** Parent Flag */ + public boolean IsParent = false; + /** Key Flag */ + public boolean IsKey = false; + /** Validation code */ + public String ValidationCode = ""; + /** Validation flag */ + public boolean IsValidated = true; + + /** Context */ + public Properties ctx = null; + /** WindowNo */ + public int WindowNo; + + /** AD_Column_Info or AD_Process_Para */ + public int Column_ID; + /** AD_Reference_ID */ + public int DisplayType; + /** Real AD_Reference_ID */ + public int AD_Reference_Value_ID; + /** CreadedBy?updatedBy */ + public boolean IsCreadedUpdatedBy = false; + + + /** + * String representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer ("MLookupInfo[") + .append(KeyColumn) + .append("-Direct=").append(QueryDirect) + .append("]"); + return sb.toString(); + } // toString + + /** + * Clone + * @return deep copy + */ + public MLookupInfo cloneIt() + { + try + { + MLookupInfo clone = (MLookupInfo)super.clone(); + return clone; + } + catch (Exception e) + { + CLogger.get().log(Level.SEVERE, "", e); + } + return null; + } // clone + + + /************************************************************************** + * Get first AD_Reference_ID of a matching Reference Name. + * Can have SQL LIKE placeholders. + * (This is more a development tool than used for production) + * @param referenceName reference name + * @return AD_Reference_ID + */ + public static int getAD_Reference_ID (String referenceName) + { + int retValue = 0; + String sql = "SELECT AD_Reference_ID,Name,ValidationType,IsActive " + + "FROM AD_Reference WHERE Name LIKE ?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, referenceName); + ResultSet rs = pstmt.executeQuery(); + // + int i = 0; + int id = 0; + String refName = ""; + String validationType = ""; + boolean isActive = false; + while (rs.next()) + { + id = rs.getInt(1); + if (i == 0) + retValue = id; + refName = rs.getString(2); + validationType = rs.getString(3); + isActive = rs.getString(4).equals("Y"); + CLogger.get().config("AD_Reference Name=" + refName + ", ID=" + id + ", Type=" + validationType + ", Active=" + isActive); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + CLogger.get().log(Level.SEVERE, sql, e); + } + return retValue; + } // getAD_Reference_ID + + /** + * Get first AD_Column_ID of matching ColumnName. + * Can have SQL LIKE placeholders. + * (This is more a development tool than used for production) + * @param columnName column name + * @return AD_Column_ID + */ + public static int getAD_Column_ID (String columnName) + { + int retValue = 0; + String sql = "SELECT c.AD_Column_ID,c.ColumnName,t.TableName " + + "FROM AD_Column c, AD_Table t " + + "WHERE c.ColumnName LIKE ? AND c.AD_Table_ID=t.AD_Table_ID"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, columnName); + ResultSet rs = pstmt.executeQuery(); + // + int i = 0; + int id = 0; + String colName = ""; + String tabName = ""; + while (rs.next()) + { + id = rs.getInt(1); + if (i == 0) + retValue = id; + colName = rs.getString(2); + tabName = rs.getString(3); + CLogger.get().config("Name=" + colName + ", ID=" + id + ", Table=" + tabName); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + CLogger.get().log(Level.SEVERE, sql, e); + } + return retValue; + } // getAD_Column_ID + +} // MLookupInfo diff --git a/dbPort/src/org/compiere/model/MMenu.java b/dbPort/src/org/compiere/model/MMenu.java new file mode 100644 index 0000000000..d998d4ff3e --- /dev/null +++ b/dbPort/src/org/compiere/model/MMenu.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Menu Model + * + * @author Jorg Janke + * @version $Id: MMenu.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MMenu extends X_AD_Menu +{ + + /** + * Get menues with where clause + * @param ctx context + * @param whereClause where clause w/o the actual WHERE + * @return MMenu + */ + public static MMenu[] get (Properties ctx, String whereClause) + { + String sql = "SELECT * FROM AD_Menu"; + if (whereClause != null && whereClause.length() > 0) + sql += " WHERE " + whereClause; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MMenu (ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MMenu[] retValue = new MMenu[list.size()]; + list.toArray (retValue); + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MMenu.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Menu_ID id + * @param trxName transaction + */ + public MMenu (Properties ctx, int AD_Menu_ID, String trxName) + { + super (ctx, AD_Menu_ID, trxName); + if (AD_Menu_ID == 0) + { + setEntityType (ENTITYTYPE_UserMaintained); // U + setIsReadOnly (false); // N + setIsSOTrx (false); + setIsSummary (false); + // setName (null); + } + } // MMenu + + /** + * Load Contrusctor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MMenu (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MMenu + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + // Reset info + if (isSummary() && getAction() != null) + setAction(null); + String action = getAction(); + if (action == null) + action = ""; + // Clean up references + if (getAD_Window_ID() != 0 && !action.equals(ACTION_Window)) + setAD_Window_ID(0); + if (getAD_Form_ID() != 0 && !action.equals(ACTION_Form)) + setAD_Form_ID(0); + if (getAD_Workflow_ID() != 0 && !action.equals(ACTION_WorkFlow)) + setAD_Workflow_ID(0); + if (getAD_Workbench_ID() != 0 && !action.equals(ACTION_Workbench)) + setAD_Workbench_ID(0); + if (getAD_Task_ID() != 0 && !action.equals(ACTION_Task)) + setAD_Task_ID(0); + if (getAD_Process_ID() != 0 + && !(action.equals(ACTION_Process) || action.equals(ACTION_Report))) + setAD_Process_ID(0); + return true; + } // beforeSave + + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord) + insert_Tree(MTree_Base.TREETYPE_Menu); + return success; + } // afterSave + + /** + * After Delete + * @param success + * @return deleted + */ + protected boolean afterDelete (boolean success) + { + if (success) + delete_Tree(MTree_Base.TREETYPE_Menu); + return success; + } // afterDelete + +} // MMenu diff --git a/dbPort/src/org/compiere/model/MMessage.java b/dbPort/src/org/compiere/model/MMessage.java new file mode 100644 index 0000000000..67218a628e --- /dev/null +++ b/dbPort/src/org/compiere/model/MMessage.java @@ -0,0 +1,139 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Message Model + * + * @author Jorg Janke + * @version $Id: MMessage.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MMessage extends X_AD_Message +{ + /** + * Get Message (cached) + * @param ctx context + * @param Value message value + * @return message + */ + public static MMessage get (Properties ctx, String Value) + { + if (Value == null || Value.length() == 0) + return null; + MMessage retValue = (MMessage)s_cache.get(Value); + // + if (retValue == null) + { + String sql = "SELECT * FROM AD_Message WHERE Value=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setString(1, Value); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = new MMessage (ctx, rs, null); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (retValue != null) + s_cache.put(Value, retValue); + } + return retValue; + } // get + + /** + * Get Message (cached) + * @param ctx context + * @param AD_Message_ID id + * @return message + */ + public static MMessage get (Properties ctx, int AD_Message_ID) + { + String key = String.valueOf(AD_Message_ID); + MMessage retValue = (MMessage)s_cache.get(key); + if (retValue == null) + { + retValue = new MMessage (ctx, AD_Message_ID, null); + s_cache.put(key, retValue); + } + return retValue; + } // get + + /** + * Get Message ID (cached) + * @param ctx context + * @param Value message value + * @return AD_Message_ID + */ + public static int getAD_Message_ID (Properties ctx, String Value) + { + MMessage msg = get(ctx, Value); + if (msg == null) + return 0; + return msg.getAD_Message_ID(); + } // getAD_Message_ID + + /** Cache */ + static private CCache s_cache = new CCache("AD_Message", 100); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger(MMessage.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Message_ID id + * @param trxName transaction + */ + public MMessage (Properties ctx, int AD_Message_ID, String trxName) + { + super(ctx, AD_Message_ID, trxName); + } // MMessage + + /** + * Load Cosntructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MMessage(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MMessage + +} // MMessage diff --git a/dbPort/src/org/compiere/model/MNote.java b/dbPort/src/org/compiere/model/MNote.java new file mode 100644 index 0000000000..17f3261647 --- /dev/null +++ b/dbPort/src/org/compiere/model/MNote.java @@ -0,0 +1,201 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * Note Model + * + * @author Jorg Janke + * @version $Id: MNote.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MNote extends X_AD_Note +{ + /** + * Standard Constructor + * @param ctx context + * @param AD_Note_ID id + * @param trxName transaction + */ + public MNote (Properties ctx, int AD_Note_ID, String trxName) + { + super (ctx, AD_Note_ID, trxName); + if (AD_Note_ID == 0) + { + setProcessed (false); + setProcessing(false); + } + } // MNote + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MNote(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MNote + + /** + * New Mandatory Constructor + * @param ctx context + * @param AD_Message_ID message + * @param AD_User_ID targeted user + * @param trxName transaction + */ + public MNote (Properties ctx, int AD_Message_ID, int AD_User_ID, String trxName) + { + this (ctx, 0, trxName); + setAD_Message_ID (AD_Message_ID); + setAD_User_ID(AD_User_ID); + } // MNote + + /** + * New Mandatory Constructor + * @param ctx context + * @param AD_MessageValue message + * @param AD_User_ID targeted user + * @param trxName transaction + */ + public MNote (Properties ctx, String AD_MessageValue, int AD_User_ID, String trxName) + { + this (ctx, MMessage.getAD_Message_ID(ctx, AD_MessageValue), AD_User_ID, trxName); + } // MNote + + /** + * Create Note + * @param ctx context + * @param AD_Message_ID message + * @param AD_User_ID user + * @param AD_Table_ID table + * @param Record_ID record + * @param TextMsg text message + * @param Reference reference + * @param trxName transaction + */ + public MNote (Properties ctx, int AD_Message_ID, int AD_User_ID, + int AD_Table_ID, int Record_ID, String Reference, String TextMsg, String trxName) + { + this (ctx, AD_Message_ID, AD_User_ID, trxName); + setRecord(AD_Table_ID, Record_ID); + setReference(Reference); + setTextMsg(TextMsg); + } // MNote + + /** + * New Constructor + * @param ctx context + * @param AD_MessageValue message + * @param AD_User_ID targeted user + * @param AD_Client_ID client + * @param AD_Org_ID org + * @param trxName transaction + */ + public MNote (Properties ctx, String AD_MessageValue, int AD_User_ID, + int AD_Client_ID, int AD_Org_ID, String trxName) + { + this (ctx, MMessage.getAD_Message_ID(ctx, AD_MessageValue), AD_User_ID, trxName); + setClientOrg(AD_Client_ID, AD_Org_ID); + } // MNote + + + /************************************************************************** + * Set Record. + * (Ss Button and defaults to String) + * @param AD_Message AD_Message + */ + public void setAD_Message_ID (String AD_Message) + { + int AD_Message_ID = DB.getSQLValue(null, + "SELECT AD_Message_ID FROM AD_Message WHERE Value=?", AD_Message); + if (AD_Message_ID != -1) + super.setAD_Message_ID(AD_Message_ID); + else + { + super.setAD_Message_ID(240); // Error + log.log(Level.SEVERE, "setAD_Message_ID - ID not found for '" + AD_Message + "'"); + } + } // setRecord_ID + + /** + * Set AD_Message_ID. + * Looks up No Message Found if 0 + * @param AD_Message_ID id + */ + public void setAD_Message_ID (int AD_Message_ID) + { + if (AD_Message_ID == 0) + super.setAD_Message_ID(MMessage.getAD_Message_ID(getCtx(), "NoMessageFound")); + else + super.setAD_Message_ID(AD_Message_ID); + } // setAD_Message_ID + + /** + * Get Message + * @return message + */ + public String getMessage() + { + int AD_Message_ID = getAD_Message_ID(); + MMessage msg = MMessage.get(getCtx(), AD_Message_ID); + return msg.getMsgText(); + } // getMessage + + /** + * Set Client Org + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + public void setClientOrg(int AD_Client_ID, int AD_Org_ID) + { + super.setClientOrg(AD_Client_ID, AD_Org_ID); + } // setClientOrg + + /** + * Set Record + * @param AD_Table_ID table + * @param Record_ID record + */ + public void setRecord (int AD_Table_ID, int Record_ID) + { + setAD_Table_ID(AD_Table_ID); + setRecord_ID(Record_ID); + } // setRecord + + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer ("MNote[") + .append(get_ID()).append(",AD_Message_ID=").append(getAD_Message_ID()) + .append(",").append(getReference()) + .append(",Processed=").append(isProcessed()) + .append("]"); + return sb.toString(); + } // toString + +} // MNote diff --git a/dbPort/src/org/compiere/model/MOrg.java b/dbPort/src/org/compiere/model/MOrg.java new file mode 100644 index 0000000000..a4fd6ca246 --- /dev/null +++ b/dbPort/src/org/compiere/model/MOrg.java @@ -0,0 +1,219 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Organization Model + * + * @author Jorg Janke + * @version $Id: MOrg.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MOrg extends X_AD_Org +{ + /** + * Get Organizations Of Client + * @param po persistent object + * @return array of orgs + */ + public static MOrg[] getOfClient (PO po) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_Org WHERE AD_Client_ID=? ORDER BY Value"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, po.getAD_Client_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MOrg (po.getCtx(), rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + MOrg[] retValue = new MOrg[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfClient + + /** + * Get Org from Cache + * @param ctx context + * @param AD_Org_ID id + * @return MOrg + */ + public static MOrg get (Properties ctx, int AD_Org_ID) + { + Integer key = new Integer (AD_Org_ID); + MOrg retValue = (MOrg) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MOrg (ctx, AD_Org_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MOrg.class); + /** Cache */ + private static CCache s_cache = new CCache("AD_Org", 20); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Org_ID id + * @param trxName transaction + */ + public MOrg (Properties ctx, int AD_Org_ID, String trxName) + { + super(ctx, AD_Org_ID, trxName); + if (AD_Org_ID == 0) + { + // setValue (null); + // setName (null); + setIsSummary (false); + } + } // MOrg + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MOrg (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MOrg + + /** + * Parent Constructor + * @param client client + * @param name name + */ + public MOrg (MClient client, String name) + { + this (client.getCtx(), 0, client.get_TrxName()); + setAD_Client_ID (client.getAD_Client_ID()); + setValue (name); + setName (name); + } // MOrg + + /** Org Info */ + private MOrgInfo m_info = null; + /** Linked Business Partner */ + private Integer m_linkedBPartner = null; + + /** + * Get Org Info + * @return Org Info + */ + public MOrgInfo getInfo() + { + if (m_info == null) + m_info = MOrgInfo.get (getCtx(), getAD_Org_ID()); + return m_info; + } // getMOrgInfo + + + + /** + * After Save + * @param newRecord new Record + * @param success save success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (!success) + return success; + if (newRecord) + { + // Info + m_info = new MOrgInfo (this); + m_info.save(); + // Access + MRoleOrgAccess.createForOrg (this); + MRole.getDefault(getCtx(), true); // reload + // TreeNode + insert_Tree(MTree_Base.TREETYPE_Organization); + } + // Value/Name change + if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) + { + MAccount.updateValueDescription(getCtx(), "AD_Org_ID=" + getAD_Org_ID(), get_TrxName()); + if ("Y".equals(Env.getContext(getCtx(), "$Element_OT"))) + MAccount.updateValueDescription(getCtx(), "AD_OrgTrx_ID=" + getAD_Org_ID(), get_TrxName()); + } + + return true; + } // afterSave + + /** + * After Delete + * @param success + * @return deleted + */ + protected boolean afterDelete (boolean success) + { + if (success) + delete_Tree(MTree_Base.TREETYPE_Organization); + return success; + } // afterDelete + + + /** + * Get Linked BPartner + * @return C_BPartner_ID + */ + public int getLinkedC_BPartner_ID() + { + if (m_linkedBPartner == null) + { + int C_BPartner_ID = DB.getSQLValue(null, + "SELECT C_BPartner_ID FROM C_BPartner WHERE AD_OrgBP_ID=?", + getAD_Org_ID()); + if (C_BPartner_ID < 0) // not found = -1 + C_BPartner_ID = 0; + m_linkedBPartner = new Integer (C_BPartner_ID); + } + return m_linkedBPartner.intValue(); + } // getLinkedC_BPartner_ID + +} // MOrg diff --git a/dbPort/src/org/compiere/model/MOrgInfo.java b/dbPort/src/org/compiere/model/MOrgInfo.java new file mode 100644 index 0000000000..89eb2e3bed --- /dev/null +++ b/dbPort/src/org/compiere/model/MOrgInfo.java @@ -0,0 +1,99 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Organization Info Model + * + * @author Jorg Janke + * @version $Id: MOrgInfo.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MOrgInfo extends X_AD_OrgInfo +{ + /** + * Load Constructor + * @param ctx context + * @param AD_Org_ID id + * @return Org Info + */ + public static MOrgInfo get (Properties ctx, int AD_Org_ID) + { + MOrgInfo retValue = null; + String sql = "SELECT * FROM AD_OrgInfo WHERE AD_Org_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Org_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = new MOrgInfo (ctx, rs, null); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MOrgInfo.class); + + + /************************************************************************** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MOrgInfo (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MOrgInfo + + /** + * Organization constructor + * @param org org + */ + public MOrgInfo (MOrg org) + { + super(org.getCtx(), 0, org.get_TrxName()); + setClientOrg(org); + setDUNS ("?"); + setTaxID ("?"); + } // MOrgInfo + +} // MOrgInfo diff --git a/dbPort/src/org/compiere/model/MPAttributeLookup.java b/dbPort/src/org/compiere/model/MPAttributeLookup.java new file mode 100644 index 0000000000..aab50d4847 --- /dev/null +++ b/dbPort/src/org/compiere/model/MPAttributeLookup.java @@ -0,0 +1,180 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Product Attribute Lookup Model (not Cached) + * + * @author Jorg Janke + * @version $Id: MPAttributeLookup.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ + */ +public class MPAttributeLookup extends Lookup + implements Serializable +{ + + /** + * Constructor + * @param ctx context + * @param WindowNo window no + */ + public MPAttributeLookup(Properties ctx, int WindowNo) + { + super(DisplayType.TableDir, WindowNo); + m_ctx = ctx; + } // MPAttribute + + /** Properties */ + private Properties m_ctx; + /** Statement */ + private PreparedStatement m_pstmt = null; + /** No Instance Value */ + private static KeyNamePair NO_INSTANCE = new KeyNamePair (0,""); + + /** + * Get Display for Value (not cached) + * @param value Location_ID + * @return String Value + */ + public String getDisplay (Object value) + { + if (value == null) + return ""; + NamePair pp = get (value); + if (pp == null) + return "<" + value.toString() + ">"; + return pp.getName(); + } // getDisplay + + /** + * The Lookup contains the key (not cached) + * @param key Location_ID + * @return true if key known + */ + public boolean containsKey (Object key) + { + return get(key) != null; + } // containsKey + + /** + * Get Object of Key Value + * @param value value + * @return Object or null + */ + public NamePair get (Object value) + { + if (value == null) + return null; + int M_AttributeSetInstance_ID = 0; + if (value instanceof Integer) + M_AttributeSetInstance_ID = ((Integer)value).intValue(); + else + { + try + { + M_AttributeSetInstance_ID = Integer.parseInt(value.toString()); + } + catch (Exception e) + { + log.log(Level.SEVERE, "Value=" + value, e); + } + } + if (M_AttributeSetInstance_ID == 0) + return NO_INSTANCE; + // + // Statement + if (m_pstmt == null) + m_pstmt = DB.prepareStatement("SELECT Description " + + "FROM M_AttributeSetInstance " + + "WHERE M_AttributeSetInstance_ID=?", null); + // + String Description = null; + try + { + m_pstmt.setInt(1, M_AttributeSetInstance_ID); + ResultSet rs = m_pstmt.executeQuery(); + if (rs.next()) + { + Description = rs.getString(1); // Description + if (Description == null || Description.length() == 0) + { + if (CLogMgt.isLevelFine()) + Description = "{" + M_AttributeSetInstance_ID + "}"; + else + Description = ""; + } + } + rs.close(); + } + catch (Exception e) + { + log.log(Level.SEVERE, "get", e); + } + if (Description == null) + return null; + return new KeyNamePair (M_AttributeSetInstance_ID, Description); + } // get + + /** + * Dispose + * @see org.compiere.model.Lookup#dispose() + */ + public void dispose() + { + try + { + if (m_pstmt != null) + m_pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, "dispose", e); + } + log.fine(""); + super.dispose(); + } // dispose + + /** + * Return data as sorted Array - not implemented + * @param mandatory mandatory + * @param onlyValidated only validated + * @param onlyActive only active + * @param temporary force load for temporary display + * @return null + */ + public ArrayList getData (boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary) + { + log.log(Level.SEVERE, "Not implemented"); + return null; + } // getArray + + /** + * Get underlying fully qualified Table.Column Name. + * Used for VLookup.actionButton (Zoom) + * @return column name + */ + public String getColumnName() + { + return "M_AttributeSetInstance_ID"; + } // getColumnName + +} // MPAttribute diff --git a/dbPort/src/org/compiere/model/MPInstance.java b/dbPort/src/org/compiere/model/MPInstance.java new file mode 100644 index 0000000000..c629b0c8df --- /dev/null +++ b/dbPort/src/org/compiere/model/MPInstance.java @@ -0,0 +1,326 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Process Instance Model + * + * @author Jorg Janke + * @version $Id: MPInstance.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $ + */ +public class MPInstance extends X_AD_PInstance +{ + /** + * Standard Constructor + * @param ctx context + * @param AD_PInstance_ID instance or 0 + * @param ignored no transaction support + */ + public MPInstance (Properties ctx, int AD_PInstance_ID, String ignored) + { + super (ctx, AD_PInstance_ID, null); + // New Process + if (AD_PInstance_ID == 0) + { + // setAD_Process_ID (0); // parent + // setRecord_ID (0); + setIsProcessing (false); + } + } // MPInstance + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param ignored no transaction support + */ + public MPInstance (Properties ctx, ResultSet rs, String ignored) + { + super(ctx, rs, null); + } // MPInstance + + /** + * Create Process Instance from Process and create parameters + * @param process process + * @param Record_ID Record + */ + public MPInstance (MProcess process, int Record_ID) + { + this (process.getCtx(), 0, null); + setAD_Process_ID (process.getAD_Process_ID()); + setRecord_ID (Record_ID); + setAD_User_ID(Env.getAD_User_ID(process.getCtx())); + if (!save()) // need to save for parameters + throw new IllegalArgumentException ("Cannot Save"); + // Set Parameter Base Info + MProcessPara[] para = process.getParameters(); + for (int i = 0; i < para.length; i++) + { + MPInstancePara pip = new MPInstancePara (this, para[i].getSeqNo()); + pip.setParameterName(para[i].getColumnName()); + pip.setInfo(para[i].getName()); + pip.save(); + } + } // MPInstance + + /** + * New Constructor + * @param ctx context + * @param AD_Process_ID Process ID + * @param Record_ID record + */ + public MPInstance (Properties ctx, int AD_Process_ID, int Record_ID) + { + this(ctx, 0, null); + setAD_Process_ID (AD_Process_ID); + setRecord_ID (Record_ID); + setAD_User_ID(Env.getAD_User_ID(ctx)); + setIsProcessing (false); + } // MPInstance + + + /** Parameters */ + private MPInstancePara[] m_parameters = null; + + /** + * Get Parameters + * @return parameter array + */ + public MPInstancePara[] getParameters() + { + if (m_parameters != null) + return m_parameters; + ArrayList list = new ArrayList(); + // + String sql = "SELECT * FROM AD_PInstance_Para WHERE AD_PInstance_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + list.add(new MPInstancePara(getCtx(), rs, null)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + // + m_parameters = new MPInstancePara[list.size()]; + list.toArray(m_parameters); + return m_parameters; + } // getParameters + + + /** Log Entries */ + private ArrayList m_log = new ArrayList(); + + /** + * Get Logs + * @return array of logs + */ + public MPInstanceLog[] getLog() + { + // load it from DB + m_log.clear(); + String sql = "SELECT * FROM AD_PInstance_Log WHERE AD_PInstance_ID=? ORDER BY Log_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + m_log.add(new MPInstanceLog(rs)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + + MPInstanceLog[] retValue = new MPInstanceLog[m_log.size()]; + m_log.toArray(retValue); + return retValue; + } // getLog + + /** + * @param P_Date date + * @param P_ID id + * @param P_Number number + * @param P_Msg msg + */ + public void addLog (Timestamp P_Date, int P_ID, BigDecimal P_Number, String P_Msg) + { + MPInstanceLog logEntry = new MPInstanceLog (getAD_PInstance_ID(), m_log.size()+1, + P_Date, P_ID, P_Number, P_Msg); + m_log.add(logEntry); + // save it to DB ? + // log.save(); + } // addLog + + + /** + * Set AD_Process_ID. + * Check Role if process can be performed + * @param AD_Process_ID process + */ + public void setAD_Process_ID (int AD_Process_ID) + { + int AD_Role_ID = Env.getAD_Role_ID(getCtx()); + if (AD_Role_ID != 0) + { + MRole role = MRole.get(getCtx(), AD_Role_ID); + Boolean access = role.getProcessAccess(AD_Process_ID); + if (access == null || !access.booleanValue()) + throw new IllegalAccessError("Cannot access Process with role: " + role.getName()); + } + super.setAD_Process_ID (AD_Process_ID); + } // setAD_Process_ID + + /** + * Set Record ID. + * direct internal record ID + * @param Record_ID record + **/ + public void setRecord_ID (int Record_ID) + { + if (Record_ID < 0) + { + log.info("Set to 0 from " + Record_ID); + Record_ID = 0; + } + set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); + } // setRecord_ID + + /** + * String Representation + * @see java.lang.Object#toString() + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MPInstance[") + .append (get_ID()) + .append(",OK=").append(isOK()); + String msg = getErrorMsg(); + if (msg != null && msg.length() > 0) + sb.append(msg); + sb.append ("]"); + return sb.toString (); + } // toString + + /** + * Dump Log + */ + public void log() + { + log.info(toString()); + MPInstanceLog[] pil = getLog(); + for (int i = 0; i < pil.length; i++) + log.info(i + "=" + pil[i]); + } // log + + /** Result OK = 1 */ + public static final int RESULT_OK = 1; + /** Result FALSE = 0 */ + public static final int RESULT_ERROR = 0; + + /** + * Is it OK + * @return Result == OK + */ + public boolean isOK() + { + return getResult() == RESULT_OK; + } // isOK + + /** + * Set Result + * @param ok + */ + public void setResult (boolean ok) + { + super.setResult (ok ? RESULT_OK : RESULT_ERROR); + } // setResult + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + // Update Statistics + if (!newRecord + && !isProcessing() + && is_ValueChanged("IsProcessing")) + { + long ms = System.currentTimeMillis() - getCreated().getTime(); + int seconds = (int)(ms / 1000); + if (seconds < 1) + seconds = 1; + MProcess prc = MProcess.get(getCtx(), getAD_Process_ID()); + prc.addStatistics(seconds); + if (prc.get_ID() != 0 && prc.save()) + log.fine("afterSave - Process Statistics updated Sec=" + seconds); + else + log.warning("afterSave - Process Statistics not updated"); + } + return success; + } // afterSave + +} // MPInstance diff --git a/dbPort/src/org/compiere/model/MPInstanceLog.java b/dbPort/src/org/compiere/model/MPInstanceLog.java new file mode 100644 index 0000000000..d00407a779 --- /dev/null +++ b/dbPort/src/org/compiere/model/MPInstanceLog.java @@ -0,0 +1,254 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.math.*; + +import org.compiere.util.DB; + +/** + * Process Instance Log Model. + * (not standard table) + * + * @author Jorg Janke + * @version $Id: MPInstanceLog.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MPInstanceLog +{ + /** + * Full Constructor + * @param AD_PInstance_ID instance + * @param Log_ID log sequence + * @param P_Date date + * @param P_ID id + * @param P_Number number + * @param P_Msg msg + */ + public MPInstanceLog (int AD_PInstance_ID, int Log_ID, Timestamp P_Date, + int P_ID, BigDecimal P_Number, String P_Msg) + { + setAD_PInstance_ID(AD_PInstance_ID); + setLog_ID(Log_ID); + setP_Date(P_Date); + setP_ID(P_ID); + setP_Number(P_Number); + setP_Msg(P_Msg); + } // MPInstance_Log + + /** + * Load Constructor + * @param rs Result Set + * @throws SQLException + */ + public MPInstanceLog (ResultSet rs) throws SQLException + { + setAD_PInstance_ID(rs.getInt("AD_PInstance_ID")); + setLog_ID(rs.getInt("Log_ID")); + setP_Date(rs.getTimestamp("P_Date")); + setP_ID(rs.getInt("P_ID")); + setP_Number(rs.getBigDecimal("P_Number")); + setP_Msg(rs.getString("P_Msg")); + } // MPInstance_Log + + + private int m_AD_PInstance_ID; + private int m_Log_ID; + private Timestamp m_P_Date; + private int m_P_ID; + private BigDecimal m_P_Number; + private String m_P_Msg; + + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer("PPInstance_Log["); + sb.append(m_Log_ID); + if (m_P_Date != null) + sb.append(",Date=").append(m_P_Date); + if (m_P_ID != 0) + sb.append(",ID=").append(m_P_ID); + if (m_P_Number != null) + sb.append(",Number=").append(m_P_Number); + if (m_P_Msg != null) + sb.append(",").append(m_P_Msg); + sb.append("]"); + return sb.toString(); + } // toString + + + /** + * Save to Database + * @return true if saved + */ + public boolean save () + { + StringBuffer sql = new StringBuffer("INSERT INTO AD_PInstance_Log " + + "(AD_PInstance_ID, Log_ID, P_Date, P_ID, P_Number, P_Msg)" + + " VALUES ("); + sql.append(m_AD_PInstance_ID).append(",") + .append(m_Log_ID).append(","); + if (m_P_Date == null) + { + sql.append("NULL,"); + } + else + { + sql.append(DB.TO_DATE(m_P_Date, false)).append(","); + } + if (m_P_ID == 0) + { + sql.append("NULL,"); + } + else + { + sql.append(m_P_ID).append(","); + } + if (m_P_Number == null) + { + sql.append("NULL,"); + } + else + { + sql.append(m_P_Number).append(","); + } + if (m_P_Msg == null) + { + sql.append("NULL)"); + } + else + { + sql.append(DB.TO_STRING(m_P_Msg, 2000)).append(")"); + // + } + int no = DB.executeUpdate(sql.toString(), null); // outside of trx + return no == 1; + } // save + + /** + * Get AD_PInstance_ID + * @return Instance id + */ + public int getAD_PInstance_ID () + { + return m_AD_PInstance_ID; + } + + /** + * Set AD_PInstance_ID + * @param AD_PInstance_ID instance id + */ + public void setAD_PInstance_ID (int AD_PInstance_ID) + { + m_AD_PInstance_ID = AD_PInstance_ID; + } + + /** + * Get Log_ID + * @return log id + */ + public int getLog_ID () + { + return m_Log_ID; + } + + /** + * Set Log_ID + * @param Log_ID log id + */ + public void setLog_ID (int Log_ID) + { + m_Log_ID = Log_ID; + } + + /** + * Get P_Date + * @return date + */ + public Timestamp getP_Date () + { + return m_P_Date; + } + + /** + * Set P_Date + * @param P_Date date + */ + public void setP_Date (Timestamp P_Date) + { + m_P_Date = P_Date; + } + + /** + * Get P_ID + * @return id + */ + public int getP_ID () + { + return m_P_ID; + } + + /** + * Set P_ID + * @param P_ID id + */ + public void setP_ID (int P_ID) + { + m_P_ID = P_ID; + } + + /** + * Get P_Number + * @return number + */ + public BigDecimal getP_Number () + { + return m_P_Number; + } + + /** + * Set P_Number + * @param P_Number number + */ + public void setP_Number (BigDecimal P_Number) + { + m_P_Number = P_Number; + } + + /** + * Get P_Msg + * @return Mag + */ + public String getP_Msg () + { + return m_P_Msg; + } + + /** + * Set P_Msg + * @param P_Msg + */ + public void setP_Msg (String P_Msg) + { + m_P_Msg = P_Msg; + } + +} // MPInstance_Log diff --git a/dbPort/src/org/compiere/model/MPInstancePara.java b/dbPort/src/org/compiere/model/MPInstancePara.java new file mode 100644 index 0000000000..578b2a6ec6 --- /dev/null +++ b/dbPort/src/org/compiere/model/MPInstancePara.java @@ -0,0 +1,191 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.*; +import java.sql.*; +import java.util.*; + +/** + * Process Instance Parameter Model + * + * @author Jorg Janke + * @version $Id: MPInstancePara.java,v 1.3 2006/07/30 00:58:05 jjanke Exp $ + */ +public class MPInstancePara extends X_AD_PInstance_Para +{ + + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MPInstancePara (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MPInstance_Para + + /** + * Parent Constructor + * @param ctx + * @param AD_PInstance_ID id + * @param SeqNo sequence + */ + public MPInstancePara (Properties ctx, int AD_PInstance_ID, int SeqNo) + { + super(ctx, 0, null); + setAD_PInstance_ID (AD_PInstance_ID); + setSeqNo (SeqNo); + } // MPInstance_Para + + /** + * Parent Constructor + * @param instance instance + * @param SeqNo sequence + */ + public MPInstancePara (MPInstance instance, int SeqNo) + { + super (instance.getCtx(), 0, instance.get_TrxName()); + setAD_PInstance_ID (instance.getAD_PInstance_ID()); + setSeqNo (SeqNo); + } // MPInstance_Para + + + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MPInstancePara (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MPInstance_Para + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MPInstancePara[") + .append (get_ID ()).append("-").append(getParameterName()); + if (getP_String() != null) + { + sb.append("(s)=").append(getP_String()); + if (getP_String_To() != null) + sb.append(" - ").append(getP_String_To()); + } + BigDecimal bd = (BigDecimal)get_Value("P_Number"); + if (bd != null) + { + sb.append("(n)=").append(bd); + BigDecimal bd2 = (BigDecimal)get_Value("P_Number_To"); + if (bd2 != null) + sb.append(" - ").append(bd2); + } + if (getP_Date() != null) + { + sb.append("(d)=").append(getP_Date()); + if (getP_Date_To() != null) + sb.append(" - ").append(getP_Date_To()); + } + sb.append ("]"); + return sb.toString (); + } // toString + + /** + * Set P_Number + * @param P_Number no + */ + public void setP_Number (int P_Number) + { + setP_Number (new BigDecimal(P_Number)); + } // setP_Number + + /** + * Set P_Number + * @param P_Number no + */ + public void setP_Number (Integer P_Number) + { + if (P_Number == null) + setP_Number(0); + else + setP_Number (((Integer)P_Number).intValue()); + } // setP_Number + + /** + * Set P_Number To + * @param P_Number_To no to + */ + public void setP_Number_To (int P_Number_To) + { + setP_Number_To (new BigDecimal(P_Number_To)); + } // setP_Number_To + + /** + * Set P_Number To + * @param P_Number_To no to + */ + public void setP_Number_To (Integer P_Number_To) + { + if (P_Number_To == null) + setP_Number_To(0); + else + setP_Number_To (((Integer)P_Number_To).intValue()); + } // setP_Number_To + + + /** + * Set String Parameter + * @param parameterName name + * @param stringParameter value + */ + public void setParameter (String parameterName, String stringParameter) + { + setParameterName(parameterName); + setP_String(stringParameter); + } // setParameter + + /** + * Set Number Parameter + * @param parameterName name + * @param bdParameter value + */ + public void setParameter (String parameterName, BigDecimal bdParameter) + { + setParameterName(parameterName); + setP_Number(bdParameter); + } // setParameter + + /** + * Set Number Parameter + * @param parameterName name + * @param iParameter value + */ + public void setParameter (String parameterName, int iParameter) + { + setParameterName(parameterName); + setP_Number(new BigDecimal(iParameter)); + } // setParameter + +} // MPInstance_Para diff --git a/dbPort/src/org/compiere/model/MPrivateAccess.java b/dbPort/src/org/compiere/model/MPrivateAccess.java new file mode 100644 index 0000000000..d8094420b9 --- /dev/null +++ b/dbPort/src/org/compiere/model/MPrivateAccess.java @@ -0,0 +1,173 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Private Access + * + * @author Jorg Janke + * @version $Id: MPrivateAccess.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MPrivateAccess extends X_AD_Private_Access +{ + /** + * Load Pricate Access + * @param ctx context + * @param AD_User_ID user + * @param AD_Table_ID table + * @param Record_ID record + * @return access or null if not found + */ + public static MPrivateAccess get (Properties ctx, int AD_User_ID, int AD_Table_ID, int Record_ID) + { + MPrivateAccess retValue = null; + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Private_Access WHERE AD_User_ID=? AND AD_Table_ID=? AND Record_ID=?"; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_User_ID); + pstmt.setInt(2, AD_Table_ID); + pstmt.setInt(3, Record_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = new MPrivateAccess (ctx, rs, null); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "MPrivateAccess", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** + * Get Where Clause of Locked Records for Table + * @param AD_Table_ID table + * @param AD_User_ID user requesting info + * @return "<>1" or " NOT IN (1,2)" or null + */ + public static String getLockedRecordWhere (int AD_Table_ID, int AD_User_ID) + { + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + String sql = "SELECT Record_ID FROM AD_Private_Access WHERE AD_Table_ID=? AND AD_User_ID<>? AND IsActive='Y'"; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Table_ID); + pstmt.setInt(2, AD_User_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new Integer(rs.getInt(1))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + if (list.size() == 0) + return null; + if (list.size() == 1) + return "<>" + list.get(0); + // + StringBuffer sb = new StringBuffer(" NOT IN("); + for (int i = 0; i < list.size(); i++) + { + if (i > 0) + sb.append(","); + sb.append(list.get(i)); + } + sb.append(")"); + return sb.toString(); + } // get + + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger(MPrivateAccess.class); + + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MPrivateAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MPrivateAccess + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MPrivateAccess(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MPrivateAccess + + /** + * New Constructor + * @param ctx context + * @param AD_User_ID user + * @param AD_Table_ID table + * @param Record_ID record + */ + public MPrivateAccess (Properties ctx, int AD_User_ID, int AD_Table_ID, int Record_ID) + { + super(ctx, 0, null); + setAD_User_ID (AD_User_ID); + setAD_Table_ID (AD_Table_ID); + setRecord_ID (Record_ID); + } // MPrivateAccess + +} // MPrivateAccess diff --git a/dbPort/src/org/compiere/model/MProcess.java b/dbPort/src/org/compiere/model/MProcess.java new file mode 100644 index 0000000000..19aabce283 --- /dev/null +++ b/dbPort/src/org/compiere/model/MProcess.java @@ -0,0 +1,431 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.process.*; +import org.compiere.util.*; + +/** + * Process Model + * + * @author Jorg Janke + * @version $Id: MProcess.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MProcess extends X_AD_Process +{ + /** + * Get MProcess from Cache + * @param ctx context + * @param AD_Process_ID id + * @return MProcess + */ + public static MProcess get (Properties ctx, int AD_Process_ID) + { + Integer key = new Integer (AD_Process_ID); + MProcess retValue = (MProcess) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MProcess (ctx, AD_Process_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** + * Get MProcess from Menu + * @param ctx context + * @param AD_Menu_ID id + * @return MProcess or null + */ + public static MProcess getFromMenu (Properties ctx, int AD_Menu_ID) + { + MProcess retValue = null; + String sql = "SELECT * FROM AD_Process p " + + "WHERE EXISTS (SELECT * FROM AD_Menu m " + + "WHERE m.AD_Process_ID=p.AD_Process_ID AND m.AD_Menu_ID=?)"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Menu_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next()) + { + retValue = new MProcess (ctx, rs, null); + // Save in cache + Integer key = new Integer (retValue.getAD_Process_ID()); + s_cache.put (key, retValue); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + return retValue; + } // getFromMenu + + + /** Cache */ + private static CCache s_cache = new CCache("AD_Process", 20); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MProcess.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Process_ID process + * @param ignored no transaction + */ + public MProcess (Properties ctx, int AD_Process_ID, String ignored) + { + super (ctx, AD_Process_ID, null); + if (AD_Process_ID == 0) + { + // setValue (null); + // setName (null); + setIsReport (false); + setIsServerProcess(false); + setAccessLevel (ACCESSLEVEL_All); + setEntityType (ENTITYTYPE_UserMaintained); + setIsBetaFunctionality(false); + } + } // MProcess + + /** + * Load Contsructor + * @param ctx context + * @param rs result set + * @param ignored no transaction + */ + public MProcess (Properties ctx, ResultSet rs, String ignored) + { + super(ctx, rs, null); + } // MProcess + + + /** Parameters */ + private MProcessPara[] m_parameters = null; + + /** + * Get Parameters + * @return parameters + */ + public MProcessPara[] getParameters() + { + if (m_parameters != null) + return m_parameters; + ArrayList list = new ArrayList(); + // + String sql = "SELECT * FROM AD_Process_Para WHERE AD_Process_ID=? ORDER BY SeqNo"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_Process_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MProcessPara(getCtx(), rs, null)); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + // + m_parameters = new MProcessPara[list.size()]; + list.toArray(m_parameters); + return m_parameters; + } // getParameters + + /** + * Get Parameter with ColumnName + * @param name column name + * @return parameter or null + */ + public MProcessPara getParameter(String name) + { + getParameters(); + for (int i = 0; i < m_parameters.length; i++) + { + if (m_parameters[i].getColumnName().equals(name)) + return m_parameters[i]; + } + return null; + } // getParameter + + + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MProcess[") + .append (get_ID()) + .append("-").append(getName()) + .append ("]"); + return sb.toString (); + } // toString + + + /************************************************************************** + * Process w/o parameter + * @param Record_ID record + * @param trx transaction + * @return Process Instance + */ + public MPInstance processIt (int Record_ID, Trx trx) + { + MPInstance pInstance = new MPInstance (this, Record_ID); + // Lock + pInstance.setIsProcessing(true); + pInstance.save(); + + boolean ok = true; + + // PL/SQL Procedure + String ProcedureName = getProcedureName(); + if (ProcedureName != null && ProcedureName.length() > 0) + ok = startProcess (ProcedureName, pInstance); + + // Unlock + pInstance.setResult(ok ? MPInstance.RESULT_OK : MPInstance.RESULT_ERROR); + pInstance.setIsProcessing(false); + pInstance.save(); + // + pInstance.log(); + return pInstance; + } // process + + /** + * Process It (sync) + * @param pi Process Info + * @param trx transaction + * @return true if OK + */ + public boolean processIt (ProcessInfo pi, Trx trx) + { + if (pi.getAD_PInstance_ID() == 0) + { + MPInstance pInstance = new MPInstance (this, pi.getRecord_ID()); + // Lock + pInstance.setIsProcessing(true); + pInstance.save(); + } + + boolean ok = false; + + // Java Class + String Classname = getClassname(); + if (Classname != null && Classname.length() > 0) + ok = startClass(Classname, pi, trx); + else + { + String msg = "No Classname for " + getName(); + pi.setSummary(msg, ok); + log.warning(msg); + } + + return ok; + } // process + + /** + * Is this a Java Process + * @return true if java process + */ + public boolean isJavaProcess() + { + String Classname = getClassname(); + return (Classname != null && Classname.length() > 0); + } // is JavaProcess + + /** + * Start Database Process + * @param ProcedureName PL/SQL procedure name + * @param pInstance process instance + * see ProcessCtl.startProcess + * @return true if success + */ + private boolean startProcess (String ProcedureName, MPInstance pInstance) + { + int AD_PInstance_ID = pInstance.getAD_PInstance_ID(); + // execute on this thread/connection + log.info(ProcedureName + "(" + AD_PInstance_ID + ")"); + String sql = "{call " + ProcedureName + "(?)}"; + try + { + CallableStatement cstmt = DB.prepareCall(sql); // ro?? + cstmt.setInt(1, AD_PInstance_ID); + cstmt.executeUpdate(); + cstmt.close(); + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + pInstance.setResult(MPInstance.RESULT_ERROR); + pInstance.setErrorMsg(e.getLocalizedMessage()); + return false; + } + pInstance.setResult(MPInstance.RESULT_OK); + return true; + } // startProcess + + + /** + * Start Java Class (sync). + * instanciate the class implementing the interface ProcessCall. + * The class can be a Server/Client class (when in Package + * org adempiere.process or org.compiere.model) or a client only class + * (e.g. in org.compiere.report) + * + * @param Classname name of the class to call + * @param pi process info + * @param trx transaction + * @return true if success + * see ProcessCtl.startClass + */ + private boolean startClass (String Classname, ProcessInfo pi, Trx trx) + { + log.info(Classname + "(" + pi + ")"); + boolean retValue = false; + ProcessCall myObject = null; + try + { + Class myClass = Class.forName(Classname); + myObject = (ProcessCall)myClass.newInstance(); + if (myObject == null) + retValue = false; + else + retValue = myObject.startProcess(getCtx(), pi, trx); + } + catch (Exception e) + { + pi.setSummary("Error Start Class " + Classname, true); + log.log(Level.SEVERE, Classname, e); + throw new RuntimeException(e); + } + return retValue; + } // startClass + + + /** + * Is it a Workflow + * @return true if Workflow + */ + public boolean isWorkflow() + { + return getAD_Workflow_ID() > 0; + } // isWorkflow + + + /** + * Update Statistics + * @param seconds sec + */ + public void addStatistics (int seconds) + { + setStatistic_Count(getStatistic_Count() + 1); + setStatistic_Seconds(getStatistic_Seconds() + seconds); + } // addStatistics + + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord) // Add to all automatic roles + { + MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'"); + for (int i = 0; i < roles.length; i++) + { + + MProcessAccess pa = new MProcessAccess(this, roles[i].getAD_Role_ID()); + pa.save(); + } + } + // Menu/Workflow + else if (is_ValueChanged("IsActive") || is_ValueChanged("Name") + || is_ValueChanged("Description") || is_ValueChanged("Help")) + { + MMenu[] menues = MMenu.get(getCtx(), "AD_Process_ID=" + getAD_Process_ID()); + for (int i = 0; i < menues.length; i++) + { + menues[i].setIsActive(isActive()); + menues[i].setName(getName()); + menues[i].setDescription(getDescription()); + menues[i].save(); + } + X_AD_WF_Node[] nodes = MWindow.getWFNodes(getCtx(), "AD_Process_ID=" + getAD_Process_ID()); + for (int i = 0; i < nodes.length; i++) + { + boolean changed = false; + if (nodes[i].isActive() != isActive()) + { + nodes[i].setIsActive(isActive()); + changed = true; + } + if (nodes[i].isCentrallyMaintained()) + { + nodes[i].setName(getName()); + nodes[i].setDescription(getDescription()); + nodes[i].setHelp(getHelp()); + changed = true; + } + if (changed) + nodes[i].save(); + } + } + return success; + } // afterSave + +} // MProcess diff --git a/dbPort/src/org/compiere/model/MProcessAccess.java b/dbPort/src/org/compiere/model/MProcessAccess.java new file mode 100644 index 0000000000..0d10324042 --- /dev/null +++ b/dbPort/src/org/compiere/model/MProcessAccess.java @@ -0,0 +1,77 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + + +/** + * Process Access Model + * + * @author Jorg Janke + * @version $Id: MProcessAccess.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MProcessAccess extends X_AD_Process_Access +{ + + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MProcessAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + else + { + // setAD_Process_ID (0); + // setAD_Role_ID (0); + setIsReadWrite (true); + } + } // MProcessAccess + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MProcessAccess (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MProcessAccess + + /** + * Parent Constructor + * @param parent parent + * @param AD_Role_ID role id + */ + public MProcessAccess (MProcess parent, int AD_Role_ID) + { + super (parent.getCtx(), 0, parent.get_TrxName()); + setClientOrg(parent); + setAD_Process_ID (parent.getAD_Process_ID()); + setAD_Role_ID (AD_Role_ID); + } // MProcessAccess + +} // MProcessAccess diff --git a/dbPort/src/org/compiere/model/MProcessPara.java b/dbPort/src/org/compiere/model/MProcessPara.java new file mode 100644 index 0000000000..df2dd13eb6 --- /dev/null +++ b/dbPort/src/org/compiere/model/MProcessPara.java @@ -0,0 +1,198 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * Process Parameter Model + * + * @author Jorg Janke + * @version $Id: MProcessPara.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MProcessPara extends X_AD_Process_Para +{ + /** + * Get MProcessPara from Cache + * @param ctx context + * @param AD_Process_Para_ID id + * @return MProcessPara + */ + public static MProcessPara get (Properties ctx, int AD_Process_Para_ID) + { + Integer key = new Integer (AD_Process_Para_ID); + MProcessPara retValue = (MProcessPara)s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MProcessPara (ctx, AD_Process_Para_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache + = new CCache ("AD_Process_Para", 20); + + + /************************************************************************** + * Constructor + * @param ctx context + * @param AD_Process_Para_ID id + * @param trxName transaction + */ + public MProcessPara (Properties ctx, int AD_Process_Para_ID, String trxName) + { + super (ctx, AD_Process_Para_ID, trxName); + if (AD_Process_Para_ID == 0) + { + // setAD_Process_ID (0); Parent + // setName (null); + // setColumnName (null); + + setFieldLength (0); + setSeqNo (0); + // setAD_Reference_ID (0); + setIsCentrallyMaintained (true); + setIsRange (false); + setIsMandatory (false); + setEntityType (ENTITYTYPE_UserMaintained); + } + } // MProcessPara + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MProcessPara (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MProcessPara + + /** Virtual Window No - 999 */ + public static int WINDOW_NO = 999; + /** Virtual Tab No - 0 */ + public static int TAB_NO = 0; + + /** The Lookup */ + private Lookup m_lookup = null; + + + /** + * Is this field a Lookup?. + * @return true if lookup field + */ + public boolean isLookup() + { + boolean retValue = false; + int displayType = getAD_Reference_ID(); + if (DisplayType.isLookup(displayType)) + retValue = true; + else if (displayType == DisplayType.Location + || displayType == DisplayType.Locator + || displayType == DisplayType.Account + || displayType == DisplayType.PAttribute) + retValue = true; + return retValue; + } // isLookup + + /** + * Set Lookup for columns with lookup + */ + public void loadLookup() + { + if (!isLookup()) + return; + log.fine("(" + getColumnName() + ")"); + int displayType = getAD_Reference_ID(); + if (DisplayType.isLookup(displayType)) + { + MLookupInfo lookupInfo = MLookupFactory.getLookupInfo(getCtx(), 0, + getAD_Process_Para_ID(), getAD_Reference_ID(), + Env.getLanguage(getCtx()), getColumnName(), + getAD_Reference_Value_ID(), false, ""); + if (lookupInfo == null) + { + log.log(Level.SEVERE, "(" + getColumnName() + ") - No LookupInfo"); + return; + } + // Prevent loading of CreatedBy/UpdatedBy + if (displayType == DisplayType.Table + && (getColumnName().equals("CreatedBy") || getColumnName().equals("UpdatedBy")) ) + { + lookupInfo.IsCreadedUpdatedBy = true; + lookupInfo.DisplayType = DisplayType.Search; + } + // + MLookup ml = new MLookup (lookupInfo, TAB_NO); + m_lookup = ml; + } + else if (displayType == DisplayType.Location) // not cached + { + MLocationLookup ml = new MLocationLookup (getCtx(), WINDOW_NO); + m_lookup = ml; + } + else if (displayType == DisplayType.Locator) + { + MLocatorLookup ml = new MLocatorLookup (getCtx(), WINDOW_NO); + m_lookup = ml; + } + else if (displayType == DisplayType.Account) // not cached + { + MAccountLookup ma = new MAccountLookup (getCtx(), WINDOW_NO); + m_lookup = ma; + } + else if (displayType == DisplayType.PAttribute) // not cached + { + MPAttributeLookup pa = new MPAttributeLookup (getCtx(), WINDOW_NO); + m_lookup = pa; + } + // + if (m_lookup != null) + m_lookup.loadComplete(); + } // loadLookup + + /** + * Get Lookup for Parameter + * @return lookup or null + */ + public Lookup getLookup() + { + if (m_lookup == null && isLookup()) + loadLookup(); + return m_lookup; + } // getLookup + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MProcessPara[") + .append (get_ID ()) + .append ("]"); + return sb.toString (); + } // toString + +} // MProcessPara diff --git a/dbPort/src/org/compiere/model/MQuery.java b/dbPort/src/org/compiere/model/MQuery.java new file mode 100644 index 0000000000..c6084c43a8 --- /dev/null +++ b/dbPort/src/org/compiere/model/MQuery.java @@ -0,0 +1,983 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Query Descriptor. + * Maintains restrictions (WHERE clause) + * + * @author Jorg Janke + * @version $Id: MQuery.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MQuery implements Serializable +{ + /** + * Get Query from Parameter + * @param ctx context (to determine language) + * @param AD_PInstance_ID instance + * @param TableName table name + * @return where clause + */ + static public MQuery get (Properties ctx, int AD_PInstance_ID, String TableName) + { + s_log.info("AD_PInstance_ID=" + AD_PInstance_ID + ", TableName=" + TableName); + MQuery query = new MQuery(TableName); + // Temporary Tables - add qualifier (not displayed) + if (TableName.startsWith("T_")) + query.addRestriction(TableName + ".AD_PInstance_ID=" + AD_PInstance_ID); + + // How many rows do we have? + int rows = 0; + String SQL = "SELECT COUNT(*) FROM AD_PInstance_Para WHERE AD_PInstance_ID=?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(SQL, null); + pstmt.setInt(1, AD_PInstance_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + rows = rs.getInt(1); + rs.close(); + pstmt.close(); + } + catch (SQLException e1) + { + s_log.log(Level.SEVERE, SQL, e1); + } + + if (rows < 1) + return query; + + // Msg.getMsg(Env.getCtx(), "Parameter") + boolean trl = !Env.isBaseLanguage(ctx, "AD_Process_Para"); + if (!trl) + SQL = "SELECT ip.ParameterName,ip.P_String,ip.P_String_To," // 1..3 + + "ip.P_Number,ip.P_Number_To," // 4..5 + + "ip.P_Date,ip.P_Date_To, ip.Info,ip.Info_To, " // 6..9 + + "pp.Name, pp.IsRange " // 10..11 + + "FROM AD_PInstance_Para ip, AD_PInstance i, AD_Process_Para pp " + + "WHERE i.AD_PInstance_ID=ip.AD_PInstance_ID" + + " AND pp.AD_Process_ID=i.AD_Process_ID" + + " AND pp.ColumnName=ip.ParameterName" + + " AND ip.AD_PInstance_ID=?"; + else + SQL = "SELECT ip.ParameterName,ip.P_String,ip.P_String_To, ip.P_Number,ip.P_Number_To," + + "ip.P_Date,ip.P_Date_To, ip.Info,ip.Info_To, " + + "ppt.Name, pp.IsRange " + + "FROM AD_PInstance_Para ip, AD_PInstance i, AD_Process_Para pp, AD_Process_Para_Trl ppt " + + "WHERE i.AD_PInstance_ID=ip.AD_PInstance_ID" + + " AND pp.AD_Process_ID=i.AD_Process_ID" + + " AND pp.ColumnName=ip.ParameterName" + + " AND pp.AD_Process_Para_ID=ppt.AD_Process_Para_ID" + + " AND ip.AD_PInstance_ID=?" + + " AND ppt.AD_Language=?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(SQL, null); + pstmt.setInt(1, AD_PInstance_ID); + if (trl) + pstmt.setString(2, Env.getAD_Language(ctx)); + ResultSet rs = pstmt.executeQuery(); + // all records + for (int row = 0; rs.next(); row++) + { + if (row == rows) + { + s_log.log(Level.SEVERE, "(Parameter) - more rows than expected"); + break; + } + String ParameterName = rs.getString(1); + String P_String = rs.getString(2); + String P_String_To = rs.getString(3); + // + Double P_Number = null; + double d = rs.getDouble(4); + if (!rs.wasNull()) + P_Number = new Double(d); + Double P_Number_To = null; + d = rs.getDouble(5); + if (!rs.wasNull()) + P_Number_To = new Double(d); + // + Timestamp P_Date = rs.getTimestamp(6); + Timestamp P_Date_To = rs.getTimestamp(7); + // + String Info = rs.getString(8); + String Info_To = rs.getString(9); + // + String Name = rs.getString(10); + boolean isRange = "Y".equals(rs.getString(11)); + // + s_log.fine(ParameterName + " S=" + P_String + "-" + P_String_To + + ", N=" + P_Number + "-" + P_Number_To + ", D=" + P_Date + "-" + P_Date_To + + "; Name=" + Name + ", Info=" + Info + "-" + Info_To + ", Range=" + isRange); + + //------------------------------------------------------------- + if (P_String != null) + { + if (P_String_To == null) + { + if (P_String.indexOf("%") == -1) + query.addRestriction(ParameterName, MQuery.EQUAL, + P_String, Name, Info); + else + query.addRestriction(ParameterName, MQuery.LIKE, + P_String, Name, Info); + } + else + query.addRangeRestriction(ParameterName, + P_String, P_String_To, Name, Info, Info_To); + } + // Number + else if (P_Number != null || P_Number_To != null) + { + if (P_Number_To == null) + { + if (isRange) + query.addRestriction(ParameterName, MQuery.GREATER_EQUAL, + P_Number, Name, Info); + else + query.addRestriction(ParameterName, MQuery.EQUAL, + P_Number, Name, Info); + } + else // P_Number_To != null + { + if (P_Number == null) + query.addRestriction("TRUNC("+ParameterName+")", MQuery.LESS_EQUAL, + P_Number_To, Name, Info); + else + query.addRangeRestriction(ParameterName, + P_Number, P_Number_To, Name, Info, Info_To); + } + } + // Date + else if (P_Date != null || P_Date_To != null) + { + if (P_Date_To == null) + { + if (isRange) + query.addRestriction("TRUNC("+ParameterName+")", MQuery.GREATER_EQUAL, + P_Date, Name, Info); + else + query.addRestriction("TRUNC("+ParameterName+")", MQuery.EQUAL, + P_Date, Name, Info); + } + else // P_Date_To != null + { + if (P_Date == null) + query.addRestriction("TRUNC("+ParameterName+")", MQuery.LESS_EQUAL, + P_Date_To, Name, Info); + else + query.addRangeRestriction("TRUNC("+ParameterName+")", + P_Date, P_Date_To, Name, Info, Info_To); + } + } + } + rs.close(); + pstmt.close(); + } + catch (SQLException e2) + { + s_log.log(Level.SEVERE, SQL, e2); + } + s_log.info(query.toString()); + return query; + } // get + + + /** + * Get Zoom Column Name. + * Converts Synonyms like SalesRep_ID to AD_User_ID + * @param columnName column name + * @return column name + */ + public static String getZoomColumnName (String columnName) + { + if (columnName == null) + return null; + if (columnName.equals("SalesRep_ID")) + return "AD_User_ID"; + if (columnName.equals("C_DocTypeTarget_ID")) + return "C_DocType_ID"; + if (columnName.equals("Bill_BPartner_ID")) + return "C_BPartner_ID"; + if (columnName.equals("Bill_Location_ID")) + return "C_BPartner_Location_ID"; + if (columnName.equals("Account_ID")) + return "C_ElementValue_ID"; + // See also MTab.validateQuery + // + return columnName; + } // getZoomColumnName + + /** + * Derive Zoom Table Name from column name. + * (e.g. drop _ID) + * @param columnName column name + * @return table name + */ + public static String getZoomTableName (String columnName) + { + String tableName = getZoomColumnName(columnName); + int index = tableName.lastIndexOf("_ID"); + if (index != -1) + return tableName.substring(0, index); + return tableName; + } // getZoomTableName + + + /************************************************************************* + * Create simple Equal Query. + * Creates columnName=value or columnName='value' + * @param columnName columnName + * @param value value + * @return quary + */ + public static MQuery getEqualQuery (String columnName, Object value) + { + MQuery query = new MQuery(); + query.addRestriction(columnName, EQUAL, value); + query.setRecordCount(1); // guess + return query; + } // getEqualQuery + + /** + * Create simple Equal Query. + * Creates columnName=value + * @param columnName columnName + * @param value value + * @return quary + */ + public static MQuery getEqualQuery (String columnName, int value) + { + MQuery query = new MQuery(); + if (columnName.endsWith("_ID")) + query.setTableName(columnName.substring(0, columnName.length()-3)); + query.addRestriction(columnName, EQUAL, new Integer(value)); + query.setRecordCount(1); // guess + return query; + } // getEqualQuery + + /** + * Create No Record query. + * @param tableName table name + * @param newRecord new Record Indicator (2=3) + * @return query + */ + public static MQuery getNoRecordQuery (String tableName, boolean newRecord) + { + MQuery query = new MQuery(tableName); + if (newRecord) + query.addRestriction(NEWRECORD); + else + query.addRestriction("1=2"); + query.setRecordCount(0); + return query; + } // getNoRecordQuery + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MQuery.class); + + + /************************************************************************** + * Constructor w/o table name + */ + public MQuery () + { + } // MQuery + + /** + * Constructor + * @param TableName Table Name + */ + public MQuery (String TableName) + { + m_TableName = TableName; + } // MQuery + + /** + * Constructor get TableNAme from Table + * @param AD_Table_ID Table_ID + */ + public MQuery (int AD_Table_ID) + { // Use Client Context as r/o + m_TableName = MTable.getTableName (Env.getCtx(), AD_Table_ID); + } // MQuery + + /** Serialization Info **/ + static final long serialVersionUID = 1511402030597166113L; + + /** Table Name */ + private String m_TableName = ""; + /** List of Restrictions */ + private ArrayList m_list = new ArrayList(); + /** Record Count */ + private int m_recordCount = 999999; + /** New Record Query */ + private boolean m_newRecord = false; + /** New Record String */ + private static final String NEWRECORD = "2=3"; + + /** + * Get Record Count + * @return count - default 999999 + */ + public int getRecordCount() + { + return m_recordCount; + } // getRecordCount + + /** + * Set Record Count + * @param count count + */ + public void setRecordCount(int count) + { + m_recordCount = count; + } // setRecordCount + + + /** Equal */ + public static final String EQUAL = "="; + /** Equal - 0 */ + public static final int EQUAL_INDEX = 0; + /** Not Equal */ + public static final String NOT_EQUAL = "!="; + /** Like */ + public static final String LIKE = " LIKE "; + /** Not Like */ + public static final String NOT_LIKE = " NOT LIKE "; + /** Greater */ + public static final String GREATER = ">"; + /** Greater Equal */ + public static final String GREATER_EQUAL = ">="; + /** Less */ + public static final String LESS = "<"; + /** Less Equal */ + public static final String LESS_EQUAL = "<="; + /** Between */ + public static final String BETWEEN = " BETWEEN "; + /** Between - 8 */ + public static final int BETWEEN_INDEX = 8; + + /** Operators for Strings */ + public static final ValueNamePair[] OPERATORS = new ValueNamePair[] { + new ValueNamePair (EQUAL, " = "), // 0 + new ValueNamePair (NOT_EQUAL, " != "), + new ValueNamePair (LIKE, " ~ "), + new ValueNamePair (NOT_LIKE, " !~ "), + new ValueNamePair (GREATER, " > "), + new ValueNamePair (GREATER_EQUAL, " >= "), // 5 + new ValueNamePair (LESS, " < "), + new ValueNamePair (LESS_EQUAL, " <= "), + new ValueNamePair (BETWEEN, " >-< ") // 8 + }; + /** Operators for IDs */ + public static final ValueNamePair[] OPERATORS_ID = new ValueNamePair[] { + new ValueNamePair (EQUAL, " = "), // 0 + new ValueNamePair (NOT_EQUAL, " != ") + }; + /** Operators for Boolean */ + public static final ValueNamePair[] OPERATORS_YN = new ValueNamePair[] { + new ValueNamePair (EQUAL, " = ") + }; + + + /************************************************************************* + * Add Restriction + * @param ColumnName ColumnName + * @param Operator Operator, e.g. = != .. + * @param Code Code, e.g 0, All% + * @param InfoName Display Name + * @param InfoDisplay Display of Code (Lookup) + */ + public void addRestriction (String ColumnName, String Operator, + Object Code, String InfoName, String InfoDisplay) + { + Restriction r = new Restriction (ColumnName, Operator, + Code, InfoName, InfoDisplay); + m_list.add(r); + } // addRestriction + + /** + * Add Restriction + * @param ColumnName ColumnName + * @param Operator Operator, e.g. = != .. + * @param Code Code, e.g 0, All% + */ + public void addRestriction (String ColumnName, String Operator, + Object Code) + { + Restriction r = new Restriction (ColumnName, Operator, + Code, null, null); + m_list.add(r); + } // addRestriction + + /** + * Add Restriction + * @param ColumnName ColumnName + * @param Operator Operator, e.g. = != .. + * @param Code Code, e.g 0 + */ + public void addRestriction (String ColumnName, String Operator, + int Code) + { + Restriction r = new Restriction (ColumnName, Operator, + new Integer(Code), null, null); + m_list.add(r); + } // addRestriction + + /** + * Add Range Restriction (BETWEEN) + * @param ColumnName ColumnName + * @param Code Code, e.g 0, All% + * @param Code_to Code, e.g 0, All% + * @param InfoName Display Name + * @param InfoDisplay Display of Code (Lookup) + * @param InfoDisplay_to Display of Code (Lookup) + */ + public void addRangeRestriction (String ColumnName, + Object Code, Object Code_to, + String InfoName, String InfoDisplay, String InfoDisplay_to) + { + Restriction r = new Restriction (ColumnName, Code, Code_to, + InfoName, InfoDisplay, InfoDisplay_to); + m_list.add(r); + } // addRestriction + + /** + * Add Range Restriction (BETWEEN) + * @param ColumnName ColumnName + * @param Code Code, e.g 0, All% + * @param Code_to Code, e.g 0, All% + */ + public void addRangeRestriction (String ColumnName, + Object Code, Object Code_to) + { + Restriction r = new Restriction (ColumnName, Code, Code_to, + null, null, null); + m_list.add(r); + } // addRestriction + + /** + * Add Restriction + * @param r Restriction + */ + protected void addRestriction (Restriction r) + { + m_list.add(r); + } // addRestriction + + /** + * Add Restriction + * @param whereClause SQL WHERE clause + */ + public void addRestriction (String whereClause) + { + if (whereClause == null || whereClause.trim().length() == 0) + return; + Restriction r = new Restriction (whereClause); + m_list.add(r); + m_newRecord = whereClause.equals(NEWRECORD); + } // addRestriction + + /** + * New Record Query + * @return true if new nercord query + */ + public boolean isNewRecordQuery() + { + return m_newRecord; + } // isNewRecord + + /************************************************************************* + * Create the resulting Query WHERE Clause + * @return Where Clause + */ + public String getWhereClause () + { + return getWhereClause(false); + } // getWhereClause + + /** + * Create the resulting Query WHERE Clause + * @param fullyQualified fully qualified Table.ColumnName + * @return Where Clause + */ + public String getWhereClause (boolean fullyQualified) + { + boolean qualified = fullyQualified; + if (qualified && (m_TableName == null || m_TableName.length() == 0)) + qualified = false; + // + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < m_list.size(); i++) + { + Restriction r = (Restriction)m_list.get(i); + if (i != 0) + sb.append(r.andCondition ? " AND " : " OR "); + if (qualified) + sb.append(r.getSQL(m_TableName)); + else + sb.append(r.getSQL(null)); + } + return sb.toString(); + } // getWhereClause + + /** + * Get printable Query Info + * @return info + */ + public String getInfo () + { + StringBuffer sb = new StringBuffer(); + if (m_TableName != null) + sb.append(m_TableName).append(": "); + // + for (int i = 0; i < m_list.size(); i++) + { + Restriction r = (Restriction)m_list.get(i); + if (i != 0) + sb.append(r.andCondition ? " AND " : " OR "); + // + sb.append(r.getInfoName()) + .append(r.getInfoOperator()) + .append(r.getInfoDisplayAll()); + } + return sb.toString(); + } // getInfo + + + /** + * Create Query WHERE Clause. + * Not fully qualified + * @param index restriction index + * @return Where Clause or "" if not valid + */ + public String getWhereClause (int index) + { + StringBuffer sb = new StringBuffer(); + if (index >= 0 && index < m_list.size()) + { + Restriction r = (Restriction)m_list.get(index); + sb.append(r.getSQL(null)); + } + return sb.toString(); + } // getWhereClause + + /** + * Get Restriction Count + * @return number of restricctions + */ + public int getRestrictionCount() + { + return m_list.size(); + } // getRestrictionCount + + /** + * Is Query Active + * @return true if number of restricctions > 0 + */ + public boolean isActive() + { + return m_list.size() != 0; + } // isActive + + /** + * Get Table Name + * @return Table Name + */ + public String getTableName () + { + return m_TableName; + } // getTableName + + /** + * Set Table Name + * @param TableName Table Name + */ + public void setTableName (String TableName) + { + m_TableName = TableName; + } // setTableName + + + /************************************************************************* + * Get ColumnName of index + * @param index index + * @return ColumnName + */ + public String getColumnName (int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.ColumnName; + } // getColumnName + + /** + * Set ColumnName of index + * @param index index + * @param ColumnName new column name + */ + protected void setColumnName (int index, String ColumnName) + { + if (index < 0 || index >= m_list.size()) + return; + Restriction r = (Restriction)m_list.get(index); + r.ColumnName = ColumnName; + } // setColumnName + + /** + * Get Operator of index + * @param index index + * @return Operator + */ + public String getOperator (int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.Operator; + } // getOperator + + /** + * Get Operator of index + * @param index index + * @return Operator + */ + public Object getCode (int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.Code; + } // getCode + + /** + * Get Restriction Display of index + * @param index index + * @return Restriction Display + */ + public String getInfoDisplay (int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.InfoDisplay; + } // getOperator + + /** + * Get TO Restriction Display of index + * @param index index + * @return Restriction Display + */ + public String getInfoDisplay_to (int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.InfoDisplay_to; + } // getOperator + + /** + * Get Info Name + * @param index index + * @return Info Name + */ + public String getInfoName(int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.InfoName; + } // getInfoName + + /** + * Get Info Operator + * @param index index + * @return info Operator + */ + public String getInfoOperator(int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.getInfoOperator(); + } // getInfoOperator + + /** + * Get Display with optional To + * @param index index + * @return info display + */ + public String getInfoDisplayAll (int index) + { + if (index < 0 || index >= m_list.size()) + return null; + Restriction r = (Restriction)m_list.get(index); + return r.getInfoDisplayAll(); + } // getInfoDisplay + + /** + * String representation + * @return info + */ + public String toString() + { + if (isActive()) + return getWhereClause(true); + return "MQuery[" + m_TableName + ",Restrictions=0]"; + } // toString + + /** + * Get Display Name + * @param ctx context + * @return display Name + */ + public String getDisplayName(Properties ctx) + { + String keyColumn = null; + if (m_TableName != null) + keyColumn = m_TableName + "_ID"; + else + keyColumn = getColumnName(0); + String retValue = Msg.translate(ctx, keyColumn); + if (retValue != null && retValue.length() > 0) + return retValue; + return m_TableName; + } // getDisplayName + + /** + * Clone Query + * @return Query + */ + public MQuery deepCopy() + { + MQuery newQuery = new MQuery(m_TableName); + for (int i = 0; i < m_list.size(); i++) + newQuery.addRestriction((Restriction)m_list.get(i)); + return newQuery; + } // clone + +} // MQuery + +/***************************************************************************** + * Query Restriction + */ +class Restriction implements Serializable +{ + /** + * Restriction + * @param columnName ColumnName + * @param operator Operator, e.g. = != .. + * @param code Code, e.g 0, All% + * @param infoName Display Name + * @param infoDisplay Display of Code (Lookup) + */ + Restriction (String columnName, String operator, + Object code, String infoName, String infoDisplay) + { + this.ColumnName = columnName.trim(); + if (infoName != null) + InfoName = infoName; + else + InfoName = ColumnName; + // + this.Operator = operator; + // Boolean + if (code instanceof Boolean) + Code = ((Boolean)code).booleanValue() ? "Y" : "N"; + else if (code instanceof KeyNamePair) + Code = new Integer(((KeyNamePair)code).getKey()); + else if (code instanceof ValueNamePair) + Code = ((ValueNamePair)code).getValue(); + else + Code = code; + // clean code + if (Code instanceof String) + { + if (Code.toString().startsWith("'")) + Code = Code.toString().substring(1); + if (Code.toString().endsWith("'")) + Code = Code.toString().substring(0, Code.toString().length()-2); + } + if (infoDisplay != null) + InfoDisplay = infoDisplay.trim(); + else if (code != null) + InfoDisplay = code.toString(); + } // Restriction + + /** + * Range Restriction (BETWEEN) + * @param columnName ColumnName + * @param code Code, e.g 0, All% + * @param code_to Code, e.g 0, All% + * @param infoName Display Name + * @param infoDisplay Display of Code (Lookup) + * @param infoDisplay_to Display of Code (Lookup) + */ + Restriction (String columnName, + Object code, Object code_to, + String infoName, String infoDisplay, String infoDisplay_to) + { + this (columnName, MQuery.BETWEEN, code, infoName, infoDisplay); + + // Code_to + Code_to = code_to; + if (Code_to instanceof String) + { + if (Code_to.toString().startsWith("'")) + Code_to = Code_to.toString().substring(1); + if (Code_to.toString().endsWith("'")) + Code_to = Code_to.toString().substring(0, Code_to.toString().length()-2); + } + // InfoDisplay_to + if (infoDisplay_to != null) + InfoDisplay_to = infoDisplay_to.trim(); + else if (Code_to != null) + InfoDisplay_to = Code_to.toString(); + } // Restriction + + /** + * Create Restriction with dircet WHERE clause + * @param whereClause SQL WHERE Clause + */ + Restriction (String whereClause) + { + DircetWhereClause = whereClause; + } // Restriction + + /** Direct Where Clause */ + protected String DircetWhereClause = null; + /** Column Name */ + protected String ColumnName; + /** Name */ + protected String InfoName; + /** Operator */ + protected String Operator; + /** SQL Where Code */ + protected Object Code; + /** Info */ + protected String InfoDisplay; + /** SQL Where Code To */ + protected Object Code_to; + /** Info To */ + protected String InfoDisplay_to; + /** And/Or Condition */ + protected boolean andCondition = true; + + /** + * Return SQL construct for this restriction + * @param tableName optional table name + * @return SQL WHERE construct + */ + public String getSQL (String tableName) + { + if (DircetWhereClause != null) + return DircetWhereClause; + // + StringBuffer sb = new StringBuffer(); + if (tableName != null && tableName.length() > 0) + { + // Assumes - REPLACE(INITCAP(variable),'s','X') or UPPER(variable) + int pos = ColumnName.lastIndexOf('(')+1; // including ( + int end = ColumnName.indexOf(')'); + // We have a Function in the ColumnName + if (pos != -1 && end != -1) + sb.append(ColumnName.substring(0, pos)) + .append(tableName).append(".").append(ColumnName.substring(pos, end)) + .append(ColumnName.substring(end)); + else + sb.append(tableName).append(".").append(ColumnName); + } + else + sb.append(ColumnName); + // + sb.append(Operator); + if (Code instanceof String) + sb.append(DB.TO_STRING(Code.toString())); + else if (Code instanceof Timestamp) + sb.append(DB.TO_DATE((Timestamp)Code)); + else + sb.append(Code); + // Between + // if (Code_to != null && InfoDisplay_to != null) + if (MQuery.BETWEEN.equals(Operator)) + { + sb.append(" AND "); + if (Code_to instanceof String) + sb.append(DB.TO_STRING(Code_to.toString())); + else if (Code_to instanceof Timestamp) + sb.append(DB.TO_DATE((Timestamp)Code_to)); + else + sb.append(Code_to); + } + return sb.toString(); + } // getSQL + + /** + * Get String Representation + * @return info + */ + public String toString() + { + return getSQL(null); + } // toString + + /** + * Get Info Name + * @return Info Name + */ + public String getInfoName() + { + return InfoName; + } // getInfoName + + /** + * Get Info Operator + * @return info Operator + */ + public String getInfoOperator() + { + for (int i = 0; i < MQuery.OPERATORS.length; i++) + { + if (MQuery.OPERATORS[i].getValue().equals(Operator)) + return MQuery.OPERATORS[i].getName(); + } + return Operator; + } // getInfoOperator + + /** + * Get Display with optional To + * @return info display + */ + public String getInfoDisplayAll() + { + if (InfoDisplay_to == null) + return InfoDisplay; + StringBuffer sb = new StringBuffer(InfoDisplay); + sb.append(" - ").append(InfoDisplay_to); + return sb.toString(); + } // getInfoDisplay + +} // Restriction diff --git a/dbPort/src/org/compiere/model/MRecordAccess.java b/dbPort/src/org/compiere/model/MRecordAccess.java new file mode 100644 index 0000000000..e6b4f2d1db --- /dev/null +++ b/dbPort/src/org/compiere/model/MRecordAccess.java @@ -0,0 +1,282 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Record Access Model + * + * @author Jorg Janke + * @version $Id: MRecordAccess.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MRecordAccess extends X_AD_Record_Access +{ + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MRecordAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MRecordAccess + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MRecordAccess (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MRecordAccess + + /** + * Full New Constructor + * @param ctx context + * @param AD_Role_ID role + * @param AD_Table_ID table + * @param Record_ID record + * @param trxName transaction + */ + public MRecordAccess (Properties ctx, int AD_Role_ID, int AD_Table_ID, int Record_ID, String trxName) + { + super (ctx,0, trxName); + setAD_Role_ID(AD_Role_ID); + setAD_Table_ID(AD_Table_ID); + setRecord_ID(Record_ID); + // + setIsExclude (true); + setIsReadOnly (false); + setIsDependentEntities(false); + } // MRecordAccess + + // Key Column Name */ + private String m_keyColumnName = null; + + /** + * Get Key Column Name + * @return Key Column Name + */ + public String getKeyColumnName() + { + if (m_keyColumnName != null) + return m_keyColumnName; + // + String sql = "SELECT ColumnName " + + "FROM AD_Column " + + "WHERE AD_Table_ID=? AND IsKey='Y' AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_Table_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String s = rs.getString(1); + if (m_keyColumnName == null) + m_keyColumnName = s; + else + log.log(Level.SEVERE, "More than one key = " + s); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (m_keyColumnName == null) + log.log(Level.SEVERE, "Record Access requires Table with one key column"); + // + return m_keyColumnName; + } // getKeyColumnName + + /** + * Get Synonym of Column + * @return Synonym Column Name + */ + public String getSynonym() + { + if ("AD_User_ID".equals(getKeyColumnName())) + return "SalesRep_ID"; + else if ("C_ElementValue_ID".equals(getKeyColumnName())) + return "Account_ID"; + // + return null; + } // getSynonym + + /** + * Key Column has a Synonym + * @return true if Key Column has Synonym + */ + public boolean isSynonym() + { + return getSynonym() == null; + } // isSynonym + + /** + * Is Read Write + * @return rw - false if exclude + */ + public boolean isReadWrite() + { + if (isExclude()) + return false; + return !super.isReadOnly(); + } // isReadWrite + + /** + * Get Key Column Name with consideration of Synonym + * @param tableInfo + * @return key column name + */ + public String getKeyColumnName (AccessSqlParser.TableInfo[] tableInfo) + { + String columnSyn = getSynonym(); + if (columnSyn == null) + return m_keyColumnName; + // We have a synonym - ignore it if base table inquired + for (int i = 0; i < tableInfo.length; i++) + { + if (m_keyColumnName.equals("AD_User_ID")) + { + // List of tables where not to use SalesRep_ID + if (tableInfo[i].getTableName().equals("AD_User")) + return m_keyColumnName; + } + else if (m_keyColumnName.equals("AD_ElementValue_ID")) + { + // List of tables where not to use Account_ID + if (tableInfo[i].getTableName().equals("AD_ElementValue")) + return m_keyColumnName; + } + } // tables to be ignored + return columnSyn; + } // getKeyColumnInfo + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MRecordAccess[AD_Role_ID=") + .append(getAD_Role_ID()) + .append(",AD_Table_ID=").append(getAD_Table_ID()) + .append(",Record_ID=").append(getRecord_ID()) + .append(",Active=").append(isActive()) + .append(",Exclude=").append(isExclude()) + .append(",ReadOnly=").append(super.isReadOnly()) + .append(",Dependent=").append(isDependentEntities()) + .append("]"); + return sb.toString(); + } // toString + + /** + * Extended String Representation + * @param ctx context + * @return extended info + */ + public String toStringX (Properties ctx) + { + String in = Msg.getMsg(ctx, "Include"); + String ex = Msg.getMsg(ctx, "Exclude"); + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(ctx, "AD_Table_ID")) + .append("=").append(getTableName(ctx)).append(", ") + .append(Msg.translate(ctx, "Record_ID")) + . append("=").append(getRecord_ID()) + .append(" - ").append(Msg.translate(ctx, "IsDependentEntities")) + .append("=").append(isDependentEntities()) + .append(" (").append(Msg.translate(ctx, "IsReadOnly")) + .append("=").append(super.isReadOnly()) + .append(") - ").append(isExclude() ? ex : in); + return sb.toString(); + } // toStringX + + /** TableName */ + private String m_tableName; + + /** + * Get Table Name + * @param ctx context + * @return table name + */ + public String getTableName (Properties ctx) + { + if (m_tableName == null) + { + String sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_Table_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + m_tableName = rs.getString(1); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // Get Clear Text + String realName = Msg.translate(ctx, m_tableName + "_ID"); + if (!realName.equals(m_tableName + "_ID")) + m_tableName = realName; + } + return m_tableName; + } // getTableName + +} // MRecordAccess diff --git a/dbPort/src/org/compiere/model/MRefList.java b/dbPort/src/org/compiere/model/MRefList.java new file mode 100644 index 0000000000..400988f683 --- /dev/null +++ b/dbPort/src/org/compiere/model/MRefList.java @@ -0,0 +1,230 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Reference List Value + * + * @author Jorg Janke + * @version $Id: MRefList.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MRefList extends X_AD_Ref_List +{ + /** + * Get Reference List + * @param ctx context + * @param AD_Reference_ID reference + * @param Value value + * @param trxName transaction + * @return List or null + */ + public static MRefList get (Properties ctx, int AD_Reference_ID, String Value, String trxName) + { + MRefList retValue = null; + String sql = "SELECT * FROM AD_Ref_List " + + "WHERE AD_Reference_ID=? AND Value=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, AD_Reference_ID); + pstmt.setString (2, Value); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MRefList (ctx, rs, trxName); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, sql, ex); + } + try + { + if (pstmt != null) + pstmt.close (); + } + catch (SQLException ex1) + { + } + pstmt = null; + + return retValue; + } // get + + /** + * Get Reference List Value Name (cached) + * @param ctx context + * @param AD_Reference_ID reference + * @param Value value + * @return List or null + */ + public static String getListName (Properties ctx, int AD_Reference_ID, String Value) + { + String AD_Language = Env.getAD_Language(ctx); + String key = AD_Language + "_" + AD_Reference_ID + "_" + Value; + String retValue = (String)s_cache.get(key); + if (retValue != null) + return retValue; + + boolean isBaseLanguage = Env.isBaseLanguage(AD_Language, "AD_Ref_List"); + String sql = isBaseLanguage ? + "SELECT Name FROM AD_Ref_List " + + "WHERE AD_Reference_ID=? AND Value=?" : + "SELECT t.Name FROM AD_Ref_List_Trl t" + + " INNER JOIN AD_Ref_List r ON (r.AD_Ref_List_ID=t.AD_Ref_List_ID) " + + "WHERE r.AD_Reference_ID=? AND r.Value=? AND t.AD_Language=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Reference_ID); + pstmt.setString(2, Value); + if (!isBaseLanguage) + pstmt.setString(3, AD_Language); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = rs.getString(1); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, sql + " - " + key, ex); + } + try + { + if (pstmt != null) + pstmt.close (); + } + catch (SQLException ex1) + { + } + pstmt = null; + + // Save into Cache + if (retValue == null) + { + retValue = ""; + s_log.warning("getListName - Not found " + key); + } + s_cache.put(key, retValue); + // + return retValue; + } // getListName + + + /** + * Get Reference List + * @param AD_Reference_ID reference + * @param optional if true add "","" + * @return List or null + */ + public static ValueNamePair[] getList (int AD_Reference_ID, boolean optional) + { + String sql = "SELECT Value, Name FROM AD_Ref_List " + + "WHERE AD_Reference_ID=? AND IsActive='Y' ORDER BY 1"; + PreparedStatement pstmt = null; + ArrayList list = new ArrayList(); + if (optional) + list.add(new ValueNamePair("", "")); + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Reference_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new ValueNamePair(rs.getString(1), rs.getString(2))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + ValueNamePair[] retValue = new ValueNamePair[list.size()]; + list.toArray(retValue); + return retValue; + } // getList + + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MRefList.class); + /** Value Cache */ + private static CCache s_cache = new CCache("AD_Ref_List", 20); + + + /************************************************************************** + * Persistency Constructor + * @param ctx context + * @param AD_Ref_List_ID id + * @param trxName transaction + */ + public MRefList (Properties ctx, int AD_Ref_List_ID, String trxName) + { + super (ctx, AD_Ref_List_ID, trxName); + if (AD_Ref_List_ID == 0) + { + // setAD_Reference_ID (0); + // setAD_Ref_List_ID (0); + setEntityType (ENTITYTYPE_UserMaintained); // U + // setName (null); + // setValue (null); + } + } // MRef_List + + /** + * Load Contructor + * @param ctx context + * @param rs result + * @param trxName transaction + */ + public MRefList (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MRef_List + + /** + * String Representation + * @return Name + */ + public String toString() + { + return getName(); + } // toString + + +} // MRef_List diff --git a/dbPort/src/org/compiere/model/MRegion.java b/dbPort/src/org/compiere/model/MRegion.java new file mode 100644 index 0000000000..9da53fa425 --- /dev/null +++ b/dbPort/src/org/compiere/model/MRegion.java @@ -0,0 +1,409 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.*; +import org.compiere.util.*; + +/** + * Localtion Region Model (Value Object) + * + * @author Jorg Janke + * @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 +{ + /** + * Load Regions (cached) + * @param ctx context + */ + private static void loadAllRegions (Properties ctx) + { + s_regions = new CCache("C_Region", 100); + String sql = "SELECT * FROM C_Region WHERE IsActive='Y'"; + try + { + Statement stmt = DB.createStatement(); + ResultSet rs = stmt.executeQuery(sql); + while(rs.next()) + { + MRegion r = new MRegion (ctx, rs, null); + s_regions.put(String.valueOf(r.getC_Region_ID()), r); + if (r.isDefault()) + s_default = r; + } + rs.close(); + stmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + } + s_log.fine(s_regions.size() + " - default=" + s_default); + } // loadAllRegions + + /** + * Get Country (cached) + * @param ctx context + * @param C_Region_ID ID + * @return Country + */ + public static MRegion get (Properties ctx, int C_Region_ID) + { + if (s_regions == null || s_regions.size() == 0) + loadAllRegions(ctx); + String key = String.valueOf(C_Region_ID); + MRegion r = (MRegion)s_regions.get(key); + if (r != null) + return r; + r = new MRegion (ctx, C_Region_ID, null); + if (r.getC_Region_ID() == C_Region_ID) + { + s_regions.put(key, r); + return r; + } + return null; + } // get + + /** + * Get Default Region + * @param ctx context + * @return Region or null + */ + public static MRegion getDefault (Properties ctx) + { + if (s_regions == null || s_regions.size() == 0) + loadAllRegions(ctx); + return s_default; + } // get + + /** + * Return Regions as Array + * @param ctx context + * @return MCountry Array + */ + @SuppressWarnings("unchecked") + public static MRegion[] getRegions(Properties ctx) + { + if (s_regions == null || s_regions.size() == 0) + loadAllRegions(ctx); + MRegion[] retValue = new MRegion[s_regions.size()]; + s_regions.values().toArray(retValue); + Arrays.sort(retValue, new MRegion(ctx, 0, null)); + return retValue; + } // getRegions + + /** + * Return Array of Regions of Country + * @param ctx context + * @param C_Country_ID country + * @return MRegion Array + */ + @SuppressWarnings("unchecked") + public static MRegion[] getRegions (Properties ctx, int C_Country_ID) + { + if (s_regions == null || s_regions.size() == 0) + loadAllRegions(ctx); + ArrayList list = new ArrayList(); + Iterator it = s_regions.values().iterator(); + while (it.hasNext()) + { + MRegion r = (MRegion)it.next(); + if (r.getC_Country_ID() == C_Country_ID) + list.add(r); + } + // Sort it + MRegion[] retValue = new MRegion[list.size()]; + list.toArray(retValue); + Arrays.sort(retValue, new MRegion(ctx, 0, null)); + return retValue; + } // getRegions + + /** Region Cache */ + private static CCache s_regions = null; + /** Default Region */ + private static MRegion s_default = null; + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MRegion.class); + + + /************************************************************************** + * Create empty Region + * @param ctx context + * @param C_Region_ID id + * @param trxName transaction + */ + public MRegion (Properties ctx, int C_Region_ID, String trxName) + { + super (ctx, C_Region_ID, trxName); + if (C_Region_ID == 0) + { + } + } // MRegion + + /** + * Create Region from current row in ResultSet + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MRegion (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MRegion + + /** + * Parent Constructor + * @param country country + * @param regionName Region Name + */ + public MRegion (MCountry country, String regionName) + { + super (country.getCtx(), 0, country.get_TrxName()); + setC_Country_ID(country.getC_Country_ID()); + setName(regionName); + } // MRegion + + /** + * Return Name + * @return Name + */ + public String toString() + { + return getName(); + } // toString + + /** + * Compare + * @param o1 object 1 + * @param o2 object 2 + * @return -1,0, 1 + */ + public int compare(Object o1, Object o2) + { + String s1 = o1.toString(); + if (s1 == null) + s1 = ""; + String s2 = o2.toString(); + if (s2 == null) + s2 = ""; + return s1.compareTo(s2); + } // compare + + /** + * Test / Load + * @param args + */ + public static void main (String[] args) + { + Adempiere.startup(true); + /** To add your regions, complete the code below. + * 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 + MCountry country = new MCountry(Env.getCtx(), C_Country_ID, null); + // Hokkaido + MRegion temp = new MRegion (country, "\u5317\u6d77\u9053"); + temp.setDescription( "\u5317\u6d77\u9053(Hokkaido)" ); + temp.save(); + // Aomori + temp = new MRegion (country, "\u9752\u68ee\u770c"); + temp.setDescription( "\u9752\u68ee\u770c(Aomori)" ); + temp.save(); + // Iwate + temp = new MRegion (country, "\u5ca9\u624b\u770c"); + temp.setDescription( "\u5ca9\u624b\u770c(Iwate)" ); + temp.save(); + // Miyagi + temp = new MRegion (country, "\u5bae\u57ce\u770c"); + temp.setDescription( "\u5bae\u57ce\u770c(Miyagi)" ); + temp.save(); + // Akita + temp = new MRegion (country, "\u79cb\u7530\u770c"); + temp.setDescription( "\u79cb\u7530\u770c(Akita)" ); + temp.save(); + // Yamagata + temp = new MRegion (country, "\u5c71\u5f62\u770c"); + temp.setDescription( "\u5c71\u5f62\u770c(Yamagata)" ); + temp.save(); + // Fukushima + temp = new MRegion (country, "\u798f\u5cf6\u770c"); + temp.setDescription( "\u798f\u5cf6\u770c(Fukushima)" ); + temp.save(); + // Ibaraki + temp = new MRegion (country, "\u8328\u57ce\u770c"); + temp.setDescription( "\u8328\u57ce\u770c(Ibaraki)" ); + temp.save(); + // Gunma + temp = new MRegion (country, "\u7fa4\u99ac\u770c"); + temp.setDescription( "\u7fa4\u99ac\u770c(Gunma)" ); + temp.save(); + // Saitama + temp = new MRegion (country, "\u57fc\u7389\u770c"); + temp.setDescription( "\u57fc\u7389\u770c(Saitama)" ); + temp.save(); + // Chiba + temp = new MRegion (country, "\u5343\u8449\u770c"); + temp.setDescription( "\u5343\u8449\u770c(Chiba)" ); + temp.save(); + // Tokyo + temp = new MRegion (country, "\u6771\u4eac\u90fd"); + temp.setDescription( "\u6771\u4eac\u90fd(Tokyo)" ); + temp.save(); + // Kanagawa + temp = new MRegion (country, "\u795e\u5948\u5ddd\u770c"); + temp.setDescription( "\u795e\u5948\u5ddd\u770c(Kanagawa)" ); + temp.save(); + // Niigata + temp = new MRegion (country, "\u65b0\u6f5f\u770c"); + temp.setDescription( "\u65b0\u6f5f\u770c(Niigata)" ); + temp.save(); + // Toyama + temp = new MRegion (country, "\u5bcc\u5c71\u770c"); + temp.setDescription( "\u5bcc\u5c71\u770c(Toyama)" ); + temp.save(); + // Ishikawa + temp = new MRegion (country, "\u77f3\u5ddd\u770c"); + temp.setDescription( "\u77f3\u5ddd\u770c(Ishikawa)" ); + temp.save(); + // Fukui + temp = new MRegion (country, "\u798f\u4e95\u770c"); + temp.setDescription( "\u798f\u4e95\u770c(Fukui)" ); + temp.save(); + // Yamanashi + temp = new MRegion (country, "\u5c71\u68a8\u770c"); + temp.setDescription( "\u5c71\u68a8\u770c(Yamanashi)" ); + temp.save(); + // Gifu + temp = new MRegion (country, "\u5c90\u961c\u770c"); + temp.setDescription( "\u5c90\u961c\u770c(Gifu)" ); + temp.save(); + // Shizuoka + temp = new MRegion (country, "\u9759\u5ca1\u770c"); + temp.setDescription( "\u9759\u5ca1\u770c(Shizuoka)" ); + temp.save(); + // Aichi + temp = new MRegion (country, "\u611b\u77e5\u770c"); + temp.setDescription( "\u611b\u77e5\u770c(Aichi)" ); + temp.save(); + // Mie + temp = new MRegion (country, "\u4e09\u91cd\u770c"); + temp.setDescription( "\u4e09\u91cd\u770c(Mie)" ); + temp.save(); + // Siga + temp = new MRegion (country, "\u6ecb\u8cc0\u770c"); + temp.setDescription( "\u6ecb\u8cc0\u770c(Siga)" ); + temp.save(); + // Kyoto + temp = new MRegion (country, "\u4eac\u90fd\u5e9c"); + temp.setDescription( "\u4eac\u90fd\u5e9c(Kyoto)" ); + temp.save(); + // Osaka + temp = new MRegion (country, "\u5927\u962a\u5e9c"); + temp.setDescription( "\u5927\u962a\u5e9c(Osaka)" ); + temp.save(); + // Hyogo + temp = new MRegion (country, "\u5175\u5eab\u770c"); + temp.setDescription( "\u5175\u5eab\u770c(Hyogo)" ); + temp.save(); + // Nara + temp = new MRegion (country, "\u5948\u826f\u770c"); + temp.setDescription( "\u5948\u826f\u770c(Nara)" ); + temp.save(); + // Wakayama + temp = new MRegion (country, "\u548c\u6b4c\u5c71\u770c"); + temp.setDescription( "\u548c\u6b4c\u5c71\u770c(Wakayama)" ); + temp.save(); + // Tottori + temp = new MRegion (country, "\u9ce5\u53d6\u770c"); + temp.setDescription( "\u9ce5\u53d6\u770c(Tottori)" ); + temp.save(); + // Shimane + temp = new MRegion (country, "\u5cf6\u6839\u770c"); + temp.setDescription( "\u5cf6\u6839\u770c(Shimane)" ); + temp.save(); + // Okayama + temp = new MRegion (country, "\u5ca1\u5c71\u770c"); + temp.setDescription( "\u5ca1\u5c71\u770c(Okayama)" ); + temp.save(); + // Hiroshima + temp = new MRegion (country, "\u5e83\u5cf6\u770c"); + temp.setDescription( "\u5e83\u5cf6\u770c(Hiroshima)" ); + temp.save(); + // Yamaguchi + temp = new MRegion (country, "\u5c71\u53e3\u770c"); + temp.setDescription( "\u5c71\u53e3\u770c(Yamaguchi)" ); + temp.save(); + // Tokushima + temp = new MRegion (country, "\u5fb3\u5cf6\u770c"); + temp.setDescription( "\u5fb3\u5cf6\u770c(Tokushima)" ); + temp.save(); + // Kagawa + temp = new MRegion (country, "\u9999\u5ddd\u770c"); + temp.setDescription( "\u9999\u5ddd\u770c(Kagawa)" ); + temp.save(); + // Ehime + temp = new MRegion (country, "\u611b\u5a9b\u770c"); + temp.setDescription( "\u611b\u5a9b\u770c(Ehime)" ); + temp.save(); + // Kouchi + temp = new MRegion (country, "\u9ad8\u77e5\u770c"); + temp.setDescription( "\u9ad8\u77e5\u770c(Kouchi)" ); + temp.save(); + // Fukuoka + temp = new MRegion (country, "\u798f\u5ca1\u770c"); + temp.setDescription( "\u798f\u5ca1\u770c(Fukuoka)" ); + temp.save(); + // Saga + temp = new MRegion (country, "\u4f50\u8cc0\u770c"); + temp.setDescription( "\u4f50\u8cc0\u770c(Saga)" ); + temp.save(); + // Nagasaki + temp = new MRegion (country, "\u9577\u5d0e\u770c"); + temp.setDescription( "\u9577\u5d0e\u770c(Nagasaki)" ); + temp.save(); + // Kumamoto + temp = new MRegion (country, "\u718a\u672c\u770c"); + temp.setDescription( "\u718a\u672c\u770c(Kumamoto)" ); + temp.save(); + // Ohita + temp = new MRegion (country, "\u5927\u5206\u770c"); + temp.setDescription( "\u5927\u5206\u770c(Ohita)" ); + temp.save(); + // Miyasaki + temp = new MRegion (country, "\u5bae\u5d0e\u770c"); + temp.setDescription( "\u5bae\u5d0e\u770c(Miyasaki)" ); + temp.save(); + // Kagoshima + temp = new MRegion (country, "\u9e7f\u5150\u5cf6\u770c"); + temp.setDescription( "\u9e7f\u5150\u5cf6\u770c(Kagoshima)" ); + temp.save(); + // Okinawa + temp = new MRegion (country, "\u6c96\u7e04\u770c"); + temp.setDescription( "\u6c96\u7e04\u770c(Okinawa)" ); + temp.save(); + + } // main + +} // MRegion diff --git a/dbPort/src/org/compiere/model/MRole.java b/dbPort/src/org/compiere/model/MRole.java new file mode 100644 index 0000000000..c0aa1c603a --- /dev/null +++ b/dbPort/src/org/compiere/model/MRole.java @@ -0,0 +1,2154 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Role Model. + * Includes AD_User runtime info for Personal Access + * The class is final, so that you cannot overwrite the security rules. + * + * @author Jorg Janke + * @version $Id: MRole.java,v 1.5 2006/08/09 16:38:47 jjanke Exp $ + */ +public final class MRole extends X_AD_Role +{ + /** + * Get Default (Client) Role + * @return role + */ + public static MRole getDefault () + { + if (s_defaultRole == null && Ini.isClient()) + return getDefault (Env.getCtx(), false); + return s_defaultRole; + } // getDefault + + /** + * Get/Set Default Role. + * @param ctx context + * @param reload if true forces load + * @return role + * @see org.compiere.util.Login#loadPreferences(KeyNamePair, KeyNamePair, java.sql.Timestamp, String) + */ + public static MRole getDefault (Properties ctx, boolean reload) + { + int AD_Role_ID = Env.getContextAsInt(ctx, "#AD_Role_ID"); + int AD_User_ID = Env.getContextAsInt(ctx, "#AD_User_ID"); + if (!Ini.isClient()) // none for Server + AD_User_ID = 0; + if (reload || s_defaultRole == null) + { + s_defaultRole = get (ctx, AD_Role_ID, AD_User_ID, reload); + } + else if (s_defaultRole.getAD_Role_ID() != AD_Role_ID + || s_defaultRole.getAD_User_ID() != AD_User_ID) + { + s_defaultRole = get (ctx, AD_Role_ID, AD_User_ID, reload); + } + return s_defaultRole; + } // getDefault + + /** + * Get Role for User + * @param ctx context + * @param AD_Role_ID role + * @param AD_User_ID user + * @param reload if true forces load + * @return role + */ + public static MRole get (Properties ctx, int AD_Role_ID, int AD_User_ID, boolean reload) + { + s_log.info("AD_Role_ID=" + AD_Role_ID + ", AD_User_ID=" + AD_User_ID + ", reload=" + reload); + String key = AD_Role_ID + "_" + AD_User_ID; + MRole role = (MRole)s_roles.get (key); + if (role == null || reload) + { + role = new MRole (ctx, AD_Role_ID, null); + s_roles.put (key, role); + if (AD_Role_ID == 0) + { + String trxName = null; + role.load(trxName); // special Handling + } + role.setAD_User_ID(AD_User_ID); + role.loadAccess(reload); + s_log.info(role.toString()); + } + return role; + } // get + + /** + * Get Role (cached). + * Did not set user - so no access loaded + * @param ctx context + * @param AD_Role_ID role + * @return role + */ + public static MRole get (Properties ctx, int AD_Role_ID) + { + String key = String.valueOf(AD_Role_ID); + MRole role = (MRole)s_roles.get (key); + String trxName = null; + if (role == null) + { + role = new MRole (ctx, AD_Role_ID, trxName); + s_roles.put (key, role); + if (AD_Role_ID == 0) // System Role + { + role.load(trxName); // special Handling + } + } + return role; + } // get + + /** + * Get Roles Of Client + * @param ctx context + * @return roles of client + */ + public static MRole[] getOfClient (Properties ctx) + { + String sql = "SELECT * FROM AD_Role WHERE AD_Client_ID=?"; + ArrayList list = new ArrayList (); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, Env.getAD_Client_ID(ctx)); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MRole(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MRole[] retValue = new MRole[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfClient + + /** + * Get Roles With where clause + * @param ctx context + * @param whereClause where clause + * @return roles of client + */ + public static MRole[] getOf (Properties ctx, String whereClause) + { + String sql = "SELECT * FROM AD_Role"; + if (whereClause != null && whereClause.length() > 0) + sql += " WHERE " + whereClause; + ArrayList list = new ArrayList (); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MRole(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MRole[] retValue = new MRole[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOf + + /** Default Role */ + private static MRole s_defaultRole = null; + /** Role/User Cache */ + private static CCache s_roles = new CCache("AD_Role", 5); + /** Log */ + private static CLogger s_log = CLogger.getCLogger(MRole.class); + + /** Access SQL Read Write */ + public static final boolean SQL_RW = true; + /** Access SQL Read Only */ + public static final boolean SQL_RO = false; + /** Access SQL Fully Qualified */ + public static final boolean SQL_FULLYQUALIFIED = true; + /** Access SQL Not Fully Qualified */ + public static final boolean SQL_NOTQUALIFIED = false; + + /** The AD_User_ID of the SuperUser */ + public static final int SUPERUSER_USER_ID = 100; + /** The AD_User_ID of the System Administrator */ + public static final int SYSTEM_USER_ID = 0; + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Role_ID id + * @param trxName transaction + */ + public MRole (Properties ctx, int AD_Role_ID, String trxName) + { + super (ctx, AD_Role_ID, trxName); + // ID=0 == System Administrator + if (AD_Role_ID == 0) + { + // setName (null); + setIsCanExport (true); + setIsCanReport (true); + setIsManual (false); + setIsPersonalAccess (false); + setIsPersonalLock (false); + setIsShowAcct (false); + setIsAccessAllOrgs(false); + setUserLevel (USERLEVEL_Organization); + setPreferenceType(PREFERENCETYPE_Organization); + setIsChangeLog(false); + setOverwritePriceLimit(false); + setIsUseUserOrgAccess(false); + setMaxQueryRecords(0); + setConfirmQueryRecords(0); + } + } // MRole + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MRole(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MRole + + /** + * Get Confirm Query Records + * @return entered records or 500 (default) + */ + public int getConfirmQueryRecords () + { + int no = super.getConfirmQueryRecords (); + if (no == 0) + return 500; + return no; + } // getConfirmQueryRecords + + /** + * Require Query + * @param noRecords records + * @return true if query required + */ + public boolean isQueryRequire (int noRecords) + { + if (noRecords < 2) + return false; + int max = getMaxQueryRecords(); + if (max > 0 && noRecords > max) + return true; + int qu = getConfirmQueryRecords(); + return (noRecords > qu); + } // isQueryRequire + + /** + * Over max Query + * @param noRecords records + * @return true if over max query + */ + public boolean isQueryMax (int noRecords) + { + int max = getMaxQueryRecords(); + return max > 0 && noRecords > max; + } // isQueryMax + + /** + * Before Save + * @param newRecord new + * @return true if it can be saved + */ + protected boolean beforeSave(boolean newRecord) + { + // if (newRecord || is_ValueChanged("UserLevel")) + // { + if (getAD_Client_ID() == 0) + setUserLevel(USERLEVEL_System); + else if (getUserLevel().equals(USERLEVEL_System)) + { + log.saveError("AccessTableNoUpdate", Msg.getElement(getCtx(), "UserLevel")); + return false; + } + // } + return true; + } // beforeSave + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord && success) + { + // Add Role to SuperUser + MUserRoles su = new MUserRoles(getCtx(), SUPERUSER_USER_ID, getAD_Role_ID(), get_TrxName()); + su.save(); + // Add Role to User + if (getCreatedBy() != SUPERUSER_USER_ID) + { + MUserRoles ur = new MUserRoles(getCtx(), getCreatedBy(), getAD_Role_ID(), get_TrxName()); + ur.save(); + } + updateAccessRecords(); + } + // + else if (is_ValueChanged("UserLevel")) + updateAccessRecords(); + + // Default Role changed + if (s_defaultRole != null + && s_defaultRole.get_ID() == get_ID()) + s_defaultRole = this; + return success; + } // afterSave + + /** + * Create Access Records + * @return info + */ + public String updateAccessRecords () + { + if (isManual()) + return "-"; + + String roleClientOrgUser = getAD_Role_ID() + "," + + getAD_Client_ID() + "," + getAD_Org_ID() + ",'Y', SysDate," + + getUpdatedBy() + ", SysDate," + getUpdatedBy() + + ",'Y' "; // IsReadWrite + + String sqlWindow = "INSERT INTO AD_Window_Access " + + "(AD_Window_ID, AD_Role_ID," + + " AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadWrite) " + + "SELECT DISTINCT w.AD_Window_ID, " + roleClientOrgUser + + "FROM AD_Window w" + + " INNER JOIN AD_Tab t ON (w.AD_Window_ID=t.AD_Window_ID)" + + " INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID) " + + "WHERE t.SeqNo=(SELECT MIN(SeqNo) FROM AD_Tab xt " // only check first tab + + "WHERE xt.AD_Window_ID=w.AD_Window_ID)" + + "AND tt.AccessLevel IN "; + + String sqlProcess = "INSERT INTO AD_Process_Access " + + "(AD_Process_ID, AD_Role_ID," + + " AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadWrite) " + + "SELECT DISTINCT p.AD_Process_ID, " + roleClientOrgUser + + "FROM AD_Process p " + + "WHERE AccessLevel IN "; + + String sqlForm = "INSERT INTO AD_Form_Access " + + "(AD_Form_ID, AD_Role_ID," + + " AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadWrite) " + + "SELECT f.AD_Form_ID, " + roleClientOrgUser + + "FROM AD_Form f " + + "WHERE AccessLevel IN "; + + String sqlWorkflow = "INSERT INTO AD_WorkFlow_Access " + + "(AD_WorkFlow_ID, AD_Role_ID," + + " AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,IsReadWrite) " + + "SELECT w.AD_WorkFlow_ID, " + roleClientOrgUser + + "FROM AD_WorkFlow w " + + "WHERE AccessLevel IN "; + + /** + * Fill AD_xx_Access + * --------------------------------------------------------------------------- + * SCO# Levels S__ 100 4 System info + * SCO 111 7 System shared info + * SC_ 110 6 System/Client info + * _CO 011 3 Client shared info + * _C_ 011 2 Client + * __O 001 1 Organization info + * Roles: + * S 4,7,6 + * _CO 7,6,3,2,1 + * __O 3,1,7 + */ + String roleAccessLevel = null; + String roleAccessLevelWin = null; + if (USERLEVEL_System.equals(getUserLevel())) + roleAccessLevel = "('4','7','6')"; + else if (USERLEVEL_Client.equals(getUserLevel())) + roleAccessLevel = "('7','6','3','2')"; + else if (USERLEVEL_ClientPlusOrganization.equals(getUserLevel())) + roleAccessLevel = "('7','6','3','2','1')"; + else // if (USERLEVEL_Organization.equals(getUserLevel())) + { + roleAccessLevel = "('3','1','7')"; + roleAccessLevelWin = roleAccessLevel + + " AND w.Name NOT LIKE '%(all)%'"; + } + if (roleAccessLevelWin == null) + roleAccessLevelWin = roleAccessLevel; + // + String whereDel = " WHERE AD_Role_ID=" + getAD_Role_ID(); + // + int winDel = DB.executeUpdate("DELETE AD_Window_Access" + whereDel, get_TrxName()); + int win = DB.executeUpdate(sqlWindow + roleAccessLevelWin, get_TrxName()); + int procDel = DB.executeUpdate("DELETE AD_Process_Access" + whereDel, get_TrxName()); + int proc = DB.executeUpdate(sqlProcess + roleAccessLevel, get_TrxName()); + int formDel = DB.executeUpdate("DELETE AD_Form_Access" + whereDel, get_TrxName()); + int form = DB.executeUpdate(sqlForm + roleAccessLevel, get_TrxName()); + int wfDel = DB.executeUpdate("DELETE AD_WorkFlow_Access" + whereDel, get_TrxName()); + int wf = DB.executeUpdate(sqlWorkflow + roleAccessLevel, get_TrxName()); + + log.fine("AD_Window_ID=" + winDel + "+" + win + + ", AD_Process_ID=" + procDel + "+" + proc + + ", AD_Form_ID=" + formDel + "+" + form + + ", AD_Workflow_ID=" + wfDel + "+" + wf); + + loadAccess(true); + return "@AD_Window_ID@ #" + win + + " - @AD_Process_ID@ #" + proc + + " - @AD_Form_ID@ #" + form + + " - @AD_Workflow_ID@ #" + wf; + } // createAccessRecords + + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MRole["); + sb.append(getAD_Role_ID()).append(",").append(getName()) + .append(",UserLevel=").append(getUserLevel()) + .append(",").append(getClientWhere(false)) + .append(",").append(getOrgWhere(false)) + .append("]"); + return sb.toString(); + } // toString + + /** + * Extended String Representation + * @param ctx Properties + * @return extended info + */ + public String toStringX (Properties ctx) + { + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(ctx, "AD_Role_ID")).append("=").append(getName()) + .append(" - ").append(Msg.translate(ctx, "IsCanExport")).append("=").append(isCanExport()) + .append(" - ").append(Msg.translate(ctx, "IsCanReport")).append("=").append(isCanReport()) + .append(Env.NL).append(Env.NL); + // + for (int i = 0; i < m_orgAccess.length; i++) + sb.append(m_orgAccess[i].toString()).append(Env.NL); + sb.append(Env.NL); + // + loadTableAccess(false); + for (int i = 0; i < m_tableAccess.length; i++) + sb.append(m_tableAccess[i].toStringX(ctx)).append(Env.NL); + if (m_tableAccess.length > 0) + sb.append(Env.NL); + // + loadColumnAccess(false); + for (int i = 0; i < m_columnAccess.length; i++) + sb.append(m_columnAccess[i].toStringX(ctx)).append(Env.NL); + if (m_columnAccess.length > 0) + sb.append(Env.NL); + // + loadRecordAccess(false); + for (int i = 0; i < m_recordAccess.length; i++) + sb.append(m_recordAccess[i].toStringX(ctx)).append(Env.NL); + return sb.toString(); + } // toStringX + + + + /************************************************************************* + * Access Management + ************************************************************************/ + + /** User */ + private int m_AD_User_ID = -1; + + /** Positive List of Organizational Access */ + private OrgAccess[] m_orgAccess = null; + /** List of Table Access */ + private MTableAccess[] m_tableAccess = null; + /** List of Column Access */ + private MColumnAccess[] m_columnAccess = null; + /** List of Record Access */ + private MRecordAccess[] m_recordAccess = null; + /** List of Dependent Record Access */ + private MRecordAccess[] m_recordDependentAccess = null; + + /** Table Data Access Level */ + private HashMap m_tableAccessLevel = null; + /** Table Name */ + private HashMap m_tableName = null; + + /** Window Access */ + private HashMap m_windowAccess = null; + /** Process Access */ + private HashMap m_processAccess = null; + /** Task Access */ + private HashMap m_taskAccess = null; + /** Workflow Access */ + private HashMap m_workflowAccess = null; + /** Form Access */ + private HashMap m_formAccess = null; + + /** + * Set Logged in user + * @param AD_User_ID user requesting info + */ + public void setAD_User_ID(int AD_User_ID) + { + m_AD_User_ID = AD_User_ID; + } // setAD_User_ID + + /** + * Get Logged in user + * @return AD_User_ID user requesting info + */ + public int getAD_User_ID() + { + return m_AD_User_ID; + } // getAD_User_ID + + + /************************************************************************** + * Load Access Info + * @param reload re-load from disk + */ + public void loadAccess (boolean reload) + { + loadOrgAccess(reload); + loadTableAccess(reload); + loadTableInfo(reload); + loadColumnAccess(reload); + loadRecordAccess(reload); + if (reload) + { + m_windowAccess = null; + m_processAccess = null; + m_taskAccess = null; + m_workflowAccess = null; + m_formAccess = null; + } + } // loadAccess + + /** + * Load Org Access + * @param reload reload + */ + private void loadOrgAccess (boolean reload) + { + if (!(reload || m_orgAccess == null)) + return; + // + ArrayList list = new ArrayList(); + + if (isUseUserOrgAccess()) + loadOrgAccessUser(list); + else + loadOrgAccessRole(list); + + m_orgAccess = new OrgAccess[list.size()]; + list.toArray(m_orgAccess); + log.fine("#" + m_orgAccess.length + (reload ? " - reload" : "")); + if (Ini.isClient()) + { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < m_orgAccess.length; i++) + { + if (i > 0) + sb.append(","); + sb.append(m_orgAccess[i].AD_Org_ID); + } + Env.setContext(Env.getCtx(), "#User_Org", sb.toString()); + } + } // loadOrgAccess + + /** + * Load Org Access User + * @param list list + */ + private void loadOrgAccessUser(ArrayList list) + { + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_User_OrgAccess " + + "WHERE AD_User_ID=? AND IsActive='Y'"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_User_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + MUserOrgAccess oa = new MUserOrgAccess(getCtx(), rs, get_TrxName()); + loadOrgAccessAdd (list, new OrgAccess(oa.getAD_Client_ID(), oa.getAD_Org_ID(), oa.isReadOnly())); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // loadOrgAccessRole + + /** + * Load Org Access Role + * @param list list + */ + private void loadOrgAccessRole(ArrayList list) + { + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Role_OrgAccess " + + "WHERE AD_Role_ID=? AND IsActive='Y'"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + MRoleOrgAccess oa = new MRoleOrgAccess(getCtx(), rs, get_TrxName()); + loadOrgAccessAdd (list, new OrgAccess(oa.getAD_Client_ID(), oa.getAD_Org_ID(), oa.isReadOnly())); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // loadOrgAccessRole + + /** + * Load Org Access Add Tree to List + * @param list list + * @param oa org access + * @see org.compiere.util.Login + */ + private void loadOrgAccessAdd (ArrayList list, OrgAccess oa) + { + if (list.contains(oa)) + return; + list.add(oa); + // Do we look for trees? + if (getAD_Tree_Org_ID() == 0) + return; + MOrg org = MOrg.get(getCtx(), oa.AD_Org_ID); + if (!org.isSummary()) + return; + // Summary Org - Get Dependents + MTree_Base tree = MTree_Base.get(getCtx(), getAD_Tree_Org_ID(), get_TrxName()); + String sql = "SELECT AD_Client_ID, AD_Org_ID FROM AD_Org " + + "WHERE IsActive='Y' AND AD_Org_ID IN (SELECT Node_ID FROM " + + tree.getNodeTableName() + + " WHERE AD_Tree_ID=? AND Parent_ID=? AND IsActive='Y')"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt(2, org.getAD_Org_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + int AD_Client_ID = rs.getInt(1); + int AD_Org_ID = rs.getInt(2); + loadOrgAccessAdd (list, new OrgAccess(AD_Client_ID, AD_Org_ID, oa.readOnly)); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // loadOrgAccessAdd + + + /** + * Load Table Access + * @param reload reload + */ + private void loadTableAccess(boolean reload) + { + if (m_tableAccess != null && !reload) + return; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Table_Access " + + "WHERE AD_Role_ID=? AND IsActive='Y'"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MTableAccess(getCtx(), rs, get_TrxName())); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + m_tableAccess = new MTableAccess[list.size()]; + list.toArray(m_tableAccess); + log.fine("#" + m_tableAccess.length); + } // loadTableAccess + + /** + * Load Table Access and Name + * @param reload reload + */ + private void loadTableInfo (boolean reload) + { + if (m_tableAccessLevel != null && m_tableName != null && !reload) + return; + m_tableAccessLevel = new HashMap(300); + m_tableName = new HashMap(300); + PreparedStatement pstmt = null; + String sql = "SELECT AD_Table_ID, AccessLevel, TableName " + + "FROM AD_Table WHERE IsActive='Y'"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + Integer ii = new Integer(rs.getInt(1)); + m_tableAccessLevel.put(ii, rs.getString(2)); + m_tableName.put(rs.getString(3), ii); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + log.fine("#" + m_tableAccessLevel.size()); + } // loadTableAccessLevel + + + /** + * Load Column Access + * @param reload reload + */ + private void loadColumnAccess(boolean reload) + { + if (m_columnAccess != null && !reload) + return; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Column_Access " + + "WHERE AD_Role_ID=? AND IsActive='Y'"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new MColumnAccess(getCtx(), rs, get_TrxName())); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + m_columnAccess = new MColumnAccess[list.size()]; + list.toArray(m_columnAccess); + log.fine("#" + m_columnAccess.length); + } // loadColumnAccess + + /** + * Load Record Access + * @param reload reload + */ + private void loadRecordAccess(boolean reload) + { + if (!(reload || m_recordAccess == null || m_recordDependentAccess == null)) + return; + ArrayList list = new ArrayList(); + ArrayList dependent = new ArrayList(); + PreparedStatement pstmt = null; + String sql = "SELECT * FROM AD_Record_Access " + + "WHERE AD_Role_ID=? AND IsActive='Y' ORDER BY AD_Table_ID"; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + MRecordAccess ra = new MRecordAccess(getCtx(), rs, get_TrxName()); + list.add(ra); + if (ra.isDependentEntities()) + dependent.add(ra); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + m_recordAccess = new MRecordAccess[list.size()]; + list.toArray(m_recordAccess); + m_recordDependentAccess = new MRecordAccess[dependent.size()]; + dependent.toArray(m_recordDependentAccess); + log.fine("#" + m_recordAccess.length + " - Dependent #" + m_recordDependentAccess.length); + } // loadRecordAccess + + + /************************************************************************** + * Get Client Where Clause Value + * @param rw read write + * @return "AD_Client_ID=0" or "AD_Client_ID IN(0,1)" + */ + public String getClientWhere (boolean rw) + { + // All Orgs - use Client of Role + if (isAccessAllOrgs()) + { + if (rw || getAD_Client_ID() == 0) + return "AD_Client_ID=" + getAD_Client_ID(); + return "AD_Client_ID IN (0," + getAD_Client_ID() + ")"; + } + + // Get Client from Org List + loadOrgAccess (false); + // Unique Strings + HashSet set = new HashSet(); + if (!rw) + set.add("0"); + // Positive List + for (int i = 0; i < m_orgAccess.length; i++) + set.add(String.valueOf(m_orgAccess[i].AD_Client_ID)); + // + StringBuffer sb = new StringBuffer(); + Iterator it = set.iterator(); + boolean oneOnly = true; + while (it.hasNext()) + { + if (sb.length() > 0) + { + sb.append(","); + oneOnly = false; + } + sb.append(it.next()); + } + if (oneOnly) + { + if (sb.length() > 0) + return "AD_Client_ID=" + sb.toString(); + else + { + log.log(Level.SEVERE, "No Access Org records"); + return "AD_Client_ID=-1"; // No Access Record + } + } + return "AD_Client_ID IN(" + sb.toString() + ")"; + } // getClientWhereValue + + /** + * Access to Client + * @param AD_Client_ID client + * @param rw read write access + * @return true if access + */ + public boolean isClientAccess(int AD_Client_ID, boolean rw) + { + if (AD_Client_ID == 0 && !rw) // can always read System + return true; + loadOrgAccess(false); + // Positive List + for (int i = 0; i < m_orgAccess.length; i++) + { + if (m_orgAccess[i].AD_Client_ID == AD_Client_ID) + { + if (!rw) + return true; + if (!m_orgAccess[i].readOnly) // rw + return true; + } + } + return false; + } // isClientAccess + + /** + * Get Org Where Clause Value + * @param rw read write + * @return "AD_Org_ID=0" or "AD_Org_ID IN(0,1)" or null (if access all org) + */ + public String getOrgWhere (boolean rw) + { + if (isAccessAllOrgs()) + return null; + loadOrgAccess(false); + // Unique Strings + HashSet set = new HashSet(); + if (!rw) + set.add("0"); + // Positive List + for (int i = 0; i < m_orgAccess.length; i++) + { + if (!rw) + set.add(String.valueOf(m_orgAccess[i].AD_Org_ID)); + else if (!m_orgAccess[i].readOnly) // rw + set.add(String.valueOf(m_orgAccess[i].AD_Org_ID)); + } + // + StringBuffer sb = new StringBuffer(); + Iterator it = set.iterator(); + boolean oneOnly = true; + while (it.hasNext()) + { + if (sb.length() > 0) + { + sb.append(","); + oneOnly = false; + } + sb.append(it.next()); + } + if (oneOnly) + { + if (sb.length() > 0) + return "AD_Org_ID=" + sb.toString(); + else + { + log.log(Level.SEVERE, "No Access Org records"); + return "AD_Org_ID=-1"; // No Access Record + } + } + return "AD_Org_ID IN(" + sb.toString() + ")"; + } // getOrgWhereValue + + /** + * Access to Org + * @param AD_Org_ID org + * @param rw read write access + * @return true if access + */ + public boolean isOrgAccess(int AD_Org_ID, boolean rw) + { + if (isAccessAllOrgs()) + return true; + if (AD_Org_ID == 0 && !rw) // can always read common org + return true; + loadOrgAccess(false); + + // Positive List + for (int i = 0; i < m_orgAccess.length; i++) + { + if (m_orgAccess[i].AD_Org_ID == AD_Org_ID) + { + if (!rw) + return true; + if (!m_orgAccess[i].readOnly) // rw + return true; + return false; + } + } + return false; + } // isOrgAccess + + + /** + * Can Report on table + * @param AD_Table_ID table + * @return true if access + */ + public boolean isCanReport (int AD_Table_ID) + { + if (!isCanReport()) // Role Level block + { + log.warning ("Role denied"); + return false; + } + if (!isTableAccess(AD_Table_ID, true)) // No R/O Access to Table + return false; + // + boolean canReport = true; + for (int i = 0; i < m_tableAccess.length; i++) + { + if (!MTableAccess.ACCESSTYPERULE_Reporting.equals(m_tableAccess[i].getAccessTypeRule())) + continue; + if (m_tableAccess[i].isExclude()) // Exclude + { + if (m_tableAccess[i].getAD_Table_ID() == AD_Table_ID) + { + canReport = m_tableAccess[i].isCanReport(); + log.fine("Exclude " + AD_Table_ID + " - " + canReport); + return canReport; + } + } + else // Include + { + canReport = false; + if (m_tableAccess[i].getAD_Table_ID() == AD_Table_ID) + { + canReport = m_tableAccess[i].isCanReport(); + log.fine("Include " + AD_Table_ID + " - " + canReport); + return canReport; + } + } + } // for all Table Access + log.fine(AD_Table_ID + " - " + canReport); + return canReport; + } // isCanReport + + /** + * Can Export Table + * @param AD_Table_ID + * @return true if access + */ + public boolean isCanExport (int AD_Table_ID) + { + if (!isCanExport()) // Role Level block + { + log.warning ("Role denied"); + return false; + } + if (!isTableAccess(AD_Table_ID, true)) // No R/O Access to Table + return false; + if (!isCanReport (AD_Table_ID)) // We cannot Export if we cannot report + return false; + // + boolean canExport = true; + for (int i = 0; i < m_tableAccess.length; i++) + { + if (!MTableAccess.ACCESSTYPERULE_Exporting.equals(m_tableAccess[i].getAccessTypeRule())) + continue; + if (m_tableAccess[i].isExclude()) // Exclude + { + canExport = m_tableAccess[i].isCanExport(); + log.fine("Exclude " + AD_Table_ID + " - " + canExport); + return canExport; + } + else // Include + { + canExport = false; + canExport = m_tableAccess[i].isCanExport(); + log.fine("Include " + AD_Table_ID + " - " + canExport); + return canExport; + } + } // for all Table Access + log.fine(AD_Table_ID + " - " + canExport); + return canExport; + } // isCanExport + + /** + * Access to Table + * @param AD_Table_ID table + * @param ro check read only access otherwise read write access level + * @return has RO/RW access to table + */ + public boolean isTableAccess (int AD_Table_ID, boolean ro) + { + if (!isTableAccessLevel (AD_Table_ID, ro)) // Role Based Access + return false; + loadTableAccess(false); + // + boolean hasAccess = true; // assuming exclusive rule + for (int i = 0; i < m_tableAccess.length; i++) + { + if (!MTableAccess.ACCESSTYPERULE_Accessing.equals(m_tableAccess[i].getAccessTypeRule())) + continue; + if (m_tableAccess[i].isExclude()) // Exclude + // If you Exclude Access to a table and select Read Only, + // you can only read data (otherwise no access). + { + if (m_tableAccess[i].getAD_Table_ID() == AD_Table_ID) + { + if (ro) + hasAccess = m_tableAccess[i].isReadOnly(); + else + hasAccess = false; + log.fine("Exclude AD_Table_ID=" + AD_Table_ID + + " (ro=" + ro + ",TableAccessRO=" + m_tableAccess[i].isReadOnly() + ") = " + hasAccess); + return hasAccess; + } + } + else // Include + // If you Include Access to a table and select Read Only, + // you can only read data (otherwise full access). + { + hasAccess = false; + if (m_tableAccess[i].getAD_Table_ID() == AD_Table_ID) + { + if (!ro) // rw only if not r/o + hasAccess = !m_tableAccess[i].isReadOnly(); + else + hasAccess = true; + log.fine("Include AD_Table_ID=" + AD_Table_ID + + " (ro=" + ro + ",TableAccessRO=" + m_tableAccess[i].isReadOnly() + ") = " + hasAccess); + return hasAccess; + } + } + } // for all Table Access + if (!hasAccess) + log.fine("AD_Table_ID=" + AD_Table_ID + + "(ro=" + ro + ") = " + hasAccess); + return hasAccess; + } // isTableAccess + + /** + * Access to Table based on Role User Level Table Access Level + * @param AD_Table_ID table + * @param ro check read only access otherwise read write access level + * @return has RO/RW access to table + */ + public boolean isTableAccessLevel (int AD_Table_ID, boolean ro) + { + if (ro) // role can always read + return true; + // + loadTableInfo(false); + // AccessLevel + // 1 = Org - 2 = Client - 4 = System + // 3 = Org+Client - 6 = Client+System - 7 = All + String roleAccessLevel = (String)m_tableAccessLevel.get(new Integer(AD_Table_ID)); + if (roleAccessLevel == null) + { + log.fine("NO - No AccessLevel - AD_Table_ID=" + AD_Table_ID); + return false; + } + // Access to all User Levels + if (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_All)) + return true; + // User Level = SCO + String userLevel = getUserLevel(); + // + if (userLevel.charAt(0) == 'S' + && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemOnly) + || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemPlusClient))) + return true; + if (userLevel.charAt(1) == 'C' + && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientOnly) + || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_SystemPlusClient))) + return true; + if (userLevel.charAt(2) == 'O' + && (roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_Organization) + || roleAccessLevel.equals(X_AD_Table.ACCESSLEVEL_ClientPlusOrganization))) + return true; + log.fine("NO - AD_Table_ID=" + AD_Table_ID + + ", UserLevel=" + userLevel + ", AccessLevel=" + roleAccessLevel); + return false; + } // isTableAccessLevel + + + /** + * Access to Column + * @param AD_Table_ID table + * @param AD_Column_ID column + * @param ro read only + * @return true if access + */ + public boolean isColumnAccess (int AD_Table_ID, int AD_Column_ID, boolean ro) + { + if (!isTableAccess(AD_Table_ID, ro)) // No Access to Table + return false; + loadColumnAccess(false); + + boolean retValue = true; // assuming exclusive + for (int i = 0; i < m_columnAccess.length; i++) + { + if (m_columnAccess[i].isExclude()) // Exclude + // If you Exclude Access to a column and select Read Only, + // you can only read data (otherwise no access). + { + if (m_columnAccess[i].getAD_Table_ID() == AD_Table_ID + && m_columnAccess[i].getAD_Column_ID() == AD_Column_ID) + { + if (ro) // just R/O Access requested + retValue = m_columnAccess[i].isReadOnly(); + else + retValue = false; + if (!retValue) + log.fine("Exclude AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + + " (ro=" + ro + ",ColumnAccessRO=" + m_columnAccess[i].isReadOnly() + ") = " + retValue); + return retValue; + } + } + else // Include + // If you Include Access to a column and select Read Only, + // you can only read data (otherwise full access). + { + if (m_columnAccess[i].getAD_Table_ID() == AD_Table_ID) + { + retValue = false; + if (m_columnAccess[i].getAD_Column_ID() == AD_Column_ID) + { + if (!ro) // rw only if not r/o + retValue = !m_columnAccess[i].isReadOnly(); + else + retValue = true; + if (!retValue) + log.fine("Include AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + + " (ro=" + ro + ",ColumnAccessRO=" + m_columnAccess[i].isReadOnly() + ") = " + retValue); + return retValue; + } + } // same table + } // include + } // for all Table Access + if (!retValue) + log.fine("AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + + " (ro=" + ro + ") = " + retValue); + return retValue; + } // isColumnAccess + + /** + * Access to Record (no check of table) + * @param AD_Table_ID table + * @param Record_ID record + * @param ro read only + * @return boolean + */ + public boolean isRecordAccess (int AD_Table_ID, int Record_ID, boolean ro) + { + // if (!isTableAccess(AD_Table_ID, ro)) // No Access to Table + // return false; + loadRecordAccess(false); + boolean negativeList = true; + for (int i = 0; i < m_recordAccess.length; i++) + { + MRecordAccess ra = m_recordAccess[i]; + if (ra.getAD_Table_ID() != AD_Table_ID) + continue; + + if (ra.isExclude()) // Exclude + // If you Exclude Access to a column and select Read Only, + // you can only read data (otherwise no access). + { + if (ra.getRecord_ID() == Record_ID) + { + if (ro) + return ra.isReadOnly(); + else + return false; + } + } + else // Include + // If you Include Access to a column and select Read Only, + // you can only read data (otherwise full access). + { + negativeList = false; // has to be defined + if (ra.getRecord_ID() == Record_ID) + { + if (!ro) + return !ra.isReadOnly(); + else // ro + return true; + } + } + } // for all Table Access + return negativeList; + } // isRecordAccess + + /** + * Get Window Access + * @param AD_Window_ID window + * @return null in no access, TRUE if r/w and FALSE if r/o + */ + public Boolean getWindowAccess (int AD_Window_ID) + { + if (m_windowAccess == null) + { + m_windowAccess = new HashMap(100); + String sql = "SELECT AD_Window_ID, IsReadWrite FROM AD_Window_Access WHERE AD_Role_ID=? AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + m_windowAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + log.fine("#" + m_windowAccess.size()); + } // reload + Boolean retValue = (Boolean)m_windowAccess.get(new Integer(AD_Window_ID)); + // log.fine("getWindowAccess - AD_Window_ID=" + AD_Window_ID + " - " + retValue); + return retValue; + } // getWindowAccess + + /** + * Get Process Access + * @param AD_Process_ID process + * @return null in no access, TRUE if r/w and FALSE if r/o + */ + public Boolean getProcessAccess (int AD_Process_ID) + { + if (m_processAccess == null) + { + m_processAccess = new HashMap(50); + String sql = "SELECT AD_Process_ID, IsReadWrite FROM AD_Process_Access WHERE AD_Role_ID=? AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + m_processAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // reload + return (Boolean)m_processAccess.get(new Integer(AD_Process_ID)); + } // getProcessAccess + + /** + * Get Task Access + * @param AD_Task_ID task + * @return null in no access, TRUE if r/w and FALSE if r/o + */ + public Boolean getTaskAccess (int AD_Task_ID) + { + if (m_taskAccess == null) + { + m_taskAccess = new HashMap(10); + String sql = "SELECT AD_Task_ID, IsReadWrite FROM AD_Task_Access " + + "WHERE AD_Role_ID=? AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + m_taskAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // reload + return (Boolean)m_taskAccess.get(new Integer(AD_Task_ID)); + } // getTaskAccess + + /** + * Get Form Access + * @param AD_Form_ID form + * @return null in no access, TRUE if r/w and FALSE if r/o + */ + public Boolean getFormAccess (int AD_Form_ID) + { + if (m_formAccess == null) + { + m_formAccess = new HashMap(20); + String sql = "SELECT AD_Form_ID, IsReadWrite FROM AD_Form_Access " + + "WHERE AD_Role_ID=? AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + m_formAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // reload + return (Boolean)m_formAccess.get(new Integer(AD_Form_ID)); + } // getTaskAccess + + /** + * Get Workflow Access + * @param AD_Workflow_ID workflow + * @return null in no access, TRUE if r/w and FALSE if r/o + */ + public Boolean getWorkflowAccess (int AD_Workflow_ID) + { + if (m_workflowAccess == null) + { + m_workflowAccess = new HashMap(20); + String sql = "SELECT AD_Workflow_ID, IsReadWrite FROM AD_Workflow_Access " + + "WHERE AD_Role_ID=? AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + m_workflowAccess.put(new Integer(rs.getInt(1)), new Boolean("Y".equals(rs.getString(2)))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // reload + return (Boolean)m_workflowAccess.get(new Integer(AD_Workflow_ID)); + } // getTaskAccess + + + /************************************************************************* + * Appends where clause to SQL statement for Table + * + * @param SQL existing SQL statement + * @param TableNameIn Table Name or list of table names AAA, BBB or AAA a, BBB b + * @param fullyQualified fullyQualified names + * @param rw if false, includes System Data + * @return updated SQL statement + */ + public String addAccessSQL (String SQL, String TableNameIn, + boolean fullyQualified, boolean rw) + { + StringBuffer retSQL = new StringBuffer(); + + // Cut off last ORDER BY clause + String orderBy = ""; + int posOrder = SQL.lastIndexOf(" ORDER BY "); + if (posOrder != -1) + { + orderBy = SQL.substring(posOrder); + retSQL.append(SQL.substring(0, posOrder)); + } + else + retSQL.append(SQL); + + // Parse SQL + AccessSqlParser asp = new AccessSqlParser(retSQL.toString()); + AccessSqlParser.TableInfo[] ti = asp.getTableInfo(asp.getMainSqlIndex()); + + // Do we have to add WHERE or AND + if (asp.getMainSql().indexOf(" WHERE ") == -1) + retSQL.append(" WHERE "); + else + retSQL.append(" AND "); + + // Use First Table + String tableName = ""; + if (ti.length > 0) + { + tableName = ti[0].getSynonym(); + if (tableName.length() == 0) + tableName = ti[0].getTableName(); + } + if (TableNameIn != null && !tableName.equals(TableNameIn)) + { + String msg = "TableName not correctly parsed - TableNameIn=" + + TableNameIn + " - " + asp; + if (ti.length > 0) + msg += " - #1 " + ti[0]; + msg += "\n = " + SQL; + log.log(Level.SEVERE, msg); + Trace.printStack(); + tableName = TableNameIn; + } + + // Client Access + if (fullyQualified) + retSQL.append(tableName).append("."); + retSQL.append(getClientWhere(rw)); + + // Org Access + if (!isAccessAllOrgs()) + { + retSQL.append(" AND "); + if (fullyQualified) + retSQL.append(tableName).append("."); + retSQL.append(getOrgWhere(rw)); + } + + // ** Data Access ** + for (int i = 0; i < ti.length; i++) + { + String TableName = ti[i].getTableName(); + int AD_Table_ID = getAD_Table_ID (TableName); + // Data Table Access + if (AD_Table_ID != 0 && !isTableAccess(AD_Table_ID, !rw)) + { + retSQL.append(" AND 1=3"); // prevent access at all + log.fine("No access to AD_Table_ID=" + AD_Table_ID + + " - " + TableName + " - " + retSQL); + break; // no need to check further + } + + // Data Column Access + + + + // Data Record Access + String keyColumnName = ""; + if (fullyQualified) + { + keyColumnName = ti[i].getSynonym(); // table synonym + if (keyColumnName.length() == 0) + keyColumnName = TableName; + keyColumnName += "."; + } + keyColumnName += TableName + "_ID"; // derived from table + + // log.fine("addAccessSQL - " + TableName + "(" + AD_Table_ID + ") " + keyColumnName); + String recordWhere = getRecordWhere (AD_Table_ID, keyColumnName, rw); + if (recordWhere.length() > 0) + { + retSQL.append(" AND ").append(recordWhere); + log.finest("Record access - " + recordWhere); + } + } // for all table info + + // Dependent Records (only for main SQL) + String mainSql = asp.getMainSql(); + loadRecordAccess(false); + int AD_Table_ID = 0; + String whereColumnName = null; + ArrayList includes = new ArrayList(); + ArrayList excludes = new ArrayList(); + for (int i = 0; i < m_recordDependentAccess.length; i++) + { + String columnName = m_recordDependentAccess[i].getKeyColumnName + (asp.getTableInfo(asp.getMainSqlIndex()) ); + if (columnName == null) + continue; // no key column + int posColumn = mainSql.indexOf(columnName); + if (posColumn == -1) + continue; + // we found the column name - make sure it's a clumn name + char charCheck = mainSql.charAt(posColumn-1); // before + if (!(charCheck == ',' || charCheck == '.' || charCheck == ' ' || charCheck == '(')) + continue; + charCheck = mainSql.charAt(posColumn+columnName.length()); // after + if (!(charCheck == ',' || charCheck == ' ' || charCheck == ')')) + continue; + + if (AD_Table_ID != 0 && AD_Table_ID != m_recordDependentAccess[i].getAD_Table_ID()) + retSQL.append(getDependentAccess(whereColumnName, includes, excludes)); + + AD_Table_ID = m_recordDependentAccess[i].getAD_Table_ID(); + // *** we found the column in the main query + if (m_recordDependentAccess[i].isExclude()) + { + excludes.add(m_recordDependentAccess[i].getRecord_ID()); + log.fine("Exclude " + columnName + " - " + m_recordDependentAccess[i]); + } + else if (!rw || !m_recordDependentAccess[i].isReadOnly()) + { + includes.add(m_recordDependentAccess[i].getRecord_ID()); + log.fine("Include " + columnName + " - " + m_recordDependentAccess[i]); + } + whereColumnName = getDependentRecordWhereColumn (mainSql, columnName); + } // for all dependent records + retSQL.append(getDependentAccess(whereColumnName, includes, excludes)); + // + retSQL.append(orderBy); + log.finest(retSQL.toString()); + return retSQL.toString(); + } // addAccessSQL + + /** + * Get Dependent Access + * @param whereColumnName column + * @param includes ids to include + * @param excludes ids to exclude + * @return where clause starting with AND or "" + */ + private String getDependentAccess(String whereColumnName, + ArrayList includes, ArrayList excludes) + { + if (includes.size() == 0 && excludes.size() == 0) + return ""; + if (includes.size() != 0 && excludes.size() != 0) + log.warning("Mixing Include and Excluse rules - Will not return values"); + + StringBuffer where = new StringBuffer(" AND "); + if (includes.size() == 1) + where.append(whereColumnName).append("=").append(includes.get(0)); + else if (includes.size() > 1) + { + where.append(whereColumnName).append(" IN ("); + for (int ii = 0; ii < includes.size(); ii++) + { + if (ii > 0) + where.append(","); + where.append(includes.get(ii)); + } + where.append(")"); + } + else if (excludes.size() == 1) + where.append(whereColumnName).append("<>").append(excludes.get(0)); + else if (excludes.size() > 1) + { + where.append(whereColumnName).append(" NOT IN ("); + for (int ii = 0; ii < excludes.size(); ii++) + { + if (ii > 0) + where.append(","); + where.append(excludes.get(ii)); + } + where.append(")"); + } + log.finest(where.toString()); + return where.toString(); + } // getDependentAccess + + + /** + * Get Dependent Record Where clause + * @param mainSql sql to examine + * @param columnName columnName + * @return where clause column "x.columnName" + */ + private String getDependentRecordWhereColumn (String mainSql, String columnName) + { + String retValue = columnName; // if nothing else found + int index = mainSql.indexOf(columnName); + // see if there are table synonym + int offset = index - 1; + char c = mainSql.charAt(offset); + if (c == '.') + { + StringBuffer sb = new StringBuffer(); + while (c != ' ' && c != ',' && c != '(') // delimeter + { + sb.insert(0, c); + c = mainSql.charAt(--offset); + } + sb.append(columnName); + return sb.toString(); + } + return retValue; + } // getDependentRecordWhereColumn + + + + /** + * UPADATE - Can I Update the record. + * Access error info (AccessTableNoUpdate) is saved in the log + * + * @param AD_Client_ID comntext to derive client/org/user level + * @param AD_Org_ID number of the current window to retrieve context + * @param AD_Table_ID table + * @param Record_ID record id + * @param createError boolean + * @return true if you can update + * see org.compiere.model.MTable#dataSave(boolean) + **/ + public boolean canUpdate (int AD_Client_ID, int AD_Org_ID, + int AD_Table_ID, int Record_ID, boolean createError) + { + String userLevel = getUserLevel(); // Format 'SCO' + + if (userLevel.indexOf("S") != -1) // System cannot change anything + return true; + + boolean retValue = true; + String whatMissing = ""; + + // System == Client=0 & Org=0 + if (AD_Client_ID == 0 && AD_Org_ID == 0 + && userLevel.charAt(0) != 'S') + { + retValue = false; + whatMissing += "S"; + } + + // Client == Client!=0 & Org=0 + else if (AD_Client_ID != 0 && AD_Org_ID == 0 + && userLevel.charAt(1) != 'C') + { + if (userLevel.charAt(2) == 'O' && isOrgAccess(AD_Org_ID, true)) + ; // Client+Org with access to * + else + { + retValue = false; + whatMissing += "C"; + } + } + + // Organization == Client!=0 & Org!=0 + else if (AD_Client_ID != 0 && AD_Org_ID != 0 + && userLevel.charAt(2) != 'O') + { + retValue = false; + whatMissing += "O"; + } + + // Data Access + if (retValue) + retValue = isTableAccess(AD_Table_ID, false); + + if (retValue && Record_ID != 0) + retValue = isRecordAccess(AD_Table_ID, Record_ID, false); + + if (!retValue && createError) + { + log.saveError("AccessTableNoUpdate", + "AD_Client_ID=" + AD_Client_ID + + ", AD_Org_ID=" + AD_Org_ID + ", UserLevel=" + userLevel + + " => missing=" + whatMissing); + log.warning (toString()); + } + return retValue; + } // canUpdate + + /** + * VIEW - Can I view record in Table with given TableLevel. + * + * TableLevel S__ 100 4 System info + * SCO 111 7 System shared info + * SC_ 110 6 System/Client info + * _CO 011 3 Client shared info + * _C_ 011 2 Client shared info + * __O 001 1 Organization info + * + * + * @param ctx context + * @param TableLevel AccessLevel + * @return true/false + * Access error info (AccessTableNoUpdate, AccessTableNoView) is saved in the log + * see org.compiere.model.MTabVO#loadTabDetails(MTabVO, ResultSet) + **/ + public boolean canView(Properties ctx, String TableLevel) + { + String userLevel = getUserLevel(); // Format 'SCO' + + boolean retValue = true; + + // 7 - All + if (X_AD_Table.ACCESSLEVEL_All.equals(TableLevel)) + retValue = true; + + // 4 - System data requires S + else if (X_AD_Table.ACCESSLEVEL_SystemOnly.equals(TableLevel) + && userLevel.charAt(0) != 'S') + retValue = false; + + // 2 - Client data requires C + else if (X_AD_Table.ACCESSLEVEL_ClientOnly.equals(TableLevel) + && userLevel.charAt(1) != 'C') + retValue = false; + + // 1 - Organization data requires O + else if (X_AD_Table.ACCESSLEVEL_Organization.equals(TableLevel) + && userLevel.charAt(2) != 'O') + retValue = false; + + // 3 - Client Shared requires C or O + else if (X_AD_Table.ACCESSLEVEL_ClientPlusOrganization.equals(TableLevel) + && (!(userLevel.charAt(1) == 'C' || userLevel.charAt(2) == 'O')) ) + retValue = false; + + // 6 - System/Client requires S or C + else if (X_AD_Table.ACCESSLEVEL_SystemPlusClient.equals(TableLevel) + && (!(userLevel.charAt(0) == 'S' || userLevel.charAt(1) == 'C')) ) + retValue = false; + + if (retValue) + return retValue; + + // Notification + /** + if (forInsert) + log.saveError("AccessTableNoUpdate", + "(Required=" + TableLevel + "(" + + getTableLevelString(Env.getAD_Language(ctx), TableLevel) + + ") != UserLevel=" + userLevel); + else + **/ + log.saveError("AccessTableNoView", + "Required=" + TableLevel + "(" + + getTableLevelString(Env.getAD_Language(ctx), TableLevel) + + ") != UserLevel=" + userLevel); + log.info (toString()); + return retValue; + } // canView + + + /** + * Returns clear text String of TableLevel + * @param AD_Language language + * @param TableLevel level + * @return info + */ + private String getTableLevelString (String AD_Language, String TableLevel) + { + String level = TableLevel + "??"; + if (TableLevel.equals("1")) + level = "AccessOrg"; + else if (TableLevel.equals("2")) + level = "AccessClient"; + else if (TableLevel.equals("3")) + level = "AccessClientOrg"; + else if (TableLevel.equals("4")) + level = "AccessSystem"; + else if (TableLevel.equals("6")) + level = "AccessSystemClient"; + else if (TableLevel.equals("7")) + level = "AccessShared"; + + return Msg.getMsg(AD_Language, level); + } // getTableLevelString + + /** + * Get Table ID from name + * @param tableName table name + * @return AD_Table_ID or 0 + */ + private int getAD_Table_ID (String tableName) + { + loadTableInfo(false); + Integer ii = (Integer)m_tableName.get(tableName); + if (ii != null) + return ii.intValue(); + // log.log(Level.WARNING,"getAD_Table_ID - not found (" + tableName + ")"); + return 0; + } // getAD_Table_ID + + /** + * Return Where clause for Record Access + * @param AD_Table_ID table + * @param keyColumnName (fully qualified) key column name + * @param rw true if read write + * @return where clause or "" + */ + private String getRecordWhere (int AD_Table_ID, String keyColumnName, boolean rw) + { + loadRecordAccess(false); + // + StringBuffer sbInclude = new StringBuffer(); + StringBuffer sbExclude = new StringBuffer(); + // Role Access + for (int i = 0; i < m_recordAccess.length; i++) + { + if (m_recordAccess[i].getAD_Table_ID() == AD_Table_ID) + { + // NOT IN (x) + if (m_recordAccess[i].isExclude()) + { + if (sbExclude.length() == 0) + sbExclude.append(keyColumnName) + .append(" NOT IN ("); + else + sbExclude.append(","); + sbExclude.append(m_recordAccess[i].getRecord_ID()); + } + // IN (x) + else if (!rw || !m_recordAccess[i].isReadOnly()) // include + { + if (sbInclude.length() == 0) + sbInclude.append(keyColumnName) + .append(" IN ("); + else + sbInclude.append(","); + sbInclude.append(m_recordAccess[i].getRecord_ID()); + } + } + } // for all Table Access + + StringBuffer sb = new StringBuffer(); + if (sbExclude.length() > 0) + sb.append(sbExclude).append(")"); + if (sbInclude.length() > 0) + { + if (sb.length() > 0) + sb.append(" AND "); + sb.append(sbInclude).append(")"); + } + + // Don't ignore Privacy Access + if (!isPersonalAccess()) + { + String lockedIDs = MPrivateAccess.getLockedRecordWhere(AD_Table_ID, m_AD_User_ID); + if (lockedIDs != null) + { + if (sb.length() > 0) + sb.append(" AND "); + sb.append(keyColumnName).append(lockedIDs); + } + } + // + return sb.toString(); + } // getRecordWhere + + /** + * Show (Value) Preference Menu + * @return true if preference type is not None + */ + public boolean isShowPreference() + { + return !MRole.PREFERENCETYPE_None.equals(getPreferenceType()); + } // isShowPreference + + /** + * Org Access Summary + */ + class OrgAccess + { + /** + * Org Access constructor + * @param ad_Client_ID client + * @param ad_Org_ID org + * @param readonly r/o + */ + public OrgAccess (int ad_Client_ID, int ad_Org_ID, boolean readonly) + { + this.AD_Client_ID = ad_Client_ID; + this.AD_Org_ID = ad_Org_ID; + this.readOnly = readonly; + } + /** Client */ + public int AD_Client_ID = 0; + /** Organization */ + public int AD_Org_ID = 0; + /** Read Only */ + public boolean readOnly = true; + + + /** + * Equals + * @param obj object to compare + * @return true if equals + */ + public boolean equals (Object obj) + { + if (obj != null && obj instanceof OrgAccess) + { + OrgAccess comp = (OrgAccess)obj; + return comp.AD_Client_ID == AD_Client_ID + && comp.AD_Org_ID == AD_Org_ID; + } + return false; + } // equals + + + /** + * Hash Code + * @return hash Code + */ + public int hashCode () + { + return (AD_Client_ID*7) + AD_Org_ID; + } // hashCode + + /** + * Extended String Representation + * @return extended info + */ + public String toString () + { + String clientName = "System"; + if (AD_Client_ID != 0) + clientName = MClient.get(getCtx(), AD_Client_ID).getName(); + String orgName = "*"; + if (AD_Org_ID != 0) + orgName = MOrg.get(getCtx(), AD_Org_ID).getName(); + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(getCtx(), "AD_Client_ID")).append("=") + .append(clientName).append(" - ") + .append(Msg.translate(getCtx(), "AD_Org_ID")).append("=") + .append(orgName); + if (readOnly) + sb.append(" r/o"); + return sb.toString(); + } // toString + + } // OrgAccess + +} // MRole diff --git a/dbPort/src/org/compiere/model/MRoleOrgAccess.java b/dbPort/src/org/compiere/model/MRoleOrgAccess.java new file mode 100644 index 0000000000..4817f2992b --- /dev/null +++ b/dbPort/src/org/compiere/model/MRoleOrgAccess.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Role Org Access Model + * + * @author Jorg Janke + * @version $Id: MRoleOrgAccess.java,v 1.3 2006/07/30 00:58:38 jjanke Exp $ + */ +public class MRoleOrgAccess extends X_AD_Role_OrgAccess +{ + /** + * Get Organizational Access of Role + * @param ctx context + * @param AD_Role_ID role + * @return array of Role Org Access + */ + public static MRoleOrgAccess[] getOfRole (Properties ctx, int AD_Role_ID) + { + return get (ctx, "SELECT * FROM AD_Role_OrgAccess WHERE AD_Role_ID=?", AD_Role_ID); + } // getOfRole + + /** + * Get Organizational Access of Client + * @param ctx context + * @param AD_Client_ID client + * @return array of Role Org Access + */ + public static MRoleOrgAccess[] getOfClient (Properties ctx, int AD_Client_ID) + { + return get (ctx, "SELECT * FROM AD_Role_OrgAccess WHERE AD_Client_ID=?", AD_Client_ID); + } // getOfClient + + /** + * Get Organizational Access of Org + * @param ctx context + * @param AD_Org_ID role + * @return array of Role Org Access + */ + public static MRoleOrgAccess[] getOfOrg (Properties ctx, int AD_Org_ID) + { + return get (ctx, "SELECT * FROM AD_Role_OrgAccess WHERE AD_Org_ID=?", AD_Org_ID); + } // getOfOrg + + /** + * Get Organizational Info + * @param ctx context + * @param sql sql command + * @param id id + * @return array of Role Org Access + */ + private static MRoleOrgAccess[] get (Properties ctx, String sql, int id) + { + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, id); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MRoleOrgAccess(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MRoleOrgAccess[] retValue = new MRoleOrgAccess[list.size ()]; + list.toArray (retValue); + return retValue; + } // get + + /** + * Create Organizational Access for all Automatic Roles + * @param org org + * @return true if created + */ + public static boolean createForOrg (MOrg org) + { + int counter = 0; + MRole[] roles = MRole.getOfClient(org.getCtx()); + for (int i = 0; i < roles.length; i++) + { + if (!roles[i].isManual()) + { + MRoleOrgAccess orgAccess = new MRoleOrgAccess (org, roles[i].getAD_Role_ID()); + if (orgAccess.save()) + counter++; + } + } + s_log.info(org + " - created #" + counter); + return counter != 0; + } // createForOrg + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MRoleOrgAccess.class); + + + /************************************************************************** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MRoleOrgAccess (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MRoleOrgAccess + + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MRoleOrgAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + setIsReadOnly(false); + } // MRoleOrgAccess + + /** + * Organization Constructor + * @param org org + * @param AD_Role_ID role + */ + public MRoleOrgAccess (MOrg org, int AD_Role_ID) + { + this (org.getCtx(), 0, org.get_TrxName()); + setClientOrg (org); + setAD_Role_ID (AD_Role_ID); + } // MRoleOrgAccess + + /** + * Role Constructor + * @param role role + * @param AD_Org_ID org + */ + public MRoleOrgAccess (MRole role, int AD_Org_ID) + { + this (role.getCtx(), 0, role.get_TrxName()); + setClientOrg (role.getAD_Client_ID(), AD_Org_ID); + setAD_Role_ID (role.getAD_Role_ID()); + } // MRoleOrgAccess + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MRoleOrgAccess["); + sb.append("AD_Role_ID=").append(getAD_Role_ID()) + .append(",AD_Client_ID=").append(getAD_Client_ID()) + .append(",AD_Org_ID=").append(getAD_Org_ID()) + .append(",RO=").append(isReadOnly()); + sb.append("]"); + return sb.toString(); + } // toString + + + /************************************************************************** + * Extended String Representation + * @param ctx context + * @return extended info + */ + public String toStringX (Properties ctx) + { + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(ctx, "AD_Client_ID")).append("=").append(getClientName()).append(" - ") + .append(Msg.translate(ctx, "AD_Org_ID")).append("=").append(getOrgName()); + return sb.toString(); + } // toStringX + + private String m_clientName; + private String m_orgName; + + /** + * Get Client Name + * @return name + */ + public String getClientName() + { + if (m_clientName == null) + { + String sql = "SELECT c.Name, o.Name " + + "FROM AD_Client c INNER JOIN AD_Org o ON (c.AD_Client_ID=o.AD_Client_ID) " + + "WHERE o.AD_Org_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_Org_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + m_clientName = rs.getString(1); + m_orgName = rs.getString(2); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "getClientName", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } + return m_clientName; + } // getClientName + + /** + * Get Client Name + * @return name + */ + public String getOrgName() + { + if (m_orgName == null) + getClientName(); + return m_orgName; + } // getOrgName + +} // MRoleOrgAccess diff --git a/dbPort/src/org/compiere/model/MRoleTest.java b/dbPort/src/org/compiere/model/MRoleTest.java new file mode 100644 index 0000000000..a0537d263c --- /dev/null +++ b/dbPort/src/org/compiere/model/MRoleTest.java @@ -0,0 +1,91 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import junit.framework.*; +import org.compiere.util.*; + +/** + * The class MRoleTest contains tests for the class MRole + *

+ * @author Jorg Janke + * @version $Id: MRoleTest.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MRoleTest extends TestCase +{ + /** + * Construct new test instance + * @param name the test name + */ + public MRoleTest(String name) + { + super(name); + } + + private MRole m_role = null; + + /** + * Perform pre-test initialization + * @throws Exception + * @see TestCase#setUp() + */ + protected void setUp() throws Exception, Exception + { + org.compiere.Adempiere.startupEnvironment(true); + m_role = MRole.getDefault(Env.getCtx(), false); + super.setUp(); + } + + /** + * Perform post-test clean up + * + * @throws Exception + * + * @see TestCase#tearDown() + */ + protected void tearDown() throws Exception + { + super.tearDown(); + } + + /** + * Run the String addAccessSQL(String, String, boolean, boolean) method + * test + */ + public void testAddAccessSQL() + { + // add test code here + String sql = m_role.addAccessSQL( + "SELECT r.a,r.b,r.c FROM AD_Role r WHERE EXISTS " + + "(SELECT AD_Column c WHERE c.a=c.b) ORDER BY 1", + "r", + MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); + System.out.println(sql); + assertEquals(sql, "SELECT r.a,r.b,r.c FROM AD_Role r WHERE EXISTS (SELECT AD_Column c WHERE c.a=c.b) AND r.AD_Client_ID=0 AND r.AD_Org_ID=0 ORDER BY 1"); + } + + + /** + * Launch the test. + * @param args String[] + */ + public static void main(String[] args) + { + junit.textui.TestRunner.run(MRoleTest.class); + } + +} // MRoleTest diff --git a/dbPort/src/org/compiere/model/MSalesRegion.java b/dbPort/src/org/compiere/model/MSalesRegion.java new file mode 100644 index 0000000000..2d95cea682 --- /dev/null +++ b/dbPort/src/org/compiere/model/MSalesRegion.java @@ -0,0 +1,121 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + + +/** + * Sales Region Model + * + * @author Jorg Janke + * @version $Id: MSalesRegion.java,v 1.3 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MSalesRegion extends X_C_SalesRegion +{ + /** + * Get SalesRegion from Cache + * @param ctx context + * @param C_SalesRegion_ID id + * @return MSalesRegion + */ + public static MSalesRegion get (Properties ctx, int C_SalesRegion_ID) + { + Integer key = new Integer (C_SalesRegion_ID); + MSalesRegion retValue = (MSalesRegion) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MSalesRegion (ctx, C_SalesRegion_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** Cache */ + private static CCache s_cache = new CCache("C_SalesRegion", 10); + + + /************************************************************************** + * Default Constructor + * @param ctx context + * @param C_SalesRegion_ID id + * @param trxName transaction + */ + public MSalesRegion (Properties ctx, int C_SalesRegion_ID, String trxName) + { + super (ctx, C_SalesRegion_ID, trxName); + } // MSalesRegion + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MSalesRegion (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MSalesRegion + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (getAD_Org_ID() != 0) + setAD_Org_ID(0); + return true; + } // beforeSave + + /** + * After Save. + * Insert + * - create tree + * @param newRecord insert + * @param success save success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (!success) + return success; + if (newRecord) + insert_Tree(MTree_Base.TREETYPE_SalesRegion); + // Value/Name change + if (!newRecord && (is_ValueChanged("Value") || is_ValueChanged("Name"))) + MAccount.updateValueDescription(getCtx(), "C_SalesRegion_ID=" + getC_SalesRegion_ID(), get_TrxName()); + + return true; + } // afterSave + + /** + * After Delete + * @param success + * @return deleted + */ + protected boolean afterDelete (boolean success) + { + if (success) + delete_Tree(MTree_Base.TREETYPE_SalesRegion); + return success; + } // afterDelete + +} // MSalesRegion diff --git a/dbPort/src/org/compiere/model/MSequence.java b/dbPort/src/org/compiere/model/MSequence.java new file mode 100644 index 0000000000..a118a46f80 --- /dev/null +++ b/dbPort/src/org/compiere/model/MSequence.java @@ -0,0 +1,1054 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Sequence Model. + * @see org.compiere.process.SequenceCheck + * @author Jorg Janke + * @version $Id: MSequence.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MSequence extends X_AD_Sequence +{ + /** Use SQL procedure to get next id */ + //begin vpj-cd e-evolution 02/11/2005 PostgreSQL + //private static final boolean USE_PROCEDURE = true; + private static boolean USE_PROCEDURE = false; + //end vpj-cd e-evolution 02/11/2005 + /** Log Level for Next ID Call */ + private static final Level LOGLEVEL = Level.ALL; + + /** + * Get next number for Key column = 0 is Error. + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return next no or (-1=not found, -2=error) + */ + public static int getNextID (int AD_Client_ID, String TableName, String trxName) + { + if (TableName == null || TableName.length() == 0) + throw new IllegalArgumentException("TableName missing"); + int retValue = -1; + + // Check AdempiereSys + boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + // + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, TableName + " - AdempiereSys=" + adempiereSys + " [" + trxName + "]"); + //begin vpj-cd e-evolution 09/02/2005 PostgreSQL + String selectSQL = null; + if (DB.isPostgreSQL()) + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID, OID " + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' " + + " FOR UPDATE OF AD_Sequence "; + USE_PROCEDURE=false; + } + else + //String selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, AD_Sequence_ID " + //end vpj-cd e-evolution 09/02/2005 PostgreSQL + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' "; + // + "FOR UPDATE"; // OF CurrentNext, CurrentNextSys"; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + Connection conn = null; + PreparedStatement pstmt = null; + for (int i = 0; i < 3; i++) + { + try + { + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionID(); + // Error + if (conn == null) + return -1; + // + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + pstmt.setString(1, TableName); + // + ResultSet rs = pstmt.executeQuery(); + if (CLogMgt.isLevelFinest()) + s_log.finest("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() + + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED + + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE + + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE + + ")"); + if (rs.next()) + { + int AD_Sequence_ID = rs.getInt(4); + // + if (USE_PROCEDURE) + { + retValue = nextID(conn, AD_Sequence_ID, adempiereSys); + } + else + { + int incrementNo = rs.getInt(3); + if (adempiereSys) + { + retValue = rs.getInt(2); + rs.updateInt(2, retValue + incrementNo); + } + else + { + retValue = rs.getInt(1); + rs.updateInt(1, retValue + incrementNo); + } + rs.updateRow(); + } + if (trx == null) + conn.commit(); + } + else + s_log.severe ("No record found - " + TableName); + rs.close(); + pstmt.close(); + pstmt = null; + // + // conn.close(); + conn = null; + // + break; // EXIT + } + catch (Exception e) + { + s_log.log(Level.SEVERE, TableName + " - " + e.getMessage(), e); + try + { + conn.rollback(); + if (pstmt != null) + pstmt.close(); + } + catch (SQLException e1) + { + } + } + Thread.yield(); // give it time + } + // Finish + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + // if (conn != null) + // conn.close(); + conn = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "Finish", e); + pstmt = null; + } + s_log.finest (retValue + " - Table=" + TableName + " [" + trx + "]"); + return retValue; + } // getNextID + + /** + * Get Next ID + * @param conn connection + * @param AD_Sequence_ID sequence + * @param adempiereSys sys + * @return next id or -1 (error) or -3 (parameter) + */ + private static int nextID (Connection conn, int AD_Sequence_ID, boolean adempiereSys) + { + if (conn == null || AD_Sequence_ID == 0) + return -3; + // + int retValue = -1; + String sqlUpdate = "{call nextID(?,?,?)}"; + CallableStatement cstmt = null; + try + { + cstmt = conn.prepareCall (sqlUpdate, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + cstmt.setInt(1, AD_Sequence_ID); + cstmt.setString(2, adempiereSys ? "Y" : "N"); + cstmt.registerOutParameter(3, Types.INTEGER); + cstmt.execute(); + retValue = cstmt.getInt(3); + cstmt.close(); + cstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, e.toString()); + } + // Finish + try + { + if (cstmt != null) + cstmt.close(); + } + catch (Exception e) + { + } + return retValue; + } // nextID + + /************************************************************************** + * Get Document No from table + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return document no or null + */ + public static synchronized String getDocumentNo (int AD_Client_ID, String TableName, String trxName) + { + if (TableName == null || TableName.length() == 0) + throw new IllegalArgumentException("TableName missing"); + + // Check AdempiereSys + boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + // + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, TableName + " - AdempiereSys=" + adempiereSys + " [" + trxName + "]"); + //begin vpj-cd e-evolution 09/02/2005 PostgreSQL + String selectSQL = null; + if (DB.isPostgreSQL()) + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, AD_Sequence_ID , OID " + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND AD_Client_ID IN (0,?)" + + " AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' " + + "ORDER BY AD_Client_ID DESC " + + " FOR UPDATE OF AD_Sequence "; + USE_PROCEDURE=false; + } + else + //String selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, AD_Sequence_ID " + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, AD_Sequence_ID " + //end vpj-cd e-evolution 09/02/2005 PostgreSQL + + "FROM AD_Sequence " + + "WHERE Name=?" + + " AND AD_Client_ID IN (0,?)" + + " AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' " + + "ORDER BY AD_Client_ID DESC "; + // + "FOR UPDATE"; + Connection conn = null; + PreparedStatement pstmt = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + // + int AD_Sequence_ID = 0; + int incrementNo = 0; + int next = -1; + String prefix = ""; + String suffix = ""; + try + { + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionID(); + // Error + if (conn == null) + return null; + // + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + pstmt.setString(1, PREFIX_DOCSEQ + TableName); + pstmt.setInt(2, AD_Client_ID); + // + ResultSet rs = pstmt.executeQuery(); + // s_log.fine("AC=" + conn.getAutoCommit() + " -Iso=" + conn.getTransactionIsolation() + // + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency()); + if (rs.next()) + { + AD_Sequence_ID = rs.getInt(6); + prefix = rs.getString(4); + suffix = rs.getString(5); + incrementNo = rs.getInt(3); + + if (USE_PROCEDURE) + { + next = nextID(conn, AD_Sequence_ID, adempiereSys); + } + else + { + if (adempiereSys) + { + next = rs.getInt(2); + rs.updateInt(2, next + incrementNo); + } + else + { + next = rs.getInt(1); + rs.updateInt(1, next + incrementNo); + } + rs.updateRow(); + } + } + else + { + s_log.warning ("(Table) - no record found - " + TableName); + MSequence seq = new MSequence (Env.getCtx(), AD_Client_ID, TableName, null); + next = seq.getNextID(); + seq.save(); + } + rs.close(); + pstmt.close(); + pstmt = null; + // Commit + if (trx == null) + { + conn.commit(); + // conn.close(); + } + conn = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(Table) [" + trxName + "]", e); + next = -2; + } + // Finish + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + // if (conn != null && trx == null) + // conn.close(); + conn = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(Table) - finish", e); + pstmt = null; + } + // Error + if (next < 0) + return null; + + // create DocumentNo + StringBuffer doc = new StringBuffer(); + if (prefix != null && prefix.length() > 0) + doc.append(prefix); + doc.append(next); + if (suffix != null && suffix.length() > 0) + doc.append(suffix); + String documentNo = doc.toString(); + s_log.finer (documentNo + " (" + incrementNo + ")" + + " - Table=" + TableName + " [" + trx + "]"); + return documentNo; + } // getDocumentNo + + /** + * Get Document No based on Document Type + * @param C_DocType_ID document type + * @param trxName optional Transaction Name + * @return document no or null + */ + public static synchronized String getDocumentNo (int C_DocType_ID, String trxName) + { + if (C_DocType_ID == 0) + { + s_log.severe ("C_DocType_ID=0"); + return null; + } + MDocType dt = MDocType.get (Env.getCtx(), C_DocType_ID); // wrong for SERVER, but r/o + if (dt != null && !dt.isDocNoControlled()) + { + s_log.finer("DocType_ID=" + C_DocType_ID + " Not DocNo controlled"); + return null; + } + if (dt == null || dt.getDocNoSequence_ID() == 0) + { + s_log.warning ("No Sequence for DocType - " + dt); + return null; + } + + // Check AdempiereSys + boolean adempiereSys = Ini.isPropertyBool(Ini.P_ADEMPIERESYS); + if (CLogMgt.isLevel(LOGLEVEL)) + s_log.log(LOGLEVEL, "DocType_ID=" + C_DocType_ID + " [" + trxName + "]"); + //begin vpj-cd e-evolution 09/02/2005 PostgreSQL + String selectSQL = null; + if (DB.isPostgreSQL()) + { + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, AD_Client_ID, AD_Sequence_ID, OID " + + "FROM AD_Sequence " + + "WHERE AD_Sequence_ID=?" + + " AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' " + + " FOR UPDATE OF AD_Sequence "; + USE_PROCEDURE=false; + } + else + //String selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, AD_Client_ID, AD_Sequence_ID " + selectSQL = "SELECT CurrentNext, CurrentNextSys, IncrementNo, Prefix, Suffix, AD_Client_ID, AD_Sequence_ID " + //end vpj-cd e-evolution 09/02/2005 PostgreSQL + + "FROM AD_Sequence " + + "WHERE AD_Sequence_ID=?" + + " AND IsActive='Y' AND IsTableID='N' AND IsAutoSequence='Y' "; + // + " FOR UPDATE"; + Connection conn = null; + PreparedStatement pstmt = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + // + int AD_Sequence_ID = 0; + int incrementNo = 0; + int next = -1; + String prefix = ""; + String suffix = ""; + try + { + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionID(); + // Error + if (conn == null) + return null; + // + pstmt = conn.prepareStatement(selectSQL, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + pstmt.setInt(1, dt.getDocNoSequence_ID()); + // + ResultSet rs = pstmt.executeQuery(); + // s_log.fine("AC=" + conn.getAutoCommit() + " -Iso=" + conn.getTransactionIsolation() + // + " - Type=" + pstmt.getResultSetType() + " - Concur=" + pstmt.getResultSetConcurrency()); + if (rs.next()) + { + incrementNo = rs.getInt(3); + prefix = rs.getString(4); + suffix = rs.getString(5); + int AD_Client_ID = rs.getInt(6); + if (adempiereSys && AD_Client_ID > 11) + adempiereSys = false; + AD_Sequence_ID = rs.getInt(7); + + if (USE_PROCEDURE) + { + next = nextID(conn, AD_Sequence_ID, adempiereSys); + } + else + { + if (adempiereSys) + { + next = rs.getInt(2); + rs.updateInt(2, next + incrementNo); + } + else + { + next = rs.getInt(1); + rs.updateInt(1, next + incrementNo); + } + rs.updateRow(); + } + } + else + { + s_log.warning ("(DocType)- no record found - " + dt); + next = -2; + } + rs.close(); + pstmt.close(); + pstmt = null; + // Commit + if (trx == null) + { + conn.commit(); + // conn.close(); + } + conn = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(DocType) [" + trxName + "]", e); + next = -2; + } + // Finish + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + // if (conn != null && trx == null) + // conn.close(); + conn = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "(DocType) - finish", e); + pstmt = null; + } + // Error + if (next < 0) + return null; + + // create DocumentNo + StringBuffer doc = new StringBuffer(); + if (prefix != null && prefix.length() > 0) + doc.append(prefix); + doc.append(next); + if (suffix != null && suffix.length() > 0) + doc.append(suffix); + String documentNo = doc.toString(); + s_log.finer (documentNo + " (" + incrementNo + ")" + + " - C_DocType_ID=" + C_DocType_ID + " [" + trx + "]"); + return documentNo; + } // getDocumentNo + + + /************************************************************************** + * Check/Initialize Client DocumentNo/Value Sequences + * @param ctx context + * @param AD_Client_ID client + * @param trxName transaction + * @return true if no error + */ + public static boolean checkClientSequences (Properties ctx, int AD_Client_ID, String trxName) + { + String sql = "SELECT TableName " + + "FROM AD_Table t " + + "WHERE IsActive='Y' AND IsView='N'" + // Get all Tables with DocumentNo or Value + + " AND AD_Table_ID IN " + + "(SELECT AD_Table_ID FROM AD_Column " + + "WHERE ColumnName = 'DocumentNo' OR ColumnName = 'Value')" + // Ability to run multiple times + + " AND 'DocumentNo_' || TableName NOT IN " + + "(SELECT Name FROM AD_Sequence s " + + "WHERE s.AD_Client_ID=?)"; + int counter = 0; + boolean success = true; + // + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + pstmt.setInt(1, AD_Client_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String tableName = rs.getString(1); + s_log.fine("Add: " + tableName); + MSequence seq = new MSequence (ctx, AD_Client_ID, tableName, trxName); + if (seq.save()) + counter++; + else + { + s_log.severe ("Not created - AD_Client_ID=" + AD_Client_ID + + " - " + tableName); + success = false; + } + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + s_log.info ("AD_Client_ID=" + AD_Client_ID + + " - created #" + counter + + " - success=" + success); + return success; + } // checkClientSequences + + + /** + * Create Table ID Sequence + * @param ctx context + * @param TableName table name + * @param trxName transaction + * @return true if created + */ + public static boolean createTableSequence (Properties ctx, String TableName, String trxName) + { + MSequence seq = new MSequence (ctx, 0, trxName); + seq.setClientOrg(0, 0); + seq.setName(TableName); + seq.setDescription("Table " + TableName); + seq.setIsTableID(true); + return seq.save(); + } // createTableSequence + + + /** + * Get Sequence + * @param ctx context + * @param tableName table name + * @return Sequence + */ + public static MSequence get (Properties ctx, String tableName) + { + String sql = "SELECT * FROM AD_Sequence " + + "WHERE UPPER(Name)=?" + + " AND IsTableID='Y'"; + MSequence retValue = null; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, tableName.toUpperCase()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MSequence (ctx, rs, null); + if (rs.next()) + s_log.log(Level.SEVERE, "More then one sequence for " + tableName); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + + /** Sequence for Table Document No's */ + private static final String PREFIX_DOCSEQ = "DocumentNo_"; + /** Start Number */ + public static final int INIT_NO = 1000000; // 1 Mio + /** Start System Number */ + public static final int INIT_SYS_NO = 100; + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger(MSequence.class); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Sequence_ID id + * @param trxName transaction + */ + public MSequence (Properties ctx, int AD_Sequence_ID, String trxName) + { + super(ctx, AD_Sequence_ID, trxName); + if (AD_Sequence_ID == 0) + { + // setName (null); + // + setIsTableID(false); + setStartNo (INIT_NO); + setCurrentNext (INIT_NO); + setCurrentNextSys (INIT_SYS_NO); + setIncrementNo (1); + setIsAutoSequence (true); + setIsAudited(false); + setStartNewYear(false); + } + } // MSequence + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MSequence (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MSequence + + /** + * New Document Sequence Constructor + * @param ctx context + * @param AD_Client_ID owner + * @param tableName name + * @param trxName transaction + */ + public MSequence (Properties ctx, int AD_Client_ID, String tableName, String trxName) + { + this (ctx, 0, trxName); + setClientOrg(AD_Client_ID, 0); // Client Ownership + setName(PREFIX_DOCSEQ + tableName); + setDescription("DocumentNo/Value for Table " + tableName); + } // MSequence; + + /** + * New Document Sequence Constructor + * @param ctx context + * @param AD_Client_ID owner + * @param sequenceName name + * @param StartNo start + * @param trxName trx + */ + public MSequence (Properties ctx, int AD_Client_ID, String sequenceName, int StartNo, String trxName) + { + this (ctx, 0, trxName); + setClientOrg(AD_Client_ID, 0); // Client Ownership + setName(sequenceName); + setDescription(sequenceName); + setStartNo(StartNo); + setCurrentNext(StartNo); + setCurrentNextSys(StartNo/10); + } // MSequence; + + + /************************************************************************** + * Get Next No and increase current next + * @return next no to use + */ + public int getNextID() + { + int retValue = getCurrentNext(); + setCurrentNext(retValue + getIncrementNo()); + return retValue; + } // getNextNo + + /** + * Get next DocumentNo + * @return document no + */ + public String getDocumentNo() + { + // create DocumentNo + StringBuffer doc = new StringBuffer(); + String prefix = getPrefix(); + if (prefix != null && prefix.length() > 0) + doc.append(prefix); + doc.append(getNextID()); + String suffix = getSuffix(); + if (suffix != null && suffix.length() > 0) + doc.append(suffix); + return doc.toString(); + } // getDocumentNo + + /** + * Validate Table Sequence Values + * @return true if updated + */ + public boolean validateTableIDValue() + { + if (!isTableID()) + return false; + String tableName = getName(); + int AD_Column_ID = DB.getSQLValue(null, "SELECT MAX(c.AD_Column_ID) " + + "FROM AD_Table t" + + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) " + + "WHERE t.TableName='" + tableName + "'" + + " AND c.ColumnName='" + tableName + "_ID'"); + if (AD_Column_ID <= 0) + return false; + // + MSystem system = MSystem.get(getCtx()); + int IDRangeEnd = 0; + if (system.getIDRangeEnd() != null) + IDRangeEnd = system.getIDRangeEnd().intValue(); + boolean change = false; + String info = null; + + // Current Next + String sql = "SELECT MAX(" + tableName + "_ID) FROM " + tableName; + if (IDRangeEnd > 0) + sql += " WHERE " + tableName + "_ID < " + IDRangeEnd; + int maxTableID = DB.getSQLValue(null, sql); + if (maxTableID < INIT_NO) + maxTableID = INIT_NO - 1; + maxTableID++; // Next + if (getCurrentNext() < maxTableID) + { + setCurrentNext(maxTableID); + info = "CurrentNext=" + maxTableID; + change = true; + } + + // Get Max System_ID used in Table + sql = "SELECT MAX(" + tableName + "_ID) FROM " + tableName + + " WHERE " + tableName + "_ID < " + INIT_NO; + int maxTableSysID = DB.getSQLValue(null, sql); + if (maxTableSysID <= 0) + maxTableSysID = INIT_SYS_NO - 1; + maxTableSysID++; // Next + if (getCurrentNextSys() < maxTableSysID) + { + setCurrentNextSys(maxTableSysID); + if (info == null) + info = "CurrentNextSys=" + maxTableSysID; + else + info += " - CurrentNextSys=" + maxTableSysID; + change = true; + } + if (info != null) + log.fine(getName() + " - " + info); + return change; + } // validate + + + /************************************************************************** + * Test + * @param args ignored + */ + static public void main (String[] args) + { + org.compiere.Adempiere.startup(true); + CLogMgt.setLevel(Level.SEVERE); + CLogMgt.setLoggerLevel(Level.SEVERE, null); + s_list = new Vector(1000); + + /** Lock Test ** + String trxName = "test"; + System.out.println(DB.getDocumentNo(115, trxName)); + System.out.println(DB.getDocumentNo(116, trxName)); + System.out.println(DB.getDocumentNo(117, trxName)); + System.out.println(DB.getDocumentNo(118, trxName)); + System.out.println(DB.getDocumentNo(118, trxName)); + System.out.println(DB.getDocumentNo(117, trxName)); + + trxName = "test1"; + System.out.println(DB.getDocumentNo(115, trxName)); // hangs here as supposed + System.out.println(DB.getDocumentNo(116, trxName)); + System.out.println(DB.getDocumentNo(117, trxName)); + System.out.println(DB.getDocumentNo(118, trxName)); + + + + + + /** **/ + + /** Time Test */ + long time = System.currentTimeMillis(); + Thread[] threads = new Thread[10]; + for (int i = 0; i < 10; i++) + { + Runnable r = new GetIDs(i); + threads[i] = new Thread(r); + threads[i].start(); + } + for (int i = 0; i < 10; i++) + { + try + { + threads[i].join(); + } + catch (InterruptedException e) + { + } + } + time = System.currentTimeMillis() - time; + + System.out.println("-------------------------------------------"); + System.out.println("Size=" + s_list.size() + " (should be 1000)"); + Integer[] ia = new Integer[s_list.size()]; + s_list.toArray(ia); + Arrays.sort(ia); + Integer last = null; + int duplicates = 0; + for (int i = 0; i < ia.length; i++) + { + if (last != null) + { + if (last.compareTo(ia[i]) == 0) + { + // System.out.println(i + ": " + ia[i]); + duplicates++; + } + } + last = ia[i]; + } + System.out.println("-------------------------------------------"); + System.out.println("Size=" + s_list.size() + " (should be 1000)"); + System.out.println("Duplicates=" + duplicates); + System.out.println("Time (ms)=" + time + " - " + ((float)time/s_list.size()) + " each" ); + System.out.println("-------------------------------------------"); + + + + /** ** + try + { + int retValue = -1; + Connection conn = DB.getConnectionRW (); + // DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); + // Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@//dev2:1521/dev2", "adempiere", "adempiere"); + + conn.setAutoCommit(false); + String sql = "SELECT CurrentNext, CurrentNextSys, IncrementNo " + + "FROM AD_Sequence " + + "WHERE Name='AD_Sequence' "; + sql += "FOR UPDATE"; + // creates ORA-00907: missing right parenthesis + // sql += "FOR UPDATE OF CurrentNext, CurrentNextSys"; + + + PreparedStatement pstmt = conn.prepareStatement(sql, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); + ResultSet rs = pstmt.executeQuery(); + System.out.println("AC=" + conn.getAutoCommit() + ", RO=" + conn.isReadOnly() + + " - Isolation=" + conn.getTransactionIsolation() + "(" + Connection.TRANSACTION_READ_COMMITTED + + ") - RSType=" + pstmt.getResultSetType() + "(" + ResultSet.TYPE_SCROLL_SENSITIVE + + "), RSConcur=" + pstmt.getResultSetConcurrency() + "(" + ResultSet.CONCUR_UPDATABLE + + ")"); + + if (rs.next()) + { + int IncrementNo = rs.getInt(3); + retValue = rs.getInt(1); + rs.updateInt(1, retValue + IncrementNo); + rs.updateRow(); + } + else + s_log.severe ("no record found"); + rs.close(); + pstmt.close(); + conn.commit(); + conn.close(); + // + System.out.println("Next=" + retValue); + + } + catch (Exception e) + { + e.printStackTrace (); + } + + System.exit(0); + + /** ** + + int AD_Client_ID = 0; + int C_DocType_ID = 115; // GL + String TableName = "C_Invoice"; + String trxName = "x"; + Trx trx = Trx.get(trxName, true); + + System.out.println ("none " + getNextID (0, "Test")); + System.out.println ("----------------------------------------------"); + System.out.println ("trx1 " + getNextID (0, "Test")); + System.out.println ("trx2 " + getNextID (0, "Test")); + // trx.rollback(); + System.out.println ("trx3 " + getNextID (0, "Test")); + // trx.commit(); + System.out.println ("trx4 " + getNextID (0, "Test")); + // trx.rollback(); + // trx.close(); + System.out.println ("----------------------------------------------"); + System.out.println ("none " + getNextID (0, "Test")); + System.out.println ("=============================================="); + + + trx = Trx.get(trxName, true); + System.out.println ("none " + getDocumentNo(AD_Client_ID, TableName, null)); + System.out.println ("----------------------------------------------"); + System.out.println ("trx1 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + System.out.println ("trx2 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + trx.rollback(); + System.out.println ("trx3 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + trx.commit(); + System.out.println ("trx4 " + getDocumentNo(AD_Client_ID, TableName, trxName)); + trx.rollback(); + trx.close(); + System.out.println ("----------------------------------------------"); + System.out.println ("none " + getDocumentNo(AD_Client_ID, TableName, null)); + System.out.println ("=============================================="); + + + trx = Trx.get(trxName, true); + System.out.println ("none " + getDocumentNo(C_DocType_ID, null)); + System.out.println ("----------------------------------------------"); + System.out.println ("trx1 " + getDocumentNo(C_DocType_ID, trxName)); + System.out.println ("trx2 " + getDocumentNo(C_DocType_ID, trxName)); + trx.rollback(); + System.out.println ("trx3 " + getDocumentNo(C_DocType_ID, trxName)); + trx.commit(); + System.out.println ("trx4 " + getDocumentNo(C_DocType_ID, trxName)); + trx.rollback(); + trx.close(); + System.out.println ("----------------------------------------------"); + System.out.println ("none " + getDocumentNo(C_DocType_ID, null)); + System.out.println ("=============================================="); + /** **/ + } // main + + /** Test */ + private static Vector s_list = null; + + /** + * Test Sequence - Get IDs + * + * @author Jorg Janke + * @version $Id: MSequence.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ + public static class GetIDs implements Runnable + { + /** + * Get IDs + * @param i + */ + public GetIDs (int i) + { + m_i = i; + } + private int m_i; + + /** + * Run + */ + public void run() + { + for (int i = 0; i < 100; i++) + { + try + { + int no = DB.getNextID(0, "Test", null); + s_list.add(new Integer(no)); + // System.out.println("#" + m_i + ": " + no); + } + catch (Exception e) + { + System.err.println(e.getMessage()); + } + } + } + } // GetIDs + +} // MSequence diff --git a/dbPort/src/org/compiere/model/MSession.java b/dbPort/src/org/compiere/model/MSession.java new file mode 100644 index 0000000000..f0303ba5cf --- /dev/null +++ b/dbPort/src/org/compiere/model/MSession.java @@ -0,0 +1,276 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.net.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Session Model. + * Maintained in AMenu. + * + * @author Jorg Janke + * @version $Id: MSession.java,v 1.3 2006/07/30 00:58:05 jjanke Exp $ + */ +public class MSession extends X_AD_Session +{ + /** + * Get existing or create local session + * @param ctx context + * @param createNew create if not found + * @return session session + */ + public static MSession get (Properties ctx, boolean createNew) + { + int AD_Session_ID = Env.getContextAsInt(ctx, "#AD_Session_ID"); + MSession session = null; + if (AD_Session_ID > 0) + session = (MSession)s_sessions.get(new Integer(AD_Session_ID)); + if (session == null && createNew) + { + session = new MSession (ctx, null); // local session + session.save(); + AD_Session_ID = session.getAD_Session_ID(); + Env.setContext (ctx, "#AD_Session_ID", AD_Session_ID); + s_sessions.put (new Integer(AD_Session_ID), session); + } + return session; + } // get + + /** + * Get existing or create remote session + * @param ctx context + * @param Remote_Addr remote address + * @param Remote_Host remote host + * @param WebSession web session + * @return session + */ + public static MSession get (Properties ctx, String Remote_Addr, String Remote_Host, String WebSession) + { + int AD_Session_ID = Env.getContextAsInt(ctx, "#AD_Session_ID"); + MSession session = null; + if (AD_Session_ID > 0) + session = (MSession)s_sessions.get(new Integer(AD_Session_ID)); + if (session == null) + { + session = new MSession (ctx, Remote_Addr, Remote_Host, WebSession, null); // remote session + session.save(); + AD_Session_ID = session.getAD_Session_ID(); + Env.setContext(ctx, "#AD_Session_ID", AD_Session_ID); + s_sessions.put(new Integer(AD_Session_ID), session); + } + return session; + } // get + + /** Sessions */ + private static CCache s_sessions = Ini.isClient() + ? new CCache("AD_Session_ID", 1, 0) // one client session + : new CCache("AD_Session_ID", 30, 0); // no time-out + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Session_ID id + * @param trxName transaction + */ + public MSession (Properties ctx, int AD_Session_ID, String trxName) + { + super(ctx, AD_Session_ID, trxName); + if (AD_Session_ID == 0) + { + setProcessed (false); + } + } // MSession + + /** + * Load Costructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MSession(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MSession + + /** + * New (remote) Constructor + * @param ctx context + * @param Remote_Addr remote address + * @param Remote_Host remote host + * @param WebSession web session + * @param trxName transaction + */ + public MSession (Properties ctx, String Remote_Addr, String Remote_Host, String WebSession, String trxName) + { + this (ctx, 0, trxName); + if (Remote_Addr != null) + setRemote_Addr(Remote_Addr); + if (Remote_Host != null) + setRemote_Host(Remote_Host); + if (WebSession != null) + setWebSession(WebSession); + } // MSession + + /** + * New (local) Constructor + * @param ctx context + * @param trxName transaction + */ + public MSession (Properties ctx, String trxName) + { + this (ctx, 0, trxName); + try + { + InetAddress lh = InetAddress.getLocalHost(); + setRemote_Addr(lh.getHostAddress()); + setRemote_Host(lh.getHostName()); + } + catch (UnknownHostException e) + { + log.log(Level.SEVERE, "No Local Host", e); + } + } // MSession + + /** Web Store Session */ + private boolean m_webStoreSession = false; + + /** + * Is it a Web Store Session + * @return Returns true if Web Store Session. + */ + public boolean isWebStoreSession () + { + return m_webStoreSession; + } // isWebStoreSession + + /** + * Set Web Store Session + * @param webStoreSession The webStoreSession to set. + */ + public void setWebStoreSession (boolean webStoreSession) + { + m_webStoreSession = webStoreSession; + } // setWebStoreSession + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MSession[") + .append(getAD_Session_ID()) + .append(",AD_User_ID=").append(getCreatedBy()) + .append(",").append(getCreated()) + .append(",Remote=").append(getRemote_Addr()); + String s = getRemote_Host(); + if (s != null && s.length() > 0) + sb.append(",").append(s); + if (m_webStoreSession) + sb.append(",WebStoreSession"); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Session Logout + */ + public void logout() + { + setProcessed(true); + save(); + s_sessions.remove(new Integer(getAD_Session_ID())); + log.info(TimeUtil.formatElapsed(getCreated(), getUpdated())); + } // logout + + + /** + * Create Change Log only if table is logged + * @param TrxName transaction name + * @param AD_ChangeLog_ID 0 for new change log + * @param AD_Table_ID table + * @param AD_Column_ID column + * @param Record_ID record + * @param AD_Client_ID client + * @param AD_Org_ID org + * @param OldValue old + * @param NewValue new + * @return saved change log or null + */ + public MChangeLog changeLog ( + String TrxName, int AD_ChangeLog_ID, + int AD_Table_ID, int AD_Column_ID, int Record_ID, + int AD_Client_ID, int AD_Org_ID, + Object OldValue, Object NewValue) + { + // Null handling + if (OldValue == null && NewValue == null) + return null; + // Equal Value + if (OldValue != null && NewValue != null && OldValue.equals(NewValue)) + return null; + + // No Log + if (AD_Column_ID == 6652 + || AD_Column_ID == 6653) // AD_Process.Statistics_ + return null; + + // Role Logging + MRole role = MRole.getDefault(getCtx(), false); + // Do we need to log + if (m_webStoreSession // log if WebStore + || MChangeLog.isLogged(AD_Table_ID) // im/explicit log + || (role != null && role.isChangeLog()))// Role Logging + ; + else + return null; + // + log.finest("AD_ChangeLog_ID=" + AD_ChangeLog_ID + + ", AD_Session_ID=" + getAD_Session_ID() + + ", AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID + + ": " + OldValue + " -> " + NewValue); + boolean success = false; + + try + { + MChangeLog cl = new MChangeLog(getCtx(), + AD_ChangeLog_ID, TrxName, getAD_Session_ID(), + AD_Table_ID, AD_Column_ID, Record_ID, AD_Client_ID, AD_Org_ID, + OldValue, NewValue); + if (cl.save()) + return cl; + } + catch (Exception e) + { + log.log(Level.SEVERE, "AD_ChangeLog_ID=" + AD_ChangeLog_ID + + ", AD_Session_ID=" + getAD_Session_ID() + + ", AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID, e); + return null; + } + log.log(Level.SEVERE, "AD_ChangeLog_ID=" + AD_ChangeLog_ID + + ", AD_Session_ID=" + getAD_Session_ID() + + ", AD_Table_ID=" + AD_Table_ID + ", AD_Column_ID=" + AD_Column_ID); + return null; + } // changeLog + +} // MSession + diff --git a/dbPort/src/org/compiere/model/MSystem.java b/dbPort/src/org/compiere/model/MSystem.java new file mode 100644 index 0000000000..f60558199f --- /dev/null +++ b/dbPort/src/org/compiere/model/MSystem.java @@ -0,0 +1,534 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.lang.management.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.db.*; +import org.compiere.util.*; + +/** + * System Record (just one) + * + * @author Jorg Janke + * @version $Id: MSystem.java,v 1.3 2006/10/09 00:22:28 jjanke Exp $ + */ +public class MSystem extends X_AD_System +{ + /** + * Load System Record + * @param ctx context + * @return System + */ + public static MSystem get (Properties ctx) + { + if (s_system != null) + return s_system; + // + String sql = "SELECT * FROM AD_System ORDER BY AD_System_ID"; // 0 first + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + s_system = new MSystem (ctx, rs, null); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (SQLException ex) + { + s_log.log(Level.SEVERE, "get", ex); + } + try + { + if (pstmt != null) + pstmt.close(); + } + catch (SQLException ex1) + { + } + pstmt = null; + if (s_system == null) + return null; + // + if (!Ini.isClient() && s_system.setInfo()) + s_system.save(); + return s_system; + } // get + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (MSystem.class); + /** System - cached */ + private static MSystem s_system = null; + + /************************************************************************** + * Default Constructor + * @param ctx context + * @param ignored id + * @param mtrxName transaction + */ + public MSystem (Properties ctx, int ignored, String mtrxName) + { + super(ctx, 0, mtrxName); + String trxName = null; + load(trxName); // load ID=0 + if (s_system == null) + s_system = this; + } // MSystem + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MSystem (Properties ctx, ResultSet rs, String trxName) + { + super (ctx, rs, trxName); + if (s_system == null) + s_system = this; + } // MSystem + + /** + * Constructor + */ + public MSystem () + { + this (new Properties(), 0, null); + } // MSystem + + /** + * Is LDAP Authentification defined + * @return true if ldap defined + */ + public boolean isLDAP() + { + String host = getLDAPHost(); + if (host == null || host.length() == 0) + return false; + String domain = getLDAPDomain(); + return domain != null + && domain.length() > 0; + } // isLDAP + + /** + * LDAP Authentification. Assumes that LDAP is defined. + * @param userName user name + * @param password password + * @return true if ldap authenticated + */ + public boolean isLDAP (String userName, String password) + { + return LDAP.validate(getLDAPHost(), getLDAPDomain(), userName, password); + } // isLDAP + + /** + * Get DB Address + * @return address + */ + public String getDBAddress () + { + String s = super.getDBAddress (); + if (s == null || s.length() == 0) + s = CConnection.get().getConnectionURL(); + return s; + } // getDBAddress + + /** + * Get Statistics Info + * @param recalc recalculate + * @return statistics + */ + public String getStatisticsInfo (boolean recalc) + { + String s = super.getStatisticsInfo (); + if (s == null || recalc) + { + String sql = "SELECT 'C'||(SELECT COUNT(*) FROM AD_Client)" + + "||'U'||(SELECT COUNT(*) FROM AD_User)" + + "||'B'||(SELECT COUNT(*) FROM C_BPartner)" + + "||'P'||(SELECT COUNT(*) FROM M_Product)" + + "||'I'||(SELECT COUNT(*) FROM C_Invoice)" + + "||'M'||(SELECT COUNT(*) FROM M_Transaction)" + + " FROM AD_System"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + s = rs.getString(1); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } + return s; + } // getStatisticsInfo + + /** + * Get Profile Info + * @param recalc recalculate + * @return profile + */ + public String getProfileInfo (boolean recalc) + { + String s = super.getProfileInfo (); + if (s == null || recalc) + { + String sql = "SELECT Value FROM AD_Client " + + "WHERE IsActive='Y' ORDER BY AD_Client_ID DESC"; + PreparedStatement pstmt = null; + StringBuffer sb = new StringBuffer(); + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + sb.append(rs.getString(1)).append('|'); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + s = sb.toString(); + } + return s; + } // getProfileInfo + + /** + * Before Save + * @param newRecord new + * @return true/false + */ + protected boolean beforeSave (boolean newRecord) + { + // Mandatory Values + if (get_Value("IsAutoErrorReport") == null) + setIsAutoErrorReport (true); + // + boolean userChange = Ini.isClient() && + (is_ValueChanged("Name") + || is_ValueChanged("UserName") + || is_ValueChanged("Password") + || is_ValueChanged("LDAPHost") + || is_ValueChanged("LDAPDomain") + || is_ValueChanged("CustomPrefix") + ); + if (userChange) + { + String name = getName(); + if (name.equals("?") || name.length() < 2) + { + log.saveError("Error", "Define a unique System name (e.g. Company name) not " + name); + return false; + } + if (getUserName().equals("?") || getUserName().length() < 2) + { + log.saveError("Error", "Use the same EMail address as in the Adempiere Web Store"); + return false; + } + if (getPassword().equals("?") || getPassword().length() < 2) + { + log.saveError("Error", "Use the same Password as in the Adempiere Web Store"); + return false; + } + } + // + setInfo(); + return true; + } // beforeSave + + /** + * Save Record (ID=0) + * @return true if saved + */ + public boolean save() + { + if (!beforeSave(false)) + return false; + return saveUpdate(); + } // save + + /** + * String Representation + * @return info + */ + public String toString() + { + return "MSystem[" + getName() + + ",User=" + getUserName() + + ",ReleaseNo=" + getReleaseNo() + + "]"; + } // toString + + + /************************************************************************** + * Check valididity + * @return true if valid + */ + public boolean isValid() + { + if (getName() == null || getName().length() < 2) + { + log.log(Level.WARNING, "Name not valid: " + getName()); + return false; + } + if (getPassword() == null || getPassword().length() < 2) + { + log.log(Level.WARNING, "Password not valid: " + getPassword()); + return false; + } + if (getInfo() == null || getInfo().length() < 2) + { + log.log(Level.WARNING, "Need to run Migration once"); + return false; + } + return true; + } // isValid + + /** + * Is there a PDF License + * @return true if there is a PDF License + */ + public boolean isPDFLicense() + { + String key = getSummary(); + return key != null && key.length() > 25; + } // isPDFLicense + + + /************************************************************************** + * Set/Derive Info if more then a day old + * @return true if set + */ + public boolean setInfo() + { + // log.severe("setInfo"); + if (!TimeUtil.getDay(getUpdated()).before(TimeUtil.getDay(null))) + return false; + try + { + setDBInfo(); + setInternalUsers(); + if (isAllowStatistics()) + { + setStatisticsInfo(getStatisticsInfo(true)); + setProfileInfo(getProfileInfo(true)); + } + } + catch (Exception e) + { + setSupportUnits(9999); + setInfo(e.getLocalizedMessage()); + log.log(Level.SEVERE, "", e); + } + return true; + } // setInfo + + /** + * Set Internal User Count + */ + private void setInternalUsers() + { + String sql = "SELECT COUNT(DISTINCT (u.AD_User_ID)) AS iu " + + "FROM AD_User u" + + " INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID) " + + "WHERE u.AD_Client_ID<>11" // no Demo + + " AND u.AD_User_ID NOT IN (0,100)"; // no System/SuperUser + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + int internalUsers = rs.getInt (1); + setSupportUnits(internalUsers); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // setInternalUsers + + /** + * Set DB Info + */ + private void setDBInfo() + { + if (!DB.isRemoteObjects()) + { + String dbAddress = CConnection.get().getConnectionURL(); + setDBAddress(dbAddress.toLowerCase()); + } + // + if (!Ini.isClient()) + { + int noProcessors = Runtime.getRuntime().availableProcessors(); + setNoProcessors(noProcessors); + } + // + String dbName = null; + PreparedStatement pstmt = null; + String sql = null; + try + { + String dbType = CConnection.get().getDatabase().getName(); + sql = getDBInfoSQL(dbType); + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + if (rs.next()) + { + // dbAddress = rs.getString(1); + dbName = rs.getString(2); + setDBInstance(dbName.toLowerCase()); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // setDBInfo + + /** + * Get DB Info SQL + * @param dbType database type + * @return sql + */ + public static String getDBInfoSQL (String dbType) + { + if (Database.DB_ORACLE.equals(dbType)) + return "SELECT SYS_CONTEXT('USERENV','HOST') || '/' || SYS_CONTEXT('USERENV','IP_ADDRESS') AS DBAddress," + + " SYS_CONTEXT('USERENV','CURRENT_USER') || '.' || SYS_CONTEXT('USERENV','DB_NAME')" + + " || '.' || SYS_CONTEXT('USERENV','DB_DOMAIN') AS DBName " + + "FROM DUAL"; + // + return "SELECT null, null FROM AD_System WHERE AD_System_ID=-1"; + } // getDBInfoSQL + + + /** + * Print info + */ + public void info() + { + if (!CLogMgt.isLevelFine()) + return; + // OS + // OperatingSystemMXBean os = ManagementFactory.getOperatingSystemMXBean(); + // log.fine(os.getName() + " " + os.getVersion() + " " + os.getArch() + // + " Processors=" + os.getAvailableProcessors()); + // Runtime + RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean(); + log.fine(rt.getName() + " (" + rt.getVmVersion() + ") Up=" + TimeUtil.formatElapsed(rt.getUptime())); + // Memory + if (CLogMgt.isLevelFiner()) + { + List list = ManagementFactory.getMemoryPoolMXBeans(); + Iterator it = list.iterator(); + while (it.hasNext()) + { + MemoryPoolMXBean pool = (MemoryPoolMXBean)it.next(); + log.finer(pool.getName() + " " + pool.getType() + + ": " + new CMemoryUsage(pool.getUsage())); + } + } + else + { + MemoryMXBean memory = ManagementFactory.getMemoryMXBean(); + log.fine("VM: " + new CMemoryUsage(memory.getNonHeapMemoryUsage())); + log.fine("Heap: " + new CMemoryUsage(memory.getHeapMemoryUsage())); + } + // Thread + ThreadMXBean th = ManagementFactory.getThreadMXBean(); + log.fine("Threads=" + th.getThreadCount() + + ", Peak=" + th.getPeakThreadCount() + + ", Demons=" + th.getDaemonThreadCount() + + ", Total=" + th.getTotalStartedThreadCount() + ); + } // info + + + /** + * Test + * @param args + */ + public static void main (String[] args) + { + new MSystem(); + } // main + +} // MSystem diff --git a/dbPort/src/org/compiere/model/MTab.java b/dbPort/src/org/compiere/model/MTab.java new file mode 100644 index 0000000000..dfb8b56930 --- /dev/null +++ b/dbPort/src/org/compiere/model/MTab.java @@ -0,0 +1,159 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Tab Model + * + * @author Jorg Janke + * @version $Id: MTab.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MTab extends X_AD_Tab +{ + + /** + * Standard Constructor + * @param ctx context + * @param AD_Tab_ID id + * @param trxName transaction + */ + public MTab (Properties ctx, int AD_Tab_ID, String trxName) + { + super (ctx, AD_Tab_ID, trxName); + if (AD_Tab_ID == 0) + { + // setAD_Window_ID (0); + // setAD_Table_ID (0); + // setName (null); + setEntityType (ENTITYTYPE_UserMaintained); // U + setHasTree (false); + setIsReadOnly (false); + setIsSingleRow (false); + setIsSortTab (false); // N + setIsTranslationTab (false); + setSeqNo (0); + setTabLevel (0); + setIsInsertRecord(true); + setIsAdvancedTab(false); + } + } // M_Tab + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTab (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // M_Tab + + /** + * Parent Constructor + * @param parent parent + */ + public MTab (MWindow parent) + { + this (parent.getCtx(), 0, parent.get_TrxName()); + setClientOrg(parent); + setAD_Window_ID(parent.getAD_Window_ID()); + setEntityType(parent.getEntityType()); + } // M_Tab + + /** + * Parent Constructor + * @param parent parent + * @param from copy from + */ + public MTab (MWindow parent, MTab from) + { + this (parent.getCtx(), 0, parent.get_TrxName()); + copyValues(from, this); + setClientOrg(parent); + setAD_Window_ID(parent.getAD_Window_ID()); + setEntityType(parent.getEntityType()); + } // M_Tab + + + /** The Fields */ + private MField[] m_fields = null; + + /** + * Get Fields + * @param reload reload data + * @return array of lines + * @param trxName transaction + */ + public MField[] getFields (boolean reload, String trxName) + { + if (m_fields != null && !reload) + return m_fields; + String sql = "SELECT * FROM AD_Field WHERE AD_Tab_ID=? ORDER BY SeqNo"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, getAD_Tab_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MField (getCtx(), rs, trxName)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + m_fields = new MField[list.size ()]; + list.toArray (m_fields); + return m_fields; + } // getFields + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + // UPDATE AD_Tab SET IsInsertRecord='N' WHERE IsInsertRecord='Y' AND IsReadOnly='Y' + if (isReadOnly() && isInsertRecord()) + setIsInsertRecord(false); + return true; + } + +} // M_Tab diff --git a/dbPort/src/org/compiere/model/MTable.java b/dbPort/src/org/compiere/model/MTable.java new file mode 100644 index 0000000000..e2a317c133 --- /dev/null +++ b/dbPort/src/org/compiere/model/MTable.java @@ -0,0 +1,576 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.lang.reflect.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Persistent Table Model + * + * @author Jorg Janke + * @version $Id: MTable.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class MTable extends X_AD_Table +{ + /** + * Get Table from Cache + * @param ctx context + * @param AD_Table_ID id + * @return MTable + */ + public static MTable get (Properties ctx, int AD_Table_ID) + { + Integer key = new Integer (AD_Table_ID); + MTable retValue = (MTable) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MTable (ctx, AD_Table_ID, null); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + /** + * Get Table from Cache + * @param ctx context + * @param tableName case insensitive table name + * @return Table + */ + public static MTable get (Properties ctx, String tableName) + { + if (tableName == null) + return null; + Iterator it = s_cache.values().iterator(); + while (it.hasNext()) + { + MTable retValue = (MTable)it.next(); + if (tableName.equalsIgnoreCase(retValue.getTableName())) + return retValue; + } + // + MTable retValue = null; + String sql = "SELECT * FROM AD_Table WHERE UPPER(TableName)=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString(1, tableName.toUpperCase()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTable (ctx, rs, null); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + if (retValue != null) + { + Integer key = new Integer (retValue.getAD_Table_ID()); + s_cache.put (key, retValue); + } + return retValue; + } // get + + /** + * Get Table Name + * @param ctx context + * @param AD_Table_ID table + * @return tavle name + */ + public static String getTableName (Properties ctx, int AD_Table_ID) + { + return MTable.get(ctx, AD_Table_ID).getTableName(); + } // getTableName + + + /** Cache */ + private static CCache s_cache = new CCache("AD_Table", 20); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTable.class); + + /** Packages for Model Classes */ + private static final String[] s_packages = new String[] { + "adempiere.model", // Extensions + "org.compiere.model", "org.compiere.wf", + "org.compiere.print", "org.compiere.impexp" + }; + + /** Special Classes */ + private static final String[] s_special = new String[] { + "AD_Element", "org.compiere.model.M_Element", + "AD_Registration", "org.compiere.model.M_Registration", + "AD_Tree", "org.compiere.model.MTree_Base", + "R_Category", "org.compiere.model.MRequestCategory", + "GL_Category", "org.compiere.model.MGLCategory", + "K_Category", "org.compiere.model.MKCategory", + "C_ValidCombination", "org.compiere.model.MAccount", + "C_Phase", "org.compiere.model.MProjectTypePhase", + "C_Task", "org.compiere.model.MProjectTypeTask" + // AD_Attribute_Value, AD_TreeNode + }; + + /** + * Get Persistency Class for Table + * @param tableName table name + * @return class or null + */ + public static Class getClass (String tableName) + { + // Not supported + if (tableName == null || tableName.endsWith("_Trl")) + return null; + + // Import Tables (Name conflict) + if (tableName.startsWith("I_")) + { + Class clazz = getPOclass("org.compiere.model.X_" + tableName); + if (clazz != null) + return clazz; + s_log.warning("No class for table: " + tableName); + return null; + } + + + // Special Naming + for (int i = 0; i < s_special.length; i++) + { + if (s_special[i++].equals(tableName)) + { + Class clazz = getPOclass(s_special[i]); + if (clazz != null) + return clazz; + break; + } + } + + // Strip table name prefix (e.g. AD_) Customizations are 3/4 + String className = tableName; + int index = className.indexOf('_'); + if (index > 0) + { + if (index < 3) // AD_, A_ + className = className.substring(index+1); + else + { + String prefix = className.substring(0,index); + if (prefix.equals("Fact")) // keep custom prefix + className = className.substring(index+1); + } + } + // Remove underlines + className = Util.replace(className, "_", ""); + + // Search packages + for (int i = 0; i < s_packages.length; i++) + { + StringBuffer name = new StringBuffer(s_packages[i]).append(".M").append(className); + Class clazz = getPOclass(name.toString()); + if (clazz != null) + return clazz; + } + + // Default Extension + Class clazz = getPOclass("adempiere.model.X_" + tableName); + if (clazz != null) + return clazz; + + // Default + clazz = getPOclass("org.compiere.model.X_" + tableName); + if (clazz != null) + return clazz; + + return null; + } // getClass + + /** + * Get PO class + * @param className fully qualified class name + * @return class or null + */ + private static Class getPOclass (String className) + { + try + { + Class clazz = Class.forName(className); + // Make sure that it is a PO class + Class superClazz = clazz.getSuperclass(); + while (superClazz != null) + { + if (superClazz == PO.class) + { + s_log.fine("Use: " + className); + return clazz; + } + superClazz = superClazz.getSuperclass(); + } + } + catch (Exception e) + { + } + s_log.finest("Not found: " + className); + return null; + } // getPOclass + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Table_ID id + * @param trxName transaction + */ + public MTable (Properties ctx, int AD_Table_ID, String trxName) + { + super (ctx, AD_Table_ID, trxName); + if (AD_Table_ID == 0) + { + // setName (null); + // setTableName (null); + setAccessLevel (ACCESSLEVEL_SystemOnly); // 4 + setEntityType (ENTITYTYPE_UserMaintained); // U + setIsChangeLog (false); + setIsDeleteable (false); + setIsHighVolume (false); + setIsSecurityEnabled (false); + setIsView (false); // N + setReplicationType (REPLICATIONTYPE_Local); + } + } // MTable + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTable (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTable + + /** Columns */ + private MColumn[] m_columns = null; + + /** + * Get Columns + * @param requery requery + * @return array of columns + */ + public MColumn[] getColumns (boolean requery) + { + if (m_columns != null && !requery) + return m_columns; + String sql = "SELECT * FROM AD_Column WHERE AD_Table_ID=? ORDER BY ColumnName"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, getAD_Table_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MColumn (getCtx(), rs, get_TrxName())); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + m_columns = new MColumn[list.size ()]; + list.toArray (m_columns); + return m_columns; + } // getColumns + + /** + * Get Column + * @param columnName (case insensitive) + * @return column if found + */ + public MColumn getColumn (String columnName) + { + if (columnName == null || columnName.length() == 0) + return null; + getColumns(false); + // + for (int i = 0; i < m_columns.length; i++) + { + if (columnName.equalsIgnoreCase(m_columns[i].getColumnName())) + return m_columns[i]; + } + return null; + } // getColumn + + /************************************************************************** + * Get PO Class Instance + * @param Record_ID record + * @param trxName + * @return PO for Record or null + */ + public PO getPO (int Record_ID, String trxName) + { + String tableName = getTableName(); + Class clazz = getClass(tableName); + if (clazz == null) + { + log.log(Level.WARNING, "(id) - Class not found for " + tableName); + return null; + } + boolean errorLogged = false; + try + { + Constructor constructor = null; + try + { + constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class}); + } + catch (Exception e) + { + String msg = e.getMessage(); + if (msg == null) + msg = e.toString(); + log.warning("No transaction Constructor for " + clazz + " (" + msg + ")"); + } + + PO po = (PO)constructor.newInstance(new Object[] {getCtx(), new Integer(Record_ID), trxName}); + if (po != null && po.get_ID() != Record_ID) + return null; + return po; + } + catch (Exception e) + { + if (e.getCause() != null) + { + Throwable t = e.getCause(); + log.log(Level.SEVERE, "(id) - Table=" + tableName + ",Class=" + clazz, t); + errorLogged = true; + if (t instanceof Exception) + log.saveError("Error", (Exception)e.getCause()); + else + log.saveError("Error", "Table=" + tableName + ",Class=" + clazz); + } + else + { + log.log(Level.SEVERE, "(id) - Table=" + tableName + ",Class=" + clazz, e); + errorLogged = true; + log.saveError("Error", "Table=" + tableName + ",Class=" + clazz); + } + } + if (!errorLogged) + log.log(Level.SEVERE, "(id) - Not found - Table=" + tableName + + ", Record_ID=" + Record_ID); + return null; + } // getPO + + /** + * Get PO Class Instance + * @param rs result set + * @param trxName transaction + * @return PO for Record or null + */ + public PO getPO (ResultSet rs, String trxName) + { + String tableName = getTableName(); + Class clazz = getClass(tableName); + if (clazz == null) + { + log.log(Level.SEVERE, "(rs) - Class not found for " + tableName); + return null; + } + boolean errorLogged = false; + try + { + Constructor constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, ResultSet.class, String.class}); + PO po = (PO)constructor.newInstance(new Object[] {getCtx(), rs, trxName}); + return po; + } + catch (Exception e) + { + log.log(Level.SEVERE, "(rs) - Table=" + tableName + ",Class=" + clazz, e); + errorLogged = true; + log.saveError("Error", "Table=" + tableName + ",Class=" + clazz); + } + if (!errorLogged) + log.log(Level.SEVERE, "(rs) - Not found - Table=" + tableName); + return null; + } // getPO + + /** + * Get PO Class Instance + * @param whereClause where clause + * @param trxName transaction + * @return PO for Record or null + */ + public PO getPO (String whereClause, String trxName) + { + if (whereClause == null || whereClause.length() == 0) + return null; + // + PO po = null; + String sql = "SELECT * FROM " + getTableName() + " WHERE " + whereClause; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + po = getPO(rs, trxName); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + log.saveError("Error", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return po; + } // getPO + + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (isView() && isDeleteable()) + setIsDeleteable(false); + // + return true; + } // beforeSave + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + // Sync Table ID + if (newRecord) + { + MSequence.createTableSequence(getCtx(), getTableName(), get_TrxName()); + } + else + { + MSequence seq = MSequence.get(getCtx(), getTableName()); + if (seq == null || seq.get_ID() == 0) + MSequence.createTableSequence(getCtx(), getTableName(), get_TrxName()); + else if (!seq.getName().equals(getTableName())) + { + seq.setName(getTableName()); + seq.save(); + } + } + + return success; + } // afterSave + + /** + * Get SQL Create + * @return create table DDL + */ + public String getSQLCreate() + { + StringBuffer sb = new StringBuffer("CREATE TABLE ") + .append(getTableName()).append(" ("); + // + boolean hasPK = false; + boolean hasParents = false; + StringBuffer constraints = new StringBuffer(); + getColumns(true); + for (int i = 0; i < m_columns.length; i++) + { + if (i > 0) + sb.append(", "); + MColumn column = m_columns[i]; + sb.append(column.getSQLDDL()); + // + if (column.isKey()) + hasPK = true; + if (column.isParent()) + hasParents = true; + String constraint = column.getConstraint(getTableName()); + if (constraint != null && constraint.length() > 0) + constraints.append(", ").append(constraint); + } + // Multi Column PK + if (!hasPK && hasParents) + { + StringBuffer cols = new StringBuffer(); + for (int i = 0; i < m_columns.length; i++) + { + MColumn column = m_columns[i]; + if (!column.isParent()) + continue; + if (cols.length() > 0) + cols.append(", "); + cols.append(column.getColumnName()); + } + sb.append(", CONSTRAINT ") + .append(getTableName()).append("_Key PRIMARY KEY (") + .append(cols).append(")"); + } + + sb.append(constraints) + .append(")"); + return sb.toString(); + } // getSQLCreate + +} // MTable diff --git a/dbPort/src/org/compiere/model/MTableAccess.java b/dbPort/src/org/compiere/model/MTableAccess.java new file mode 100644 index 0000000000..885477349d --- /dev/null +++ b/dbPort/src/org/compiere/model/MTableAccess.java @@ -0,0 +1,147 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * + * + * @author Jorg Janke + * @version $Id: MTableAccess.java,v 1.3 2006/07/30 00:58:38 jjanke Exp $ + */ +public class MTableAccess extends X_AD_Table_Access +{ + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MTableAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MTableAccess + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTableAccess(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTableAccess + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MTableAccess["); + sb.append("AD_Role_ID=").append(getAD_Role_ID()) + .append(",AD_Table_ID=").append(getAD_Table_ID()) + .append(",Exclude=").append(isExclude()) + .append(",Type=").append(getAccessTypeRule()); + if (ACCESSTYPERULE_Accessing.equals(getAccessTypeRule())) + sb.append("-ReadOnly=").append(isReadOnly()); + else if (ACCESSTYPERULE_Exporting.equals(getAccessTypeRule())) + sb.append("-CanExport=").append(isCanExport()); + else if (ACCESSTYPERULE_Reporting.equals(getAccessTypeRule())) + sb.append("-CanReport=").append(isCanReport()); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Extended String Representation + * @param ctx context + * @return extended info + */ + public String toStringX (Properties ctx) + { + String in = Msg.getMsg(ctx, "Include"); + String ex = Msg.getMsg(ctx, "Exclude"); + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(ctx, "AD_Table_ID")) + .append("=").append(getTableName(ctx)); + if (ACCESSTYPERULE_Accessing.equals(getAccessTypeRule())) + sb.append(" - ").append(Msg.translate(ctx, "IsReadOnly")).append("=").append(isReadOnly()); + else if (ACCESSTYPERULE_Exporting.equals(getAccessTypeRule())) + sb.append(" - ").append(Msg.translate(ctx, "IsCanExport")).append("=").append(isCanExport()); + else if (ACCESSTYPERULE_Reporting.equals(getAccessTypeRule())) + sb.append(" - ").append(Msg.translate(ctx, "IsCanReport")).append("=").append(isCanReport()); + sb.append(" - ").append(isExclude() ? ex : in); + return sb.toString(); + } // toStringX + + /** TableName */ + private String m_tableName; + + /** + * Get Table Name + * @param ctx context + * @return table name + */ + public String getTableName (Properties ctx) + { + if (m_tableName == null) + { + String sql = "SELECT TableName FROM AD_Table WHERE AD_Table_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, getAD_Table_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + m_tableName = rs.getString(1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "getTableName", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // Get Clear Text + String realName = Msg.translate(ctx, m_tableName + "_ID"); + if (!realName.equals(m_tableName + "_ID")) + m_tableName = realName; + } + return m_tableName; + } // getTableName + +} // MTableAccess diff --git a/dbPort/src/org/compiere/model/MTest.java b/dbPort/src/org/compiere/model/MTest.java new file mode 100644 index 0000000000..95d892ab33 --- /dev/null +++ b/dbPort/src/org/compiere/model/MTest.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.math.*; +import java.sql.*; +import java.util.*; +import org.compiere.*; +import org.compiere.util.*; + +/** + * Test Model + * + * @author Jorg Janke + * @version $Id: MTest.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MTest extends X_Test +{ + /** + * Constructor + * @param ctx context + * @param Test_ID + * @param trxName transaction + */ + public MTest(Properties ctx, int Test_ID, String trxName) + { + super (ctx, Test_ID, trxName); + } // MTest + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTest(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTest + + /** + * Test Object Constructor + * @param ctx context + * @param testString test string + * @param testNo test no + */ + public MTest (Properties ctx, String testString, int testNo) + { + super(ctx, 0, null); + testString = testString + "_" + testNo; + setName(testString); + setDescription(testString + " " + testString + " " + testString); + setHelp (getDescription() + " - " + getDescription()); + setT_Date(new Timestamp (System.currentTimeMillis())); + setT_DateTime(new Timestamp (System.currentTimeMillis())); + setT_Integer(testNo); + setT_Amount(new BigDecimal(testNo)); + setT_Number(Env.ONE.divide(new BigDecimal(testNo), BigDecimal.ROUND_HALF_UP)); + // + setC_Currency_ID(100); // USD + setC_Location_ID(109); // Monroe + setC_UOM_ID(100); // Each + // setC_BPartner_ID(C_BPartner_ID); + // setC_Payment_ID(C_Payment_ID); + // setM_Locator_ID(M_Locator_ID); + // setM_Product_ID(M_Product_ID); + } // MTest + + + /** + * Before Delete + * @return true if it can be deleted + */ + protected boolean beforeDelete () + { + log.info("***"); + return true; + } + + /** + * After Delete + * @param success + * @return success + */ + protected boolean afterDelete (boolean success) + { + log.info("*** Success=" + success); + return success; + } + + /** + * Before Save + * @param newRecord + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + log.info("New=" + newRecord + " ***"); + return true; + } + + /** + * After Save + * @param newRecord + * @param success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + log.info("New=" + newRecord + ", Seccess=" + success + " ***"); + return success; + } // afterSave + + + /************************************************************************* + * Test + * @param args + */ + public static void main(String[] args) + { + Adempiere.startup(true); + Properties ctx = Env.getCtx(); + + /** Test CLOB */ + MTest t1 = new MTest (ctx, 0, null); + t1.setName("Test1"); + System.out.println("->" + t1.getCharacterData() + "<-"); + t1.save(); + t1.setCharacterData("Long Text JJ"); + t1.save(); + int Test_ID = t1.getTest_ID(); + // + MTest t2 = new MTest (Env.getCtx(), Test_ID, null); + System.out.println("->" + t2.getCharacterData() + "<-"); + + t2.delete(true); + + + /** Volume Test + for (int i = 1; i < 20000; i++) + { + new MTest (ctx, "test", i).save(); + } + /** */ + } // main + +} // MTest diff --git a/dbPort/src/org/compiere/model/MTree_Base.java b/dbPort/src/org/compiere/model/MTree_Base.java new file mode 100644 index 0000000000..bde9752e85 --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_Base.java @@ -0,0 +1,369 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Base Tree Model. + * (see also MTree in project base) + * + * @author Jorg Janke + * @version $Id: MTree_Base.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MTree_Base extends X_AD_Tree +{ + + /** + * Add Node to correct tree + * @param ctx cpntext + * @param treeType tree type + * @param Record_ID id + * @param trxName transaction + * @return true if node added + */ + public static boolean addNode (Properties ctx, String treeType, int Record_ID, String trxName) + { + // Get Tree + int AD_Tree_ID = 0; + MClient client = MClient.get(ctx); + MClientInfo ci = client.getInfo(); + + if (TREETYPE_Activity.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_Activity_ID(); + else if (TREETYPE_BoM.equals(treeType)) + throw new IllegalArgumentException("BoM Trees not supported"); + else if (TREETYPE_BPartner.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_BPartner_ID(); + else if (TREETYPE_Campaign.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_Campaign_ID(); + else if (TREETYPE_ElementValue.equals(treeType)) + throw new IllegalArgumentException("ElementValue cannot use this API"); + else if (TREETYPE_Menu.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_Menu_ID(); + else if (TREETYPE_Organization.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_Org_ID(); + else if (TREETYPE_Product.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_Product_ID(); + else if (TREETYPE_ProductCategory.equals(treeType)) + throw new IllegalArgumentException("Product Category Trees not supported"); + else if (TREETYPE_Project.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_Project_ID(); + else if (TREETYPE_SalesRegion.equals(treeType)) + AD_Tree_ID = ci.getAD_Tree_SalesRegion_ID(); + + if (AD_Tree_ID == 0) + throw new IllegalArgumentException("No Tree found"); + MTree_Base tree = MTree_Base.get(ctx, AD_Tree_ID, trxName); + if (tree.get_ID() != AD_Tree_ID) + throw new IllegalArgumentException("Tree found AD_Tree_ID=" + AD_Tree_ID); + + // Insert Tree in correct tree + boolean saved = false; + if (TREETYPE_Menu.equals(treeType)) + { + MTree_NodeMM node = new MTree_NodeMM (tree, Record_ID); + saved = node.save(); + } + else if (TREETYPE_BPartner.equals(treeType)) + { + MTree_NodeBP node = new MTree_NodeBP (tree, Record_ID); + saved = node.save(); + } + else if (TREETYPE_Product.equals(treeType)) + { + MTree_NodePR node = new MTree_NodePR (tree, Record_ID); + saved = node.save(); + } + else + { + MTree_Node node = new MTree_Node (tree, Record_ID); + saved = node.save(); + } + return saved; + } // addNode + + + /************************************************************************** + * Get Node TableName + * @param treeType tree type + * @return node table name, e.g. AD_TreeNode + */ + public static String getNodeTableName(String treeType) + { + String nodeTableName = "AD_TreeNode"; + if (TREETYPE_Menu.equals(treeType)) + nodeTableName += "MM"; + else if (TREETYPE_BPartner.equals(treeType)) + nodeTableName += "BP"; + else if (TREETYPE_Product.equals(treeType)) + nodeTableName += "PR"; + // + else if (TREETYPE_CMContainer.equals(treeType)) + nodeTableName += "CMC"; + else if (TREETYPE_CMContainerStage.equals(treeType)) + nodeTableName += "CMS"; + else if (TREETYPE_CMMedia.equals(treeType)) + nodeTableName += "CMM"; + else if (TREETYPE_CMTemplate.equals(treeType)) + nodeTableName += "CMT"; + // + else if (TREETYPE_User1.equals(treeType)) + nodeTableName += "U1"; + else if (TREETYPE_User2.equals(treeType)) + nodeTableName += "U2"; + else if (TREETYPE_User3.equals(treeType)) + nodeTableName += "U3"; + else if (TREETYPE_User4.equals(treeType)) + nodeTableName += "U4"; + return nodeTableName; + } // getNodeTableName + + /** + * Get Source TableName + * @param treeType tree typw + * @return source table name, e.g. AD_Org or null + */ + public static String getSourceTableName(String treeType) + { + if (treeType == null) + return null; + String sourceTable = null; + if (treeType.equals(TREETYPE_Menu)) + sourceTable = "AD_Menu"; + else if (treeType.equals(TREETYPE_Organization)) + sourceTable = "AD_Org"; + else if (treeType.equals(TREETYPE_Product)) + sourceTable = "M_Product"; + else if (treeType.equals(TREETYPE_ProductCategory)) + sourceTable = "M_Product_Category"; + else if (treeType.equals(TREETYPE_BoM)) + sourceTable = "M_BOM"; + else if (treeType.equals(TREETYPE_ElementValue)) + sourceTable = "C_ElementValue"; + else if (treeType.equals(TREETYPE_BPartner)) + sourceTable = "C_BPartner"; + else if (treeType.equals(TREETYPE_Campaign)) + sourceTable = "C_Campaign"; + else if (treeType.equals(TREETYPE_Project)) + sourceTable = "C_Project"; + else if (treeType.equals(TREETYPE_Activity)) + sourceTable = "C_Activity"; + else if (treeType.equals(TREETYPE_SalesRegion)) + sourceTable = "C_SalesRegion"; + // + else if (treeType.equals(TREETYPE_CMContainer)) + sourceTable = "CM_Container"; + else if (treeType.equals(TREETYPE_CMContainerStage)) + sourceTable = "CM_CStage"; + else if (treeType.equals(TREETYPE_CMMedia)) + sourceTable = "CM_Media"; + else if (treeType.equals(TREETYPE_CMTemplate)) + sourceTable = "CM_Template"; + // User Trees +// else if (treeType.equals(TREETYPE_User1)) +// sourceTable = "??"; + + return sourceTable; + } // getSourceTableName + + /** + * Get MTree_Base from Cache + * @param ctx context + * @param AD_Tree_ID id + * @param trxName transaction + * @return MTree_Base + */ + public static MTree_Base get (Properties ctx, int AD_Tree_ID, String trxName) + { + Integer key = new Integer (AD_Tree_ID); + MTree_Base retValue = (MTree_Base) s_cache.get (key); + if (retValue != null) + return retValue; + retValue = new MTree_Base (ctx, AD_Tree_ID, trxName); + if (retValue.get_ID () != 0) + s_cache.put (key, retValue); + return retValue; + } // get + + + /** Cache */ + private static CCache s_cache = new CCache("AD_Tree", 10); + + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Tree_ID id + * @param trxName transaction + */ + public MTree_Base (Properties ctx, int AD_Tree_ID, String trxName) + { + super(ctx, AD_Tree_ID, trxName); + if (AD_Tree_ID == 0) + { + // setName (null); + // setTreeType (null); + setIsAllNodes (true); // complete tree + setIsDefault(false); + } + } // MTree_Base + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_Base (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_Base + + /** + * Parent Constructor + * @param client client + * @param name name + * @param treeType + */ + public MTree_Base (MClient client, String name, String treeType) + { + this (client.getCtx(), 0, client.get_TrxName()); + setClientOrg (client); + setName (name); + setTreeType (treeType); + } // MTree_Base + + /** + * Full Constructor + * @param ctx context + * @param Name name + * @param TreeType tree type + * @param trxName transaction + */ + public MTree_Base (Properties ctx, String Name, String TreeType, + String trxName) + { + super(ctx, 0, trxName); + setName (Name); + setTreeType (TreeType); + setIsAllNodes (true); // complete tree + setIsDefault(false); + } // MTree_Base + + + /** + * Get Node TableName + * @return node table name, e.g. AD_TreeNode + */ + public String getNodeTableName() + { + return getNodeTableName(getTreeType()); + } // getNodeTableName + + /** + * Get Source TableName (i.e. where to get the name and color) + * @param tableNameOnly if false return From clause (alias = t) + * @return source table name, e.g. AD_Org or null + */ + public String getSourceTableName (boolean tableNameOnly) + { + String tableName = getSourceTableName(getTreeType()); + if (tableNameOnly) + return tableName; + if ("M_Product".equals(tableName)) + return "M_Product t INNER JOIN M_Product_Category x ON (t.M_Product_Category_ID=x.M_Product_Category_ID)"; + if ("C_BPartner".equals(tableName)) + return "C_BPartner t INNER JOIN C_BP_Group x ON (t.C_BP_Group_ID=x.C_BP_Group_ID)"; + if ("AD_Org".equals(tableName)) + return "AD_Org t INNER JOIN AD_OrgInfo i ON (t.AD_Org_ID=i.AD_Org_ID) " + + "LEFT OUTER JOIN AD_OrgType x ON (i.AD_OrgType_ID=x.AD_OrgType_ID)"; + if ("C_Campaign".equals(tableName)) + return "C_Campaign t LEFT OUTER JOIN C_Channel x ON (t.C_Channel_ID=x.C_Channel_ID)"; + if (tableName != null) + tableName += " t"; + return tableName; + } // getSourceTableName + + + /** + * Get fully qualified Name of Action/Color Column + * @return NULL or Action or Color + */ + public String getActionColorName() + { + String tableName = getSourceTableName(getTreeType()); + if ("AD_Menu".equals(tableName)) + return "t.Action"; + if ("M_Product".equals(tableName) || "C_BPartner".equals(tableName) + || "AD_Org".equals(tableName) || "C_Campaign".equals(tableName)) + return "x.AD_PrintColor_ID"; + // return "NULL"; // globalqss - saca error en PostgreSQL + return "0"; + } // getSourceTableName + + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + if (!isActive() || !isAllNodes()) + setIsDefault(false); + return true; + } // beforeSabe + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord) // Base Node + { + if (TREETYPE_BPartner.equals(getTreeType())) + { + MTree_NodeBP ndBP = new MTree_NodeBP(this, 0); + ndBP.save(); + } + else if (TREETYPE_Menu.equals(getTreeType())) + { + MTree_NodeMM ndMM = new MTree_NodeMM(this, 0); + ndMM.save(); + } + else if (TREETYPE_Product.equals(getTreeType())) + { + MTree_NodePR ndPR = new MTree_NodePR(this, 0); + ndPR.save(); + } + else + { + MTree_Node nd = new MTree_Node(this, 0); + nd.save(); + } + } + + return success; + } // afterSave + +} // MTree_Base diff --git a/dbPort/src/org/compiere/model/MTree_Node.java b/dbPort/src/org/compiere/model/MTree_Node.java new file mode 100644 index 0000000000..2b7ca2f8ef --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_Node.java @@ -0,0 +1,103 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * (Disk) Tree Node Model + * + * @author Jorg Janke + * @version $Id: MTree_Node.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MTree_Node extends X_AD_TreeNode +{ + /** + * Get Tree Node + * @param tree tree + * @param Node_ID node + * @return node or null + */ + public static MTree_Node get (MTree_Base tree, int Node_ID) + { + MTree_Node retValue = null; + String sql = "SELECT * FROM AD_TreeNode WHERE AD_Tree_ID=? AND Node_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, tree.get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Node_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTree_Node (tree.getCtx(), rs, tree.get_TrxName()); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTree_Node.class); + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_Node (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_Node + + /** + * Full Constructor + * @param tree tree + * @param Node_ID node + */ + public MTree_Node (MTree_Base tree, int Node_ID) + { + super (tree.getCtx(), 0, tree.get_TrxName()); + setClientOrg(tree); + setAD_Tree_ID (tree.getAD_Tree_ID()); + setNode_ID(Node_ID); + // Add to root + setParent_ID(0); + setSeqNo (0); + } // MTree_Node + +} // MTree_Node diff --git a/dbPort/src/org/compiere/model/MTree_NodeBP.java b/dbPort/src/org/compiere/model/MTree_NodeBP.java new file mode 100644 index 0000000000..c6daaba28b --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_NodeBP.java @@ -0,0 +1,103 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * (Disk) Tree Node Model BPartner + * + * @author Jorg Janke + * @version $Id: MTree_NodeBP.java,v 1.3 2006/07/30 00:58:38 jjanke Exp $ + */ +public class MTree_NodeBP extends X_AD_TreeNodeBP +{ + /** + * Get Tree Node + * @param tree tree + * @param Node_ID node + * @return node or null + */ + public static MTree_NodeBP get (MTree_Base tree, int Node_ID) + { + MTree_NodeBP retValue = null; + String sql = "SELECT * FROM AD_TreeNodeBP WHERE AD_Tree_ID=? AND Node_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, tree.get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Node_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTree_NodeBP (tree.getCtx(), rs, tree.get_TrxName()); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTree_NodeBP.class); + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_NodeBP(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_NodeBP + + /** + * Full Constructor + * @param tree tree + * @param Node_ID node + */ + public MTree_NodeBP (MTree_Base tree, int Node_ID) + { + super (tree.getCtx(), 0, tree.get_TrxName()); + setClientOrg(tree); + setAD_Tree_ID (tree.getAD_Tree_ID()); + setNode_ID(Node_ID); + // Add to root + setParent_ID(0); + setSeqNo (0); + } // MTree_NodeBP + +} // MTree_NodeBP diff --git a/dbPort/src/org/compiere/model/MTree_NodeCMC.java b/dbPort/src/org/compiere/model/MTree_NodeCMC.java new file mode 100644 index 0000000000..233529f4da --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_NodeCMC.java @@ -0,0 +1,157 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * (Disk) Tree Node Model CM Container + * + * @author Jorg Janke + * @version $Id: MTree_NodeCMC.java,v 1.3 2006/09/16 07:28:53 comdivision Exp $ + */ +public class MTree_NodeCMC extends X_AD_TreeNodeCMC +{ + /** + * Get Tree + * @param ctx context + * @param AD_Tree_ID tree + * @param trxName transaction + * @return array of nodes + */ + public static MTree_NodeCMC[] getTree (Properties ctx, int AD_Tree_ID, String trxName) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_TreeNodeCMC WHERE AD_Tree_ID=? ORDER BY Node_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, AD_Tree_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + list.add (new MTree_NodeCMC (ctx, rs, trxName)); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MTree_NodeCMC[] retValue = new MTree_NodeCMC[list.size ()]; + list.toArray (retValue); + return retValue; + } // getTree + + + /** + * Get Tree Node + * @param tree tree + * @param Node_ID node + * @return node or null + */ + public static MTree_NodeCMC get (MTree_Base tree, int Node_ID) + { + MTree_NodeCMC retValue = null; + String sql = "SELECT * FROM AD_TreeNodeCMC WHERE AD_Tree_ID=? AND Node_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, tree.get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Node_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTree_NodeCMC (tree.getCtx(), rs, tree.get_TrxName()); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTree_NodeCMC.class); + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_NodeCMC (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_NodeCMC + + /** + * Full Constructor + * @param tree tree + * @param Node_ID node + */ + public MTree_NodeCMC (MTree_Base tree, int Node_ID) + { + super (tree.getCtx(), 0, tree.get_TrxName()); + setClientOrg(tree); + setAD_Tree_ID (tree.getAD_Tree_ID()); + setNode_ID(Node_ID); + // Add to root + setParent_ID(0); + setSeqNo (0); + } // MTree_NodeCMC + + /** + * setParent_ID overwrite as Tree's need to allow 0 parents + * @see org.compiere.model.X_AD_TreeNodeCMC#setParent_ID(int) + * @param Parent_ID + */ + public void setParent_ID (int Parent_ID) + { + set_Value ("Parent_ID", new Integer(Parent_ID)); + } +} // MTree_NodeCMC diff --git a/dbPort/src/org/compiere/model/MTree_NodeCMS.java b/dbPort/src/org/compiere/model/MTree_NodeCMS.java new file mode 100644 index 0000000000..744a8099a9 --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_NodeCMS.java @@ -0,0 +1,147 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * (Disk) Tree Node Model CM Stage + * + * @author Jorg Janke + * @version $Id: MTree_NodeCMS.java,v 1.2 2006/07/30 00:58:36 jjanke Exp $ + */ +public class MTree_NodeCMS extends X_AD_TreeNodeCMS +{ + /** + * Get Tree + * @param ctx context + * @param AD_Tree_ID tree + * @param trxName transaction + * @return array of nodes + */ + public static MTree_NodeCMS[] getTree (Properties ctx, int AD_Tree_ID, String trxName) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_TreeNodeCMS WHERE AD_Tree_ID=? ORDER BY Node_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, AD_Tree_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + list.add (new MTree_NodeCMS (ctx, rs, trxName)); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MTree_NodeCMS[] retValue = new MTree_NodeCMS[list.size ()]; + list.toArray (retValue); + return retValue; + } // getTree + + /** + * Get Tree Node + * @param tree tree + * @param Node_ID node + * @return node or null + */ + public static MTree_NodeCMS get (MTree_Base tree, int Node_ID) + { + MTree_NodeCMS retValue = null; + String sql = "SELECT * FROM AD_TreeNodeCMS WHERE AD_Tree_ID=? AND Node_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, tree.get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Node_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTree_NodeCMS (tree.getCtx(), rs, tree.get_TrxName()); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTree_NodeCMS.class); + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_NodeCMS (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_NodeCMS + + /** + * Full Constructor + * @param tree tree + * @param Node_ID node + */ + public MTree_NodeCMS (MTree_Base tree, int Node_ID) + { + super (tree.getCtx(), 0, tree.get_TrxName()); + setClientOrg(tree); + setAD_Tree_ID (tree.getAD_Tree_ID()); + setNode_ID(Node_ID); + // Add to root + setParent_ID(0); + setSeqNo (0); + } // MTree_NodeCMS + +} // MTree_NodeCMS diff --git a/dbPort/src/org/compiere/model/MTree_NodeMM.java b/dbPort/src/org/compiere/model/MTree_NodeMM.java new file mode 100644 index 0000000000..7ad55f57ef --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_NodeMM.java @@ -0,0 +1,103 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * (Disk) Tree Node Model Menu + * + * @author Jorg Janke + * @version $Id: MTree_NodeMM.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MTree_NodeMM extends X_AD_TreeNodeMM +{ + /** + * Get Tree Node + * @param tree tree + * @param Node_ID node + * @return node or null + */ + public static MTree_NodeMM get (MTree_Base tree, int Node_ID) + { + MTree_NodeMM retValue = null; + String sql = "SELECT * FROM AD_TreeNodeMM WHERE AD_Tree_ID=? AND Node_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, tree.get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Node_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTree_NodeMM (tree.getCtx(), rs, tree.get_TrxName()); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "get", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTree_NodeMM.class); + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_NodeMM (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_NodeMM + + /** + * Full Constructor + * @param tree tree + * @param Node_ID node + */ + public MTree_NodeMM (MTree_Base tree, int Node_ID) + { + super (tree.getCtx(), 0, tree.get_TrxName()); + setClientOrg(tree); + setAD_Tree_ID (tree.getAD_Tree_ID()); + setNode_ID(Node_ID); + // Add to root + setParent_ID(0); + setSeqNo (0); + } // MTree_NodeMM + +} // MTree_NodeMM diff --git a/dbPort/src/org/compiere/model/MTree_NodePR.java b/dbPort/src/org/compiere/model/MTree_NodePR.java new file mode 100644 index 0000000000..67efbf2211 --- /dev/null +++ b/dbPort/src/org/compiere/model/MTree_NodePR.java @@ -0,0 +1,103 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * (Disk) Tree Node Model Product + * + * @author Jorg Janke + * @version $Id: MTree_NodePR.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MTree_NodePR extends X_AD_TreeNodePR +{ + /** + * Get Tree Node + * @param tree tree + * @param Node_ID node + * @return node or null + */ + public static MTree_NodePR get (MTree_Base tree, int Node_ID) + { + MTree_NodePR retValue = null; + String sql = "SELECT * FROM AD_TreeNodePR WHERE AD_Tree_ID=? AND Node_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, tree.get_TrxName()); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Node_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = new MTree_NodePR (tree.getCtx(), rs, tree.get_TrxName()); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MTree_NodePR.class); + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MTree_NodePR(Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MTree_NodePR + + /** + * Full Constructor + * @param tree tree + * @param Node_ID node + */ + public MTree_NodePR (MTree_Base tree, int Node_ID) + { + super (tree.getCtx(), 0, tree.get_TrxName()); + setClientOrg(tree); + setAD_Tree_ID (tree.getAD_Tree_ID()); + setNode_ID(Node_ID); + // Add to root + setParent_ID(0); + setSeqNo (0); + } // MTree_NodePR + +} // MTree_NodePR diff --git a/dbPort/src/org/compiere/model/MUser.java b/dbPort/src/org/compiere/model/MUser.java new file mode 100644 index 0000000000..620b581f34 --- /dev/null +++ b/dbPort/src/org/compiere/model/MUser.java @@ -0,0 +1,668 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.mail.internet.*; +import javax.naming.*; +import javax.naming.directory.*; + +import org.compiere.util.*; + +/** + * User Model + * + * @author Jorg Janke + * @version $Id: MUser.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class MUser extends X_AD_User +{ + /** + * Get active Users of BPartner + * @param ctx context + * @param C_BPartner_ID id + * @return array of users + */ + public static MUser[] getOfBPartner (Properties ctx, int C_BPartner_ID) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_User WHERE C_BPartner_ID=? AND IsActive='Y'"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, C_BPartner_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MUser(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + MUser[] retValue = new MUser[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfBPartner + + /** + * Get Users with Role + * @param role role + * @return array of users + */ + public static MUser[] getWithRole (MRole role) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_User u " + + "WHERE u.IsActive='Y'" + + " AND EXISTS (SELECT * FROM AD_User_Roles ur " + + "WHERE ur.AD_User_ID=u.AD_User_ID AND ur.AD_Role_ID=? AND ur.IsActive='Y')"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, role.getAD_Role_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MUser(role.getCtx(), rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + MUser[] retValue = new MUser[list.size ()]; + list.toArray (retValue); + return retValue; + } // getWithRole + + /** + * Get User (cached) + * Also loads Admninistrator (0) + * @param ctx context + * @param AD_User_ID id + * @return user + */ + public static MUser get (Properties ctx, int AD_User_ID) + { + Integer key = new Integer(AD_User_ID); + MUser retValue = (MUser)s_cache.get(key); + if (retValue == null) + { + retValue = new MUser (ctx, AD_User_ID, null); + if (AD_User_ID == 0) + { + String trxName = null; + retValue.load(trxName); // load System Record + } + s_cache.put(key, retValue); + } + return retValue; + } // get + + /** + * Get Current User (cached) + * @param ctx context + * @return user + */ + public static MUser get (Properties ctx) + { + return get(ctx, Env.getAD_User_ID(ctx)); + } // get + + /** + * Get User + * @param ctx context + * @param name name + * @param password password + * @return user or null + */ + public static MUser get (Properties ctx, String name, String password) + { + if (name == null || name.length() == 0 || password == null || password.length() == 0) + { + s_log.warning ("Invalid Name/Password = " + name + "/" + password); + return null; + } + int AD_Client_ID = Env.getAD_Client_ID(ctx); + + MUser retValue = null; + String sql = "SELECT * FROM AD_User " + + "WHERE Name=? AND Password=? AND IsActive='Y' AND AD_Client_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, name); + pstmt.setString (2, password); + pstmt.setInt(3, AD_Client_ID); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + retValue = new MUser (ctx, rs, null); + if (rs.next()) + s_log.warning ("More then one user with Name/Password = " + name); + } + else + s_log.fine("No record"); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + /** + * Get Name of AD_User + * @param AD_User_ID System User + * @return Name of user or ? + */ + public static String getNameOfUser (int AD_User_ID) + { + String name = "?"; + // Get ID + String sql = "SELECT Name FROM AD_User WHERE AD_User_ID=?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_User_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + name = rs.getString(1); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + } + return name; + } // getNameOfUser + + + /** + * User is SalesRep + * @param AD_User_ID user + * @return true if sales rep + */ + public static boolean isSalesRep (int AD_User_ID) + { + if (AD_User_ID == 0) + return false; + String sql = "SELECT MAX(AD_User_ID) FROM AD_User u" + + " INNER JOIN C_BPartner bp ON (u.C_BPartner_ID=bp.C_BPartner_ID) " + + "WHERE bp.IsSalesRep='Y' AND AD_User_ID=?"; + int no = DB.getSQLValue(null, sql, AD_User_ID); + return no == AD_User_ID; + } // isSalesRep + + /** Cache */ + static private CCache s_cache = new CCache("AD_User", 30, 60); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MUser.class); + + + /************************************************************************** + * Default Constructor + * @param ctx context + * @param AD_User_ID id + * @param trxName transaction + */ + public MUser (Properties ctx, int AD_User_ID, String trxName) + { + super (ctx, AD_User_ID, trxName); // 0 is also System + if (AD_User_ID == 0) + { + setIsFullBPAccess (true); + setNotificationType(NOTIFICATIONTYPE_EMail); + } + } // MUser + + /** + * Parent Constructor + * @param partner partner + */ + public MUser (X_C_BPartner partner) + { + this (partner.getCtx(), 0, partner.get_TrxName()); + setClientOrg(partner); + setC_BPartner_ID (partner.getC_BPartner_ID()); + setName(partner.getName()); + } // MUser + + /** + * Load Constructor + * @param ctx context + * @param rs current row of result set to be loaded + * @param trxName transaction + */ + public MUser (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MUser + + /** Roles of User with Org */ + private MRole[] m_roles = null; + /** Roles of User with Org */ + private int m_rolesAD_Org_ID = -1; + /** Is Administrator */ + private Boolean m_isAdministrator = null; + /** User Access Rights */ + private X_AD_UserBPAccess[] m_bpAccess = null; + + + /** + * Add to Description + * @param description description to be added + */ + public void addDescription (String description) + { + if (description == null || description.length() == 0) + return; + String descr = getDescription(); + if (descr == null || descr.length() == 0) + setDescription (description); + else + setDescription (descr + " - " + description); + } // addDescription + + + /** + * String Representation + * @return Info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("MUser[") + .append(get_ID()) + .append(",Name=").append(getName()) + .append(",EMailUserID=").append(getEMailUser()) + .append ("]"); + return sb.toString (); + } // toString + + /** + * Is it an Online Access User + * @return true if it has an email and password + */ + public boolean isOnline () + { + if (getEMail() == null || getPassword() == null) + return false; + return true; + } // isOnline + + /** + * Convert EMail + * @return Valid Internet Address + */ + public InternetAddress getInternetAddress () + { + String email = getEMail(); + if (email == null || email.length() == 0) + return null; + try + { + InternetAddress ia = new InternetAddress (email, true); + if (ia != null) + ia.validate(); // throws AddressException + return ia; + } + catch (AddressException ex) + { + log.warning(email + " - " + ex.getLocalizedMessage()); + } + return null; + } // getInternetAddress + + /** + * Validate Email (does not work). + * Check DNS MX record + * @param ia email + * @return error message or "" + */ + private String validateEmail (InternetAddress ia) + { + if (ia == null) + return "NoEmail"; + if (true) + return null; + + Hashtable env = new Hashtable(); + env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory"); + // env.put(Context.PROVIDER_URL, "dns://admin.adempiere.org"); + try + { + DirContext ctx = new InitialDirContext(env); + // Attributes atts = ctx.getAttributes("admin"); + Attributes atts = ctx.getAttributes("dns://admin.adempiere.org", new String[] {"MX"}); + NamingEnumeration en = atts.getAll(); + // NamingEnumeration en = ctx.list("adempiere.org"); + while (en.hasMore()) + { + System.out.println(en.next()); + } + /**/ + } + catch (Exception e) + { + e.printStackTrace(); + return e.getLocalizedMessage(); + } + return null; + } // validateEmail + + /** + * Is the email valid + * @return return true if email is valid (artificial check) + */ + public boolean isEMailValid() + { + return validateEmail(getInternetAddress()) == null; + } // isEMailValid + + /** + * Could we send an email + * @return true if EMail Uwer/PW exists + */ + public boolean isCanSendEMail() + { + String s = getEMailUser(); + if (s == null || s.length() == 0) + return false; + s = getEMailUserPW(); + return s != null && s.length() > 0; + } // isCanSendEMail + + /** + * Get EMail Validation Code + * @return code + */ + public String getEMailVerifyCode() + { + long code = getAD_User_ID() + + getName().hashCode(); + return "C" + String.valueOf(Math.abs(code)) + "C"; + } // getEMailValidationCode + + /** + * Check & Set EMail Validation Code. + * @param code code + * @param info info + * @return true if valid + */ + public boolean setEMailVerifyCode (String code, String info) + { + boolean ok = code != null + && code.equals(getEMailVerifyCode()); + if (ok) + setEMailVerifyDate(new Timestamp(System.currentTimeMillis())); + else + setEMailVerifyDate(null); + setEMailVerify(info); + return ok; + } // setEMailValidationCode + + /** + * Is EMail Verified by response + * @return true if verified + */ + public boolean isEMailVerified() + { + // UPDATE AD_User SET EMailVerifyDate=SysDate, EMailVerify='Direct' WHERE AD_User_ID=1 + return getEMailVerifyDate() != null + && getEMailVerify() != null + && getEMailVerify().length() > 0; + } // isEMailVerified + + /** + * Get Notification via EMail + * @return true if email + */ + public boolean isNotificationEMail() + { + String s = getNotificationType(); + return s == null || NOTIFICATIONTYPE_EMail.equals(s); + } // isNotificationEMail + + /** + * Get Notification via Note + * @return true if note + */ + public boolean isNotificationNote() + { + String s = getNotificationType(); + return s != null && NOTIFICATIONTYPE_Notice.equals(s); + } // isNotificationNote + + + /************************************************************************** + * Get User Roles for Org + * @param AD_Org_ID org + * @return array of roles + */ + public MRole[] getRoles (int AD_Org_ID) + { + if (m_roles != null && m_rolesAD_Org_ID == AD_Org_ID) + return m_roles; + + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM AD_Role r " + + "WHERE r.IsActive='Y'" + + " AND EXISTS (SELECT * FROM AD_Role_OrgAccess ro" + + " WHERE r.AD_Role_ID=ro.AD_Role_ID AND ro.IsActive='Y' AND ro.AD_Org_ID=?)" + + " AND EXISTS (SELECT * FROM AD_User_Roles ur" + + " WHERE r.AD_Role_ID=ur.AD_Role_ID AND ur.IsActive='Y' AND ur.AD_User_ID=?) " + + "ORDER BY AD_Role_ID"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, get_TrxName()); + pstmt.setInt (1, AD_Org_ID); + pstmt.setInt (2, getAD_User_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MRole(getCtx(), rs, get_TrxName())); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + m_rolesAD_Org_ID = AD_Org_ID; + m_roles = new MRole[list.size()]; + list.toArray (m_roles); + return m_roles; + } // getRoles + + /** + * Is User an Administrator? + * @return true id Admin + */ + public boolean isAdministrator() + { + if (m_isAdministrator == null) + { + m_isAdministrator = Boolean.FALSE; + MRole[] roles = getRoles(0); + for (int i = 0; i < roles.length; i++) + { + if (roles[i].getAD_Role_ID() == 0) + { + m_isAdministrator = Boolean.TRUE; + break; + } + } + } + return m_isAdministrator.booleanValue(); + } // isAdministrator + + /** + * Has the user Access to BP info and resources + * @param BPAccessType access type + * @param params opt parameter + * @return true if access + */ + public boolean hasBPAccess (String BPAccessType, Object[] params) + { + if (isFullBPAccess()) + return true; + getBPAccess(false); + for (int i = 0; i < m_bpAccess.length; i++) + { + if (m_bpAccess[i].getBPAccessType().equals(BPAccessType)) + { + return true; + } + } + return false; + } // hasBPAccess + + /** + * Get active BP Access records + * @param requery requery + * @return access list + */ + public X_AD_UserBPAccess[] getBPAccess (boolean requery) + { + if (m_bpAccess != null && !requery) + return m_bpAccess; + String sql = "SELECT * FROM AD_UserBPAccess WHERE AD_User_ID=? AND IsActive='Y'"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getAD_User_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + list.add (new X_AD_UserBPAccess (getCtx(), rs, null)); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + m_bpAccess = new X_AD_UserBPAccess[list.size ()]; + list.toArray (m_bpAccess); + return m_bpAccess; + } // getBPAccess + + + /** + * Before Save + * @param newRecord new + * @return true + */ + protected boolean beforeSave (boolean newRecord) + { + // New Address invalidates verification + if (!newRecord && is_ValueChanged("EMail")) + setEMailVerifyDate(null); + return true; + } // beforeSave + + + /** + * Test + * @param args ignored + * + public static void main (String[] args) + { + try + { + validateEmail(new InternetAddress("jjanke@adempiere.org")); + } + catch (Exception e) + { + e.printStackTrace(); + } + + // org.compiere.Adempiere.startupClient(); + // System.out.println ( MUser.get(Env.getCtx(), "SuperUser", "22") ); + } // main /* */ +} // MUser diff --git a/dbPort/src/org/compiere/model/MUserOrgAccess.java b/dbPort/src/org/compiere/model/MUserOrgAccess.java new file mode 100644 index 0000000000..ba518d9d82 --- /dev/null +++ b/dbPort/src/org/compiere/model/MUserOrgAccess.java @@ -0,0 +1,225 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * User Org Access + * + * @author Jorg Janke + * @version $Id: MUserOrgAccess.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MUserOrgAccess extends X_AD_User_OrgAccess +{ + /** + * Get Organizational Access of User + * @param ctx context + * @param AD_User_ID user + * @return array of User Org Access + */ + public static MUserOrgAccess[] getOfUser (Properties ctx, int AD_User_ID) + { + return get (ctx, "SELECT * FROM AD_User_OrgAccess WHERE AD_User_ID=?", AD_User_ID); + } // getOfUser + + /** + * Get Organizational Info + * @param ctx context + * @param sql sql command + * @param id id + * @return array of User Org Access + */ + private static MUserOrgAccess[] get (Properties ctx, String sql, int id) + { + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, id); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MUserOrgAccess(ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MUserOrgAccess[] retValue = new MUserOrgAccess[list.size ()]; + list.toArray (retValue); + return retValue; + } // get + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MUserOrgAccess.class); + + + /************************************************************************** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MUserOrgAccess (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MUserOrgAccess + + /** + * Persistency Constructor + * @param ctx context + * @param ignored ignored + * @param trxName transaction + */ + public MUserOrgAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + setIsReadOnly(false); + } // MUserOrgAccess + + /** + * Organization Constructor + * @param org org + * @param AD_User_ID role + */ + public MUserOrgAccess (MOrg org, int AD_User_ID) + { + this (org.getCtx(), 0, org.get_TrxName()); + setClientOrg (org); + setAD_User_ID (AD_User_ID); + } // MUserOrgAccess + + /** + * User Constructor + * param user user + * param AD_Org_ID org + * + public MUserOrgAccess (MUser user, int AD_Org_ID) + { + this (user.getCtx(), 0, user.get_TrxName()); + setClientOrg (user.getAD_Client_ID(), AD_Org_ID); + setAD_User_ID (user.getAD_User_ID()); + } // MUserOrgAccess + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("MUserOrgAccess["); + sb.append("AD_User_ID=").append(getAD_User_ID()) + .append(",AD_Client_ID=").append(getAD_Client_ID()) + .append(",AD_Org_ID=").append(getAD_Org_ID()) + .append(",RO=").append(isReadOnly()); + sb.append("]"); + return sb.toString(); + } // toString + + + /************************************************************************** + * Extended String Representation + * @param ctx context + * @return extended info + */ + public String toStringX (Properties ctx) + { + StringBuffer sb = new StringBuffer(); + sb.append(Msg.translate(ctx, "AD_Client_ID")).append("=").append(getClientName()).append(" - ") + .append(Msg.translate(ctx, "AD_Org_ID")).append("=").append(getOrgName()); + return sb.toString(); + } // toStringX + + private String m_clientName; + private String m_orgName; + + /** + * Get Client Name + * @return name + */ + public String getClientName() + { + if (m_clientName == null) + { + String sql = "SELECT c.Name, o.Name " + + "FROM AD_Client c INNER JOIN AD_Org o ON (c.AD_Client_ID=o.AD_Client_ID) " + + "WHERE o.AD_Org_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, getAD_Org_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + m_clientName = rs.getString(1); + m_orgName = rs.getString(2); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } + return m_clientName; + } // getClientName + + /** + * Get Client Name + * @return name + */ + public String getOrgName() + { + if (m_orgName == null) + getClientName(); + return m_orgName; + } // getOrgName + +} // MUserOrgAccess diff --git a/dbPort/src/org/compiere/model/MUserRoles.java b/dbPort/src/org/compiere/model/MUserRoles.java new file mode 100644 index 0000000000..eb05772d87 --- /dev/null +++ b/dbPort/src/org/compiere/model/MUserRoles.java @@ -0,0 +1,177 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * User Roles Model + * + * @author Jorg Janke + * @version $Id: MUserRoles.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class MUserRoles extends X_AD_User_Roles +{ + /** + * Get User Roles Of Role + * @param ctx context + * @param AD_Role_ID role + * @return array of user roles + */ + public static MUserRoles[] getOfRole (Properties ctx, int AD_Role_ID) + { + String sql = "SELECT * FROM AD_User_Roles WHERE AD_Role_ID=?"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Role_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MUserRoles (ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "getOfRole", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MUserRoles[] retValue = new MUserRoles[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfRole + + /** + * Get User Roles Of User + * @param ctx context + * @param AD_User_ID role + * @return array of user roles + */ + public static MUserRoles[] getOfUser (Properties ctx, int AD_User_ID) + { + String sql = "SELECT * FROM AD_User_Roles WHERE AD_User_ID=?"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_User_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MUserRoles (ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "getOfUser", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MUserRoles[] retValue = new MUserRoles[list.size ()]; + list.toArray (retValue); + return retValue; + } // getOfUser + + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MUserRoles.class); + + + /************************************************************************** + * Persistence Constructor + * @param ctx context + * @param ignored invalid + * @param trxName transaction + */ + public MUserRoles (Properties ctx, int ignored, String trxName) + { + super (ctx, ignored, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + } // MUserRoles + + /** + * Load constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MUserRoles (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MUserRoles + + /** + * Full Constructor + * @param ctx context + * @param AD_User_ID user + * @param AD_Role_ID role + * @param trxName transaction + */ + public MUserRoles (Properties ctx, int AD_User_ID, int AD_Role_ID, String trxName) + { + this (ctx, 0, trxName); + setAD_User_ID(AD_User_ID); + setAD_Role_ID(AD_Role_ID); + } // MUserRoles + + /** + * Set User/Contact. + * User within the system - Internal or Business Partner Contact + * @param AD_User_ID user + */ + public void setAD_User_ID (int AD_User_ID) + { + set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); + } // setAD_User_ID + + /** + * Set Role. + * Responsibility Role + * @param AD_Role_ID role + **/ + public void setAD_Role_ID (int AD_Role_ID) + { + set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); + } // setAD_Role_ID + +} // MUserRoles diff --git a/dbPort/src/org/compiere/model/MWarehouse.java b/dbPort/src/org/compiere/model/MWarehouse.java new file mode 100644 index 0000000000..e8894dd32e --- /dev/null +++ b/dbPort/src/org/compiere/model/MWarehouse.java @@ -0,0 +1,236 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Warehouse Model + * + * @author Jorg Janke + * @version $Id: MWarehouse.java,v 1.3 2006/07/30 00:58:05 jjanke Exp $ + */ +public class MWarehouse extends X_M_Warehouse +{ + /** + * Get from Cache + * @param ctx context + * @param M_Warehouse_ID id + * @return warehouse + */ + public static MWarehouse get (Properties ctx, int M_Warehouse_ID) + { + Integer key = new Integer(M_Warehouse_ID); + MWarehouse retValue = (MWarehouse)s_cache.get(key); + if (retValue != null) + return retValue; + // + retValue = new MWarehouse (ctx, M_Warehouse_ID, null); + s_cache.put (key, retValue); + return retValue; + } // get + + /** + * Get Warehouses for Org + * @param ctx context + * @param AD_Org_ID id + * @return warehouse + */ + public static MWarehouse[] getForOrg (Properties ctx, int AD_Org_ID) + { + ArrayList list = new ArrayList(); + String sql = "SELECT * FROM M_Warehouse WHERE AD_Org_ID=? ORDER BY Created"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, AD_Org_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MWarehouse (ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + MWarehouse[] retValue = new MWarehouse[list.size ()]; + list.toArray (retValue); + return retValue; + } // get + + + /** Cache */ + private static CCache s_cache = new CCache("M_Warehouse", 5); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MWarehouse.class); + + /** + * Standard Constructor + * @param ctx context + * @param M_Warehouse_ID id + * @param trxName transaction + */ + public MWarehouse (Properties ctx, int M_Warehouse_ID, String trxName) + { + super(ctx, M_Warehouse_ID, trxName); + if (M_Warehouse_ID == 0) + { + // setValue (null); + // setName (null); + // setC_Location_ID (0); + setSeparator ("*"); // * + } + } // MWarehouse + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MWarehouse (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MWarehouse + + /** + * Organization Constructor + * @param org parent + */ + public MWarehouse (MOrg org) + { + this (org.getCtx(), 0, org.get_TrxName()); + setClientOrg(org); + setValue (org.getValue()); + setName (org.getName()); + if (org.getInfo() != null) + setC_Location_ID (org.getInfo().getC_Location_ID()); + } // MWarehouse + + /** Warehouse Locators */ + private MLocator[] m_locators = null; + + /** + * Get Locators + * @param reload if true reload + * @return array of locators + */ + public MLocator[] getLocators(boolean reload) + { + if (!reload && m_locators != null) + return m_locators; + // + String sql = "SELECT * FROM M_Locator WHERE M_Warehouse_ID=? ORDER BY X,Y,Z"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, getM_Warehouse_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add(new MLocator (getCtx(), rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + m_locators = new MLocator[list.size()]; + list.toArray (m_locators); + return m_locators; + } // getLocators + + /** + * Get Default Locator + * @return (first) default locator + */ + public MLocator getDefaultLocator() + { + MLocator[] locators = getLocators(false); + for (int i = 0; i < locators.length; i++) + { + if (locators[i].isDefault() && locators[i].isActive()) + return locators[i]; + } + // No Default - first one + if (locators.length > 0) + { + log.warning("No default locator for " + getName()); + return locators[0]; + } + // No Locator - create one + MLocator loc = new MLocator (this, "Standard"); + loc.setIsDefault(true); + loc.save(); + log.info("Created default locator for " + getName()); + return loc; + } // getLocators + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord & success) + insert_Accounting("M_Warehouse_Acct", "C_AcctSchema_Default", null); + + return success; + } // afterSave + + /** + * Before Delete + * @return true + */ + protected boolean beforeDelete () + { + return delete_Accounting("M_Warehouse_Acct"); + } // beforeDelete + +} // MWarehouse diff --git a/dbPort/src/org/compiere/model/MWindow.java b/dbPort/src/org/compiere/model/MWindow.java new file mode 100644 index 0000000000..cf860ba647 --- /dev/null +++ b/dbPort/src/org/compiere/model/MWindow.java @@ -0,0 +1,223 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.awt.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Window Model + * + * @author Jorg Janke + * @version $Id: MWindow.java,v 1.2 2006/07/30 00:58:05 jjanke Exp $ + */ +public class MWindow extends X_AD_Window +{ + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (MWindow.class); + + /** + * Standard Constructor + * @param ctx context + * @param AD_Window_ID + * @param trxName transaction + */ + public MWindow (Properties ctx, int AD_Window_ID, String trxName) + { + super (ctx, AD_Window_ID, trxName); + if (AD_Window_ID == 0) + { + setWindowType (WINDOWTYPE_Maintain); // M + setEntityType (ENTITYTYPE_UserMaintained); // U + setIsBetaFunctionality (false); + setIsDefault (false); + setIsSOTrx (true); // Y + } } // M_Window + + /** + * Koad Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public MWindow (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // M_Window + + /** + * Set Window Size + * @param size size + */ + public void setWindowSize (Dimension size) + { + if (size != null) + { + setWinWidth(size.width); + setWinHeight(size.height); + } + } // setWindowSize + + /** The Lines */ + private MTab[] m_tabs = null; + + /** + * Get Fields + * @param reload reload data + * @return array of lines + * @param trxName transaction + */ + public MTab[] getTabs (boolean reload, String trxName) + { + if (m_tabs != null && !reload) + return m_tabs; + String sql = "SELECT * FROM AD_Tab WHERE AD_Window_ID=? ORDER BY SeqNo"; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, trxName); + pstmt.setInt (1, getAD_Window_ID()); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new MTab (getCtx(), rs, trxName)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + m_tabs = new MTab[list.size ()]; + list.toArray (m_tabs); + return m_tabs; + } // getFields + + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + if (newRecord) // Add to all automatic roles + { + MRole[] roles = MRole.getOf(getCtx(), "IsManual='N'"); + for (int i = 0; i < roles.length; i++) + { + MWindowAccess wa = new MWindowAccess(this, roles[i].getAD_Role_ID()); + wa.save(); + } + } + // Menu/Workflow + else if (is_ValueChanged("IsActive") || is_ValueChanged("Name") + || is_ValueChanged("Description") || is_ValueChanged("Help")) + { + MMenu[] menues = MMenu.get(getCtx(), "AD_Window_ID=" + getAD_Window_ID()); + for (int i = 0; i < menues.length; i++) + { + menues[i].setName(getName()); + menues[i].setDescription(getDescription()); + menues[i].setIsActive(isActive()); + menues[i].save(); + } + // + X_AD_WF_Node[] nodes = getWFNodes(getCtx(), "AD_Window_ID=" + getAD_Window_ID()); + for (int i = 0; i < nodes.length; i++) + { + boolean changed = false; + if (nodes[i].isActive() != isActive()) + { + nodes[i].setIsActive(isActive()); + changed = true; + } + if (nodes[i].isCentrallyMaintained()) + { + nodes[i].setName(getName()); + nodes[i].setDescription(getDescription()); + nodes[i].setHelp(getHelp()); + changed = true; + } + if (changed) + nodes[i].save(); + } + } + return success; + } // afterSave + + + /** + * Get workflow nodes with where clause. + * Is here as MWFNode is in base + * @param ctx context + * @param whereClause where clause w/o the actual WHERE + * @return nodes + */ + public static X_AD_WF_Node[] getWFNodes (Properties ctx, String whereClause) + { + String sql = "SELECT * FROM AD_WF_Node"; + if (whereClause != null && whereClause.length() > 0) + sql += " WHERE " + whereClause; + ArrayList list = new ArrayList(); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + list.add (new X_AD_WF_Node (ctx, rs, null)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + X_AD_WF_Node[] retValue = new X_AD_WF_Node[list.size()]; + list.toArray (retValue); + return retValue; + } // getWFNode + +} // M_Window diff --git a/dbPort/src/org/compiere/model/MWindowAccess.java b/dbPort/src/org/compiere/model/MWindowAccess.java new file mode 100644 index 0000000000..aa10340505 --- /dev/null +++ b/dbPort/src/org/compiere/model/MWindowAccess.java @@ -0,0 +1,75 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + + +/** + * + * + * @author Jorg Janke + * @version $Id: MWindowAccess.java,v 1.4 2006/07/30 00:54:54 jjanke Exp $ + */ +public class MWindowAccess extends X_AD_Window_Access +{ + + /** + * Standard Constructor + * @param ctx context + * @param ignored - + * @param trxName transaction + */ + public MWindowAccess (Properties ctx, int ignored, String trxName) + { + super(ctx, 0, trxName); + if (ignored != 0) + throw new IllegalArgumentException("Multi-Key"); + else + { + // setAD_Role_ID (0); + // setAD_Window_ID (0); + setIsReadWrite (true); + } + } // MWindowAccess + + /** + * MWindowAccess + * @param ctx + * @param rs + * @param trxName transaction + */ + public MWindowAccess (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // MWindowAccess + + /** + * Parent Constructor + * @param parent parent + * @param AD_Role_ID role id + */ + public MWindowAccess (MWindow parent, int AD_Role_ID) + { + super (parent.getCtx(), 0, parent.get_TrxName()); + setClientOrg(parent); + setAD_Window_ID(parent.getAD_Window_ID()); + setAD_Role_ID (AD_Role_ID); + } // MWindowAccess + +} // MWindowAccess diff --git a/dbPort/src/org/compiere/model/M_Element.java b/dbPort/src/org/compiere/model/M_Element.java new file mode 100644 index 0000000000..6a5a885bfe --- /dev/null +++ b/dbPort/src/org/compiere/model/M_Element.java @@ -0,0 +1,245 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + + +/** + * System Element Model + * + * @author Jorg Janke + * @version $Id: M_Element.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class M_Element extends X_AD_Element +{ + /** + * Get case sensitive Column Name + * @param columnName case insentitive column name + * @return case sensitive column name + */ + public static String getColumnName (String columnName) + { + if (columnName == null || columnName.length() == 0) + return columnName; + String retValue = columnName; + String sql = "SELECT ColumnName FROM AD_Element WHERE UPPER(ColumnName)=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, columnName.toUpperCase()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + retValue = rs.getString(1); + if (rs.next()) + s_log.warning("Not unique: " + columnName + + " -> " + retValue + " - " + rs.getString(1)); + } + else + s_log.warning("No found: " + columnName); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, columnName, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // getColumnName + + /** + * Get Element + * @param ctx context + * @param columnName case insentitive column name + * @return case sensitive column name + */ + public static M_Element get (Properties ctx, String columnName) + { + if (columnName == null || columnName.length() == 0) + return null; + M_Element retValue = null; + String sql = "SELECT * FROM AD_Element WHERE UPPER(ColumnName)=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, columnName.toUpperCase()); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + { + retValue = new M_Element (ctx, rs, null); + if (rs.next()) + s_log.warning("Not unique: " + columnName + + " -> " + retValue + " - " + rs.getString("ColumnName")); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get + + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (M_Element.class); + + /************************************************************************** + * Standard Constructor + * @param ctx context + * @param AD_Element_ID element + * @param trxName transaction + */ + public M_Element (Properties ctx, int AD_Element_ID, String trxName) + { + super (ctx, AD_Element_ID, trxName); + if (AD_Element_ID == 0) + { + // setColumnName (null); + // setEntityType (null); // U + // setName (null); + // setPrintName (null); + } + } // M_Element + + /** + * Load Constructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public M_Element (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // M_Element + + /** + * Minimum Constructor + * @param ctx context + * @param columnName column + * @param EntityType entity type + * @param trxName trx + */ + public M_Element (Properties ctx, String columnName, String EntityType, + String trxName) + { + super(ctx, 0, trxName); + setColumnName (columnName); + setName (columnName); + setPrintName (columnName); + // + setEntityType (EntityType); // U + } // M_Element + + + /** + * After Save + * @param newRecord new + * @param success success + * @return success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + // Update Columns, Fields, Parameters, Print Info + if (!newRecord) + { + // Column + StringBuffer sql = new StringBuffer("UPDATE AD_Column SET ColumnName=") + .append(DB.TO_STRING(getColumnName())) + .append(", Name=").append(DB.TO_STRING(getName())) + .append(", Description=").append(DB.TO_STRING(getDescription())) + .append(", Help=").append(DB.TO_STRING(getHelp())) + .append(" WHERE AD_Element_ID=").append(get_ID()); + int no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine("afterSave - Columns updated #" + no); + + // Field + sql = new StringBuffer("UPDATE AD_Field SET Name=") + .append(DB.TO_STRING(getName())) + .append(", Description=").append(DB.TO_STRING(getDescription())) + .append(", Help=").append(DB.TO_STRING(getHelp())) + .append(" WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=") + .append(get_ID()) + .append(") AND IsCentrallyMaintained='Y'"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine("afterSave - Fields updated #" + no); + + // Parameter + sql = new StringBuffer("UPDATE AD_Process_Para SET ColumnName=") + .append(DB.TO_STRING(getColumnName())) + .append(", Name=").append(DB.TO_STRING(getName())) + .append(", Description=").append(DB.TO_STRING(getDescription())) + .append(", Help=").append(DB.TO_STRING(getHelp())) + .append(", AD_Element_ID=").append(get_ID()) + .append(" WHERE UPPER(ColumnName)=") + .append(DB.TO_STRING(getColumnName().toUpperCase())) + .append(" AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + sql = new StringBuffer("UPDATE AD_Process_Para SET ColumnName=") + .append(DB.TO_STRING(getColumnName())) + .append(", Name=").append(DB.TO_STRING(getName())) + .append(", Description=").append(DB.TO_STRING(getDescription())) + .append(", Help=").append(DB.TO_STRING(getHelp())) + .append(" WHERE AD_Element_ID=").append(get_ID()) + .append(" AND IsCentrallyMaintained='Y'"); + no += DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine("afterSave - Parameters updated #" + no); + + // Print Info + sql = new StringBuffer("UPDATE AD_PrintFormatItem pi SET PrintName=") + .append(DB.TO_STRING(getPrintName())) + .append(", Name=").append(DB.TO_STRING(getName())) + .append(" WHERE AD_Client_ID=0") + .append(" AND EXISTS (SELECT * FROM AD_Column c ") + .append("WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=") + .append(get_ID()).append(")"); + no = DB.executeUpdate(sql.toString(), get_TrxName()); + log.fine("afterSave - PrintFormatItem updated #" + no); + } + return success; + } // afterSave + +} // M_Element diff --git a/dbPort/src/org/compiere/model/M_Registration.java b/dbPort/src/org/compiere/model/M_Registration.java new file mode 100644 index 0000000000..e69ed49784 --- /dev/null +++ b/dbPort/src/org/compiere/model/M_Registration.java @@ -0,0 +1,75 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.*; + + +/** + * System Registration Model + * + * @author Jorg Janke + * @version $Id: M_Registration.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $ + */ +public class M_Registration extends X_AD_Registration +{ + /** + * Default Constructor + * @param ctx context + * @param AD_Registration_ID id + * @param trxName transaction + */ + public M_Registration (Properties ctx, int AD_Registration_ID, String trxName) + { + super (ctx, AD_Registration_ID, trxName); + setAD_Client_ID(0); + setAD_Org_ID(0); + setAD_System_ID(0); + } // M_Registration + + /** + * Load Cosntructor + * @param ctx context + * @param rs result set + * @param trxName transaction + */ + public M_Registration (Properties ctx, ResultSet rs, String trxName) + { + super(ctx, rs, trxName); + } // M_Registration + + + /** + * Before Save + * @param newRecord new + * @return true/false + */ + protected boolean beforeSave (boolean newRecord) + { + MSystem system = MSystem.get(getCtx()); + if (system.getName().equals("?") + || system.getUserName().equals("?")) + { + log.saveError("Error", "Define System first"); + return false; + } + return true; + } // beforeSave + + +} // M_Registration diff --git a/dbPort/src/org/compiere/model/ModelValidationEngine.java b/dbPort/src/org/compiere/model/ModelValidationEngine.java new file mode 100644 index 0000000000..23d42bd559 --- /dev/null +++ b/dbPort/src/org/compiere/model/ModelValidationEngine.java @@ -0,0 +1,302 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.beans.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Model Validation Engine + * + * @author Jorg Janke + * @version $Id: ModelValidationEngine.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ + */ +public class ModelValidationEngine +{ + /** + * Get Singleton + * @return engine + */ + public static ModelValidationEngine get() + { + if (s_engine == null) + s_engine = new ModelValidationEngine(); + return s_engine; + } // get + + /** Engine Singleton */ + private static ModelValidationEngine s_engine = null; + + + /************************************************************************** + * Constructor. + * Creates Model Validators + */ + private ModelValidationEngine () + { + super (); + // Go through all Clients and start Validators + MClient[] clients = MClient.getAll(new Properties()); + for (int i = 0; i < clients.length; i++) + { + String classNames = clients[i].getModelValidationClasses(); + if (classNames == null || classNames.length() == 0) + continue; + StringTokenizer st = new StringTokenizer(classNames, ";"); + while (st.hasMoreTokens()) + { + String className = null; + try + { + className = st.nextToken(); + if (className == null) + continue; + className = className.trim(); + if (className.length() == 0) + continue; + // + Class clazz = Class.forName(className); + ModelValidator validator = (ModelValidator)clazz.newInstance(); + initialize(validator, clients[i]); + } + catch (Exception e) + { + log.log(Level.SEVERE, className + ": " + e.getMessage()); + } + } + } + log.config(toString()); + } // ModelValidatorEngine + + /** Logger */ + private static CLogger log = CLogger.getCLogger(ModelValidationEngine.class); + /** Change Support */ + private VetoableChangeSupport m_changeSupport = new VetoableChangeSupport(this); + + /** Validators */ + private ArrayList m_validators = new ArrayList(); + /** Model Change Listeners */ + private Hashtable> m_modelChangeListeners = new Hashtable>(); + /** Document Validation Listeners */ + private Hashtable> m_docValidateListeners = new Hashtable>(); + + /** + * Initialize and add validator + * @param validator + * @param client + */ + private void initialize(ModelValidator validator, MClient client) + { + validator.initialize(this, client); + m_validators.add(validator); + } // initialize + + /** + * Called when login is complete + * @param AD_Client_ID client + * @param AD_Org_ID org + * @param AD_Role_ID role + * @param AD_User_ID user + * @return error message or null + */ + public String loginComplete (int AD_Client_ID, int AD_Org_ID, int AD_Role_ID, int AD_User_ID) + { + for (int i = 0; i < m_validators.size(); i++) + { + ModelValidator validator = (ModelValidator)m_validators.get(i); + if (AD_Client_ID == validator.getAD_Client_ID()) + { + String error = validator.login(AD_Org_ID, AD_Role_ID, AD_User_ID); + if (error != null && error.length() > 0) + return error; + } + } + return null; + } // loginComplete + + + /************************************************************************** + * Add Model Change Listener + * @param tableName table name + * @param listener listener + */ + public void addModelChange (String tableName, ModelValidator listener) + { + if (tableName == null || listener == null) + return; + // + String propertyName = tableName + listener.getAD_Client_ID(); + ArrayList list = (ArrayList)m_modelChangeListeners.get(propertyName); + if (list == null) + { + list = new ArrayList(); + list.add(listener); + m_modelChangeListeners.put(propertyName, list); + } + else + list.add(listener); + } // addModelValidator + + /** + * Remove Model Change Listener + * @param tableName table name + * @param listener listener + */ + public void removeModelChange (String tableName, ModelValidator listener) + { + if (tableName == null || listener == null) + return; + String propertyName = tableName + listener.getAD_Client_ID(); + ArrayList list = (ArrayList)m_modelChangeListeners.get(propertyName); + if (list == null) + return; + list.remove(listener); + if (list.size() == 0) + m_modelChangeListeners.remove(propertyName); + } // removeModelValidator + + /** + * Fire Model Change. + * Call modelChange method of added validators + * @param po persistent objects + * @param type ModelValidator.TYPE_* + * @return error message or NULL for no veto + */ + public String fireModelChange (PO po, int type) + { + if (po == null || m_modelChangeListeners.size() == 0) + return null; + // + String propertyName = po.get_TableName() + po.getAD_Client_ID(); + ArrayList list = (ArrayList)m_modelChangeListeners.get(propertyName); + if (list == null) + return null; + + // + for (int i = 0; i < list.size(); i++) + { + try + { + ModelValidator validator = (ModelValidator)list.get(i); + String error = validator.modelChange(po, type); + if (error != null && error.length() > 0) + return error; + } + catch (Exception e) + { + String error = e.getMessage(); + if (error == null) + error = e.toString(); + return error; + } + } + return null; + } // fireModelChange + + + /************************************************************************** + * Add Document Validation Listener + * @param tableName table name + * @param listener listener + */ + public void addDocValidate (String tableName, ModelValidator listener) + { + if (tableName == null || listener == null) + return; + // + String propertyName = tableName + listener.getAD_Client_ID(); + ArrayList list = (ArrayList)m_docValidateListeners.get(propertyName); + if (list == null) + { + list = new ArrayList(); + list.add(listener); + m_docValidateListeners.put(propertyName, list); + } + else + list.add(listener); + } // addDocValidate + + /** + * Remove Document Validation Listener + * @param tableName table name + * @param listener listener + */ + public void removeDocValidate (String tableName, ModelValidator listener) + { + if (tableName == null || listener == null) + return; + String propertyName = tableName + listener.getAD_Client_ID(); + ArrayList list = (ArrayList)m_docValidateListeners.get(propertyName); + if (list == null) + return; + list.remove(listener); + if (list.size() == 0) + m_docValidateListeners.remove(propertyName); + } // removeModelValidator + + /** + * Fire Document Validation. + * Call docValidate method of added validators + * @param po persistent objects + * @param timing see ModelValidator.TIMING_ constants + * @return error message or null + */ + public String fireDocValidate (PO po, int timing) + { + if (po == null || m_docValidateListeners.size() == 0) + return null; + // + String propertyName = po.get_TableName() + po.getAD_Client_ID(); + ArrayList list = (ArrayList)m_docValidateListeners.get(propertyName); + if (list == null) + return null; + + // + for (int i = 0; i < list.size(); i++) + { + ModelValidator validator = null; + try + { + validator = (ModelValidator)list.get(i); + String error = validator.docValidate(po, timing); + if (error != null && error.length() > 0) + return error; + } + catch (Exception e) + { + log.log(Level.SEVERE, validator.toString(), e); + } + } + return null; + } // fireModelChange + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("ModelValidationEngine["); + sb.append("Validators=#").append(m_validators.size()) + .append(", ModelChange=#").append(m_modelChangeListeners.size()) + .append(", DocValidate=#").append(m_docValidateListeners.size()) + .append("]"); + return sb.toString(); + } // toString +} // ModelValidatorEngine diff --git a/dbPort/src/org/compiere/model/ModelValidator.java b/dbPort/src/org/compiere/model/ModelValidator.java new file mode 100644 index 0000000000..9c42419047 --- /dev/null +++ b/dbPort/src/org/compiere/model/ModelValidator.java @@ -0,0 +1,90 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** + * Model Validator + * + * @author Jorg Janke + * @version $Id: ModelValidator.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $ + */ +public interface ModelValidator +{ + /** Model Change Type New */ + public static final int TYPE_NEW = 1; + /** Model Change Type Change */ + public static final int TYPE_CHANGE = 2; + /** Model Change Type Delete */ + public static final int TYPE_DELETE = 3; + + + /** + * Initialize Validation + * @param engine validation engine + * @param client client + */ + public void initialize (ModelValidationEngine engine, MClient client); + + /** + * Get Client to be monitored + * @return AD_Client_ID + */ + public int getAD_Client_ID(); + + /** + * User logged in + * Called before preferences are set + * @param AD_Org_ID org + * @param AD_Role_ID role + * @param AD_User_ID user + * @return error message or null + */ + public String login (int AD_Org_ID, int AD_Role_ID, int AD_User_ID); + + + /** + * Model Change of a monitored Table. + * Called after PO.beforeSave/PO.beforeDelete + * when you called addModelChange for the table + * @param po persistent object + * @param type TYPE_ + * @return error message or null + * @exception Exception if the recipient wishes the change to be not accept. + */ + public String modelChange (PO po, int type) throws Exception; + + + /** + * Validate Document. + * Called as first step of DocAction.prepareIt + * or at the end of DocAction.completeIt + * when you called addDocValidate for the table. + * Note that totals, etc. may not be correct before the prepare stage. + * @param po persistent object + * @param timing see TIMING_ constants + * @return error message or null - + * if not null, the pocument will be marked as Invalid. + */ + public String docValidate (PO po, int timing); + + + /** Called before document is prepared */ + public static final int TIMING_BEFORE_PREPARE = 1; + /** Called after document is processed */ + public static final int TIMING_AFTER_COMPLETE = 9; + +} // ModelValidator diff --git a/dbPort/src/org/compiere/model/Null.java b/dbPort/src/org/compiere/model/Null.java new file mode 100644 index 0000000000..f73967fa5b --- /dev/null +++ b/dbPort/src/org/compiere/model/Null.java @@ -0,0 +1,46 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** + * Database Null Indicator + * + * @author Jorg Janke + * @version $Id: Null.java,v 1.2 2006/07/30 00:58:04 jjanke Exp $ + */ +public class Null +{ + /** Singleton */ + public static final Null NULL = new Null(); + + /** + * NULL Constructor + */ + private Null () + { + } // Null + + /** + * String Representation + * @return info + */ + public String toString () + { + return "NULL"; + } // toString + +} // Null diff --git a/dbPort/src/org/compiere/model/Obscure.java b/dbPort/src/org/compiere/model/Obscure.java new file mode 100644 index 0000000000..5c5e9a4eb6 --- /dev/null +++ b/dbPort/src/org/compiere/model/Obscure.java @@ -0,0 +1,202 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + + +/** + * Obscure Strings (e.g. Credit Card Numbers). + * Obscure Type defined in AD_Field + * + * @author Jorg Janke + * @version $Id: Obscure.java,v 1.4 2006/10/02 05:19:06 jjanke Exp $ + */ +public class Obscure extends Object +{ + /** + * Obscure clear value. + * Obscure Digits but last 4 + * @param clearValue clear value + * @return obscured value or "-" + */ + public static String obscure (String clearValue) + { + if (clearValue == null || clearValue.length() == 0) + return "-"; + Obscure ob = new Obscure (clearValue); + return ob.getObscuredValue(); + } // obscure + + /** + * Obscure clear value + * @param clearValue clear value + * @param obscureType Obscure Type + * @return obscured value + */ + public static String obscure (String clearValue, String obscureType) + { + Obscure ob = new Obscure (clearValue, obscureType); + return ob.getObscuredValue(); + } // obscure + + + /************************************************************************** + * Obscure + */ + public Obscure () + { + } // Obscure + + /** + * Obscure. + * Obscure Digits but last 4 + * @param clearValue clear value + */ + public Obscure (String clearValue) + { + setClearValue(clearValue); + } // Obscure + + /** + * Obscure + * @param clearValue clear value + * @param obscureType Obscure Type + */ + public Obscure (String clearValue, String obscureType) + { + setClearValue(clearValue); + setType(obscureType); + } // Obscure + + /** Obscure Digits but last 4 = 904 (default) */ + public static final String OBSCURETYPE_ObscureDigitsButLast4 = "904"; + /** Obscure Digits but first/last 4 = 944 */ + public static final String OBSCURETYPE_ObscureDigitsButFirstLast4 = "944"; + /** Obscure AlphaNumeric but first/last 4 = A44 */ + public static final String OBSCURETYPE_ObscureAlphaNumericButFirstLast4 = "A44"; + /** Obscure AlphaNumeric but last 4 = A04 */ + public static final String OBSCURETYPE_ObscureAlphaNumericButLast4 = "A04"; + + /** Obscure Type */ + private String m_type = OBSCURETYPE_ObscureDigitsButLast4; + /** Clear Value */ + private String m_clearValue; + /** Obscrure Value */ + private String m_obscuredValue; + + /** + * Set Type + * @param obscureType Obscure Type + */ + public void setType (String obscureType) + { + if (obscureType == null || obscureType.equals("904") || obscureType.equals("944") || obscureType.equals("A44") || obscureType.equals("A04")) + { + m_type = obscureType; + m_obscuredValue = null; + return; + } + throw new IllegalArgumentException ("ObscureType Invalid value - Reference_ID=291 - 904 - 944 - A44 - A04"); + } // setType + + /** + * Get Obscure Type + * @return type + */ + public String getType () + { + return m_type; + } // getType + + /** + * Get Clear Value + * @return Returns the clear Value. + */ + public String getClearValue () + { + return m_clearValue; + } // getClearValue + + /** + * Set Clear Value + * @param clearValue The clearValue to set. + */ + public void setClearValue (String clearValue) + { + m_clearValue = clearValue; + m_obscuredValue = null; + } // setClearValue + + /** + * Get Obscured Value + * @param clearValue The clearValue to set. + * @return Returns the obscuredValue. + */ + public String getObscuredValue (String clearValue) + { + setClearValue(clearValue); + return getObscuredValue(); + } // getObscuredValue + + /** + * Get Obscured Value + * @return Returns the obscuredValue. + */ + public String getObscuredValue () + { + if (m_obscuredValue != null) + return m_obscuredValue; + if (m_clearValue == null || m_clearValue.length() == 0) + return m_clearValue; + // + boolean alpha = m_type.charAt(0) == 'A'; + int clearStart = Integer.parseInt(m_type.substring(1,2)); + int clearEnd = Integer.parseInt(m_type.substring(2)); + // + char[] chars = m_clearValue.toCharArray(); + int length = chars.length; + StringBuffer sb = new StringBuffer(length); + for (int i = 0; i < length; i++) + { + char c = chars[i]; + if (i < clearStart) + sb.append(c); + else if (i >= length-clearEnd) + sb.append(c); + else + { + if (!alpha && !Character.isDigit(c)) + sb.append(c); + else + sb.append('*'); + } + } + m_obscuredValue = sb.toString(); + return m_obscuredValue; + } // getObscuredValue + + + /************************************************************************** + * test + * @param args ignored + */ + public static void main (String[] args) + { + System.out.println (Obscure.obscure("1a2b3c4d5e6f7g8h9")); + } // main + + +} // Obscrure diff --git a/dbPort/src/org/compiere/model/PO.java b/dbPort/src/org/compiere/model/PO.java new file mode 100644 index 0000000000..65ee791606 --- /dev/null +++ b/dbPort/src/org/compiere/model/PO.java @@ -0,0 +1,3347 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.xml.parsers.*; +import javax.xml.transform.*; +import javax.xml.transform.dom.*; +import javax.xml.transform.stream.*; +import org.compiere.*; +import org.compiere.util.*; +import org.w3c.dom.*; + +/** + * Persistent Object. + * Superclass for actual implementations + * + * @author Jorg Janke + * @version $Id: PO.java,v 1.12 2006/08/09 16:38:47 jjanke Exp $ + */ +public abstract class PO + implements Serializable, Comparator, Evaluatee +{ + /** + * Set Document Value Workflow Manager + * @param docWFMgr mgr + */ + public static void setDocWorkflowMgr (DocWorkflowMgr docWFMgr) + { + s_docWFMgr = docWFMgr; + s_log.config (s_docWFMgr.toString()); + } // setDocWorkflowMgr + + /** Document Value Workflow Manager */ + private static DocWorkflowMgr s_docWFMgr = null; + + /** User Maintained Entity Type */ + static protected final String ENTITYTYPE_UserMaintained = "U"; + /** Dictionary Maintained Entity Type */ + static protected final String ENTITYTYPE_Dictionary = "D"; + + /************************************************************************** + * Create New Persisent Object + * @param ctx context + */ + public PO (Properties ctx) + { + this (ctx, 0, null, null); + } // PO + + /** + * Create & Load existing Persistent Object + * @param ID The unique ID of the object + * @param ctx context + * @param trxName transaction name + */ + public PO (Properties ctx, int ID, String trxName) + { + this (ctx, ID, trxName, null); + } // PO + + /** + * Create & Load existing Persistent Object. + * @param ctx context + * @param rs optional - load from current result set position (no navigation, not closed) + * if null, a new record is created. + * @param trxName transaction name + */ + public PO (Properties ctx, ResultSet rs, String trxName) + { + this (ctx, 0, trxName, rs); + } // PO + + /** + * Create & Load existing Persistent Object. + *

+	 *  You load
+	 * 		- an existing single key record with 	new PO (ctx, Record_ID)
+	 * 			or									new PO (ctx, Record_ID, trxName)
+	 * 			or									new PO (ctx, rs, get_TrxName())
+	 * 		- a new single key record with			new PO (ctx, 0)
+	 * 		- an existing multi key record with		new PO (ctx, rs, get_TrxName())
+	 * 		- a new multi key record with			new PO (ctx, null)
+	 *  The ID for new single key records is created automatically,
+	 *  you need to set the IDs for multi-key records explicitly.
+	 *	
+ * @param ctx context + * @param ID the ID if 0, the record defaults are applied - ignored if re exists + * @param trxName transaction name + * @param rs optional - load from current result set position (no navigation, not closed) + */ + public PO (Properties ctx, int ID, String trxName, ResultSet rs) + { + if (ctx == null) + throw new IllegalArgumentException ("No Context"); + p_ctx = ctx; + p_info = initPO(ctx); + if (p_info == null || p_info.getTableName() == null) + throw new IllegalArgumentException ("Invalid PO Info - " + p_info); + // + int size = p_info.getColumnCount(); + m_oldValues = new Object[size]; + m_newValues = new Object[size]; + m_trxName = trxName; + if (rs != null) + load(rs); // will not have virtual columns + else + load(ID, trxName); + } // PO + + /** + * Create New PO by Copying existing (key not copied). + * @param ctx context + * @param source souce object + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + public PO (Properties ctx, PO source, int AD_Client_ID, int AD_Org_ID) + { + this (ctx, 0, null, null); // create new + // + if (source != null) + copyValues (source, this); + setAD_Client_ID(AD_Client_ID); + setAD_Org_ID(AD_Org_ID); + } // PO + + + /** Logger */ + protected transient CLogger log = CLogger.getCLogger (getClass()); + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (PO.class); + + /** Context */ + protected Properties p_ctx; + /** Model Info */ + protected volatile POInfo p_info = null; + + /** Original Values */ + private Object[] m_oldValues = null; + /** New Valies */ + private Object[] m_newValues = null; + + /** Record_IDs */ + private Object[] m_IDs = new Object[] {I_ZERO}; + /** Key Columns */ + private String[] m_KeyColumns = null; + /** Create New for Multi Key */ + private boolean m_createNew = false; + /** Attachment with entriess */ + private MAttachment m_attachment = null; + /** Deleted ID */ + private int m_idOld = 0; + /** Custom Columns */ + private HashMap m_custom = null; + + /** Zero Integer */ + protected static final Integer I_ZERO = new Integer(0); + /** Accounting Columns */ + private ArrayList s_acctColumns = null; + + + /** Access Level S__ 100 4 System info */ + public static final int ACCESSLEVEL_SYSTEM = 4; + /** Access Level _C_ 010 2 Client info */ + public static final int ACCESSLEVEL_CLIENT = 2; + /** Access Level __O 001 1 Organization info */ + public static final int ACCESSLEVEL_ORG = 1; + /** Access Level SCO 111 7 System shared info */ + public static final int ACCESSLEVEL_ALL = 7; + /** Access Level SC_ 110 6 System/Client info */ + public static final int ACCESSLEVEL_SYSTEMCLIENT = 6; + /** Access Level _CO 011 3 Client shared info */ + public static final int ACCESSLEVEL_CLIENTORG = 3; + + + /** + * Initialize and return PO_Info + * @param ctx context + * @return POInfo + */ + abstract protected POInfo initPO (Properties ctx); + + /** + * Get Table Access Level + * @return Access Level + */ + abstract protected int get_AccessLevel(); + + /** + * String representation + * @return String representation + */ + public String toString() + { + StringBuffer sb = new StringBuffer("PO[") + .append(get_WhereClause(true)).append("]"); + return sb.toString(); + } // toString + + /** + * Equals based on ID + * @param cmp comperator + * @return true if ID the same + */ + public boolean equals (Object cmp) + { + if (cmp == null) + return false; + if (!(cmp instanceof PO)) + return false; + if (cmp.getClass().equals(this.getClass())) + return ((PO)cmp).get_ID() == get_ID(); + return super.equals(cmp); + } // equals + + /** + * Compare based on DocumentNo, Value, Name, Description + * @param o1 Object 1 + * @param o2 Object 2 + * @return -1 if o1 < o2 + */ + public int compare (Object o1, Object o2) + { + if (o1 == null) + return -1; + else if (o2 == null) + return 1; + if (!(o1 instanceof PO)) + throw new ClassCastException ("Not PO -1- " + o1); + if (!(o2 instanceof PO)) + throw new ClassCastException ("Not PO -2- " + o2); + // same class + if (o1.getClass().equals(o2.getClass())) + { + int index = get_ColumnIndex("DocumentNo"); + if (index == -1) + index = get_ColumnIndex("Value"); + if (index == -1) + index = get_ColumnIndex("Name"); + if (index == -1) + index = get_ColumnIndex("Description"); + if (index != -1) + { + PO po1 = (PO)o1; + Object comp1 = po1.get_Value(index); + PO po2 = (PO)o2; + Object comp2 = po2.get_Value(index); + if (comp1 == null) + return -1; + else if (comp2 == null) + return 1; + return comp1.toString().compareTo(comp2.toString()); + } + } + return o1.toString().compareTo(o2.toString()); + } // compare + + /** + * Get TableName. + * @return table name + */ + public String get_TableName() + { + return p_info.getTableName(); + } // get_TableName + + /** + * Get Key Columns. + * @return table name + */ + public String[] get_KeyColumns() + { + return m_KeyColumns; + } // get_KeyColumns + + /** + * Get Table ID. + * @return table id + */ + public int get_Table_ID() + { + return p_info.getAD_Table_ID(); + } // get_TableID + + /** + * Return Single Key Record ID + * @return ID or 0 + */ + public int get_ID() + { + Object oo = m_IDs[0]; + if (oo != null && oo instanceof Integer) + return ((Integer)oo).intValue(); + return 0; + } // getID + + /** + * Return Deleted Single Key Record ID + * @return ID or 0 + */ + public int get_IDOld() + { + return m_idOld; + } // getID + + /** + * Get Context + * @return context + */ + public Properties getCtx() + { + return p_ctx; + } // getCtx + + /** + * Get Logger + * @return logger + */ + public CLogger get_Logger() + { + return log; + } // getLogger + + /************************************************************************** + * Get Value + * @param index index + * @return value + */ + public final Object get_Value (int index) + { + if (index < 0 || index >= get_ColumnCount()) + { + log.log(Level.SEVERE, "Index invalid - " + index); + return null; + } + if (m_newValues[index] != null) + { + if (m_newValues[index].equals(Null.NULL)) + return null; + return m_newValues[index]; + } + return m_oldValues[index]; + } // get_Value + + /** + * Get Value as int + * @param index index + * @return int value or 0 + */ + protected int get_ValueAsInt (int index) + { + Object value = get_Value(index); + if (value == null) + return 0; + if (value instanceof Integer) + return ((Integer)value).intValue(); + try + { + return Integer.parseInt(value.toString()); + } + catch (NumberFormatException ex) + { + log.warning(p_info.getColumnName(index) + " - " + ex.getMessage()); + return 0; + } + } // get_ValueAsInt + + /** + * Get Value + * @param columnName column name + * @return value or null + */ + public final Object get_Value (String columnName) + { + int index = get_ColumnIndex(columnName); + if (index < 0) + { + log.log(Level.SEVERE, "Column not found - " + columnName); + Trace.printStack(); + return null; + } + return get_Value (index); + } // get_Value + + /** + * Get Encrypted Value + * @param columnName column name + * @return value or null + */ + protected final Object get_ValueE (String columnName) + { + return get_Value (columnName); + } // get_ValueE + + /** + * Get Column Value + * @param variableName name + * @return value or "" + */ + public String get_ValueAsString (String variableName) + { + Object value = get_Value (variableName); + if (value == null) + return ""; + return value.toString(); + } // get_ValueAsString + + /** + * Get Value of Column + * @param AD_Column_ID column + * @return value or null + */ + public final Object get_ValueOfColumn (int AD_Column_ID) + { + int index = p_info.getColumnIndex(AD_Column_ID); + if (index < 0) + { + log.log(Level.SEVERE, "Not found - AD_Column_ID=" + AD_Column_ID); + return null; + } + return get_Value (index); + } // get_ValueOfColumn + + /** + * Get Old Value + * @param index index + * @return value + */ + public final Object get_ValueOld (int index) + { + if (index < 0 || index >= get_ColumnCount()) + { + log.log(Level.SEVERE, "Index invalid - " + index); + return null; + } + return m_oldValues[index]; + } // get_ValueOld + + /** + * Get Old Value + * @param columnName column name + * @return value or null + */ + public final Object get_ValueOld (String columnName) + { + int index = get_ColumnIndex(columnName); + if (index < 0) + { + log.log(Level.SEVERE, "Column not found - " + columnName); + return null; + } + return get_ValueOld (index); + } // get_ValueOld + + /** + * Get Old Value as int + * @param columnName column name + * @return int value or 0 + */ + protected int get_ValueOldAsInt (String columnName) + { + Object value = get_ValueOld(columnName); + if (value == null) + return 0; + if (value instanceof Integer) + return ((Integer)value).intValue(); + try + { + return Integer.parseInt(value.toString()); + } + catch (NumberFormatException ex) + { + log.warning(columnName + " - " + ex.getMessage()); + return 0; + } + } // get_ValueOldAsInt + + /** + * Is Value Changed + * @param index index + * @return true if changed + */ + public final boolean is_ValueChanged (int index) + { + if (index < 0 || index >= get_ColumnCount()) + { + log.log(Level.SEVERE, "Index invalid - " + index); + return false; + } + if (m_newValues[index] == null) + return false; + return !m_newValues[index].equals(m_oldValues[index]); + } // is_ValueChanged + + /** + * Is Value Changed + * @param columnName column name + * @return true if changed + */ + public final boolean is_ValueChanged (String columnName) + { + int index = get_ColumnIndex(columnName); + if (index < 0) + { + log.log(Level.SEVERE, "Column not found - " + columnName); + return false; + } + return is_ValueChanged (index); + } // is_ValueChanged + + /** + * Return new - old. + * - New Value if Old Valus is null + * - New Value - Old Value if Number + * - otherwise null + * @param index index + * @return new - old or null if not appropiate or not changed + */ + public final Object get_ValueDifference (int index) + { + if (index < 0 || index >= get_ColumnCount()) + { + log.log(Level.SEVERE, "Index invalid - " + index); + return null; + } + Object nValue = m_newValues[index]; + // No new Value or NULL + if (nValue == null || nValue == Null.NULL) + return null; + // + Object oValue = m_oldValues[index]; + if (oValue == null || oValue == Null.NULL) + return nValue; + if (nValue instanceof BigDecimal) + { + BigDecimal obd = (BigDecimal)oValue; + return ((BigDecimal)nValue).subtract(obd); + } + else if (nValue instanceof Integer) + { + int result = ((Integer)nValue).intValue(); + result -= ((Integer)oValue).intValue(); + return new Integer(result); + } + // + log.warning("Invalid type - New=" + nValue); + return null; + } // get_ValueDifference + + /** + * Return new - old. + * - New Value if Old Valus is null + * - New Value - Old Value if Number + * - otherwise null + * @param columnName column name + * @return new - old or null if not appropiate or not changed + */ + public final Object get_ValueDifference (String columnName) + { + int index = get_ColumnIndex(columnName); + if (index < 0) + { + log.log(Level.SEVERE, "Column not found - " + columnName); + return null; + } + return get_ValueDifference (index); + } // get_ValueDifference + + + /************************************************************************** + * Set Value + * @param ColumnName column name + * @param value value + * @return true if value set + */ + protected final boolean set_Value (String ColumnName, Object value) + { + int index = get_ColumnIndex(ColumnName); + if (index < 0) + { + log.log(Level.SEVERE, "Column not found - " + ColumnName); + return false; + } + return set_Value (index, value); + } // setValue + + /** + * Set Encrypted Value + * @param ColumnName column name + * @param value value + * @return true if value set + */ + protected final boolean set_ValueE (String ColumnName, Object value) + { + return set_Value (ColumnName, value); + } // setValueE + + /** + * Set Value if updateable and correct class. + * (and to NULL if not mandatory) + * @param index index + * @param value value + * @return true if value set + */ + protected final boolean set_Value (int index, Object value) + { + if (index < 0 || index >= get_ColumnCount()) + { + log.log(Level.SEVERE, "Index invalid - " + index); + return false; + } + String ColumnName = p_info.getColumnName(index); + String colInfo = " - " + ColumnName; + // + if (p_info.isVirtualColumn(index)) + { + log.log(Level.SEVERE, "Virtual Column" + colInfo); + return false; + } + // + if (!p_info.isColumnUpdateable(index)) + { + colInfo += " - NewValue=" + value + " - OldValue=" + get_Value(index); + log.log(Level.SEVERE, "Column not updateable" + colInfo); + return false; + } + // + if (value == null) + { + if (p_info.isColumnMandatory(index)) + { + log.log(Level.SEVERE, "Cannot set mandatory column to null " + colInfo); + // Trace.printStack(); + return false; + } + m_newValues[index] = Null.NULL; // correct + log.finer(ColumnName + " = null"); + } + else + { + // matching class or generic object + if (value.getClass().equals(p_info.getColumnClass(index)) + || p_info.getColumnClass(index) == Object.class) + m_newValues[index] = value; // correct + // Integer can be set as BigDecimal + else if (value.getClass() == BigDecimal.class + && p_info.getColumnClass(index) == Integer.class) + m_newValues[index] = new Integer (((BigDecimal)value).intValue()); + // Set Boolean + else if (p_info.getColumnClass(index) == Boolean.class + && ("Y".equals(value) || "N".equals(value)) ) + m_newValues[index] = new Boolean("Y".equals(value)); + else + { + log.log(Level.SEVERE, ColumnName + + " - Class invalid: " + value.getClass().toString() + + ", Should be " + p_info.getColumnClass(index).toString() + ": " + value); + return false; + } + // Validate (Min/Max) + String error = p_info.validate(index, value); + if (error != null) + { + log.log(Level.WARNING, ColumnName + "=" + value + " - " + error); + return false; + } + // Length for String + if (p_info.getColumnClass(index) == String.class) + { + String stringValue = value.toString(); + int length = p_info.getFieldLength(index); + if (stringValue.length() > length && length > 0) + { + log.warning(ColumnName + " - Value too long - truncated to length=" + length); + m_newValues[index] = stringValue.substring(0,length-1); + } + } + log.finest(ColumnName + " = " + m_newValues[index]); + } + set_Keys (ColumnName, m_newValues[index]); + return true; + } // setValue + + /** + * Set Value w/o check (update, r/o, ..). + * Used when Column is R/O + * Required for key and parent values + * @param ColumnName column name + * @param value value + * @return true if value set + */ + protected final boolean set_ValueNoCheck (String ColumnName, Object value) + { + int index = get_ColumnIndex(ColumnName); + if (index < 0) + { + log.log(Level.SEVERE, "Column not found - " + ColumnName); + return false; + } + if (value == null) + m_newValues[index] = Null.NULL; // write direct + else + { + // matching class or generic object + if (value.getClass().equals(p_info.getColumnClass(index)) + || p_info.getColumnClass(index) == Object.class) + m_newValues[index] = value; // correct + // Integer can be set as BigDecimal + else if (value.getClass() == BigDecimal.class + && p_info.getColumnClass(index) == Integer.class) + m_newValues[index] = new Integer (((BigDecimal)value).intValue()); + // Set Boolean + else if (p_info.getColumnClass(index) == Boolean.class + && ("Y".equals(value) || "N".equals(value)) ) + m_newValues[index] = new Boolean("Y".equals(value)); + else + { + log.warning (ColumnName + + " - Class invalid: " + value.getClass().toString() + + ", Should be " + p_info.getColumnClass(index).toString() + ": " + value); + m_newValues[index] = value; // correct + } + // Validate (Min/Max) + String error = p_info.validate(index, value); + if (error != null) + log.warning(ColumnName + "=" + value + " - " + error); + // length for String + if (p_info.getColumnClass(index) == String.class) + { + String stringValue = value.toString(); + int length = p_info.getFieldLength(index); + if (stringValue.length() > length && length > 0) + { + log.warning(ColumnName + " - Value too long - truncated to length=" + length); + m_newValues[index] = stringValue.substring(0,length-1); + } + } + } + log.finest(ColumnName + " = " + m_newValues[index] + + " (" + (m_newValues[index]==null ? "-" : m_newValues[index].getClass().getName()) + ")"); + set_Keys (ColumnName, m_newValues[index]); + return true; + } // set_ValueNoCheck + + /** + * Set Encrypted Value w/o check (update, r/o, ..). + * Used when Column is R/O + * Required for key and parent values + * @param ColumnName column name + * @param value value + * @return true if value set + */ + protected final boolean set_ValueNoCheckE (String ColumnName, Object value) + { + return set_ValueNoCheckE (ColumnName, value); + } // set_ValueNoCheckE + + + /** + * Set Value of Column + * @param AD_Column_ID column + * @param value value + */ + public final void set_ValueOfColumn (int AD_Column_ID, Object value) + { + int index = p_info.getColumnIndex(AD_Column_ID); + if (index < 0) + log.log(Level.SEVERE, "Not found - AD_Column_ID=" + AD_Column_ID); + set_Value (index, value); + } // setValueOfColumn + + + /** + * Set Custom Column + * @param columnName column + * @param value value + */ + public final void set_CustomColumn (String columnName, Object value) + { + if (m_custom == null) + m_custom = new HashMap(); + String valueString = "NULL"; + if (value == null) + ; + else if (value instanceof Number) + valueString = value.toString(); + else if (value instanceof Boolean) + valueString = ((Boolean)value).booleanValue() ? "'Y'" : "'N'"; + else if (value instanceof Timestamp) + valueString = DB.TO_DATE((Timestamp)value, false); + else // if (value instanceof String) + valueString = DB.TO_STRING(value.toString()); + // Save it + log.log(Level.INFO, columnName + "=" + valueString); + m_custom.put(columnName, valueString); + } // set_CustomColumn + + + /** + * Set (numeric) Key Value + * @param ColumnName column name + * @param value value + */ + private void set_Keys (String ColumnName, Object value) + { + // Update if KeyColumn + for (int i = 0; i < m_IDs.length; i++) + { + if (ColumnName.equals (m_KeyColumns[i])) + { + m_IDs[i] = value; + } + } // for all key columns + } // setKeys + + + /************************************************************************** + * Get Column Count + * @return column count + */ + protected int get_ColumnCount() + { + return p_info.getColumnCount(); + } // getColumnCount + + /** + * Get Column Name + * @param index index + * @return ColumnName + */ + protected String get_ColumnName (int index) + { + return p_info.getColumnName (index); + } // getColumnName + + /** + * Get Column Label + * @param index index + * @return Column Label + */ + protected String get_ColumnLabel (int index) + { + return p_info.getColumnLabel (index); + } // getColumnLabel + + /** + * Get Column Description + * @param index index + * @return column description + */ + protected String get_ColumnDescription (int index) + { + return p_info.getColumnDescription (index); + } // getColumnDescription + + /** + * Is Column Mandatory + * @param index index + * @return true if column mandatory + */ + protected boolean isColumnMandatory (int index) + { + return p_info.isColumnMandatory(index); + } // isColumnNandatory + + /** + * Is Column Updateable + * @param index index + * @return true if column updateable + */ + protected boolean isColumnUpdateable (int index) + { + return p_info.isColumnUpdateable(index); + } // isColumnUpdateable + + /** + * Set Column Updateable + * @param index index + * @param updateable column updateable + */ + protected void set_ColumnUpdateable (int index, boolean updateable) + { + p_info.setColumnUpdateable(index, updateable); + } // setColumnUpdateable + + /** + * Set all columns updateable + * @param updateable updateable + */ + protected void setUpdateable (boolean updateable) + { + p_info.setUpdateable (updateable); + } // setUpdateable + + /** + * Get Column DisplayType + * @param index index + * @return display type + */ + protected int get_ColumnDisplayType (int index) + { + return p_info.getColumnDisplayType(index); + } // getColumnDisplayType + + /** + * Get Lookup + * @param index index + * @return Lookup or null + */ + protected Lookup get_ColumnLookup(int index) + { + return p_info.getColumnLookup(index); + } // getColumnLookup + + /** + * Get Column Index + * @param columnName column name + * @return index of column with ColumnName or -1 if not found + */ + public final int get_ColumnIndex (String columnName) + { + return p_info.getColumnIndex(columnName); + } // getColumnIndex + + /** + * Get Display Value of value + * @param columnName columnName + * @param currentValue current value + * @return String value with "./." as null + */ + protected String get_DisplayValue(String columnName, boolean currentValue) + { + Object value = currentValue ? get_Value(columnName) : get_ValueOld(columnName); + if (value == null) + return "./."; + String retValue = value.toString(); + int index = get_ColumnIndex(columnName); + if (index < 0) + return retValue; + int dt = get_ColumnDisplayType(index); + if (DisplayType.isText(dt) || DisplayType.YesNo == dt) + return retValue; + // Lookup + Lookup lookup = get_ColumnLookup(index); + if (lookup != null) + return lookup.getDisplay(value); + // Other + return retValue; + } // get_DisplayValue + + + /** + * Copy old values of From to new values of To. + * Does not copy Keys + * @param from old, existing & unchanged PO + * @param to new, not saved PO + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + protected static void copyValues (PO from, PO to, int AD_Client_ID, int AD_Org_ID) + { + copyValues (from, to); + to.setAD_Client_ID(AD_Client_ID); + to.setAD_Org_ID(AD_Org_ID); + } // copyValues + + /** + * Copy old values of From to new values of To. + * Does not copy Keys and AD_Client_ID/AD_Org_ID + * @param from old, existing & unchanged PO + * @param to new, not saved PO + */ + protected static void copyValues (PO from, PO to) + { + s_log.fine("From ID=" + from.get_ID() + " - To ID=" + to.get_ID()); + // Different Classes + if (from.getClass() != to.getClass()) + { + for (int i1 = 0; i1 < from.m_oldValues.length; i1++) + { + if (from.p_info.isVirtualColumn(i1) + || from.p_info.isKey(i1)) // KeyColumn + continue; + String colName = from.p_info.getColumnName(i1); + // Ignore Standard Values + if (colName.startsWith("Created") + || colName.startsWith("Updated") + || colName.equals("IsActive") + || colName.equals("AD_Client_ID") + || colName.equals("AD_Org_ID")) + ; // ignore + else + { + for (int i2 = 0; i2 < to.m_oldValues.length; i2++) + { + if (to.p_info.getColumnName(i2).equals(colName)) + { + to.m_newValues[i2] = from.m_oldValues[i1]; + break; + } + } + } + } // from loop + } + else // same class + { + for (int i = 0; i < from.m_oldValues.length; i++) + { + if (from.p_info.isVirtualColumn(i) + || from.p_info.isKey(i)) // KeyColumn + continue; + String colName = from.p_info.getColumnName(i); + // Ignore Standard Values + if (colName.startsWith("Created") + || colName.startsWith("Updated") + || colName.equals("IsActive") + || colName.equals("AD_Client_ID") + || colName.equals("AD_Org_ID")) + ; // ignore + else + to.m_newValues[i] = from.m_oldValues[i]; + } + } // same class + } // copy + + + /************************************************************************** + * Load record with ID + * @param ID ID + * @param trxName transaction name + */ + protected void load (int ID, String trxName) + { + log.finest("ID=" + ID); + if (ID > 0) + { + m_IDs = new Object[] {new Integer(ID)}; + m_KeyColumns = new String[] {p_info.getTableName() + "_ID"}; + load(trxName); + } + else // new + { + loadDefaults(); + m_createNew = true; + setKeyInfo(); // sets m_IDs + loadComplete(true); + } + } // load + + + /** + * (re)Load record with m_ID[*] + * @param trxName transaction + * @return true if loaded + */ + public boolean load (String trxName) + { + m_trxName = trxName; + boolean success = true; + StringBuffer sql = new StringBuffer("SELECT "); + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + if (i != 0) + sql.append(","); + sql.append(p_info.getColumnSQL(i)); // Normal and Virtual Column + } + sql.append(" FROM ").append(p_info.getTableName()) + .append(" WHERE ") + .append(get_WhereClause(false)); + + // + // int index = -1; + if (CLogMgt.isLevelFinest()) + log.finest(get_WhereClause(true)); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql.toString(), m_trxName); // local trx only + for (int i = 0; i < m_IDs.length; i++) + { + Object oo = m_IDs[i]; + if (oo instanceof Integer) + pstmt.setInt(i+1, ((Integer)m_IDs[i]).intValue()); + else + pstmt.setString(i+1, m_IDs[i].toString()); + } + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + success = load(rs); + } + else + { + log.log(Level.SEVERE, "NO Data found for " + get_WhereClause(true), new Exception()); + m_IDs = new Object[] {I_ZERO}; + success = false; + // throw new DBException("NO Data found for " + get_WhereClause(true)); + } + rs.close(); + pstmt.close(); + pstmt = null; + m_createNew = false; + // reset new values + m_newValues = new Object[size]; + } + catch (Exception e) + { + String msg = ""; + if (m_trxName != null) + msg = "[" + m_trxName + "] - "; + msg += get_WhereClause(true) + // + ", Index=" + index + // + ", Column=" + get_ColumnName(index) + // + ", " + p_info.toString(index) + + ", SQL=" + sql.toString(); + success = false; + m_IDs = new Object[] {I_ZERO}; + log.log(Level.SEVERE, msg, e); + // throw new DBException(e); + } + // Finish + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (SQLException e1) + { + } + loadComplete(success); + return success; + } // load + + + /** + * Load from the current position of a ResultSet + * @param rs result set + * @return true if loaded + */ + protected boolean load (ResultSet rs) + { + int size = get_ColumnCount(); + boolean success = true; + int index = 0; + log.finest("(rs)"); + // load column values + for (index = 0; index < size; index++) + { + String columnName = p_info.getColumnName(index); + Class clazz = p_info.getColumnClass(index); + int dt = p_info.getColumnDisplayType(index); + try + { + if (clazz == Integer.class) + m_oldValues[index] = decrypt(index, new Integer(rs.getInt(columnName))); + else if (clazz == BigDecimal.class) + m_oldValues[index] = decrypt(index, rs.getBigDecimal(columnName)); + else if (clazz == Boolean.class) + m_oldValues[index] = new Boolean ("Y".equals(decrypt(index, rs.getString(columnName)))); + else if (clazz == Timestamp.class) + m_oldValues[index] = decrypt(index, rs.getTimestamp(columnName)); + else if (DisplayType.isLOB(dt)) + m_oldValues[index] = get_LOB (rs.getObject(columnName)); + else if (clazz == String.class) + m_oldValues[index] = decrypt(index, rs.getString(columnName)); + else + m_oldValues[index] = loadSpecial(rs, index); + // NULL + if (rs.wasNull() && m_oldValues[index] != null) + m_oldValues[index] = null; + // + if (CLogMgt.isLevelAll()) + log.finest(String.valueOf(index) + ": " + p_info.getColumnName(index) + + "(" + p_info.getColumnClass(index) + ") = " + m_oldValues[index]); + } + catch (SQLException e) + { + if (p_info.isVirtualColumn(index)) // if rs constructor used + log.log(Level.FINER, "Virtual Column not loaded: " + columnName); + else + { + log.log(Level.SEVERE, "(rs) - " + String.valueOf(index) + + ": " + p_info.getTableName() + "." + p_info.getColumnName(index) + + " (" + p_info.getColumnClass(index) + ") - " + e); + success = false; + } + } + } + m_createNew = false; + setKeyInfo(); + loadComplete(success); + return success; + } // load + + /** + * Load from HashMap + * @param hmIn hash map + * @return true if loaded + */ + protected boolean load (HashMap hmIn) + { + int size = get_ColumnCount(); + boolean success = true; + int index = 0; + log.finest("(hm)"); + // load column values + for (index = 0; index < size; index++) + { + String columnName = p_info.getColumnName(index); + String value = (String)hmIn.get(columnName); + if (value == null) + continue; + Class clazz = p_info.getColumnClass(index); + int dt = p_info.getColumnDisplayType(index); + try + { + if (clazz == Integer.class) + m_oldValues[index] = new Integer(value); + else if (clazz == BigDecimal.class) + m_oldValues[index] = new BigDecimal(value); + else if (clazz == Boolean.class) + m_oldValues[index] = new Boolean ("Y".equals(value)); + else if (clazz == Timestamp.class) + m_oldValues[index] = Timestamp.valueOf(value); + else if (DisplayType.isLOB(dt)) + m_oldValues[index] = null; // get_LOB (rs.getObject(columnName)); + else if (clazz == String.class) + m_oldValues[index] = value; + else + m_oldValues[index] = null; // loadSpecial(rs, index); + // + if (CLogMgt.isLevelAll()) + log.finest(String.valueOf(index) + ": " + p_info.getColumnName(index) + + "(" + p_info.getColumnClass(index) + ") = " + m_oldValues[index]); + } + catch (Exception e) + { + if (p_info.isVirtualColumn(index)) // if rs constructor used + log.log(Level.FINER, "Virtual Column not loaded: " + columnName); + else + { + log.log(Level.SEVERE, "(ht) - " + String.valueOf(index) + + ": " + p_info.getTableName() + "." + p_info.getColumnName(index) + + " (" + p_info.getColumnClass(index) + ") - " + e); + success = false; + } + } + } + m_createNew = false; + // Overwrite + setStandardDefaults(); + setKeyInfo(); + loadComplete(success); + return success; + } // load + + /** + * Create Hashmap with data as Strings + * @return HashMap + */ + protected HashMap get_HashMap() + { + HashMap hmOut = new HashMap(); + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + Object value = get_Value(i); + // Don't insert NULL values (allows Database defaults) + if (value == null + || p_info.isVirtualColumn(i)) + continue; + // Display Type + int dt = p_info.getColumnDisplayType(i); + // Based on class of definition, not class of value + Class c = p_info.getColumnClass(i); + String stringValue = null; + if (c == Object.class) + ; // saveNewSpecial (value, i)); + else if (value == null || value.equals (Null.NULL)) + ; + else if (value instanceof Integer || value instanceof BigDecimal) + stringValue = value.toString(); + else if (c == Boolean.class) + { + boolean bValue = false; + if (value instanceof Boolean) + bValue = ((Boolean)value).booleanValue(); + else + bValue = "Y".equals(value); + stringValue = bValue ? "Y" : "N"; + } + else if (value instanceof Timestamp) + stringValue = value.toString(); + else if (c == String.class) + stringValue = (String)value; + else if (DisplayType.isLOB(dt)) + ; + else + ; // saveNewSpecial (value, i)); + // + if (stringValue != null) + hmOut.put(p_info.getColumnName(i), stringValue); + } + // Custom Columns + if (m_custom != null) + { + Iterator it = m_custom.keySet().iterator(); + while (it.hasNext()) + { + String column = (String)it.next(); + int index = p_info.getColumnIndex(column); + String value = (String)m_custom.get(column); + if (value != null) + hmOut.put(column, value); + } + m_custom = null; + } + return hmOut; + } // get_HashMap + + /** + * Load Special data (images, ..). + * To be extended by sub-classes + * @param rs result set + * @param index zero based index + * @return value value + * @throws SQLException + */ + protected Object loadSpecial (ResultSet rs, int index) throws SQLException + { + log.finest("(NOP) - " + p_info.getColumnName(index)); + return null; + } // loadSpecial + + /** + * Load is complete + * @param success success + * To be extended by sub-classes + */ + protected void loadComplete (boolean success) + { + } // loadComplete + + + /** + * Load Defaults + */ + protected void loadDefaults() + { + setStandardDefaults(); + // + /** @todo defaults from Field */ + // MField.getDefault(p_info.getDefaultLogic(i)); + } // loadDefaults + + /** + * Set Default values. + * Client, Org, Created/Updated, *By, IsActive + */ + protected void setStandardDefaults() + { + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + if (p_info.isVirtualColumn(i)) + continue; + String colName = p_info.getColumnName(i); + // Set Standard Values + if (colName.endsWith("tedBy")) + m_newValues[i] = new Integer (Env.getContextAsInt(p_ctx, "#AD_User_ID")); + else if (colName.equals("Created") || colName.equals("Updated")) + m_newValues[i] = new Timestamp (System.currentTimeMillis()); + else if (colName.equals(p_info.getTableName() + "_ID")) // KeyColumn + m_newValues[i] = I_ZERO; + else if (colName.equals("IsActive")) + m_newValues[i] = new Boolean(true); + else if (colName.equals("AD_Client_ID")) + m_newValues[i] = new Integer(Env.getAD_Client_ID(p_ctx)); + else if (colName.equals("AD_Org_ID")) + m_newValues[i] = new Integer(Env.getAD_Org_ID(p_ctx)); + else if (colName.equals("Processed")) + m_newValues[i] = new Boolean(false); + else if (colName.equals("Processing")) + m_newValues[i] = new Boolean(false); + else if (colName.equals("Posted")) + m_newValues[i] = new Boolean(false); + } + } // setDefaults + + /** + * Set Key Info (IDs and KeyColumns). + */ + private void setKeyInfo() + { + // Search for Primary Key + for (int i = 0; i < p_info.getColumnCount(); i++) + { + if (p_info.isKey(i) && p_info.getColumnName(i).endsWith("_ID")) + { + String ColumnName = p_info.getColumnName(i); + m_KeyColumns = new String[] {ColumnName}; + Integer ii = (Integer)get_Value(i); + if (ii == null) + m_IDs = new Object[] {I_ZERO}; + else + m_IDs = new Object[] {ii}; + log.finest("(PK) " + ColumnName + "=" + ii); + return; + } + } // primary key search + + // Search for Parents + ArrayList columnNames = new ArrayList(); + for (int i = 0; i < p_info.getColumnCount(); i++) + { + if (p_info.isColumnParent(i)) + columnNames.add(p_info.getColumnName(i)); + } + // Set FKs + int size = columnNames.size(); + if (size == 0) + throw new IllegalStateException("No PK nor FK - " + p_info.getTableName()); + m_IDs = new Object[size]; + m_KeyColumns = new String[size]; + for (int i = 0; i < size; i++) + { + m_KeyColumns[i] = (String)columnNames.get(i); + if (m_KeyColumns[i].endsWith("_ID")) + { + Integer ii = null; + try + { + ii = (Integer)get_Value(m_KeyColumns[i]); + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + } + if (ii != null) + m_IDs[i] = ii; + } + else + m_IDs[i] = get_Value(m_KeyColumns[i]); + log.finest("(FK) " + m_KeyColumns[i] + "=" + m_IDs[i]); + } + } // setKeyInfo + + + /************************************************************************** + * Are all mandatory Fields filled (i.e. can we save)?. + * Stops at first null mandatory field + * @return true if all mandatory fields are ok + */ + protected boolean isMandatoryOK() + { + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + if (p_info.isColumnMandatory(i)) + { + if (p_info.isVirtualColumn(i)) + continue; + if (get_Value(i) == null || get_Value(i).equals(Null.NULL)) + { + log.info(p_info.getColumnName(i)); + return false; + } + } + } + return true; + } // isMandatoryOK + + + /************************************************************************** + * Set AD_Client + * @param AD_Client_ID client + */ + final protected void setAD_Client_ID (int AD_Client_ID) + { + set_ValueNoCheck ("AD_Client_ID", new Integer(AD_Client_ID)); + } // setAD_Client_ID + + /** + * Get AD_Client + * @return AD_Client_ID + */ + public final int getAD_Client_ID() + { + Integer ii = (Integer)get_Value("AD_Client_ID"); + if (ii == null) + return 0; + return ii.intValue(); + } // getAD_Client_ID + + /** + * Set AD_Org + * @param AD_Org_ID org + */ + final public void setAD_Org_ID (int AD_Org_ID) + { + set_ValueNoCheck ("AD_Org_ID", new Integer(AD_Org_ID)); + } // setAD_Org_ID + + /** + * Get AD_Org + * @return AD_Org_ID + */ + public int getAD_Org_ID() + { + Integer ii = (Integer)get_Value("AD_Org_ID"); + if (ii == null) + return 0; + return ii.intValue(); + } // getAD_Org_ID + + /** + * Overwrite Client Org if different + * @param AD_Client_ID client + * @param AD_Org_ID org + */ + protected void setClientOrg (int AD_Client_ID, int AD_Org_ID) + { + if (AD_Client_ID != getAD_Client_ID()) + setAD_Client_ID(AD_Client_ID); + if (AD_Org_ID != getAD_Org_ID()) + setAD_Org_ID(AD_Org_ID); + } // setClientOrg + + /** + * Overwrite Client Org if different + * @param po persistent object + */ + protected void setClientOrg (PO po) + { + setClientOrg(po.getAD_Client_ID(), po.getAD_Org_ID()); + } // setClientOrg + + /** + * Set Active + * @param active active + */ + public final void setIsActive (boolean active) + { + set_Value("IsActive", new Boolean(active)); + } // setActive + + /** + * Is Active + * @return is active + */ + public final boolean isActive() + { + Boolean bb = (Boolean)get_Value("IsActive"); + if (bb != null) + return bb.booleanValue(); + return false; + } // isActive + + /** + * Get Created + * @return created + */ + final public Timestamp getCreated() + { + return (Timestamp)get_Value("Created"); + } // getCreated + + /** + * Get Updated + * @return updated + */ + final public Timestamp getUpdated() + { + return (Timestamp)get_Value("Updated"); + } // getUpdated + + /** + * Get CreatedBy + * @return AD_User_ID + */ + final public int getCreatedBy() + { + Integer ii = (Integer)get_Value("CreatedBy"); + if (ii == null) + return 0; + return ii.intValue(); + } // getCreateddBy + + /** + * Get UpdatedBy + * @return AD_User_ID + */ + final public int getUpdatedBy() + { + Integer ii = (Integer)get_Value("UpdatedBy"); + if (ii == null) + return 0; + return ii.intValue(); + } // getUpdatedBy + + /** + * Set UpdatedBy + * @param AD_User_ID user + */ + final protected void setUpdatedBy (int AD_User_ID) + { + set_ValueNoCheck ("UpdatedBy", new Integer(AD_User_ID)); + } // setAD_User_ID + + /** + * Get Translation of column + * @param columnName + * @param AD_Language + * @return translation or null if not found + */ + protected String get_Translation (String columnName, String AD_Language) + { + if (columnName == null || AD_Language == null + || m_IDs.length > 1 || m_IDs[0].equals(I_ZERO) + || !(m_IDs[0] instanceof Integer)) + { + log.severe ("Invalid Argument: ColumnName" + columnName + + ", AD_Language=" + AD_Language + + ", ID.length=" + m_IDs.length + ", ID=" + m_IDs[0]); + return null; + } + int ID = ((Integer)m_IDs[0]).intValue(); + String retValue = null; + StringBuffer sql = new StringBuffer ("SELECT ").append(columnName) + .append(" FROM ").append(p_info.getTableName()).append("_Trl WHERE ") + .append(m_KeyColumns[0]).append("=?") + .append(" AND AD_Language=?"); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql.toString(), get_TrxName()); + pstmt.setInt (1, ID); + pstmt.setString (2, AD_Language); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + retValue = rs.getString(1); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql.toString(), e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // get_Translation + + /** + * Is new record + * @return true if new + */ + public boolean is_new() + { + if (m_createNew) + return true; + // + for (int i = 0; i < m_IDs.length; i++) + { + if (m_IDs[i].equals(I_ZERO)) + continue; + return false; // one value is non-zero + } + return true; + } // is_new + + /************************************************************************** + * Update Value or create new record. + * To reload call load() - not updated + * @return true if saved + */ + public boolean save() + { + CLogger.resetLast(); + boolean newRecord = is_new(); // save locally as load resets + if (!newRecord && !is_Changed()) + { + log.fine("Nothing changed - " + p_info.getTableName()); + return true; + } + + // Organization Check + if (getAD_Org_ID() == 0 + && (get_AccessLevel() == ACCESSLEVEL_ORG + || (get_AccessLevel() == ACCESSLEVEL_CLIENTORG + && MClientShare.isOrgLevelOnly(getAD_Client_ID(), get_Table_ID())))) + { + log.saveError("FillMandatory", Msg.getElement(getCtx(), "AD_Org_ID")); + return false; + } + // Should be Org 0 + if (getAD_Org_ID() != 0) + { + boolean reset = get_AccessLevel() == ACCESSLEVEL_SYSTEM; + if (!reset && MClientShare.isClientLevelOnly(getAD_Client_ID(), get_Table_ID())) + { + reset = get_AccessLevel() == ACCESSLEVEL_CLIENT + || get_AccessLevel() == ACCESSLEVEL_SYSTEMCLIENT + || get_AccessLevel() == ACCESSLEVEL_CLIENTORG; + } + if (reset) + { + log.warning("Set Org to 0"); + setAD_Org_ID(0); + } + } + // Before Save + try + { + if (!beforeSave(newRecord)) + { + log.warning("beforeSave failed - " + toString()); + return false; + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "beforeSave - " + toString(), e); + log.saveError("Error", e.toString(), false); + // throw new DBException(e); + return false; + } + String errorMsg = ModelValidationEngine.get().fireModelChange + (this, newRecord ? ModelValidator.TYPE_NEW : ModelValidator.TYPE_CHANGE); + if (errorMsg != null) + { + log.warning("Validation failed - " + errorMsg); + log.saveError("Error", errorMsg); + return false; + } + // Save + boolean success = false; + if (newRecord) + return saveNew(); + else + return saveUpdate(); + } // save + + /** + * Finish Save Process + * @param newRecord new + * @param success success + * @return true if saved + */ + private boolean saveFinish (boolean newRecord, boolean success) + { + // Translations + if (success) + { + if (newRecord) + insertTranslations(); + else + updateTranslations(); + } + // + try + { + success = afterSave (newRecord, success); + } + catch (Exception e) + { + log.log(Level.SEVERE, "afterSave", e); + log.saveError("Error", e.toString(), false); + success = false; + // throw new DBException(e); + } + // OK + if (success) + { + if (s_docWFMgr == null) + { + try + { + Class.forName("org.compiere.wf.DocWorkflowManager"); + } + catch (Exception e) + { + } + } + if (s_docWFMgr != null) + s_docWFMgr.process (this, p_info.getAD_Table_ID()); + + // Copy to Old values + int size = p_info.getColumnCount(); + for (int i = 0; i < size; i++) + { + if (m_newValues[i] != null) + { + if (m_newValues[i] == Null.NULL) + m_oldValues[i] = null; + else + m_oldValues[i] = m_newValues[i]; + } + } + m_newValues = new Object[size]; + } + m_createNew = false; + if (!newRecord) + CacheMgt.get().reset(p_info.getTableName()); + return success; + } // saveFinish + + /** + * Update Value or create new record. + * To reload call load() - not updated + * @param trxName transaction + * @return true if saved + */ + public boolean save (String trxName) + { + set_TrxName(trxName); + return save(); + } // save + + /** + * Is there a Change to be saved? + * @return true if record changed + */ + public boolean is_Changed() + { + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + if (m_newValues[i] != null) + return true; // something changed + } + return false; + } // is_Change + + /** + * Called before Save for Pre-Save Operation + * @param newRecord new record + * @return true if record can be saved + */ + protected boolean beforeSave(boolean newRecord) + { + /** Prevents saving + log.saveError("Error", Msg.parseTranslation(getCtx(), "@C_Currency_ID@ = @C_Currency_ID@")); + log.saveError("FillMandatory", Msg.getElement(getCtx(), "PriceEntered")); + /** Issues message + log.saveWarning(AD_Message, message); + log.saveInfo (AD_Message, message); + **/ + return true; + } // beforeSave + + /** + * Called after Save for Post-Save Operation + * @param newRecord new record + * @param success true if save operation was success + * @return if save was a success + */ + protected boolean afterSave (boolean newRecord, boolean success) + { + return success; + } // afterSave + + /** + * Update Record directly + * @return true if updated + */ + protected boolean saveUpdate() + { + String where = get_WhereClause(true); + // + boolean changes = false; + StringBuffer sql = new StringBuffer ("UPDATE "); + sql.append(p_info.getTableName()).append( " SET "); + boolean updated = false; + boolean updatedBy = false; + lobReset(); + + // Change Log + MSession session = MSession.get (p_ctx, false); + if (session == null) + log.fine("No Session found"); + int AD_ChangeLog_ID = 0; + + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + Object value = m_newValues[i]; + if (value == null + || p_info.isVirtualColumn(i)) + continue; + // we have a change + Class c = p_info.getColumnClass(i); + int dt = p_info.getColumnDisplayType(i); + String columnName = p_info.getColumnName(i); + // + // updated/by + if (columnName.equals("UpdatedBy")) + { + if (updatedBy) // explicit + continue; + updatedBy = true; + } + else if (columnName.equals("Updated")) + { + if (updated) + continue; + updated = true; + } + if (DisplayType.isLOB(dt)) + { + lobAdd (value, i, dt); + // If no changes set UpdatedBy explicitly to ensure commit of lob + if (!changes & !updatedBy) + { + int AD_User_ID = Env.getContextAsInt(p_ctx, "#AD_User_ID"); + set_ValueNoCheck("UpdatedBy", new Integer(AD_User_ID)); + sql.append("UpdatedBy=").append(AD_User_ID); + changes = true; + updatedBy = true; + } + continue; + } + // Update Document No + if (columnName.equals("DocumentNo")) + { + String strValue = (String)value; + if (strValue.startsWith("<") && strValue.endsWith(">")) + { + value = null; + int AD_Client_ID = getAD_Client_ID(); + int index = p_info.getColumnIndex("C_DocTypeTarget_ID"); + if (index == -1) + index = p_info.getColumnIndex("C_DocType_ID"); + if (index != -1) // get based on Doc Type (might return null) + value = DB.getDocumentNo(get_ValueAsInt(index), m_trxName); + if (value == null) // not overwritten by DocType and not manually entered + value = DB.getDocumentNo(AD_Client_ID, p_info.getTableName(), m_trxName); + } + else + log.warning("DocumentNo updated: " + m_oldValues[i] + " -> " + value); + } + + if (changes) + sql.append(", "); + changes = true; + sql.append(columnName).append("="); + + // values + if (value == Null.NULL) + sql.append("NULL"); + else if (value instanceof Integer || value instanceof BigDecimal) + sql.append(encrypt(i,value)); + else if (c == Boolean.class) + { + boolean bValue = false; + if (value instanceof Boolean) + bValue = ((Boolean)value).booleanValue(); + else + bValue = "Y".equals(value); + sql.append(encrypt(i,bValue ? "'Y'" : "'N'")); + } + else if (value instanceof Timestamp) + sql.append(DB.TO_DATE((Timestamp)encrypt(i,value),p_info.getColumnDisplayType(i) == DisplayType.Date)); + else + sql.append(encrypt(i,DB.TO_STRING(value.toString()))); + + // Change Log - Only + if (session != null + && m_IDs.length == 1 + && !p_info.isEncrypted(i) // not encrypted + && !p_info.isVirtualColumn(i) // no virtual column + && !"Password".equals(columnName) + ) + { + Object oldV = m_oldValues[i]; + Object newV = value; + if (oldV != null && oldV == Null.NULL) + oldV = null; + if (newV != null && newV == Null.NULL) + newV = null; + // + MChangeLog cLog = session.changeLog ( + m_trxName, AD_ChangeLog_ID, + p_info.getAD_Table_ID(), p_info.getColumn(i).AD_Column_ID, + get_ID(), getAD_Client_ID(), getAD_Org_ID(), oldV, newV); + if (cLog != null) + AD_ChangeLog_ID = cLog.getAD_ChangeLog_ID(); + } + } // for all fields + + // Custom Columns (cannot be logged as no column) + if (m_custom != null) + { + Iterator it = m_custom.keySet().iterator(); + while (it.hasNext()) + { + if (changes) + sql.append(", "); + changes = true; + // + String column = (String)it.next(); + String value = (String)m_custom.get(column); + int index = p_info.getColumnIndex(column); + sql.append(column).append("=").append(encrypt(index,value)); + } + m_custom = null; + } + + // Something changed + if (changes) + { + if (m_trxName == null) + log.fine(p_info.getTableName() + "." + where); + else + log.fine("[" + m_trxName + "] - " + p_info.getTableName() + "." + where); + if (!updated) // Updated not explicitly set + { + Timestamp now = new Timestamp(System.currentTimeMillis()); + set_ValueNoCheck("Updated", now); + sql.append(",Updated=").append(DB.TO_DATE(now, false)); + } + if (!updatedBy) // UpdatedBy not explicitly set + { + int AD_User_ID = Env.getContextAsInt(p_ctx, "#AD_User_ID"); + set_ValueNoCheck("UpdatedBy", new Integer(AD_User_ID)); + sql.append(",UpdatedBy=").append(AD_User_ID); + } + sql.append(" WHERE ").append(where); + /** @todo status locking goes here */ + + log.finest(sql.toString()); + int no = DB.executeUpdate(sql.toString(), m_trxName); + boolean ok = no == 1; + if (ok) + ok = lobSave(); + else + { + if (m_trxName == null) + log.log(Level.WARNING, p_info.getTableName() + "." + where); + else + log.log(Level.WARNING, "[" + m_trxName + "] - " + p_info.getTableName() + "." + where); + } + return saveFinish (false, ok); + } + + // nothing changed, so OK + return saveFinish (false, true); + } // saveUpdate + + /** + * Create New Record + * @return true if new record inserted + */ + private boolean saveNew() + { + // Set ID for single key - Multi-Key values need explicitly be set previously + if (m_IDs.length == 1 && p_info.hasKeyColumn() + && m_KeyColumns[0].endsWith("_ID")) // AD_Language, EntityType + { + int no = saveNew_getID(); + if (no <= 0) + no = DB.getNextID(getAD_Client_ID(), p_info.getTableName(), m_trxName); + if (no <= 0) + { + log.severe("No NextID (" + no + ")"); + return saveFinish (true, false); + } + m_IDs[0] = new Integer(no); + set_ValueNoCheck(m_KeyColumns[0], m_IDs[0]); + } + if (m_trxName == null) + log.fine(p_info.getTableName() + " - " + get_WhereClause(true)); + else + log.fine("[" + m_trxName + "] - " + p_info.getTableName() + " - " + get_WhereClause(true)); + + // Set new DocumentNo + String columnName = "DocumentNo"; + int index = p_info.getColumnIndex(columnName); + if (index != -1) + { + String value = (String)get_Value(index); + if (value != null && value.startsWith("<") && value.endsWith(">")) + value = null; + if (value == null || value.length() == 0) + { + int dt = p_info.getColumnIndex("C_DocTypeTarget_ID"); + if (dt == -1) + dt = p_info.getColumnIndex("C_DocType_ID"); + if (dt != -1) // get based on Doc Type (might return null) + value = DB.getDocumentNo(get_ValueAsInt(dt), m_trxName); + if (value == null) // not overwritten by DocType and not manually entered + value = DB.getDocumentNo(getAD_Client_ID(), p_info.getTableName(), m_trxName); + set_ValueNoCheck(columnName, value); + } + } + // Set empty Value + columnName = "Value"; + index = p_info.getColumnIndex(columnName); + if (index != -1) + { + String value = (String)get_Value(index); + if (value == null || value.length() == 0) + { + value = DB.getDocumentNo (getAD_Client_ID(), p_info.getTableName(), m_trxName); + set_ValueNoCheck(columnName, value); + } + } + + lobReset(); + + // SQL + StringBuffer sqlInsert = new StringBuffer("INSERT INTO "); + sqlInsert.append(p_info.getTableName()).append(" ("); + StringBuffer sqlValues = new StringBuffer(") VALUES ("); + int size = get_ColumnCount(); + boolean doComma = false; + for (int i = 0; i < size; i++) + { + Object value = get_Value(i); + // Don't insert NULL values (allows Database defaults) + if (value == null + || p_info.isVirtualColumn(i)) + continue; + + // Display Type + int dt = p_info.getColumnDisplayType(i); + if (DisplayType.isLOB(dt)) + { + lobAdd (value, i, dt); + continue; + } + + // ** add column ** + if (doComma) + { + sqlInsert.append(","); + sqlValues.append(","); + } + else + doComma = true; + sqlInsert.append(p_info.getColumnName(i)); + // + // Based on class of definition, not class of value + Class c = p_info.getColumnClass(i); + try + { + if (c == Object.class) // may have need to deal with null values differently + sqlValues.append (saveNewSpecial (value, i)); + else if (value == null || value.equals (Null.NULL)) + sqlValues.append ("NULL"); + else if (value instanceof Integer || value instanceof BigDecimal) + sqlValues.append (encrypt(i,value)); + else if (c == Boolean.class) + { + boolean bValue = false; + if (value instanceof Boolean) + bValue = ((Boolean)value).booleanValue(); + else + bValue = "Y".equals(value); + sqlValues.append (encrypt(i,bValue ? "'Y'" : "'N'")); + } + else if (value instanceof Timestamp) + sqlValues.append (DB.TO_DATE ((Timestamp)encrypt(i,value), p_info.getColumnDisplayType (i) == DisplayType.Date)); + else if (c == String.class) + sqlValues.append (encrypt(i,DB.TO_STRING ((String)value))); + else if (DisplayType.isLOB(dt)) + sqlValues.append("null"); // no db dependent stuff here + else + sqlValues.append (saveNewSpecial (value, i)); + } + catch (Exception e) + { + String msg = ""; + if (m_trxName != null) + msg = "[" + m_trxName + "] - "; + msg += p_info.toString(i) + + " - Value=" + value + + "(" + (value==null ? "null" : value.getClass().getName()) + ")"; + log.log(Level.SEVERE, msg, e); + throw new DBException(e); // fini + } + } + // Custom Columns + if (m_custom != null) + { + Iterator it = m_custom.keySet().iterator(); + while (it.hasNext()) + { + String column = (String)it.next(); + index = p_info.getColumnIndex(column); + String value = (String)m_custom.get(column); + if (doComma) + { + sqlInsert.append(","); + sqlValues.append(","); + } + else + doComma = true; + sqlInsert.append(column); + sqlValues.append(encrypt(index, value)); + } + m_custom = null; + } + sqlInsert.append(sqlValues) + .append(")"); + // + int no = DB.executeUpdate(sqlInsert.toString(), m_trxName); + boolean ok = no == 1; + if (ok) + { + ok = lobSave(); + if (!load(m_trxName)) // re-read Info + { + if (m_trxName == null) + log.log(Level.SEVERE, "reloading"); + else + log.log(Level.SEVERE, "[" + m_trxName + "] - reloading"); + ok = false;; + } + } + else + { + String msg = "Not inserted - "; + if (CLogMgt.isLevelFiner()) + msg += sqlInsert.toString(); + else + msg += get_TableName(); + if (m_trxName == null) + log.log(Level.WARNING, msg); + else + log.log(Level.WARNING, "[" + m_trxName + "]" + msg); + } + return saveFinish (true, ok); + } // saveNew + + /** + * Get ID for new record during save. + * You can overwite this to explicitly set the ID + * @return ID to be used or 0 for fedault logic + */ + protected int saveNew_getID() + { + return 0; + } // saveNew_getID + + + /** + * Create Single/Multi Key Where Clause + * @param withValues if true uses actual values otherwise ? + * @return where clause + */ + public String get_WhereClause (boolean withValues) + { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < m_IDs.length; i++) + { + if (i != 0) + sb.append(" AND "); + sb.append(m_KeyColumns[i]).append("="); + if (withValues) + { + if (m_KeyColumns[i].endsWith("_ID")) + sb.append(m_IDs[i]); + else + sb.append("'").append(m_IDs[i]).append("'"); + } + else + sb.append("?"); + } + return sb.toString(); + } // getWhereClause + + + /** + * Save Special Data. + * To be extended by sub-classes + * @param value value + * @param index index + * @return SQL code for INSERT VALUES clause + */ + protected String saveNewSpecial (Object value, int index) + { + String colName = p_info.getColumnName(index); + String colClass = p_info.getColumnClass(index).toString(); + String colValue = value == null ? "null" : value.getClass().toString(); + int dt = p_info.getColumnDisplayType(index); + + log.log(Level.SEVERE, "Unknown class for column " + colName + + " (" + colClass + ") - Value=" + colValue); + + if (value == null) + return "NULL"; + return value.toString(); + } // saveNewSpecial + + /** + * Encrypt data. + * Not: LOB, special values/Obkects + * @param index index + * @param xx data + * @return xx + */ + private Object encrypt (int index, Object xx) + { + if (xx == null) + return null; + if (index != -1 && p_info.isEncrypted(index)) + return SecureEngine.encrypt(xx); + return xx; + } // encrypt + + /** + * Decrypt data + * @param index index + * @param yy data + * @return yy + */ + private Object decrypt (int index, Object yy) + { + if (yy == null) + return null; + if (index != -1 && p_info.isEncrypted(index)) + return SecureEngine.decrypt(yy); + return yy; + } // decrypt + + /************************************************************************** + * Delete Current Record + * @param force delete also processed records + * @return true if deleted + */ + public boolean delete (boolean force) + { + CLogger.resetLast(); + if (is_new()) + return true; + + int AD_Table_ID = p_info.getAD_Table_ID(); + int Record_ID = get_ID(); + + if (!force) + { + int iProcessed = get_ColumnIndex("Processed"); + if (iProcessed != -1) + { + Boolean processed = (Boolean)get_Value(iProcessed); + if (processed != null && processed.booleanValue()) + { + log.warning("Record processed"); // CannotDeleteTrx + log.saveError("Processed", "Processed", false); + return false; + } + } // processed + } // force + + try + { + if (!beforeDelete()) + { + log.warning("beforeDelete failed"); + return false; + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "beforeDelete", e); + log.saveError("Error", e.toString(), false); + // throw new DBException(e); + return false; + } + // Delete Restrict AD_Table_ID/Record_ID (Requests, ..) + String errorMsg = PO_Record.exists(AD_Table_ID, Record_ID, m_trxName); + if (errorMsg != null) + { + log.saveError("CannotDelete", errorMsg); + return false; + } + // + errorMsg = ModelValidationEngine.get().fireModelChange + (this, ModelValidator.TYPE_DELETE); + if (errorMsg != null) + { + log.saveError("Error", errorMsg); + return false; + } + Trx localTrx = null; + String localTrxName = m_trxName; + if (localTrxName == null) + { + localTrxName = Trx.createTrxName("POdel"); + localTrx = Trx.get(localTrxName, true); + } + // + deleteTranslations(localTrxName); + // Delete Cascade AD_Table_ID/Record_ID (Attachments, ..) + PO_Record.deleteCascade(AD_Table_ID, Record_ID, localTrxName); + + // The Delete Statement + StringBuffer sql = new StringBuffer ("DELETE ") + .append(p_info.getTableName()) + .append(" WHERE ") + .append(get_WhereClause(true)); + int no = DB.executeUpdate(sql.toString(), localTrxName); + boolean success = no == 1; + + // Save ID + m_idOld = get_ID(); + // + if (!success) + { + log.warning("Not deleted"); + if (localTrx != null) + localTrx.rollback(); + } + else + { + if (localTrx != null) + localTrx.commit(); + // Change Log + MSession session = MSession.get (p_ctx, false); + if (session == null) + log.fine("No Session found"); + else if (m_IDs.length == 1 + && MChangeLog.isLogged(AD_Table_ID)) + { + int AD_ChangeLog_ID = 0; + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + Object value = m_oldValues[i]; + if (value != null + && !p_info.isEncrypted(i) // not encrypted + && !p_info.isVirtualColumn(i) // no virtual column + && !"Password".equals(p_info.getColumnName(i)) + ) + { + MChangeLog cLog = session.changeLog ( + m_trxName, AD_ChangeLog_ID, + AD_Table_ID, p_info.getColumn(i).AD_Column_ID, + Record_ID, getAD_Client_ID(), getAD_Org_ID(), value, null); + if (cLog != null) + AD_ChangeLog_ID = cLog.getAD_ChangeLog_ID(); + } + } // for all fields + } + + // Housekeeping + m_IDs[0] = I_ZERO; + if (m_trxName == null) + log.fine("complete"); + else + log.fine("[" + m_trxName + "] - complete"); + m_attachment = null; + } + if (localTrx != null) + localTrx.close(); + localTrx = null; + + try + { + success = afterDelete (success); + } + catch (Exception e) + { + log.log(Level.SEVERE, "afterDelete", e); + log.saveError("Error", e.toString(), false); + success = false; + // throw new DBException(e); + } + + // Reset + if (success) + { + m_idOld = 0; + int size = p_info.getColumnCount(); + m_oldValues = new Object[size]; + m_newValues = new Object[size]; + CacheMgt.get().reset(p_info.getTableName()); + } + // log.info("" + success); + return success; + } // delete + + /** + * Delete Current Record + * @param force delete also processed records + * @param trxName transaction + * @return true if deleted + */ + public boolean delete (boolean force, String trxName) + { + set_TrxName(trxName); + return delete (force); + } // delete + + /** + * Executed before Delete operation. + * @return true if record can be deleted + */ + protected boolean beforeDelete () + { + // log.saveError("Error", Msg.getMsg(getCtx(), "CannotDelete")); + return true; + } // beforeDelete + + /** + * Executed after Delete operation. + * @param success true if record deleted + * @return true if delete is a success + */ + protected boolean afterDelete (boolean success) + { + return success; + } // afterDelete + + + /** + * Insert (missing) Translation Records + * @return false if error (true if no translation or success) + */ + private boolean insertTranslations() + { + // Not a translation table + if (m_IDs.length > 1 + || m_IDs[0].equals(I_ZERO) + || !p_info.isTranslated() + || !(m_IDs[0] instanceof Integer)) + return true; + // + StringBuffer iColumns = new StringBuffer(); + StringBuffer sColumns = new StringBuffer(); + for (int i = 0; i < p_info.getColumnCount(); i++) + { + if (p_info.isColumnTranslated(i)) + { + iColumns.append(p_info.getColumnName(i)) + .append(","); + sColumns.append("t.") + .append(p_info.getColumnName(i)) + .append(","); + } + } + if (iColumns.length() == 0) + return true; + + String tableName = p_info.getTableName(); + String keyColumn = m_KeyColumns[0]; + StringBuffer sql = new StringBuffer ("INSERT INTO ") + .append(tableName).append("_Trl (AD_Language,") + .append(keyColumn).append(", ") + .append(iColumns) + .append(" IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) ") + .append("SELECT l.AD_Language,t.") + .append(keyColumn).append(", ") + .append(sColumns) + .append(" 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy ") + .append("FROM AD_Language l, ").append(tableName).append(" t ") + .append("WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.") + .append(keyColumn).append("=").append(get_ID()) + .append(" AND NOT EXISTS (SELECT * FROM ").append(tableName) + .append("_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.") + .append(keyColumn).append("=t.").append(keyColumn).append(")"); + int no = DB.executeUpdate(sql.toString(), m_trxName); + log.fine("#" + no); + return no > 0; + } // insertTranslations + + /** + * Update Translations. + * @return false if error (true if no translation or success) + */ + private boolean updateTranslations() + { + // Not a translation table + if (m_IDs.length > 1 + || m_IDs[0].equals(I_ZERO) + || !p_info.isTranslated() + || !(m_IDs[0] instanceof Integer)) + return true; + // + boolean trlColumnChanged = false; + for (int i = 0; i < p_info.getColumnCount(); i++) + { + if (p_info.isColumnTranslated(i) + && is_ValueChanged(p_info.getColumnName(i))) + { + trlColumnChanged = true; + break; + } + } + if (!trlColumnChanged) + return true; + // + MClient client = MClient.get(getCtx()); + // + String tableName = p_info.getTableName(); + String keyColumn = m_KeyColumns[0]; + StringBuffer sql = new StringBuffer ("UPDATE ") + .append(tableName).append("_Trl SET "); + // + if (client.isAutoUpdateTrl(tableName)) + { + for (int i = 0; i < p_info.getColumnCount(); i++) + { + if (p_info.isColumnTranslated(i)) + { + String columnName = p_info.getColumnName(i); + sql.append(columnName).append("="); + Object value = get_Value(columnName); + if (value == null) + sql.append("NULL"); + else if (value instanceof String) + sql.append(DB.TO_STRING((String)value)); + else if (value instanceof Boolean) + sql.append(((Boolean)value).booleanValue() ? "'Y'" : "'N'"); + else if (value instanceof Timestamp) + sql.append(DB.TO_DATE((Timestamp)value)); + else + sql.append(value.toString()); + sql.append(","); + } + } + sql.append("IsTranslated='Y'"); + } + else + sql.append("IsTranslated='N'"); + // + sql.append(" WHERE ") + .append(keyColumn).append("=").append(get_ID()); + int no = DB.executeUpdate(sql.toString(), m_trxName); + log.fine("#" + no); + return no >= 0; + } // updateTranslations + + /** + * Delete Translation Records + * @param trxName transaction + * @return false if error (true if no translation or success) + */ + private boolean deleteTranslations(String trxName) + { + // Not a translation table + if (m_IDs.length > 1 + || m_IDs[0].equals(I_ZERO) + || !p_info.isTranslated() + || !(m_IDs[0] instanceof Integer)) + return true; + // + String tableName = p_info.getTableName(); + String keyColumn = m_KeyColumns[0]; + StringBuffer sql = new StringBuffer ("DELETE ") + .append(tableName).append("_Trl WHERE ") + .append(keyColumn).append("=").append(get_ID()); + int no = DB.executeUpdate(sql.toString(), trxName); + log.fine("#" + no); + return no >= 0; + } // deleteTranslations + + /** + * Insert Accounting Records + * @param acctTable accounting sub table + * @param acctBaseTable acct table to get data from + * @param whereClause optional where clause with alisa "p" for acctBaseTable + * @return true if records inserted + */ + protected boolean insert_Accounting (String acctTable, + String acctBaseTable, String whereClause) + { + if (s_acctColumns == null // cannot cache C_BP_*_Acct as there are 3 + || acctTable.startsWith("C_BP_")) + { + s_acctColumns = new ArrayList(); + String sql = "SELECT c.ColumnName " + + "FROM AD_Column c INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) " + + "WHERE t.TableName=? AND c.IsActive='Y' AND c.AD_Reference_ID=25 ORDER BY 1"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setString (1, acctTable); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + s_acctColumns.add (rs.getString(1)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, acctTable, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + if (s_acctColumns.size() == 0) + { + log.severe ("No Columns for " + acctTable); + return false; + } + } + + // Create SQL Statement - INSERT + StringBuffer sb = new StringBuffer("INSERT INTO ") + .append(acctTable) + .append(" (").append(get_TableName()) + .append("_ID, C_AcctSchema_ID, AD_Client_ID,AD_Org_ID,IsActive, Created,CreatedBy,Updated,UpdatedBy "); + for (int i = 0; i < s_acctColumns.size(); i++) + sb.append(",").append(s_acctColumns.get(i)); + // .. SELECT + sb.append(") SELECT ").append(get_ID()) + .append(", p.C_AcctSchema_ID, p.AD_Client_ID,0,'Y', SysDate,") + .append(getUpdatedBy()).append(",SysDate,").append(getUpdatedBy()); + for (int i = 0; i < s_acctColumns.size(); i++) + sb.append(",p.").append(s_acctColumns.get(i)); + // .. FROM + sb.append(" FROM ").append(acctBaseTable) + .append(" p WHERE p.AD_Client_ID=").append(getAD_Client_ID()); + if (whereClause != null && whereClause.length() > 0) + sb.append (" AND ").append(whereClause); + sb.append(" AND NOT EXISTS (SELECT * FROM ").append(acctTable) + .append(" e WHERE e.C_AcctSchema_ID=p.C_AcctSchema_ID AND e.") + .append(get_TableName()).append("_ID=").append(get_ID()).append(")"); + // + int no = DB.executeUpdate(sb.toString(), get_TrxName()); + if (no > 0) + log.fine("#" + no); + else + log.warning("#" + no + + " - Table=" + acctTable + " from " + acctBaseTable); + return no > 0; + } // insert_Accounting + + /** + * Delete Accounting records. + * NOP - done by database constraints + * @param acctTable accounting sub table + * @return true + */ + protected boolean delete_Accounting(String acctTable) + { + return true; + } // delete_Accounting + + + /** + * Insert id data into Tree + * @param treeType MTree TREETYPE_* + * @return true if inserted + */ + protected boolean insert_Tree (String treeType) + { + return insert_Tree (treeType, 0); + } // insert_Tree + + /** + * Insert id data into Tree + * @param treeType MTree TREETYPE_* + * @param C_Element_ID element for accounting element values + * @return true if inserted + */ + protected boolean insert_Tree (String treeType, int C_Element_ID) + { + StringBuffer sb = new StringBuffer ("INSERT INTO ") + .append(MTree_Base.getNodeTableName(treeType)) + .append(" (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, " + + "AD_Tree_ID, Node_ID, Parent_ID, SeqNo) " + + "SELECT t.AD_Client_ID,0, 'Y', SysDate, 0, SysDate, 0," + + "t.AD_Tree_ID, ").append(get_ID()).append(", 0, 999 " + + "FROM AD_Tree t " + + "WHERE t.AD_Client_ID=").append(getAD_Client_ID()).append(" AND t.IsActive='Y'"); + // Account Element Value handling + if (C_Element_ID != 0) + sb.append(" AND EXISTS (SELECT * FROM C_Element ae WHERE ae.C_Element_ID=") + .append(C_Element_ID).append(" AND t.AD_Tree_ID=ae.AD_Tree_ID)"); + else // std trees + sb.append(" AND t.IsAllNodes='Y' AND t.TreeType='").append(treeType).append("'"); + // Duplicate Check + sb.append(" AND NOT EXISTS (SELECT * FROM " + MTree_Base.getNodeTableName(treeType) + " e " + + "WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=").append(get_ID()).append(")"); + int no = DB.executeUpdate(sb.toString(), get_TrxName()); + if (no > 0) + log.fine("#" + no + " - TreeType=" + treeType); + else + log.warning("#" + no + " - TreeType=" + treeType); + return no > 0; + } // insert_Tree + + /** + * Delete ID Tree Nodes + * @param treeType MTree TREETYPE_* + * @return true if deleted + */ + protected boolean delete_Tree (String treeType) + { + int id = get_ID(); + if (id == 0) + id = get_IDOld(); + StringBuffer sb = new StringBuffer ("DELETE FROM ") + .append(MTree_Base.getNodeTableName(treeType)) + .append(" n WHERE Node_ID=").append(id) + .append(" AND EXISTS (SELECT * FROM AD_Tree t " + + "WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.TreeType='") + .append(treeType).append("')"); + int no = DB.executeUpdate(sb.toString(), get_TrxName()); + if (no > 0) + log.fine("#" + no + " - TreeType=" + treeType); + else + log.warning("#" + no + " - TreeType=" + treeType); + return no > 0; + } // delete_Tree + + /************************************************************************** + * Lock it. + * @return true if locked + */ + public boolean lock() + { + int index = get_ProcessingIndex(); + if (index != -1) + { + m_newValues[index] = Boolean.TRUE; // direct + String sql = "UPDATE " + p_info.getTableName() + + " SET Processing='Y' WHERE (Processing='N' OR Processing IS NULL) AND " + + get_WhereClause(true); + boolean success = DB.executeUpdate(sql, null) == 1; // outside trx + if (success) + log.fine("success"); + else + log.log(Level.SEVERE, "failed"); + return success; + } + return false; + } // lock + + /** + * Get the Column Processing index + * @return index or -1 + */ + private int get_ProcessingIndex() + { + return p_info.getColumnIndex("Processing"); + } // getProcessingIndex + + /** + * UnLock it + * @param trxName transaction + * @return true if unlocked (false only if unlock fails) + */ + public boolean unlock (String trxName) + { + // log.warning(trxName); + int index = get_ProcessingIndex(); + if (index != -1) + { + m_newValues[index] = Boolean.FALSE; // direct + String sql = "UPDATE " + p_info.getTableName() + + " SET Processing='N' WHERE " + get_WhereClause(true); + boolean success = DB.executeUpdate(sql, trxName) == 1; + if (success) + log.fine("success" + (trxName == null ? "" : "[" + trxName + "]")); + else + log.log(Level.SEVERE, "failed" + (trxName == null ? "" : "[" + trxName + "]")); + return success; + } + return true; + } // unlock + + /** Optional Transaction */ + private String m_trxName = null; + + /** + * Set Trx + * @param trxName transaction + */ + public void set_TrxName (String trxName) + { + m_trxName = trxName; + } // setTrx + + /** + * Get Trx + * @return transaction + */ + public String get_TrxName() + { + return m_trxName; + } // getTrx + + + /************************************************************************** + * Get Attachments. + * An attachment may have multiple entries + * @return Attachment or null + */ + public MAttachment getAttachment () + { + return getAttachment(false); + } // getAttachment + + /** + * Get Attachments + * @param requery requery + * @return Attachment or null + */ + public MAttachment getAttachment (boolean requery) + { + if (m_attachment == null || requery) + m_attachment = MAttachment.get (getCtx(), p_info.getAD_Table_ID(), get_ID()); + return m_attachment; + } // getAttachment + + /** + * Create/return Attachment for PO. + * If not exist, create new + * @return attachment + */ + public MAttachment createAttachment() + { + getAttachment (false); + if (m_attachment == null) + m_attachment = new MAttachment (getCtx(), p_info.getAD_Table_ID(), get_ID(), null); + return m_attachment; + } // createAttachment + + + /** + * Do we have a Attachment of type + * @param extension extension e.g. .pdf + * @return true if there is a attachment of type + */ + public boolean isAttachment (String extension) + { + getAttachment (false); + if (m_attachment == null) + return false; + for (int i = 0; i < m_attachment.getEntryCount(); i++) + { + if (m_attachment.getEntryName(i).endsWith(extension)) + { + log.fine("#" + i + ": " + m_attachment.getEntryName(i)); + return true; + } + } + return false; + } // isAttachment + + /** + * Get Attachment Data of type + * @param extension extension e.g. .pdf + * @return data or null + */ + public byte[] getAttachmentData (String extension) + { + getAttachment(false); + if (m_attachment == null) + return null; + for (int i = 0; i < m_attachment.getEntryCount(); i++) + { + if (m_attachment.getEntryName(i).endsWith(extension)) + { + log.fine("#" + i + ": " + m_attachment.getEntryName(i)); + return m_attachment.getEntryData(i); + } + } + return null; + } // getAttachmentData + + /** + * Do we have a PDF Attachment + * @return true if there is a PDF attachment + */ + public boolean isPdfAttachment() + { + return isAttachment(".pdf"); + } // isPdfAttachment + + /** + * Get PDF Attachment Data + * @return data or null + */ + public byte[] getPdfAttachment() + { + return getAttachmentData(".pdf"); + } // getPDFAttachment + + + /************************************************************************** + * Dump Record + */ + public void dump () + { + if (CLogMgt.isLevelFinest()) + { + log.finer(get_WhereClause (true)); + for (int i = 0; i < get_ColumnCount (); i++) + dump (i); + } + } // dump + + /** + * Dump column + * @param index index + */ + public void dump (int index) + { + StringBuffer sb = new StringBuffer(" ").append(index); + if (index < 0 || index >= get_ColumnCount()) + { + log.finest(sb.append(": invalid").toString()); + return; + } + sb.append(": ").append(get_ColumnName(index)) + .append(" = ").append(m_oldValues[index]) + .append(" (").append(m_newValues[index]).append(")"); + log.finest(sb.toString()); + } // dump + + + /************************************************************************* + * Get All IDs of Table. + * Used for listing all Entities + * + int[] IDs = PO.getAllIDs ("AD_PrintFont", null); + for (int i = 0; i < IDs.length; i++) + { + pf = new MPrintFont(Env.getCtx(), IDs[i]); + System.out.println(IDs[i] + " = " + pf.getFont()); + } + * + * @param TableName table name (key column with _ID) + * @param WhereClause optional where clause + * @return array of IDs or null + * @param trxName transaction + */ + public static int[] getAllIDs (String TableName, String WhereClause, String trxName) + { + ArrayList list = new ArrayList(); + StringBuffer sql = new StringBuffer("SELECT "); + sql.append(TableName).append("_ID FROM ").append(TableName); + if (WhereClause != null && WhereClause.length() > 0) + sql.append(" WHERE ").append(WhereClause); + try + { + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), trxName); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new Integer(rs.getInt(1))); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql.toString(), e); + return null; + } + // Convert to array + int[] retValue = new int[list.size()]; + for (int i = 0; i < retValue.length; i++) + retValue[i] = ((Integer)list.get(i)).intValue(); + return retValue; + } // getAllIDs + + + /** + * Get Find parameter. + * Convert to upper case and add % at the end + * @param query in string + * @return out string + */ + protected static String getFindParameter (String query) + { + if (query == null) + return null; + if (query.length() == 0 || query.equals("%")) + return null; + if (!query.endsWith("%")) + query += "%"; + return query.toUpperCase(); + } // getFindParameter + + + /************************************************************************** + * Load LOB + * @param value LOB + * @return object + */ + private Object get_LOB (Object value) + { + log.fine("Value=" + value); + if (value == null) + return null; + // + Object retValue = null; + //begin vpj-cd e-Evolution 03/11/2005 PostgreSQL + if(DB.isPostgreSQL()) + { + byte buf[] = (byte[])value; + retValue = buf; + return retValue; + } + //end vpj-cd e-Evolution 03/11/2005 PostgreSQL + long length = -99; + try + { + if (value instanceof Clob) // returns String + { + Clob clob = (Clob)value; + length = clob.length(); + retValue = clob.getSubString(1, (int)length); + } + else if (value instanceof Blob) // returns byte[] + { + Blob blob = (Blob)value; + length = blob.length(); + int index = 1; // correct + if (blob.getClass().getName().equals("oracle.jdbc.rowset.OracleSerialBlob")) + index = 0; // Oracle Bug Invalid Arguments + // at oracle.jdbc.rowset.OracleSerialBlob.getBytes(OracleSerialBlob.java:130) + retValue = blob.getBytes(index, (int)length); + } + else + log.log(Level.SEVERE, "Unknown: " + value); + } + catch (Exception e) + { + log.log(Level.SEVERE, "Length=" + length, e); + } + return retValue; + } // getLOB + + /** LOB Info */ + private ArrayList m_lobInfo = null; + + /** + * Reset LOB info + */ + private void lobReset() + { + m_lobInfo = null; + } // resetLOB + + /** + * Prepare LOB save + * @param value value + * @param index index + * @param displayType display type + */ + private void lobAdd (Object value, int index, int displayType) + { + log.finest("Value=" + value); + PO_LOB lob = new PO_LOB (p_info.getTableName(), get_ColumnName(index), + get_WhereClause(true), displayType, value); + if (m_lobInfo == null) + m_lobInfo = new ArrayList(); + m_lobInfo.add(lob); + } // lobAdd + + /** + * Save LOB + * @return true if saved or ok + */ + private boolean lobSave () + { + if (m_lobInfo == null) + return true; + boolean retValue = true; + for (int i = 0; i < m_lobInfo.size(); i++) + { + PO_LOB lob = (PO_LOB)m_lobInfo.get(i); + if (!lob.save(get_TrxName())) + { + retValue = false; + break; + } + } // for all LOBs + lobReset(); + return retValue; + } // saveLOB + + /** + * Get Object xml representation as string + * @param xml optional string buffer + * @return updated/new string buffer header is only added once + */ + public StringBuffer get_xmlString (StringBuffer xml) + { + if (xml == null) + xml = new StringBuffer(); + else + xml.append(Env.NL); + // + try + { + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + DOMSource source = new DOMSource(get_xmlDocument(xml.length()!=0)); + TransformerFactory tFactory = TransformerFactory.newInstance(); + Transformer transformer = tFactory.newTransformer(); + transformer.transform (source, result); + StringBuffer newXML = writer.getBuffer(); + // + if (xml.length() != 0) + { // // + int tagIndex = newXML.indexOf("?>"); + if (tagIndex != -1) + xml.append(newXML.substring(tagIndex+2)); + else + xml.append(newXML); + } + else + xml.append(newXML); + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + } + return xml; + } // get_xmlString + + /** Table ID Attribute */ + protected final static String XML_ATTRIBUTE_AD_Table_ID = "AD_Table_ID"; + /** Record ID Attribute */ + protected final static String XML_ATTRIBUTE_Record_ID = "Record_ID"; + + /** + * Get XML Document representation + * @param noComment do not add comment + * @return XML document + */ + public Document get_xmlDocument(boolean noComment) + { + Document document = null; + try + { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + document = builder.newDocument(); + if (!noComment) + document.appendChild(document.createComment(Adempiere.getSummaryAscii())); + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + } + // Root + Element root = document.createElement(get_TableName()); + root.setAttribute(XML_ATTRIBUTE_AD_Table_ID, String.valueOf(get_Table_ID())); + root.setAttribute(XML_ATTRIBUTE_Record_ID, String.valueOf(get_ID())); + document.appendChild(root); + // Columns + int size = get_ColumnCount(); + for (int i = 0; i < size; i++) + { + if (p_info.isVirtualColumn(i)) + continue; + + Element col = document.createElement(p_info.getColumnName(i)); + // + Object value = get_Value(i); + // Display Type + int dt = p_info.getColumnDisplayType(i); + // Based on class of definition, not class of value + Class c = p_info.getColumnClass(i); + if (value == null || value.equals (Null.NULL)) + ; + else if (c == Object.class) + col.appendChild(document.createCDATASection(value.toString())); + else if (value instanceof Integer || value instanceof BigDecimal) + col.appendChild(document.createTextNode(value.toString())); + else if (c == Boolean.class) + { + boolean bValue = false; + if (value instanceof Boolean) + bValue = ((Boolean)value).booleanValue(); + else + bValue = "Y".equals(value); + col.appendChild(document.createTextNode(bValue ? "Y" : "N")); + } + else if (value instanceof Timestamp) + col.appendChild(document.createTextNode(value.toString())); + else if (c == String.class) + col.appendChild(document.createCDATASection((String)value)); + else if (DisplayType.isLOB(dt)) + col.appendChild(document.createCDATASection(value.toString())); + else + col.appendChild(document.createCDATASection(value.toString())); + // + root.appendChild(col); + } + // Custom Columns + if (m_custom != null) + { + Iterator it = m_custom.keySet().iterator(); + while (it.hasNext()) + { + String columnName = (String)it.next(); + int index = p_info.getColumnIndex(columnName); + String value = (String)m_custom.get(columnName); + // + Element col = document.createElement(columnName); + if (value != null) + col.appendChild(document.createTextNode(value)); + root.appendChild(col); + } + m_custom = null; + } + return document; + } // getDocument + +} // PO diff --git a/dbPort/src/org/compiere/model/POInfo.java b/dbPort/src/org/compiere/model/POInfo.java new file mode 100644 index 0000000000..6a00c71606 --- /dev/null +++ b/dbPort/src/org/compiere/model/POInfo.java @@ -0,0 +1,628 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Persistet Object Info. + * Provides structural information + * + * @author Jorg Janke + * @version $Id: POInfo.java,v 1.2 2006/07/30 00:58:37 jjanke Exp $ + */ +public class POInfo implements Serializable +{ + /** Used by Remote FinReport */ + static final long serialVersionUID = -5976719579744948419L; + + /** + * POInfo Factory + * @param ctx context + * @param AD_Table_ID AD_Table_ID + * @return POInfo + */ + public static POInfo getPOInfo (Properties ctx, int AD_Table_ID) + { + Integer key = new Integer(AD_Table_ID); + POInfo retValue = (POInfo)s_cache.get(key); + if (retValue == null) + { + retValue = new POInfo(ctx, AD_Table_ID, false); + if (retValue.getColumnCount() == 0) + // May be run before Language verification + retValue = new POInfo(ctx, AD_Table_ID, true); + else + s_cache.put(key, retValue); + } + return retValue; + } // getPOInfo + + /** Cache of POInfo */ + private static CCache s_cache = new CCache("POInfo", 200); + + /************************************************************************** + * Create Persistent Info + * @param ctx context + * @param AD_Table_ID AD_ Table_ID + * @param baseLanguageOnly get in base language + */ + private POInfo (Properties ctx, int AD_Table_ID, boolean baseLanguageOnly) + { + m_ctx = ctx; + m_AD_Table_ID = AD_Table_ID; + boolean baseLanguage = baseLanguageOnly ? true : Env.isBaseLanguage(m_ctx, "AD_Table"); + loadInfo (baseLanguage); + } // PInfo + + /** Context */ + private Properties m_ctx = null; + /** Table_ID */ + private int m_AD_Table_ID = 0; + /** Table Name */ + private String m_TableName = null; + /** Access Level */ + private String m_AccessLevel = MTable.ACCESSLEVEL_Organization; + /** Columns */ + private POInfoColumn[] m_columns = null; + /** Table has Key Column */ + private boolean m_hasKeyColumn = false; + + + /** + * Load Table/Column Info + * @param baseLanguage in English + */ + private void loadInfo (boolean baseLanguage) + { + ArrayList list = new ArrayList(15); + StringBuffer sql = new StringBuffer(); + sql.append("SELECT t.TableName, c.ColumnName,c.AD_Reference_ID," // 1..3 + + "c.IsMandatory,c.IsUpdateable,c.DefaultValue," // 4..6 + + "e.Name,e.Description, c.AD_Column_ID, " // 7..9 + + "c.IsKey,c.IsParent, " // 10..11 + + "c.AD_Reference_Value_ID, vr.Code, " // 12..13 + + "c.FieldLength, c.ValueMin, c.ValueMax, c.IsTranslated, " // 14..17 + + "t.AccessLevel, c.ColumnSQL, c.IsEncrypted "); // 18..20 + sql.append("FROM AD_Table t" + + " INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)" + + " LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)" + + " INNER JOIN AD_Element"); + if (!baseLanguage) + sql.append("_Trl"); + sql.append(" e " + + " ON (c.AD_Element_ID=e.AD_Element_ID) " + + "WHERE t.AD_Table_ID=?" + + " AND c.IsActive='Y'"); + if (!baseLanguage) + sql.append(" AND e.AD_Language='").append(Env.getAD_Language(m_ctx)).append("'"); + // + try + { + PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setInt(1, m_AD_Table_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + if (m_TableName == null) + m_TableName = rs.getString(1); + String ColumnName = rs.getString(2); + int AD_Reference_ID = rs.getInt(3); + boolean IsMandatory = "Y".equals(rs.getString(4)); + boolean IsUpdateable = "Y".equals(rs.getString(5)); + String DefaultLogic = rs.getString(6); + String Name = rs.getString(7); + String Description = rs.getString(8); + int AD_Column_ID = rs.getInt(9); + boolean IsKey = "Y".equals(rs.getString(10)); + if (IsKey) + m_hasKeyColumn = true; + boolean IsParent = "Y".equals(rs.getString(11)); + int AD_Reference_Value_ID = rs.getInt(12); + String ValidationCode = rs.getString(13); + int FieldLength = rs.getInt(14); + String ValueMin = rs.getString(15); + String ValueMax = rs.getString(16); + boolean IsTranslated = "Y".equals(rs.getString(17)); + // + m_AccessLevel = rs.getString(18); + String ColumnSQL = rs.getString(19); + boolean IsEncrypted = "Y".equals(rs.getString(20)); + + POInfoColumn col = new POInfoColumn ( + AD_Column_ID, ColumnName, ColumnSQL, AD_Reference_ID, + IsMandatory, IsUpdateable, + DefaultLogic, Name, Description, + IsKey, IsParent, + AD_Reference_Value_ID, ValidationCode, + FieldLength, ValueMin, ValueMax, + IsTranslated, IsEncrypted); + list.add(col); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + CLogger.get().log(Level.SEVERE, sql.toString(), e); + } + // convert to array + m_columns = new POInfoColumn[list.size()]; + list.toArray(m_columns); + } // loadInfo + + /** + * String representation + * @return String Representation + */ + public String toString() + { + return "POInfo[" + getTableName() + ",AD_Table_ID=" + getAD_Table_ID() + "]"; + } // toString + + /** + * String representation for index + * @param index column index + * @return String Representation + */ + public String toString (int index) + { + if (index < 0 || index >= m_columns.length) + return "POInfo[" + getTableName() + "-(InvalidColumnIndex=" + index + ")]"; + return "POInfo[" + getTableName() + "-" + m_columns[index].toString() + "]"; + } // toString + + /** + * Get Table Name + * @return Table Name + */ + public String getTableName() + { + return m_TableName; + } // getTableName + + /** + * Get AD_Table_ID + * @return AD_Table_ID + */ + public int getAD_Table_ID() + { + return m_AD_Table_ID; + } // getAD_Table_ID + + /** + * Table has a Key Column + * @return true if has a key column + */ + public boolean hasKeyColumn() + { + return m_hasKeyColumn; + } // hasKeyColumn + + /** + * Get Table Access Level + * @return Table.ACCESS.. + */ + public String getAccessLevel() + { + return m_AccessLevel; + } // getAccessLevel + + /************************************************************************** + * Get ColumnCount + * @return column count + */ + public int getColumnCount() + { + return m_columns.length; + } // getColumnCount + + /** + * Get Column Index + * @param ColumnName column name + * @return index of column with ColumnName or -1 if not found + */ + public int getColumnIndex (String ColumnName) + { + for (int i = 0; i < m_columns.length; i++) + { + if (ColumnName.equals(m_columns[i].ColumnName)) + return i; + } + return -1; + } // getColumnIndex + + /** + * Get Column Index + * @param AD_Column_ID column + * @return index of column with ColumnName or -1 if not found + */ + public int getColumnIndex (int AD_Column_ID) + { + for (int i = 0; i < m_columns.length; i++) + { + if (AD_Column_ID == m_columns[i].AD_Column_ID) + return i; + } + return -1; + } // getColumnIndex + + /** + * Get Column + * @param index index + * @return column + */ + protected POInfoColumn getColumn (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + return m_columns[index]; + } // getColumn + + /** + * Get Column Name + * @param index index + * @return ColumnName column name + */ + public String getColumnName (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + return m_columns[index].ColumnName; + } // getColumnName + + /** + * Get Column SQL or Column Name + * @param index index + * @return ColumnSQL column sql or name + */ + public String getColumnSQL (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + if (m_columns[index].ColumnSQL != null && m_columns[index].ColumnSQL.length() > 0) + return m_columns[index].ColumnSQL + " AS " + m_columns[index].ColumnName; + return m_columns[index].ColumnName; + } // getColumnSQL + + /** + * Is Column Virtal? + * @param index index + * @return true if column is virtual + */ + public boolean isVirtualColumn (int index) + { + if (index < 0 || index >= m_columns.length) + return true; + return m_columns[index].ColumnSQL != null + && m_columns[index].ColumnSQL.length() > 0; + } // isVirtualColumn + + /** + * Get Column Label + * @param index index + * @return column label + */ + public String getColumnLabel (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + return m_columns[index].ColumnLabel; + } // getColumnLabel + + /** + * Get Column Description + * @param index index + * @return column description + */ + public String getColumnDescription (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + return m_columns[index].ColumnDescription; + } // getColumnDescription + + /** + * Get Column Class + * @param index index + * @return Class + */ + public Class getColumnClass (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + return m_columns[index].ColumnClass; + } // getColumnClass + + /** + * Get Column Display Type + * @param index index + * @return DisplayType + */ + public int getColumnDisplayType (int index) + { + if (index < 0 || index >= m_columns.length) + return DisplayType.String; + return m_columns[index].DisplayType; + } // getColumnDisplayType + + /** + * Get Column Default Logic + * @param index index + * @return Default Logic + */ + public String getDefaultLogic (int index) + { + if (index < 0 || index >= m_columns.length) + return null; + return m_columns[index].DefaultLogic; + } // getDefaultLogic + + /** + * Is Column Mandatory + * @param index index + * @return true if column mandatory + */ + public boolean isColumnMandatory (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return m_columns[index].IsMandatory; + } // isMandatory + + /** + * Is Column Updateable + * @param index index + * @return true if column updateable + */ + public boolean isColumnUpdateable (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return m_columns[index].IsUpdateable; + } // isUpdateable + + /** + * Set Column Updateable + * @param index index + * @param updateable column updateable + */ + public void setColumnUpdateable (int index, boolean updateable) + { + if (index < 0 || index >= m_columns.length) + return; + m_columns[index].IsUpdateable = updateable; + } // setColumnUpdateable + + /** + * Set all columns updateable + * @param updateable updateable + */ + public void setUpdateable (boolean updateable) + { + for (int i = 0; i < m_columns.length; i++) + m_columns[i].IsUpdateable = updateable; + } // setUpdateable + + /** + * Is Lookup Column + * @param index index + * @return true if it is a lookup column + */ + public boolean isColumnLookup (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return DisplayType.isLookup(m_columns[index].DisplayType); + } // isColumnLookup + + /** + * Get Lookup + * @param index index + * @return Lookup + */ + public Lookup getColumnLookup (int index) + { + if (!isColumnLookup(index)) + return null; + // + int WindowNo = 0; + // List, Table, TableDir + Lookup lookup = null; + try + { + lookup = MLookupFactory.get (m_ctx, WindowNo, + m_columns[index].AD_Column_ID, m_columns[index].DisplayType, + Env.getLanguage(m_ctx), m_columns[index].ColumnName, + m_columns[index].AD_Reference_Value_ID, + m_columns[index].IsParent, m_columns[index].ValidationCode); + } + catch (Exception e) + { + lookup = null; // cannot create Lookup + } + return lookup; + /** @todo other lookup types */ + } // getColumnLookup + + /** + * Is Column Key + * @param index index + * @return true if column is the key + */ + public boolean isKey (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return m_columns[index].IsKey; + } // isKey + + /** + * Is Column Parent + * @param index index + * @return true if column is a Parent + */ + public boolean isColumnParent (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return m_columns[index].IsParent; + } // isColumnParent + + /** + * Is Column Translated + * @param index index + * @return true if column is translated + */ + public boolean isColumnTranslated (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return m_columns[index].IsTranslated; + } // isColumnTranslated + + /** + * Is Table Translated + * @return true if table is translated + */ + public boolean isTranslated () + { + for (int i = 0; i < m_columns.length; i++) + { + if (m_columns[i].IsTranslated) + return true; + } + return false; + } // isTranslated + + /** + * Is Column (data) Encrypted + * @param index index + * @return true if column is encrypted + */ + public boolean isEncrypted (int index) + { + if (index < 0 || index >= m_columns.length) + return false; + return m_columns[index].IsEncrypted; + } // isEncrypted + + /** + * Get Column FieldLength + * @param index index + * @return field length + */ + public int getFieldLength (int index) + { + if (index < 0 || index >= m_columns.length) + return 0; + return m_columns[index].FieldLength; + } // getFieldLength + + /** + * Validate Content + * @param index index + * @param value new Value + * @return null if all valid otherwise error message + */ + public String validate (int index, Object value) + { + if (index < 0 || index >= m_columns.length) + return "RangeError"; + // Mandatory (i.e. not null + if (m_columns[index].IsMandatory && value == null) + { + return "IsMandatory"; + } + if (value == null) + return null; + + // Length ignored + + // + if (m_columns[index].ValueMin != null) + { + BigDecimal value_BD = null; + try + { + if (m_columns[index].ValueMin_BD != null) + value_BD = new BigDecimal(value.toString()); + } + catch (Exception ex){} + // Both are Numeric + if (m_columns[index].ValueMin_BD != null && value_BD != null) + { // error: 1 - 0 => 1 - OK: 1 - 1 => 0 & 1 - 10 => -1 + int comp = m_columns[index].ValueMin_BD.compareTo(value_BD); + if (comp > 0) + { + return "MinValue=" + m_columns[index].ValueMin_BD + + "(" + m_columns[index].ValueMin + ")" + + " - compared with Numeric Value=" + value_BD + "(" + value + ")" + + " - results in " + comp; + } + } + else // String + { + int comp = m_columns[index].ValueMin.compareTo(value.toString()); + if (comp > 0) + { + return "MinValue=" + m_columns[index].ValueMin + + " - compared with String Value=" + value + + " - results in " + comp; + } + } + } + if (m_columns[index].ValueMax != null) + { + BigDecimal value_BD = null; + try + { + if (m_columns[index].ValueMax_BD != null) + value_BD = new BigDecimal(value.toString()); + } + catch (Exception ex){} + // Both are Numeric + if (m_columns[index].ValueMax_BD != null && value_BD != null) + { // error 12 - 20 => -1 - OK: 12 - 12 => 0 & 12 - 10 => 1 + int comp = m_columns[index].ValueMax_BD.compareTo(value_BD); + if (comp < 0) + { + return "MaxValue=" + m_columns[index].ValueMax_BD + "(" + m_columns[index].ValueMax + ")" + + " - compared with Numeric Value=" + value_BD + "(" + value + ")" + + " - results in " + comp; + } + } + else // String + { + int comp = m_columns[index].ValueMax.compareTo(value.toString()); + if (comp < 0) + { + return "MaxValue=" + m_columns[index].ValueMax + + " - compared with String Value=" + value + + " - results in " + comp; + } + } + } + return null; + } // validate + +} // POInfo diff --git a/dbPort/src/org/compiere/model/POInfoColumn.java b/dbPort/src/org/compiere/model/POInfoColumn.java new file mode 100644 index 0000000000..cdb4e22130 --- /dev/null +++ b/dbPort/src/org/compiere/model/POInfoColumn.java @@ -0,0 +1,181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.math.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * PO Info Column Info Value Object + * + * @author Jorg Janke + * @version $Id: POInfoColumn.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class POInfoColumn implements Serializable +{ + /** Used by Remote FinReport */ + static final long serialVersionUID = -3983585608504631958L; + + /** + * Constructor + * @param ad_Column_ID Column ID + * @param columnName Dolumn name + * @param columnSQL virtual column + * @param displayType Display Type + * @param isMandatory Mandatory + * @param isUpdateable Updateable + * @param defaultLogic Default Logic + * @param columnLabel Column Label + * @param columnDescription Column Description + * @param isKey true if key + * @param isParent true if parent + * @param ad_Reference_Value_ID reference value + * @param validationCode sql validation code + * @param fieldLength Field Length + * @param valueMin minimal value + * @param valueMax maximal value + * @param isTranslated translated + * @param isEncrypted encrypted + */ + public POInfoColumn (int ad_Column_ID, String columnName, String columnSQL, int displayType, + boolean isMandatory, boolean isUpdateable, String defaultLogic, + String columnLabel, String columnDescription, + boolean isKey, boolean isParent, + int ad_Reference_Value_ID, String validationCode, + int fieldLength, String valueMin, String valueMax, + boolean isTranslated, boolean isEncrypted) + { + AD_Column_ID = ad_Column_ID; + ColumnName = columnName; + ColumnSQL = columnSQL; + DisplayType = displayType; + if (columnName.equals("AD_Language") || columnName.equals("EntityType")) + { + DisplayType = org.compiere.util.DisplayType.String; + ColumnClass = String.class; + } + else if (columnName.equals("Posted") + || columnName.equals("Processed") + || columnName.equals("Processing")) + { + ColumnClass = Boolean.class; + } + else if (columnName.equals("Record_ID")) + { + DisplayType = org.compiere.util.DisplayType.ID; + ColumnClass = Integer.class; + } + else + ColumnClass = org.compiere.util.DisplayType.getClass(displayType, true); + IsMandatory = isMandatory; + IsUpdateable = isUpdateable; + DefaultLogic = defaultLogic; + ColumnLabel = columnLabel; + ColumnDescription = columnDescription; + IsKey = isKey; + IsParent = isParent; + // + AD_Reference_Value_ID = ad_Reference_Value_ID; + ValidationCode = validationCode; + // + FieldLength = fieldLength; + ValueMin = valueMin; + try + { + if (valueMin != null && valueMin.length() > 0) + ValueMin_BD = new BigDecimal(valueMin); + } + catch (Exception ex) + { + CLogger.get().log(Level.SEVERE, "ValueMin=" + valueMin, ex); + } + ValueMax = valueMax; + try + { + if (valueMax != null && valueMax.length() > 0) + ValueMax_BD = new BigDecimal(valueMax); + } + catch (Exception ex) + { + CLogger.get().log(Level.SEVERE, "ValueMax=" + valueMax, ex); + } + IsTranslated = isTranslated; + IsEncrypted = isEncrypted; + } // Column + + /** Column ID */ + public int AD_Column_ID; + /** Column Name */ + public String ColumnName; + /** Virtual Column */ + public String ColumnSQL; + /** Display Type */ + public int DisplayType; + /** Data Type */ + public Class ColumnClass; + /** Mandatory */ + public boolean IsMandatory; + /** Default Value */ + public String DefaultLogic; + /** Updateable */ + public boolean IsUpdateable; + /** Label */ + public String ColumnLabel; + /** Description */ + public String ColumnDescription; + /** PK */ + public boolean IsKey; + /** FK to Parent */ + public boolean IsParent; + /** Translated */ + public boolean IsTranslated; + /** Encryoted */ + public boolean IsEncrypted; + + /** Reference Value */ + public int AD_Reference_Value_ID; + /** Validation */ + public String ValidationCode; + + /** Field Length */ + public int FieldLength; + /** Min Value */ + public String ValueMin; + /** Max Value */ + public String ValueMax; + /** Min Value */ + public BigDecimal ValueMin_BD = null; + /** Max Value */ + public BigDecimal ValueMax_BD = null; + + /** + * String representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("POInfo.Column["); + sb.append(ColumnName).append(",ID=").append(AD_Column_ID) + .append(",DisplayType=").append(DisplayType) + .append(",ColumnClass=").append(ColumnClass); + sb.append("]"); + return sb.toString(); + } // toString + +} // POInfoColumn diff --git a/dbPort/src/org/compiere/model/PO_LOB.java b/dbPort/src/org/compiere/model/PO_LOB.java new file mode 100644 index 0000000000..0bfec127d6 --- /dev/null +++ b/dbPort/src/org/compiere/model/PO_LOB.java @@ -0,0 +1,263 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.rmi.*; +import java.sql.*; +import java.util.logging.*; +import org.compiere.db.*; +import org.compiere.interfaces.*; +import org.compiere.util.*; + +/** + * Persistent Object LOB. + * Allows to store LOB remotely + * Currently Oracle specific! + * + * @author Jorg Janke + * @version $Id: PO_LOB.java,v 1.2 2006/07/30 00:58:04 jjanke Exp $ + */ +public class PO_LOB implements Serializable +{ + /** + * Constructor + * @param tableName table name + * @param columnName column name + * @param whereClause where + * @param displayType display type + * @param value value + */ + public PO_LOB (String tableName, String columnName, String whereClause, + int displayType, Object value) + { + m_tableName = tableName; + m_columnName = columnName; + m_whereClause = whereClause; + m_displayType = displayType; + m_value = value; + } // PO_LOB + + /** Logger */ + protected CLogger log = CLogger.getCLogger (getClass()); + /** Table Name */ + private String m_tableName; + /** Column Name */ + private String m_columnName; + /** Where Clause */ + private String m_whereClause; + + /** Display Type */ + private int m_displayType; + /** Data */ + private Object m_value; + + /** + * Save LOB + * @param whereClause clause + * @param trxName trx name + * @return true if saved + */ + public boolean save (String whereClause, String trxName) + { + m_whereClause = whereClause; + return save(trxName); + } // save + + /** + * Save LOB. + * see also org.compiere.session.ServerBean#updateLOB + * @param trxName trx name + * @return true if saved + */ + public boolean save (String trxName) + { + if (m_value == null + || (!(m_value instanceof String || m_value instanceof byte[])) + || (m_value instanceof String && m_value.toString().length() == 0) + || (m_value instanceof byte[] && ((byte[])m_value).length == 0) + ) + { + StringBuffer sql = new StringBuffer ("UPDATE ") + .append(m_tableName) + .append(" SET ").append(m_columnName) + .append("=null WHERE ").append(m_whereClause); + int no = DB.executeUpdate(sql.toString(), trxName); + log.fine("save [" + trxName + "] #" + no + " - no data - set to null - " + m_value); + if (no == 0) + log.warning("[" + trxName + "] - not updated - " + sql); + return true; + } + + StringBuffer sql = new StringBuffer ("UPDATE ") + .append(m_tableName) + .append(" SET ").append(m_columnName) + .append("=? WHERE ").append(m_whereClause); + // + boolean success = true; + if (DB.isRemoteObjects()) + { + log.fine("[" + trxName + "] - Remote - " + m_value); + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + success = server.updateLOB (sql.toString(), m_displayType, m_value); + if (CLogMgt.isLevelFinest()) + log.fine("server => " + success); + if (success) + return true; + } + log.log(Level.SEVERE, "AppsServer not found"); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + } + + log.fine("[" + trxName + "] - Local - " + m_value); + // Connection + Trx trx = null; + if (trxName != null) + trx = Trx.get(trxName, false); + Connection con = null; + // Create Connection + if (trx != null) + con = trx.getConnection(); + if (con == null) + con = DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED); + if (con == null) + { + log.log(Level.SEVERE, "Could not get Connection"); + return false; + } + + PreparedStatement pstmt = null; + success = true; + try + { + pstmt = con.prepareStatement(sql.toString()); + if (m_displayType == DisplayType.TextLong) + pstmt.setString(1, (String)m_value); + else + pstmt.setBytes(1, (byte[])m_value); + int no = pstmt.executeUpdate(); + if (no != 1) + { + log.fine("[" + trxName + "] - Not updated #" + no + " - " + sql); + success = false; + } + // + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.FINE, "[" + trxName + "] - " + sql, e); + success = false; + } + // Close Statement + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // Success - commit local trx + if (success) + { + if (trx != null) + { + trx = null; + con = null; + } + else + { + try + { + con.commit(); + con.close(); + con = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "[" + trxName + "] - commit " , e); + success = false; + } + } + } + // Error - roll back + if (!success) + { + log.severe ("[" + trxName + "] - rollback"); + if (trx != null) + { + trx.rollback(); + trx = null; + con = null; + } + else + { + try + { + con.rollback(); + con.close(); + con = null; + } + catch (Exception ee) + { + log.log(Level.SEVERE, "[" + trxName + "] - rollback" , ee); + } + } + } + + // Clean Connection + try + { + if (con != null) + con.close(); + con = null; + } + catch (Exception e) + { + con = null; + } + return success; + } // save + + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("PO_LOB["); + sb.append(m_tableName).append(".").append(m_columnName) + .append(",DisplayType=").append(m_displayType) + .append("]"); + return sb.toString(); + } // toString + +} // PO_LOB diff --git a/dbPort/src/org/compiere/model/PO_Record.java b/dbPort/src/org/compiere/model/PO_Record.java new file mode 100644 index 0000000000..4be117d267 --- /dev/null +++ b/dbPort/src/org/compiere/model/PO_Record.java @@ -0,0 +1,241 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.sql.*; +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Maintain AD_Table_ID/Record_ID contraint + * + * @author Jorg Janke + * @version $Id: PO_Record.java,v 1.4 2006/07/30 00:58:04 jjanke Exp $ + */ +public class PO_Record +{ + /** Parent Tables */ + private static int[] s_parents = new int[]{ + X_C_Order.Table_ID, + X_CM_Container.Table_ID + }; + private static String[] s_parentNames = new String[]{ + X_C_Order.Table_Name, + X_CM_Container.Table_Name + }; + private static int[] s_parentChilds = new int[]{ + X_C_OrderLine.Table_ID, + X_CM_Container_Element.Table_ID + }; + private static String[] s_parentChildNames = new String[]{ + X_C_OrderLine.Table_Name, + X_CM_Container_Element.Table_Name + }; + + + + /** Cascade Table ID */ + private static int[] s_cascades = new int[]{ + X_AD_Attachment.Table_ID, + X_AD_Archive.Table_ID, + // X_CM_ContainerTTable.Table_ID, + // X_CM_CStageTTable.Table_ID, + X_K_Index.Table_ID, + X_AD_Note.Table_ID + }; + /** Cascade Table Names */ + private static String[] s_cascadeNames = new String[]{ + X_AD_Attachment.Table_Name, + X_AD_Archive.Table_Name, + // X_CM_ContainerTTable.Table_Name, + // X_CM_CStageTTable.Table_Name, + X_K_Index.Table_Name, + X_AD_Note.Table_Name + }; + + /** Restrict Table ID */ + private static int[] s_restricts = new int[]{ + X_R_Request.Table_ID, + X_CM_Chat.Table_ID + // X_Fact_Acct.Table_ID + }; + /** Restrict Table Names */ + private static String[] s_restrictNames = new String[]{ + X_R_Request.Table_Name, + X_CM_Chat.Table_Name + // X_Fact_Acct.Table_Name + }; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (PO_Record.class); + + /** + * Delete Cascade including (selected)parent relationships + * @param AD_Table_ID table + * @param Record_ID record + * @param trxName transaction + * @return false if could not be deleted + */ + static boolean deleteCascade (int AD_Table_ID, int Record_ID, String trxName) + { + // Table Loop + for (int i = 0; i < s_cascades.length; i++) + { + // DELETE FROM table WHERE AD_Table_ID=#1 AND Record_ID=#2 + if (s_cascades[i] != AD_Table_ID) + { + Object[] params = new Object[]{new Integer(AD_Table_ID), new Integer(Record_ID)}; + StringBuffer sql = new StringBuffer ("DELETE FROM ") + .append(s_cascadeNames[i]) + .append(" WHERE AD_Table_ID=? AND Record_ID=?"); + int no = DB.executeUpdate(sql.toString(), params, false, trxName); + if (no > 0) + log.config(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); + else if (no < 0) + { + log.severe(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); + return false; + } + } + } + // Parent Loop + for (int j = 0; j < s_parents.length; j++) + { + // DELETE FROM AD_Attachment WHERE AD_Table_ID=1 AND Record_ID IN + // (SELECT C_InvoiceLine_ID FROM C_InvoiceLine WHERE C_Invoice_ID=1) + if (s_parents[j] == AD_Table_ID) + { + int AD_Table_IDchild = s_parentChilds[j]; + Object[] params = new Object[]{new Integer(AD_Table_IDchild), new Integer(Record_ID)}; + for (int i = 0; i < s_cascades.length; i++) + { + StringBuffer sql = new StringBuffer ("DELETE FROM ") + .append(s_cascadeNames[i]) + .append(" WHERE AD_Table_ID=? AND Record_ID IN (SELECT ") + .append(s_parentChildNames[j]).append("_ID FROM ") + .append(s_parentChildNames[j]).append(" WHERE ") + .append(s_parentNames[j]).append("_ID=?)"); + int no = DB.executeUpdate(sql.toString(), params, false, trxName); + if (no > 0) + log.config(s_cascadeNames[i] + " " + s_parentNames[j] + + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); + else if (no < 0) + { + log.severe(s_cascadeNames[i] + " " + s_parentNames[j] + + " (" + AD_Table_ID + "/" + Record_ID + ") #" + no); + return false; + } + } + } + } + return true; + } // deleteCascase + + /** + * An entry Exists for restrict table/record combination + * @param AD_Table_ID table + * @param Record_ID record + * @param trxName transaction + * @return error message (Table Name) or null + */ + static String exists (int AD_Table_ID, int Record_ID, String trxName) + { + // Table Loop only + for (int i = 0; i < s_restricts.length; i++) + { + // SELECT COUNT(*) FROM table WHERE AD_Table_ID=#1 AND Record_ID=#2 + StringBuffer sql = new StringBuffer ("SELECT COUNT(*) FROM ") + .append(s_restrictNames[i]) + .append(" WHERE AD_Table_ID=? AND Record_ID=?"); + int no = DB.getSQLValue(trxName, sql.toString(), AD_Table_ID, Record_ID); + if (no > 0) + return s_restrictNames[i]; + } + return null; + } // exists + + /** + * Validate all tables for AD_Table/Record_ID relationships + */ + static void validate () + { + String sql = "SELECT AD_Table_ID, TableName FROM AD_Table WHERE IsView='N' ORDER BY 2"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + validate (rs.getInt(1), rs.getString(2)); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // validate + + /** + * Validate all tables for AD_Table/Record_ID relationships + * @param AD_Table_ID table + */ + static void validate (int AD_Table_ID) + { + MTable table = new MTable(Env.getCtx(), AD_Table_ID, null); + if (table.isView()) + log.warning("Ignored - View " + table.getTableName()); + else + validate (table.getAD_Table_ID(), table.getTableName()); + } // validate + + /** + * Validate Table for Table/Record + * @param AD_Table_ID table + * @param TableName Name + */ + static private void validate (int AD_Table_ID, String TableName) + { + for (int i = 0; i < s_cascades.length; i++) + { + StringBuffer sql = new StringBuffer ("DELETE FROM ") + .append(s_cascadeNames[i]) + .append(" WHERE AD_Table_ID=").append(AD_Table_ID) + .append(" AND Record_ID NOT IN (SELECT ") + .append(TableName).append("_ID FROM ").append(TableName).append(")"); + int no = DB.executeUpdate(sql.toString(), null); + if (no > 0) + log.config(s_cascadeNames[i] + " (" + AD_Table_ID + "/" + TableName + + ") Invalid #" + no); + } + } // validate + + +} // PO_Record diff --git a/dbPort/src/org/compiere/model/PrintInfo.java b/dbPort/src/org/compiere/model/PrintInfo.java new file mode 100644 index 0000000000..2c42cbdd61 --- /dev/null +++ b/dbPort/src/org/compiere/model/PrintInfo.java @@ -0,0 +1,284 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import org.compiere.process.*; + + +/** + * Print Info + * + * @author Jorg Janke + * @version $Id: PrintInfo.java,v 1.3 2006/07/30 00:58:37 jjanke Exp $ + */ +public class PrintInfo +{ + /** + * Process Archive Info + * @param pi process info + */ + public PrintInfo (ProcessInfo pi) + { + setName(pi.getTitle()); + setAD_Process_ID(pi.getAD_Process_ID()); + setAD_Table_ID(pi.getTable_ID()); + setRecord_ID(pi.getRecord_ID()); + } // PrintInfo + + + /** + * Document Archive Info + * @param Name name + * @param AD_Table_ID table + * @param Record_ID record + * @param C_BPartner_ID bpartner + */ + public PrintInfo (String Name, int AD_Table_ID, int Record_ID, int C_BPartner_ID) + { + setName(Name); + setAD_Table_ID(AD_Table_ID); + setRecord_ID(Record_ID); + setC_BPartner_ID(C_BPartner_ID); + } // ArchiveInfo + + /** + * Report Archive Info + * @param Name name + * @param AD_Table_ID table + * @param Record_ID record + */ + public PrintInfo (String Name, int AD_Table_ID, int Record_ID) + { + setName(Name); + setAD_Table_ID(AD_Table_ID); + setRecord_ID(Record_ID); + } // ArchiveInfo + + boolean m_withDialog = false; + private int m_copies = 1; + private boolean m_isDocumentCopy = false; + private String m_printerName = null; + // + private String m_Name = null; + private String m_Description = null; + private String m_Help = null; + private int m_AD_Process_ID = 0; + private int m_AD_Table_ID = 0; + private int m_Record_ID = 0; + private int m_C_BPartner_ID = 0; + + + /** + * Is this a Report + * @return true if report + */ + public boolean isReport() + { + return m_AD_Process_ID != 0 // Menu Report + || m_C_BPartner_ID == 0; + } // isReport + + /** + * Is this a Document + * @return true if BPartner defined + */ + public boolean isDocument() + { + return m_C_BPartner_ID != 0; + } // isDocument + + + /** + * @return Returns the copies. + */ + public int getCopies () + { + return m_copies; + } + /** + * @param copies The copies to set. + */ + public void setCopies (int copies) + { + m_copies = copies; + } + /** + * @return Returns the printerName. + */ + public String getPrinterName () + { + return m_printerName; + } + /** + * @param printerName The printerName to set. + */ + public void setPrinterName (String printerName) + { + m_printerName = printerName; + } + /** + * @return Returns the withDialog. + */ + public boolean isWithDialog () + { + return m_withDialog; + } + /** + * @param withDialog The withDialog to set. + */ + public void setWithDialog (boolean withDialog) + { + m_withDialog = withDialog; + } + /** + * @param isDocumentCopy The isDocument to set. + */ + public void setDocumentCopy (boolean isDocumentCopy) + { + m_isDocumentCopy = isDocumentCopy; + } + /** + * Document Copy + * @return true if copy + */ + public boolean isDocumentCopy() + { + return m_isDocumentCopy; + } // isDocument + /** + * @return Returns the aD_Process_ID. + */ + public int getAD_Process_ID () + { + return m_AD_Process_ID; + } + /** + * @param process_ID The aD_Process_ID to set. + */ + public void setAD_Process_ID (int process_ID) + { + m_AD_Process_ID = process_ID; + } + /** + * @return Returns the aD_Table_ID. + */ + public int getAD_Table_ID () + { + return m_AD_Table_ID; + } + /** + * @param table_ID The aD_Table_ID to set. + */ + public void setAD_Table_ID (int table_ID) + { + m_AD_Table_ID = table_ID; + } + /** + * @return Returns the c_BPartner_ID. + */ + public int getC_BPartner_ID () + { + return m_C_BPartner_ID; + } + /** + * @param partner_ID The c_BPartner_ID to set. + */ + public void setC_BPartner_ID (int partner_ID) + { + m_C_BPartner_ID = partner_ID; + } + /** + * @return Returns the description. + */ + public String getDescription () + { + return m_Description; + } + /** + * @param description The description to set. + */ + public void setDescription (String description) + { + m_Description = description; + } + /** + * @return Returns the help. + */ + public String getHelp () + { + return m_Help; + } + /** + * @param help The help to set. + */ + public void setHelp (String help) + { + m_Help = help; + } + /** + * @return Returns the name. + */ + public String getName () + { + if (m_Name == null || m_Name.length() == 0) + return"Unknown"; + return m_Name; + } + /** + * @param name The name to set. + */ + public void setName (String name) + { + m_Name = name; + } + /** + * @return Returns the record_ID. + */ + public int getRecord_ID () + { + return m_Record_ID; + } + /** + * @param record_ID The record_ID to set. + */ + public void setRecord_ID (int record_ID) + { + m_Record_ID = record_ID; + } + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("PrintInfo["); + sb.append(getName()); + if (getAD_Process_ID() != 0) + sb.append(",AD_Process_ID=").append(getAD_Process_ID()); + if (getAD_Table_ID() != 0) + sb.append(",AD_Table_ID=").append(getAD_Table_ID()); + if (getRecord_ID()!= 0) + sb.append(",Record_ID=").append(getRecord_ID()); + if (getC_BPartner_ID() != 0) + sb.append(",C_BPartner_ID=").append(getC_BPartner_ID()); + + sb.append("]"); + return sb.toString(); + } // toString + +} // ArchiveInfo diff --git a/dbPort/src/org/compiere/model/TranslationTable.java b/dbPort/src/org/compiere/model/TranslationTable.java new file mode 100644 index 0000000000..c7fb641720 --- /dev/null +++ b/dbPort/src/org/compiere/model/TranslationTable.java @@ -0,0 +1,260 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.util.*; +import org.compiere.util.*; + +/** + * Translation Table Management + * + * @author Jorg Janke + * @version $Id: TranslationTable.java,v 1.2 2006/07/30 00:54:54 jjanke Exp $ + */ +public class TranslationTable +{ + /** + * Save translation for po + * @param po persistent object + * @param newRecord new + * @return true if no active language or translation saved/reset + */ + public static boolean save (PO po, boolean newRecord) + { + if (!TranslationTable.isActiveLanguages(false)) + return true; + TranslationTable table = TranslationTable.get(po.get_TableName()); + if (newRecord) + return table.createTranslation(po); + return table.resetTranslationFlag(po); + } // save + + /** + * Delete translation for po + * @param po persistent object + * @return true if no active language or translation deleted + */ + public static boolean delete (PO po) + { + if (!TranslationTable.isActiveLanguages(false)) + return true; + TranslationTable table = TranslationTable.get(po.get_TableName()); + return table.deleteTranslation(po); + } // delete + + /** + * Get Number of active Translation Languages + * @param requery requery + * @return number of active Translations + */ + public static int getActiveLanguages (boolean requery) + { + if (s_activeLanguages != null && !requery) + return s_activeLanguages.intValue(); + int no = DB.getSQLValue(null, + "SELECT COUNT(*) FROM AD_Language WHERE IsActive='Y' AND IsSystemLanguage='Y'"); + s_activeLanguages = new Integer(no); + return s_activeLanguages.intValue(); + } // getActiveLanguages + + /** + * Are there active Translation Languages + * @param requery requery + * @return true active Translations + */ + public static boolean isActiveLanguages (boolean requery) + { + int no = getActiveLanguages(requery); + return no > 0; + } // isActiveLanguages + + /** + * Get TranslationTable from Cache + * @param baseTableName base table name + * @return TranslationTable + */ + public static TranslationTable get (String baseTableName) + { + TranslationTable retValue = (TranslationTable)s_cache.get (baseTableName); + if (retValue != null) + return retValue; + retValue = new TranslationTable (baseTableName); + s_cache.put (baseTableName, retValue); + return retValue; + } // get + + /** Active Translations */ + private static Integer s_activeLanguages = null; + + /** Cache */ + private static CCache s_cache = new CCache("TranslationTable", 20); + + + /** + * Translation Table + * @param baseTableName base table name + */ + protected TranslationTable (String baseTableName) + { + if (baseTableName == null) + throw new IllegalArgumentException("Base Table Name is null"); + m_baseTableName = baseTableName; + m_trlTableName = baseTableName + "_Trl"; + initColumns(); + log.fine(toString()); + } // TranslationTable + + /** Static Logger */ + private static CLogger log = CLogger.getCLogger (TranslationTable.class); + + /** Translation Table Name */ + private String m_trlTableName = null; + /** Base Table Name */ + private String m_baseTableName = null; + /** Column Names */ + private ArrayList m_columns = new ArrayList(); + + /** + * Add Translation Columns + */ + private void initColumns() + { + MTable table = MTable.get(Env.getCtx(), m_trlTableName); + if (table == null) + throw new IllegalArgumentException("Table Not found=" + m_trlTableName); + MColumn[] columns = table.getColumns(false); + for (int i = 0; i < columns.length; i++) + { + MColumn column = columns[i]; + if (column.isStandardColumn()) + continue; + String columnName = column.getColumnName(); + if (columnName.endsWith("_ID") + || columnName.startsWith("AD_Language") + || columnName.equals("IsTranslated")) + continue; + // + m_columns.add(columnName); + } + if (m_columns.size() == 0) + throw new IllegalArgumentException("No Columns found=" + m_trlTableName); + } // initColumns + + /** + * Create Translation record from PO + * @param po base table record + * @return true if inserted or no translation + */ + public boolean createTranslation (PO po) + { + if (!isActiveLanguages(false)) + return true; + if (po.get_ID() == 0) + throw new IllegalArgumentException("PO ID is 0"); + // + StringBuffer sql1 = new StringBuffer(); + sql1.append("INSERT INTO ").append(m_trlTableName).append(" ("); + StringBuffer sql2 = new StringBuffer(); + sql2.append(") SELECT "); + + // Key Columns + sql1.append(m_baseTableName).append("_ID,AD_Language"); + sql2.append("b.").append(m_baseTableName).append("_ID,l.AD_Language"); + + // Base Columns + sql1.append(", AD_Client_ID,AD_Org_ID,IsActive, Created,CreatedBy,Updated,UpdatedBy, IsTranslated"); + sql2.append(", b.AD_Client_ID,b.AD_Org_ID,b.IsActive, b.Created,b.CreatedBy,b.Updated,b.UpdatedBy, 'N'"); + + for (int i = 0; i < m_columns.size(); i++) + { + String columnName = (String)m_columns.get(i); + Object value = po.get_Value(columnName); + // + if (value == null) + continue; + sql1.append(",").append(columnName); + sql2.append(",b.").append(columnName); + } + // + StringBuffer sql = new StringBuffer(); + sql.append(sql1).append(sql2) + .append(" FROM AD_Language l, " + m_baseTableName + + " b WHERE l.IsActive = 'Y' AND l.IsSystemLanguage = 'Y' AND b." + + m_baseTableName + "_ID=").append(po.get_ID()); + int no = DB.executeUpdate(sql.toString(), po.get_TrxName()); + log.fine(m_trlTableName + ": ID=" + po.get_ID() + " #" + no); + return no != 0; + } // createTranslation + + /** + * Reset Translation Flag + * @param po po + * @return true if updated or no translations + */ + public boolean resetTranslationFlag (PO po) + { + if (!isActiveLanguages(false)) + return true; + if (po.get_ID() == 0) + throw new IllegalArgumentException("PO ID is 0"); + // + StringBuffer sb = new StringBuffer("UPDATE "); + sb.append(m_trlTableName) + .append(" SET IsTranslated='N',Updated=SysDate WHERE ") + .append(m_baseTableName).append("_ID=").append(po.get_ID()); + int no = DB.executeUpdate(sb.toString(), po.get_TrxName()); + log.fine(m_trlTableName + ": ID=" + po.get_ID() + " #" + no); + return no != 0; + } // resetTranslationFlag + + /** + * Delete Translation + * @param po po + * @return true if udeleted or no translations + */ + public boolean deleteTranslation (PO po) + { + if (!isActiveLanguages(false)) + return true; + if (po.get_IDOld() == 0) + throw new IllegalArgumentException("PO Old ID is 0"); + // + StringBuffer sb = new StringBuffer("DELETE "); + sb.append(m_trlTableName) + .append(" WHERE ") + .append(m_baseTableName).append("_ID=").append(po.get_IDOld()); + int no = DB.executeUpdate(sb.toString(), po.get_TrxName()); + log.fine(m_trlTableName + ": ID=" + po.get_IDOld() + " #" + no); + return no != 0; + } // resetTranslationFlag + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("TranslationTable["); + sb.append(m_trlTableName) + .append("(").append(m_baseTableName).append(")"); + for (int i = 0; i < m_columns.size(); i++) + sb.append("-").append(m_columns.get(i)); + sb.append ("]"); + return sb.toString (); + } // toString + +} // TranslationTable diff --git a/dbPort/src/org/compiere/model/VO.java b/dbPort/src/org/compiere/model/VO.java new file mode 100644 index 0000000000..626075c0e6 --- /dev/null +++ b/dbPort/src/org/compiere/model/VO.java @@ -0,0 +1,202 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +import java.io.*; +import java.util.*; + +/** + * Value Object + * + * @author Jorg Janke + * @version $Id: VO.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $ + */ +public class VO + implements Map, Serializable +{ + /** + * Constructor + */ + public VO () + { + super (); + } // VO + +// private static final long serialVersionUID = 8683452581122892189L; + + /** Keys */ + private ArrayList m_keys = new ArrayList(); + /** Values */ + private ArrayList m_values = new ArrayList(); + + /** + * Get Size + * @return size + */ + public int size () + { + return m_keys.size(); + } // size + + /** + * Is Empty + * @return true if empty + */ + public boolean isEmpty () + { + return m_keys.isEmpty(); + } // isEmpty + + /** + * Contains Key + * @param key key + * @return true if contains + */ + public boolean containsKey (Object key) + { + if (key == null) + return false; + return m_keys.contains(key); + } // containsKey + + /** + * Contains Value + * @param value value + * @return true if contains value + */ + public boolean containsValue (Object value) + { + if (value == null) + return false; + return m_values.contains(value); + } // containsValue + + /** + * Get Value with Key + * @param key key + * @return value or null + */ + public synchronized Object get (Object key) + { + if (key == null) + return null; + int index = m_keys.indexOf(key); + if (index != -1) + return m_values.get(index); + return null; + } // get + + /** + * Put key/value + * @param key key + * @param value value + * @return previous value or null + */ + public synchronized Object put (Object key, Object value) + { + if (key == null) + return null; + if (value == null) + return remove(key); + // + String stringKey = key.toString(); + String stringValue = value.toString(); + int index = m_keys.indexOf(key); + if (index != -1) + return m_values.set (index, stringValue); + m_values.add(stringKey); + m_values.add(stringValue); + return null; + } // put + + /** + * Remove + * @param key key + * @return previous value or null + */ + public synchronized Object remove (Object key) + { + if (key == null) + return null; + int index = m_keys.indexOf(key); + Object old = null; + if (index != -1) + { + old = m_values.get(index); + m_keys.remove(index); + m_values.remove(index); + } + return old; + } // remove + + /** + * Put All + * @param t map + */ + public void putAll (Map t) + { + Iterator it = t.keySet().iterator(); + while (it.hasNext()) + { + Object key = it.next(); + Object value = t.get(key); + put(key, value); + } + } // putAll + + /** + * Clear keys/values + */ + public void clear () + { + m_keys.clear(); + m_values.clear(); + } // clear + + /** + * Get Key Set + * @return key set + */ + public Set keySet () + { + HashSet set = new HashSet(m_keys); + return set; + } // keySet + + /** + * Get Values + * @return values as collection + */ + public Collection values () + { + return m_values; + } // values + + /** + * Get Values Set + * @return values set + */ + public Set entrySet () + { + HashSet set = new HashSet(m_values); + return set; + } // entrySet + + + + +} // VO diff --git a/dbPort/src/org/compiere/model/X_AD_AccessLog.java b/dbPort/src/org/compiere/model/X_AD_AccessLog.java new file mode 100644 index 0000000000..4b27b607e7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_AccessLog.java @@ -0,0 +1,242 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_AccessLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:51.89 */ +public class X_AD_AccessLog extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_AccessLog_ID id +@param trxName transaction +*/ +public X_AD_AccessLog (Properties ctx, int AD_AccessLog_ID, String trxName) +{ +super (ctx, AD_AccessLog_ID, trxName); +/** if (AD_AccessLog_ID == 0) +{ +setAD_AccessLog_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_AccessLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=717 */ +public static final int Table_ID=717; + +/** TableName=AD_AccessLog */ +public static final String Table_Name="AD_AccessLog"; + +protected static KeyNamePair Model = new KeyNamePair(717,"AD_AccessLog"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_AccessLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Access Log. +@param AD_AccessLog_ID Log of Access to the System */ +public void setAD_AccessLog_ID (int AD_AccessLog_ID) +{ +if (AD_AccessLog_ID < 1) throw new IllegalArgumentException ("AD_AccessLog_ID is mandatory."); +set_ValueNoCheck ("AD_AccessLog_ID", new Integer(AD_AccessLog_ID)); +} +/** Get Access Log. +@return Log of Access to the System */ +public int getAD_AccessLog_ID() +{ +Integer ii = (Integer)get_Value("AD_AccessLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_AccessLog_ID())); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_Value ("Record_ID", null); + else +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_Value ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Host = Remote_Host.substring(0,59); +} +set_Value ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Reply. +@param Reply Reply or Answer */ +public void setReply (String Reply) +{ +if (Reply != null && Reply.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Reply = Reply.substring(0,1999); +} +set_Value ("Reply", Reply); +} +/** Get Reply. +@return Reply or Answer */ +public String getReply() +{ +return (String)get_Value("Reply"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Alert.java b/dbPort/src/org/compiere/model/X_AD_Alert.java new file mode 100644 index 0000000000..1d7b8547ec --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Alert.java @@ -0,0 +1,273 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Alert + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:51.953 */ +public class X_AD_Alert extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Alert_ID id +@param trxName transaction +*/ +public X_AD_Alert (Properties ctx, int AD_Alert_ID, String trxName) +{ +super (ctx, AD_Alert_ID, trxName); +/** if (AD_Alert_ID == 0) +{ +setAD_AlertProcessor_ID (0); +setAD_Alert_ID (0); +setAlertMessage (null); +setAlertSubject (null); +setEnforceClientSecurity (true); // Y +setEnforceRoleSecurity (true); // Y +setIsValid (true); // Y +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Alert (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=594 */ +public static final int Table_ID=594; + +/** TableName=AD_Alert */ +public static final String Table_Name="AD_Alert"; + +protected static KeyNamePair Model = new KeyNamePair(594,"AD_Alert"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Alert[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Alert Processor. +@param AD_AlertProcessor_ID Alert Processor/Server Parameter */ +public void setAD_AlertProcessor_ID (int AD_AlertProcessor_ID) +{ +if (AD_AlertProcessor_ID < 1) throw new IllegalArgumentException ("AD_AlertProcessor_ID is mandatory."); +set_Value ("AD_AlertProcessor_ID", new Integer(AD_AlertProcessor_ID)); +} +/** Get Alert Processor. +@return Alert Processor/Server Parameter */ +public int getAD_AlertProcessor_ID() +{ +Integer ii = (Integer)get_Value("AD_AlertProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alert. +@param AD_Alert_ID Adempiere Alert */ +public void setAD_Alert_ID (int AD_Alert_ID) +{ +if (AD_Alert_ID < 1) throw new IllegalArgumentException ("AD_Alert_ID is mandatory."); +set_ValueNoCheck ("AD_Alert_ID", new Integer(AD_Alert_ID)); +} +/** Get Alert. +@return Adempiere Alert */ +public int getAD_Alert_ID() +{ +Integer ii = (Integer)get_Value("AD_Alert_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alert Message. +@param AlertMessage Message of the Alert */ +public void setAlertMessage (String AlertMessage) +{ +if (AlertMessage == null) throw new IllegalArgumentException ("AlertMessage is mandatory."); +if (AlertMessage.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +AlertMessage = AlertMessage.substring(0,1999); +} +set_Value ("AlertMessage", AlertMessage); +} +/** Get Alert Message. +@return Message of the Alert */ +public String getAlertMessage() +{ +return (String)get_Value("AlertMessage"); +} +/** Set Alert Subject. +@param AlertSubject Subject of the Alert */ +public void setAlertSubject (String AlertSubject) +{ +if (AlertSubject == null) throw new IllegalArgumentException ("AlertSubject is mandatory."); +if (AlertSubject.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AlertSubject = AlertSubject.substring(0,59); +} +set_Value ("AlertSubject", AlertSubject); +} +/** Get Alert Subject. +@return Subject of the Alert */ +public String getAlertSubject() +{ +return (String)get_Value("AlertSubject"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Enforce Client Security. +@param EnforceClientSecurity Send alerts to recipient only if the client security rules of the role allows */ +public void setEnforceClientSecurity (boolean EnforceClientSecurity) +{ +set_Value ("EnforceClientSecurity", new Boolean(EnforceClientSecurity)); +} +/** Get Enforce Client Security. +@return Send alerts to recipient only if the client security rules of the role allows */ +public boolean isEnforceClientSecurity() +{ +Object oo = get_Value("EnforceClientSecurity"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Enforce Role Security. +@param EnforceRoleSecurity Send alerts to recipient only if the data security rules of the role allows */ +public void setEnforceRoleSecurity (boolean EnforceRoleSecurity) +{ +set_Value ("EnforceRoleSecurity", new Boolean(EnforceRoleSecurity)); +} +/** Get Enforce Role Security. +@return Send alerts to recipient only if the data security rules of the role allows */ +public boolean isEnforceRoleSecurity() +{ +Object oo = get_Value("EnforceRoleSecurity"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_AlertProcessor.java b/dbPort/src/org/compiere/model/X_AD_AlertProcessor.java new file mode 100644 index 0000000000..fb7aa75293 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_AlertProcessor.java @@ -0,0 +1,266 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_AlertProcessor + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.062 */ +public class X_AD_AlertProcessor extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_AlertProcessor_ID id +@param trxName transaction +*/ +public X_AD_AlertProcessor (Properties ctx, int AD_AlertProcessor_ID, String trxName) +{ +super (ctx, AD_AlertProcessor_ID, trxName); +/** if (AD_AlertProcessor_ID == 0) +{ +setAD_AlertProcessor_ID (0); +setFrequency (0); +setFrequencyType (null); +setKeepLogDays (0); // 7 +setName (null); +setSupervisor_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_AlertProcessor (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=700 */ +public static final int Table_ID=700; + +/** TableName=AD_AlertProcessor */ +public static final String Table_Name="AD_AlertProcessor"; + +protected static KeyNamePair Model = new KeyNamePair(700,"AD_AlertProcessor"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_AlertProcessor[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Alert Processor. +@param AD_AlertProcessor_ID Alert Processor/Server Parameter */ +public void setAD_AlertProcessor_ID (int AD_AlertProcessor_ID) +{ +if (AD_AlertProcessor_ID < 1) throw new IllegalArgumentException ("AD_AlertProcessor_ID is mandatory."); +set_ValueNoCheck ("AD_AlertProcessor_ID", new Integer(AD_AlertProcessor_ID)); +} +/** Get Alert Processor. +@return Alert Processor/Server Parameter */ +public int getAD_AlertProcessor_ID() +{ +Integer ii = (Integer)get_Value("AD_AlertProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +set_Value ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=221 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=221; +/** Day = D */ +public static final String FREQUENCYTYPE_Day = "D"; +/** Hour = H */ +public static final String FREQUENCYTYPE_Hour = "H"; +/** Minute = M */ +public static final String FREQUENCYTYPE_Minute = "M"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("H") || FrequencyType.equals("M")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=221 - D - H - M"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Days to keep Log. +@param KeepLogDays Number of days to keep the log entries */ +public void setKeepLogDays (int KeepLogDays) +{ +set_Value ("KeepLogDays", new Integer(KeepLogDays)); +} +/** Get Days to keep Log. +@return Number of days to keep the log entries */ +public int getKeepLogDays() +{ +Integer ii = (Integer)get_Value("KeepLogDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** Supervisor_ID AD_Reference_ID=316 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=316; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID < 1) throw new IllegalArgumentException ("Supervisor_ID is mandatory."); +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_AlertProcessorLog.java b/dbPort/src/org/compiere/model/X_AD_AlertProcessorLog.java new file mode 100644 index 0000000000..65a09bac74 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_AlertProcessorLog.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_AlertProcessorLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.125 */ +public class X_AD_AlertProcessorLog extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_AlertProcessorLog_ID id +@param trxName transaction +*/ +public X_AD_AlertProcessorLog (Properties ctx, int AD_AlertProcessorLog_ID, String trxName) +{ +super (ctx, AD_AlertProcessorLog_ID, trxName); +/** if (AD_AlertProcessorLog_ID == 0) +{ +setAD_AlertProcessorLog_ID (0); +setAD_AlertProcessor_ID (0); +setIsError (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_AlertProcessorLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=699 */ +public static final int Table_ID=699; + +/** TableName=AD_AlertProcessorLog */ +public static final String Table_Name="AD_AlertProcessorLog"; + +protected static KeyNamePair Model = new KeyNamePair(699,"AD_AlertProcessorLog"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_AlertProcessorLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Alert Processor Log. +@param AD_AlertProcessorLog_ID Result of the execution of the Alert Processor */ +public void setAD_AlertProcessorLog_ID (int AD_AlertProcessorLog_ID) +{ +if (AD_AlertProcessorLog_ID < 1) throw new IllegalArgumentException ("AD_AlertProcessorLog_ID is mandatory."); +set_ValueNoCheck ("AD_AlertProcessorLog_ID", new Integer(AD_AlertProcessorLog_ID)); +} +/** Get Alert Processor Log. +@return Result of the execution of the Alert Processor */ +public int getAD_AlertProcessorLog_ID() +{ +Integer ii = (Integer)get_Value("AD_AlertProcessorLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alert Processor. +@param AD_AlertProcessor_ID Alert Processor/Server Parameter */ +public void setAD_AlertProcessor_ID (int AD_AlertProcessor_ID) +{ +if (AD_AlertProcessor_ID < 1) throw new IllegalArgumentException ("AD_AlertProcessor_ID is mandatory."); +set_ValueNoCheck ("AD_AlertProcessor_ID", new Integer(AD_AlertProcessor_ID)); +} +/** Get Alert Processor. +@return Alert Processor/Server Parameter */ +public int getAD_AlertProcessor_ID() +{ +Integer ii = (Integer)get_Value("AD_AlertProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Error. +@param IsError An Error occured in the execution */ +public void setIsError (boolean IsError) +{ +set_Value ("IsError", new Boolean(IsError)); +} +/** Get Error. +@return An Error occured in the execution */ +public boolean isError() +{ +Object oo = get_Value("IsError"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_AlertRecipient.java b/dbPort/src/org/compiere/model/X_AD_AlertRecipient.java new file mode 100644 index 0000000000..64eff30e0a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_AlertRecipient.java @@ -0,0 +1,157 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_AlertRecipient + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.14 */ +public class X_AD_AlertRecipient extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_AlertRecipient_ID id +@param trxName transaction +*/ +public X_AD_AlertRecipient (Properties ctx, int AD_AlertRecipient_ID, String trxName) +{ +super (ctx, AD_AlertRecipient_ID, trxName); +/** if (AD_AlertRecipient_ID == 0) +{ +setAD_AlertRecipient_ID (0); +setAD_Alert_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_AlertRecipient (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=592 */ +public static final int Table_ID=592; + +/** TableName=AD_AlertRecipient */ +public static final String Table_Name="AD_AlertRecipient"; + +protected static KeyNamePair Model = new KeyNamePair(592,"AD_AlertRecipient"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_AlertRecipient[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Alert Recipient. +@param AD_AlertRecipient_ID Recipient of the Alert Notification */ +public void setAD_AlertRecipient_ID (int AD_AlertRecipient_ID) +{ +if (AD_AlertRecipient_ID < 1) throw new IllegalArgumentException ("AD_AlertRecipient_ID is mandatory."); +set_ValueNoCheck ("AD_AlertRecipient_ID", new Integer(AD_AlertRecipient_ID)); +} +/** Get Alert Recipient. +@return Recipient of the Alert Notification */ +public int getAD_AlertRecipient_ID() +{ +Integer ii = (Integer)get_Value("AD_AlertRecipient_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alert. +@param AD_Alert_ID Adempiere Alert */ +public void setAD_Alert_ID (int AD_Alert_ID) +{ +if (AD_Alert_ID < 1) throw new IllegalArgumentException ("AD_Alert_ID is mandatory."); +set_ValueNoCheck ("AD_Alert_ID", new Integer(AD_Alert_ID)); +} +/** Get Alert. +@return Adempiere Alert */ +public int getAD_Alert_ID() +{ +Integer ii = (Integer)get_Value("AD_Alert_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID <= 0) set_Value ("AD_Role_ID", null); + else +set_Value ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_AlertRule.java b/dbPort/src/org/compiere/model/X_AD_AlertRule.java new file mode 100644 index 0000000000..21e92b1be7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_AlertRule.java @@ -0,0 +1,302 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_AlertRule + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.156 */ +public class X_AD_AlertRule extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_AlertRule_ID id +@param trxName transaction +*/ +public X_AD_AlertRule (Properties ctx, int AD_AlertRule_ID, String trxName) +{ +super (ctx, AD_AlertRule_ID, trxName); +/** if (AD_AlertRule_ID == 0) +{ +setAD_AlertRule_ID (0); +setAD_Alert_ID (0); +setFromClause (null); +setIsValid (true); // Y +setName (null); +setSelectClause (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_AlertRule (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=593 */ +public static final int Table_ID=593; + +/** TableName=AD_AlertRule */ +public static final String Table_Name="AD_AlertRule"; + +protected static KeyNamePair Model = new KeyNamePair(593,"AD_AlertRule"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_AlertRule[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Alert Rule. +@param AD_AlertRule_ID Definition of the alert element */ +public void setAD_AlertRule_ID (int AD_AlertRule_ID) +{ +if (AD_AlertRule_ID < 1) throw new IllegalArgumentException ("AD_AlertRule_ID is mandatory."); +set_ValueNoCheck ("AD_AlertRule_ID", new Integer(AD_AlertRule_ID)); +} +/** Get Alert Rule. +@return Definition of the alert element */ +public int getAD_AlertRule_ID() +{ +Integer ii = (Integer)get_Value("AD_AlertRule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alert. +@param AD_Alert_ID Adempiere Alert */ +public void setAD_Alert_ID (int AD_Alert_ID) +{ +if (AD_Alert_ID < 1) throw new IllegalArgumentException ("AD_Alert_ID is mandatory."); +set_ValueNoCheck ("AD_Alert_ID", new Integer(AD_Alert_ID)); +} +/** Get Alert. +@return Adempiere Alert */ +public int getAD_Alert_ID() +{ +Integer ii = (Integer)get_Value("AD_Alert_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Error Msg. +@param ErrorMsg Error Msg */ +public void setErrorMsg (String ErrorMsg) +{ +if (ErrorMsg != null && ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ErrorMsg = ErrorMsg.substring(0,1999); +} +set_Value ("ErrorMsg", ErrorMsg); +} +/** Get Error Msg. +@return Error Msg */ +public String getErrorMsg() +{ +return (String)get_Value("ErrorMsg"); +} +/** Set Sql FROM. +@param FromClause SQL FROM clause */ +public void setFromClause (String FromClause) +{ +if (FromClause == null) throw new IllegalArgumentException ("FromClause is mandatory."); +if (FromClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +FromClause = FromClause.substring(0,1999); +} +set_Value ("FromClause", FromClause); +} +/** Get Sql FROM. +@return SQL FROM clause */ +public String getFromClause() +{ +return (String)get_Value("FromClause"); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Other SQL Clause. +@param OtherClause Other SQL Clause */ +public void setOtherClause (String OtherClause) +{ +if (OtherClause != null && OtherClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OtherClause = OtherClause.substring(0,1999); +} +set_Value ("OtherClause", OtherClause); +} +/** Get Other SQL Clause. +@return Other SQL Clause */ +public String getOtherClause() +{ +return (String)get_Value("OtherClause"); +} +/** Set Post Processing. +@param PostProcessing Process SQL after executing the query */ +public void setPostProcessing (String PostProcessing) +{ +if (PostProcessing != null && PostProcessing.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +PostProcessing = PostProcessing.substring(0,1999); +} +set_Value ("PostProcessing", PostProcessing); +} +/** Get Post Processing. +@return Process SQL after executing the query */ +public String getPostProcessing() +{ +return (String)get_Value("PostProcessing"); +} +/** Set Pre Processing. +@param PreProcessing Process SQL before executing the query */ +public void setPreProcessing (String PreProcessing) +{ +if (PreProcessing != null && PreProcessing.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +PreProcessing = PreProcessing.substring(0,1999); +} +set_Value ("PreProcessing", PreProcessing); +} +/** Get Pre Processing. +@return Process SQL before executing the query */ +public String getPreProcessing() +{ +return (String)get_Value("PreProcessing"); +} +/** Set Sql SELECT. +@param SelectClause SQL SELECT clause */ +public void setSelectClause (String SelectClause) +{ +if (SelectClause == null) throw new IllegalArgumentException ("SelectClause is mandatory."); +if (SelectClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +SelectClause = SelectClause.substring(0,1999); +} +set_Value ("SelectClause", SelectClause); +} +/** Get Sql SELECT. +@return SQL SELECT clause */ +public String getSelectClause() +{ +return (String)get_Value("SelectClause"); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Archive.java b/dbPort/src/org/compiere/model/X_AD_Archive.java new file mode 100644 index 0000000000..488f5332de --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Archive.java @@ -0,0 +1,259 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Archive + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.171 */ +public class X_AD_Archive extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Archive_ID id +@param trxName transaction +*/ +public X_AD_Archive (Properties ctx, int AD_Archive_ID, String trxName) +{ +super (ctx, AD_Archive_ID, trxName); +/** if (AD_Archive_ID == 0) +{ +setAD_Archive_ID (0); +setBinaryData (null); +setIsReport (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Archive (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=754 */ +public static final int Table_ID=754; + +/** TableName=AD_Archive */ +public static final String Table_Name="AD_Archive"; + +protected static KeyNamePair Model = new KeyNamePair(754,"AD_Archive"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Archive[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Archive. +@param AD_Archive_ID Document and Report Archive */ +public void setAD_Archive_ID (int AD_Archive_ID) +{ +if (AD_Archive_ID < 1) throw new IllegalArgumentException ("AD_Archive_ID is mandatory."); +set_ValueNoCheck ("AD_Archive_ID", new Integer(AD_Archive_ID)); +} +/** Get Archive. +@return Document and Report Archive */ +public int getAD_Archive_ID() +{ +Integer ii = (Integer)get_Value("AD_Archive_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +if (BinaryData == null) throw new IllegalArgumentException ("BinaryData is mandatory."); +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Report. +@param IsReport Indicates a Report record */ +public void setIsReport (boolean IsReport) +{ +set_Value ("IsReport", new Boolean(IsReport)); +} +/** Get Report. +@return Indicates a Report record */ +public boolean isReport() +{ +Object oo = get_Value("IsReport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_Value ("Record_ID", null); + else +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Attachment.java b/dbPort/src/org/compiere/model/X_AD_Attachment.java new file mode 100644 index 0000000000..f2ce1deb55 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Attachment.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Attachment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.203 */ +public class X_AD_Attachment extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Attachment_ID id +@param trxName transaction +*/ +public X_AD_Attachment (Properties ctx, int AD_Attachment_ID, String trxName) +{ +super (ctx, AD_Attachment_ID, trxName); +/** if (AD_Attachment_ID == 0) +{ +setAD_Attachment_ID (0); +setAD_Table_ID (0); +setRecord_ID (0); +setTitle (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Attachment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=254 */ +public static final int Table_ID=254; + +/** TableName=AD_Attachment */ +public static final String Table_Name="AD_Attachment"; + +protected static KeyNamePair Model = new KeyNamePair(254,"AD_Attachment"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Attachment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attachment. +@param AD_Attachment_ID Attachment for the document */ +public void setAD_Attachment_ID (int AD_Attachment_ID) +{ +if (AD_Attachment_ID < 1) throw new IllegalArgumentException ("AD_Attachment_ID is mandatory."); +set_ValueNoCheck ("AD_Attachment_ID", new Integer(AD_Attachment_ID)); +} +/** Get Attachment. +@return Attachment for the document */ +public int getAD_Attachment_ID() +{ +Integer ii = (Integer)get_Value("AD_Attachment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_ValueNoCheck ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title == null) throw new IllegalArgumentException ("Title is mandatory."); +if (Title.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Title = Title.substring(0,59); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getTitle()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_AttachmentNote.java b/dbPort/src/org/compiere/model/X_AD_AttachmentNote.java new file mode 100644 index 0000000000..477cbd7b75 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_AttachmentNote.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_AttachmentNote + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.234 */ +public class X_AD_AttachmentNote extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_AttachmentNote_ID id +@param trxName transaction +*/ +public X_AD_AttachmentNote (Properties ctx, int AD_AttachmentNote_ID, String trxName) +{ +super (ctx, AD_AttachmentNote_ID, trxName); +/** if (AD_AttachmentNote_ID == 0) +{ +setAD_AttachmentNote_ID (0); +setAD_Attachment_ID (0); +setAD_User_ID (0); +setTextMsg (null); +setTitle (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_AttachmentNote (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=705 */ +public static final int Table_ID=705; + +/** TableName=AD_AttachmentNote */ +public static final String Table_Name="AD_AttachmentNote"; + +protected static KeyNamePair Model = new KeyNamePair(705,"AD_AttachmentNote"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_AttachmentNote[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attachment Note. +@param AD_AttachmentNote_ID Personal Attachment Note */ +public void setAD_AttachmentNote_ID (int AD_AttachmentNote_ID) +{ +if (AD_AttachmentNote_ID < 1) throw new IllegalArgumentException ("AD_AttachmentNote_ID is mandatory."); +set_ValueNoCheck ("AD_AttachmentNote_ID", new Integer(AD_AttachmentNote_ID)); +} +/** Get Attachment Note. +@return Personal Attachment Note */ +public int getAD_AttachmentNote_ID() +{ +Integer ii = (Integer)get_Value("AD_AttachmentNote_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attachment. +@param AD_Attachment_ID Attachment for the document */ +public void setAD_Attachment_ID (int AD_Attachment_ID) +{ +if (AD_Attachment_ID < 1) throw new IllegalArgumentException ("AD_Attachment_ID is mandatory."); +set_ValueNoCheck ("AD_Attachment_ID", new Integer(AD_Attachment_ID)); +} +/** Get Attachment. +@return Attachment for the document */ +public int getAD_Attachment_ID() +{ +Integer ii = (Integer)get_Value("AD_Attachment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg == null) throw new IllegalArgumentException ("TextMsg is mandatory."); +if (TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title == null) throw new IllegalArgumentException ("Title is mandatory."); +if (Title.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Title = Title.substring(0,59); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getTitle()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Attribute.java b/dbPort/src/org/compiere/model/X_AD_Attribute.java new file mode 100644 index 0000000000..bc9d542b2a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Attribute.java @@ -0,0 +1,515 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Attribute + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.25 */ +public class X_AD_Attribute extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Attribute_ID id +@param trxName transaction +*/ +public X_AD_Attribute (Properties ctx, int AD_Attribute_ID, String trxName) +{ +super (ctx, AD_Attribute_ID, trxName); +/** if (AD_Attribute_ID == 0) +{ +setAD_Attribute_ID (0); +setAD_Reference_ID (0); +setAD_Table_ID (0); +setIsEncrypted (false); +setIsFieldOnly (false); +setIsHeading (false); +setIsMandatory (false); +setIsReadOnly (false); +setIsSameLine (false); +setIsUpdateable (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Attribute (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=405 */ +public static final int Table_ID=405; + +/** TableName=AD_Attribute */ +public static final String Table_Name="AD_Attribute"; + +protected static KeyNamePair Model = new KeyNamePair(405,"AD_Attribute"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Attribute[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Attribute. +@param AD_Attribute_ID System Attribute */ +public void setAD_Attribute_ID (int AD_Attribute_ID) +{ +if (AD_Attribute_ID < 1) throw new IllegalArgumentException ("AD_Attribute_ID is mandatory."); +set_ValueNoCheck ("AD_Attribute_ID", new Integer(AD_Attribute_ID)); +} +/** Get System Attribute. +@return System Attribute */ +public int getAD_Attribute_ID() +{ +Integer ii = (Integer)get_Value("AD_Attribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_ID AD_Reference_ID=1 */ +public static final int AD_REFERENCE_ID_AD_Reference_ID=1; +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_Value ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_Value_ID AD_Reference_ID=4 */ +public static final int AD_REFERENCE_VALUE_ID_AD_Reference_ID=4; +/** Set Reference Key. +@param AD_Reference_Value_ID Required to specify, if data type is Table or List */ +public void setAD_Reference_Value_ID (int AD_Reference_Value_ID) +{ +if (AD_Reference_Value_ID <= 0) set_Value ("AD_Reference_Value_ID", null); + else +set_Value ("AD_Reference_Value_ID", new Integer(AD_Reference_Value_ID)); +} +/** Get Reference Key. +@return Required to specify, if data type is Table or List */ +public int getAD_Reference_Value_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_Value_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dynamic Validation. +@param AD_Val_Rule_ID Dynamic Validation Rule */ +public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) +{ +if (AD_Val_Rule_ID <= 0) set_Value ("AD_Val_Rule_ID", null); + else +set_Value ("AD_Val_Rule_ID", new Integer(AD_Val_Rule_ID)); +} +/** Get Dynamic Validation. +@return Dynamic Validation Rule */ +public int getAD_Val_Rule_ID() +{ +Integer ii = (Integer)get_Value("AD_Val_Rule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Callout. +@param Callout Fully qualified class names and method - separated by semicolons */ +public void setCallout (String Callout) +{ +if (Callout != null && Callout.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Callout = Callout.substring(0,59); +} +set_Value ("Callout", Callout); +} +/** Get Callout. +@return Fully qualified class names and method - separated by semicolons */ +public String getCallout() +{ +return (String)get_Value("Callout"); +} +/** Set Default Logic. +@param DefaultValue Default value hierarchy, separated by ; + */ +public void setDefaultValue (String DefaultValue) +{ +if (DefaultValue != null && DefaultValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DefaultValue = DefaultValue.substring(0,1999); +} +set_Value ("DefaultValue", DefaultValue); +} +/** Get Default Logic. +@return Default value hierarchy, separated by ; + */ +public String getDefaultValue() +{ +return (String)get_Value("DefaultValue"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Display Length. +@param DisplayLength Length of the display in characters */ +public void setDisplayLength (int DisplayLength) +{ +set_Value ("DisplayLength", new Integer(DisplayLength)); +} +/** Get Display Length. +@return Length of the display in characters */ +public int getDisplayLength() +{ +Integer ii = (Integer)get_Value("DisplayLength"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Display Logic. +@param DisplayLogic If the Field is displayed, the result determines if the field is actually displayed */ +public void setDisplayLogic (String DisplayLogic) +{ +if (DisplayLogic != null && DisplayLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DisplayLogic = DisplayLogic.substring(0,1999); +} +set_Value ("DisplayLogic", DisplayLogic); +} +/** Get Display Logic. +@return If the Field is displayed, the result determines if the field is actually displayed */ +public String getDisplayLogic() +{ +return (String)get_Value("DisplayLogic"); +} +/** Set Length. +@param FieldLength Length of the column in the database */ +public void setFieldLength (int FieldLength) +{ +set_Value ("FieldLength", new Integer(FieldLength)); +} +/** Get Length. +@return Length of the column in the database */ +public int getFieldLength() +{ +Integer ii = (Integer)get_Value("FieldLength"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Encrypted. +@param IsEncrypted Display or Storage is encrypted */ +public void setIsEncrypted (boolean IsEncrypted) +{ +set_Value ("IsEncrypted", new Boolean(IsEncrypted)); +} +/** Get Encrypted. +@return Display or Storage is encrypted */ +public boolean isEncrypted() +{ +Object oo = get_Value("IsEncrypted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Field Only. +@param IsFieldOnly Label is not displayed */ +public void setIsFieldOnly (boolean IsFieldOnly) +{ +set_Value ("IsFieldOnly", new Boolean(IsFieldOnly)); +} +/** Get Field Only. +@return Label is not displayed */ +public boolean isFieldOnly() +{ +Object oo = get_Value("IsFieldOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Heading only. +@param IsHeading Field without Column - Only label is displayed */ +public void setIsHeading (boolean IsHeading) +{ +set_Value ("IsHeading", new Boolean(IsHeading)); +} +/** Get Heading only. +@return Field without Column - Only label is displayed */ +public boolean isHeading() +{ +Object oo = get_Value("IsHeading"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory. +@param IsMandatory Data entry is required in this column */ +public void setIsMandatory (boolean IsMandatory) +{ +set_Value ("IsMandatory", new Boolean(IsMandatory)); +} +/** Get Mandatory. +@return Data entry is required in this column */ +public boolean isMandatory() +{ +Object oo = get_Value("IsMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Same Line. +@param IsSameLine Displayed on same line as previous field */ +public void setIsSameLine (boolean IsSameLine) +{ +set_Value ("IsSameLine", new Boolean(IsSameLine)); +} +/** Get Same Line. +@return Displayed on same line as previous field */ +public boolean isSameLine() +{ +Object oo = get_Value("IsSameLine"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Updateable. +@param IsUpdateable Determines, if the field can be updated */ +public void setIsUpdateable (boolean IsUpdateable) +{ +set_Value ("IsUpdateable", new Boolean(IsUpdateable)); +} +/** Get Updateable. +@return Determines, if the field can be updated */ +public boolean isUpdateable() +{ +Object oo = get_Value("IsUpdateable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Value Format. +@param VFormat Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setVFormat (String VFormat) +{ +if (VFormat != null && VFormat.length() > 60) +{ +log.warning("Length > 60 - truncated"); +VFormat = VFormat.substring(0,59); +} +set_Value ("VFormat", VFormat); +} +/** Get Value Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getVFormat() +{ +return (String)get_Value("VFormat"); +} +/** Set Max. Value. +@param ValueMax Maximum Value for a field */ +public void setValueMax (String ValueMax) +{ +if (ValueMax != null && ValueMax.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ValueMax = ValueMax.substring(0,19); +} +set_Value ("ValueMax", ValueMax); +} +/** Get Max. Value. +@return Maximum Value for a field */ +public String getValueMax() +{ +return (String)get_Value("ValueMax"); +} +/** Set Min. Value. +@param ValueMin Minimum Value for a field */ +public void setValueMin (String ValueMin) +{ +if (ValueMin != null && ValueMin.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ValueMin = ValueMin.substring(0,19); +} +set_Value ("ValueMin", ValueMin); +} +/** Get Min. Value. +@return Minimum Value for a field */ +public String getValueMin() +{ +return (String)get_Value("ValueMin"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Attribute_Value.java b/dbPort/src/org/compiere/model/X_AD_Attribute_Value.java new file mode 100644 index 0000000000..28d4b6219e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Attribute_Value.java @@ -0,0 +1,165 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Attribute_Value + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.312 */ +public class X_AD_Attribute_Value extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Attribute_Value_ID id +@param trxName transaction +*/ +public X_AD_Attribute_Value (Properties ctx, int AD_Attribute_Value_ID, String trxName) +{ +super (ctx, AD_Attribute_Value_ID, trxName); +/** if (AD_Attribute_Value_ID == 0) +{ +setAD_Attribute_ID (0); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Attribute_Value (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=406 */ +public static final int Table_ID=406; + +/** TableName=AD_Attribute_Value */ +public static final String Table_Name="AD_Attribute_Value"; + +protected static KeyNamePair Model = new KeyNamePair(406,"AD_Attribute_Value"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Attribute_Value[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Attribute. +@param AD_Attribute_ID System Attribute */ +public void setAD_Attribute_ID (int AD_Attribute_ID) +{ +if (AD_Attribute_ID < 1) throw new IllegalArgumentException ("AD_Attribute_ID is mandatory."); +set_ValueNoCheck ("AD_Attribute_ID", new Integer(AD_Attribute_ID)); +} +/** Get System Attribute. +@return System Attribute */ +public int getAD_Attribute_ID() +{ +Integer ii = (Integer)get_Value("AD_Attribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set V_Date. +@param V_Date V_Date */ +public void setV_Date (Timestamp V_Date) +{ +set_Value ("V_Date", V_Date); +} +/** Get V_Date. +@return V_Date */ +public Timestamp getV_Date() +{ +return (Timestamp)get_Value("V_Date"); +} +/** Set V_Number. +@param V_Number V_Number */ +public void setV_Number (String V_Number) +{ +if (V_Number != null && V_Number.length() > 22) +{ +log.warning("Length > 22 - truncated"); +V_Number = V_Number.substring(0,21); +} +set_Value ("V_Number", V_Number); +} +/** Get V_Number. +@return V_Number */ +public String getV_Number() +{ +return (String)get_Value("V_Number"); +} +/** Set V_String. +@param V_String V_String */ +public void setV_String (String V_String) +{ +if (V_String != null && V_String.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +V_String = V_String.substring(0,1999); +} +set_Value ("V_String", V_String); +} +/** Get V_String. +@return V_String */ +public String getV_String() +{ +return (String)get_Value("V_String"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ChangeLog.java b/dbPort/src/org/compiere/model/X_AD_ChangeLog.java new file mode 100644 index 0000000000..0c5558246e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ChangeLog.java @@ -0,0 +1,294 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ChangeLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.328 */ +public class X_AD_ChangeLog extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ChangeLog_ID id +@param trxName transaction +*/ +public X_AD_ChangeLog (Properties ctx, int AD_ChangeLog_ID, String trxName) +{ +super (ctx, AD_ChangeLog_ID, trxName); +/** if (AD_ChangeLog_ID == 0) +{ +setAD_ChangeLog_ID (0); +setAD_Column_ID (0); +setAD_Session_ID (0); +setAD_Table_ID (0); +setIsCustomization (false); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ChangeLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=580 */ +public static final int Table_ID=580; + +/** TableName=AD_ChangeLog */ +public static final String Table_Name="AD_ChangeLog"; + +protected static KeyNamePair Model = new KeyNamePair(580,"AD_ChangeLog"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ChangeLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Change Log. +@param AD_ChangeLog_ID Log of data changes */ +public void setAD_ChangeLog_ID (int AD_ChangeLog_ID) +{ +if (AD_ChangeLog_ID < 1) throw new IllegalArgumentException ("AD_ChangeLog_ID is mandatory."); +set_ValueNoCheck ("AD_ChangeLog_ID", new Integer(AD_ChangeLog_ID)); +} +/** Get Change Log. +@return Log of data changes */ +public int getAD_ChangeLog_ID() +{ +Integer ii = (Integer)get_Value("AD_ChangeLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_ValueNoCheck ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Session. +@param AD_Session_ID User Session Online or Web */ +public void setAD_Session_ID (int AD_Session_ID) +{ +if (AD_Session_ID < 1) throw new IllegalArgumentException ("AD_Session_ID is mandatory."); +set_ValueNoCheck ("AD_Session_ID", new Integer(AD_Session_ID)); +} +/** Get Session. +@return User Session Online or Web */ +public int getAD_Session_ID() +{ +Integer ii = (Integer)get_Value("AD_Session_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Session_ID())); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Customization. +@param IsCustomization The change is a customization of the data dictionary and can be applied after Migration */ +public void setIsCustomization (boolean IsCustomization) +{ +set_Value ("IsCustomization", new Boolean(IsCustomization)); +} +/** Get Customization. +@return The change is a customization of the data dictionary and can be applied after Migration */ +public boolean isCustomization() +{ +Object oo = get_Value("IsCustomization"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set New Value. +@param NewValue New field value */ +public void setNewValue (String NewValue) +{ +if (NewValue != null && NewValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +NewValue = NewValue.substring(0,1999); +} +set_ValueNoCheck ("NewValue", NewValue); +} +/** Get New Value. +@return New field value */ +public String getNewValue() +{ +return (String)get_Value("NewValue"); +} +/** Set Old Value. +@param OldValue The old file data */ +public void setOldValue (String OldValue) +{ +if (OldValue != null && OldValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OldValue = OldValue.substring(0,1999); +} +set_ValueNoCheck ("OldValue", OldValue); +} +/** Get Old Value. +@return The old file data */ +public String getOldValue() +{ +return (String)get_Value("OldValue"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Redo. +@param Redo Redo */ +public void setRedo (String Redo) +{ +if (Redo != null && Redo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Redo = Redo.substring(0,0); +} +set_Value ("Redo", Redo); +} +/** Get Redo. +@return Redo */ +public String getRedo() +{ +return (String)get_Value("Redo"); +} +/** Set Transaction. +@param TrxName Name of the transaction */ +public void setTrxName (String TrxName) +{ +if (TrxName != null && TrxName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +TrxName = TrxName.substring(0,59); +} +set_ValueNoCheck ("TrxName", TrxName); +} +/** Get Transaction. +@return Name of the transaction */ +public String getTrxName() +{ +return (String)get_Value("TrxName"); +} +/** Set Undo. +@param Undo Undo */ +public void setUndo (String Undo) +{ +if (Undo != null && Undo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Undo = Undo.substring(0,0); +} +set_Value ("Undo", Undo); +} +/** Get Undo. +@return Undo */ +public String getUndo() +{ +return (String)get_Value("Undo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Client.java b/dbPort/src/org/compiere/model/X_AD_Client.java new file mode 100644 index 0000000000..40efd1c2ef --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Client.java @@ -0,0 +1,482 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Client + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.359 */ +public class X_AD_Client extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Client_ID id +@param trxName transaction +*/ +public X_AD_Client (Properties ctx, int AD_Client_ID, String trxName) +{ +super (ctx, AD_Client_ID, trxName); +/** if (AD_Client_ID == 0) +{ +setAutoArchive (null); // N +setIsCostImmediate (false); // N +setIsMultiLingualDocument (false); +setIsPostImmediate (false); // N +setIsServerEMail (false); +setIsSmtpAuthorization (false); // N +setIsUseBetaFunctions (true); // Y +setMMPolicy (null); // F +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Client (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=112 */ +public static final int Table_ID=112; + +/** TableName=AD_Client */ +public static final String Table_Name="AD_Client"; + +protected static KeyNamePair Model = new KeyNamePair(112,"AD_Client"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Client[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=327 */ +public static final int AD_LANGUAGE_AD_Reference_ID=327; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language != null && AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} + +/** AutoArchive AD_Reference_ID=334 */ +public static final int AUTOARCHIVE_AD_Reference_ID=334; +/** All (Reports, Documents) = 1 */ +public static final String AUTOARCHIVE_AllReportsDocuments = "1"; +/** Documents = 2 */ +public static final String AUTOARCHIVE_Documents = "2"; +/** External Documents = 3 */ +public static final String AUTOARCHIVE_ExternalDocuments = "3"; +/** None = N */ +public static final String AUTOARCHIVE_None = "N"; +/** Set Auto Archive. +@param AutoArchive Enable and level of automatic Archive of documents */ +public void setAutoArchive (String AutoArchive) +{ +if (AutoArchive == null) throw new IllegalArgumentException ("AutoArchive is mandatory"); +if (AutoArchive.equals("1") || AutoArchive.equals("2") || AutoArchive.equals("3") || AutoArchive.equals("N")); + else throw new IllegalArgumentException ("AutoArchive Invalid value - " + AutoArchive + " - Reference_ID=334 - 1 - 2 - 3 - N"); +if (AutoArchive.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AutoArchive = AutoArchive.substring(0,0); +} +set_Value ("AutoArchive", AutoArchive); +} +/** Get Auto Archive. +@return Enable and level of automatic Archive of documents */ +public String getAutoArchive() +{ +return (String)get_Value("AutoArchive"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Directory. +@param DocumentDir Directory for documents from the application server */ +public void setDocumentDir (String DocumentDir) +{ +if (DocumentDir != null && DocumentDir.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DocumentDir = DocumentDir.substring(0,59); +} +set_Value ("DocumentDir", DocumentDir); +} +/** Get Document Directory. +@return Directory for documents from the application server */ +public String getDocumentDir() +{ +return (String)get_Value("DocumentDir"); +} +/** Set EMail Test. +@param EMailTest Test EMail */ +public void setEMailTest (String EMailTest) +{ +if (EMailTest != null && EMailTest.length() > 1) +{ +log.warning("Length > 1 - truncated"); +EMailTest = EMailTest.substring(0,0); +} +set_Value ("EMailTest", EMailTest); +} +/** Get EMail Test. +@return Test EMail */ +public String getEMailTest() +{ +return (String)get_Value("EMailTest"); +} +/** Set Cost Immediately. +@param IsCostImmediate Update Costs immediately for testing */ +public void setIsCostImmediate (boolean IsCostImmediate) +{ +set_Value ("IsCostImmediate", new Boolean(IsCostImmediate)); +} +/** Get Cost Immediately. +@return Update Costs immediately for testing */ +public boolean isCostImmediate() +{ +Object oo = get_Value("IsCostImmediate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Multi Lingual Documents. +@param IsMultiLingualDocument Documents are Multi Lingual */ +public void setIsMultiLingualDocument (boolean IsMultiLingualDocument) +{ +set_Value ("IsMultiLingualDocument", new Boolean(IsMultiLingualDocument)); +} +/** Get Multi Lingual Documents. +@return Documents are Multi Lingual */ +public boolean isMultiLingualDocument() +{ +Object oo = get_Value("IsMultiLingualDocument"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Immediately. +@param IsPostImmediate Post the accounting immediately for testing */ +public void setIsPostImmediate (boolean IsPostImmediate) +{ +set_Value ("IsPostImmediate", new Boolean(IsPostImmediate)); +} +/** Get Post Immediately. +@return Post the accounting immediately for testing */ +public boolean isPostImmediate() +{ +Object oo = get_Value("IsPostImmediate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Server EMail. +@param IsServerEMail Send EMail from Server */ +public void setIsServerEMail (boolean IsServerEMail) +{ +set_Value ("IsServerEMail", new Boolean(IsServerEMail)); +} +/** Get Server EMail. +@return Send EMail from Server */ +public boolean isServerEMail() +{ +Object oo = get_Value("IsServerEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set SMTP Authentication. +@param IsSmtpAuthorization Your mail server requires Authentication */ +public void setIsSmtpAuthorization (boolean IsSmtpAuthorization) +{ +set_Value ("IsSmtpAuthorization", new Boolean(IsSmtpAuthorization)); +} +/** Get SMTP Authentication. +@return Your mail server requires Authentication */ +public boolean isSmtpAuthorization() +{ +Object oo = get_Value("IsSmtpAuthorization"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Use Beta Functions. +@param IsUseBetaFunctions Enable the use of Beta Functionality */ +public void setIsUseBetaFunctions (boolean IsUseBetaFunctions) +{ +set_Value ("IsUseBetaFunctions", new Boolean(IsUseBetaFunctions)); +} +/** Get Use Beta Functions. +@return Enable the use of Beta Functionality */ +public boolean isUseBetaFunctions() +{ +Object oo = get_Value("IsUseBetaFunctions"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** MMPolicy AD_Reference_ID=335 */ +public static final int MMPOLICY_AD_Reference_ID=335; +/** FiFo = F */ +public static final String MMPOLICY_FiFo = "F"; +/** LiFo = L */ +public static final String MMPOLICY_LiFo = "L"; +/** Set Material Policy. +@param MMPolicy Material Movement Policy */ +public void setMMPolicy (String MMPolicy) +{ +if (MMPolicy == null) throw new IllegalArgumentException ("MMPolicy is mandatory"); +if (MMPolicy.equals("F") || MMPolicy.equals("L")); + else throw new IllegalArgumentException ("MMPolicy Invalid value - " + MMPolicy + " - Reference_ID=335 - F - L"); +if (MMPolicy.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MMPolicy = MMPolicy.substring(0,0); +} +set_Value ("MMPolicy", MMPolicy); +} +/** Get Material Policy. +@return Material Movement Policy */ +public String getMMPolicy() +{ +return (String)get_Value("MMPolicy"); +} +/** Set Model Validation Classes. +@param ModelValidationClasses List of data model validation classes separated by ; + */ +public void setModelValidationClasses (String ModelValidationClasses) +{ +if (ModelValidationClasses != null && ModelValidationClasses.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ModelValidationClasses = ModelValidationClasses.substring(0,254); +} +set_Value ("ModelValidationClasses", ModelValidationClasses); +} +/** Get Model Validation Classes. +@return List of data model validation classes separated by ; + */ +public String getModelValidationClasses() +{ +return (String)get_Value("ModelValidationClasses"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Request EMail. +@param RequestEMail EMail address to send automated mails from or receive mails for automated processing (fully qualified) */ +public void setRequestEMail (String RequestEMail) +{ +if (RequestEMail != null && RequestEMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RequestEMail = RequestEMail.substring(0,59); +} +set_Value ("RequestEMail", RequestEMail); +} +/** Get Request EMail. +@return EMail address to send automated mails from or receive mails for automated processing (fully qualified) */ +public String getRequestEMail() +{ +return (String)get_Value("RequestEMail"); +} +/** Set Request Folder. +@param RequestFolder EMail folder to process incoming emails; + if empty INBOX is used */ +public void setRequestFolder (String RequestFolder) +{ +if (RequestFolder != null && RequestFolder.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RequestFolder = RequestFolder.substring(0,19); +} +set_Value ("RequestFolder", RequestFolder); +} +/** Get Request Folder. +@return EMail folder to process incoming emails; + if empty INBOX is used */ +public String getRequestFolder() +{ +return (String)get_Value("RequestFolder"); +} +/** Set Request User. +@param RequestUser User Name (ID) of the email owner */ +public void setRequestUser (String RequestUser) +{ +if (RequestUser != null && RequestUser.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RequestUser = RequestUser.substring(0,59); +} +set_Value ("RequestUser", RequestUser); +} +/** Get Request User. +@return User Name (ID) of the email owner */ +public String getRequestUser() +{ +return (String)get_Value("RequestUser"); +} +/** Set Request User Password. +@param RequestUserPW Password of the user name (ID) for mail processing */ +public void setRequestUserPW (String RequestUserPW) +{ +if (RequestUserPW != null && RequestUserPW.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RequestUserPW = RequestUserPW.substring(0,19); +} +set_Value ("RequestUserPW", RequestUserPW); +} +/** Get Request User Password. +@return Password of the user name (ID) for mail processing */ +public String getRequestUserPW() +{ +return (String)get_Value("RequestUserPW"); +} +/** Set Mail Host. +@param SMTPHost Hostname of Mail Server for SMTP and IMAP */ +public void setSMTPHost (String SMTPHost) +{ +if (SMTPHost != null && SMTPHost.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SMTPHost = SMTPHost.substring(0,59); +} +set_Value ("SMTPHost", SMTPHost); +} +/** Get Mail Host. +@return Hostname of Mail Server for SMTP and IMAP */ +public String getSMTPHost() +{ +return (String)get_Value("SMTPHost"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ClientInfo.java b/dbPort/src/org/compiere/model/X_AD_ClientInfo.java new file mode 100644 index 0000000000..39fb587bed --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ClientInfo.java @@ -0,0 +1,421 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ClientInfo + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.375 */ +public class X_AD_ClientInfo extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ClientInfo_ID id +@param trxName transaction +*/ +public X_AD_ClientInfo (Properties ctx, int AD_ClientInfo_ID, String trxName) +{ +super (ctx, AD_ClientInfo_ID, trxName); +/** if (AD_ClientInfo_ID == 0) +{ +setIsDiscountLineAmt (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ClientInfo (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=227 */ +public static final int Table_ID=227; + +/** TableName=AD_ClientInfo */ +public static final String Table_Name="AD_ClientInfo"; + +protected static KeyNamePair Model = new KeyNamePair(227,"AD_ClientInfo"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ClientInfo[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Tree_Activity_ID AD_Reference_ID=184 */ +public static final int AD_TREE_ACTIVITY_ID_AD_Reference_ID=184; +/** Set Activity Tree. +@param AD_Tree_Activity_ID Tree to determine activity hierarchy */ +public void setAD_Tree_Activity_ID (int AD_Tree_Activity_ID) +{ +if (AD_Tree_Activity_ID <= 0) set_ValueNoCheck ("AD_Tree_Activity_ID", null); + else +set_ValueNoCheck ("AD_Tree_Activity_ID", new Integer(AD_Tree_Activity_ID)); +} +/** Get Activity Tree. +@return Tree to determine activity hierarchy */ +public int getAD_Tree_Activity_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_BPartner_ID AD_Reference_ID=184 */ +public static final int AD_TREE_BPARTNER_ID_AD_Reference_ID=184; +/** Set BPartner Tree. +@param AD_Tree_BPartner_ID Tree to determine business partner hierarchy */ +public void setAD_Tree_BPartner_ID (int AD_Tree_BPartner_ID) +{ +if (AD_Tree_BPartner_ID <= 0) set_ValueNoCheck ("AD_Tree_BPartner_ID", null); + else +set_ValueNoCheck ("AD_Tree_BPartner_ID", new Integer(AD_Tree_BPartner_ID)); +} +/** Get BPartner Tree. +@return Tree to determine business partner hierarchy */ +public int getAD_Tree_BPartner_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Campaign_ID AD_Reference_ID=184 */ +public static final int AD_TREE_CAMPAIGN_ID_AD_Reference_ID=184; +/** Set Campaign Tree. +@param AD_Tree_Campaign_ID Tree to determine marketing campaign hierarchy */ +public void setAD_Tree_Campaign_ID (int AD_Tree_Campaign_ID) +{ +if (AD_Tree_Campaign_ID <= 0) set_ValueNoCheck ("AD_Tree_Campaign_ID", null); + else +set_ValueNoCheck ("AD_Tree_Campaign_ID", new Integer(AD_Tree_Campaign_ID)); +} +/** Get Campaign Tree. +@return Tree to determine marketing campaign hierarchy */ +public int getAD_Tree_Campaign_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Menu_ID AD_Reference_ID=184 */ +public static final int AD_TREE_MENU_ID_AD_Reference_ID=184; +/** Set Menu Tree. +@param AD_Tree_Menu_ID Tree of the menu */ +public void setAD_Tree_Menu_ID (int AD_Tree_Menu_ID) +{ +if (AD_Tree_Menu_ID <= 0) set_ValueNoCheck ("AD_Tree_Menu_ID", null); + else +set_ValueNoCheck ("AD_Tree_Menu_ID", new Integer(AD_Tree_Menu_ID)); +} +/** Get Menu Tree. +@return Tree of the menu */ +public int getAD_Tree_Menu_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Menu_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Org_ID AD_Reference_ID=184 */ +public static final int AD_TREE_ORG_ID_AD_Reference_ID=184; +/** Set Organization Tree. +@param AD_Tree_Org_ID Tree to determine organizational hierarchy */ +public void setAD_Tree_Org_ID (int AD_Tree_Org_ID) +{ +if (AD_Tree_Org_ID <= 0) set_ValueNoCheck ("AD_Tree_Org_ID", null); + else +set_ValueNoCheck ("AD_Tree_Org_ID", new Integer(AD_Tree_Org_ID)); +} +/** Get Organization Tree. +@return Tree to determine organizational hierarchy */ +public int getAD_Tree_Org_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Product_ID AD_Reference_ID=184 */ +public static final int AD_TREE_PRODUCT_ID_AD_Reference_ID=184; +/** Set Product Tree. +@param AD_Tree_Product_ID Tree to determine product hierarchy */ +public void setAD_Tree_Product_ID (int AD_Tree_Product_ID) +{ +if (AD_Tree_Product_ID <= 0) set_ValueNoCheck ("AD_Tree_Product_ID", null); + else +set_ValueNoCheck ("AD_Tree_Product_ID", new Integer(AD_Tree_Product_ID)); +} +/** Get Product Tree. +@return Tree to determine product hierarchy */ +public int getAD_Tree_Product_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Project_ID AD_Reference_ID=184 */ +public static final int AD_TREE_PROJECT_ID_AD_Reference_ID=184; +/** Set Project Tree. +@param AD_Tree_Project_ID Tree to determine project hierarchy */ +public void setAD_Tree_Project_ID (int AD_Tree_Project_ID) +{ +if (AD_Tree_Project_ID <= 0) set_ValueNoCheck ("AD_Tree_Project_ID", null); + else +set_ValueNoCheck ("AD_Tree_Project_ID", new Integer(AD_Tree_Project_ID)); +} +/** Get Project Tree. +@return Tree to determine project hierarchy */ +public int getAD_Tree_Project_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_SalesRegion_ID AD_Reference_ID=184 */ +public static final int AD_TREE_SALESREGION_ID_AD_Reference_ID=184; +/** Set Sales Region Tree. +@param AD_Tree_SalesRegion_ID Tree to determine sales regional hierarchy */ +public void setAD_Tree_SalesRegion_ID (int AD_Tree_SalesRegion_ID) +{ +if (AD_Tree_SalesRegion_ID <= 0) set_ValueNoCheck ("AD_Tree_SalesRegion_ID", null); + else +set_ValueNoCheck ("AD_Tree_SalesRegion_ID", new Integer(AD_Tree_SalesRegion_ID)); +} +/** Get Sales Region Tree. +@return Tree to determine sales regional hierarchy */ +public int getAD_Tree_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_AcctSchema1_ID AD_Reference_ID=136 */ +public static final int C_ACCTSCHEMA1_ID_AD_Reference_ID=136; +/** Set Primary Accounting Schema. +@param C_AcctSchema1_ID Primary rules for accounting */ +public void setC_AcctSchema1_ID (int C_AcctSchema1_ID) +{ +if (C_AcctSchema1_ID <= 0) set_ValueNoCheck ("C_AcctSchema1_ID", null); + else +set_ValueNoCheck ("C_AcctSchema1_ID", new Integer(C_AcctSchema1_ID)); +} +/** Get Primary Accounting Schema. +@return Primary rules for accounting */ +public int getC_AcctSchema1_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_BPartnerCashTrx_ID AD_Reference_ID=138 */ +public static final int C_BPARTNERCASHTRX_ID_AD_Reference_ID=138; +/** Set Template B.Partner. +@param C_BPartnerCashTrx_ID Business Partner used for creating new Business Partners on the fly */ +public void setC_BPartnerCashTrx_ID (int C_BPartnerCashTrx_ID) +{ +if (C_BPartnerCashTrx_ID <= 0) set_Value ("C_BPartnerCashTrx_ID", null); + else +set_Value ("C_BPartnerCashTrx_ID", new Integer(C_BPartnerCashTrx_ID)); +} +/** Get Template B.Partner. +@return Business Partner used for creating new Business Partners on the fly */ +public int getC_BPartnerCashTrx_ID() +{ +Integer ii = (Integer)get_Value("C_BPartnerCashTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID <= 0) set_Value ("C_Calendar_ID", null); + else +set_Value ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_UOM_Length_ID AD_Reference_ID=114 */ +public static final int C_UOM_LENGTH_ID_AD_Reference_ID=114; +/** Set UOM for Length. +@param C_UOM_Length_ID Standard Unit of Measure for Length */ +public void setC_UOM_Length_ID (int C_UOM_Length_ID) +{ +if (C_UOM_Length_ID <= 0) set_Value ("C_UOM_Length_ID", null); + else +set_Value ("C_UOM_Length_ID", new Integer(C_UOM_Length_ID)); +} +/** Get UOM for Length. +@return Standard Unit of Measure for Length */ +public int getC_UOM_Length_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_Length_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_UOM_Time_ID AD_Reference_ID=114 */ +public static final int C_UOM_TIME_ID_AD_Reference_ID=114; +/** Set UOM for Time. +@param C_UOM_Time_ID Standard Unit of Measure for Time */ +public void setC_UOM_Time_ID (int C_UOM_Time_ID) +{ +if (C_UOM_Time_ID <= 0) set_Value ("C_UOM_Time_ID", null); + else +set_Value ("C_UOM_Time_ID", new Integer(C_UOM_Time_ID)); +} +/** Get UOM for Time. +@return Standard Unit of Measure for Time */ +public int getC_UOM_Time_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_Time_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_UOM_Volume_ID AD_Reference_ID=114 */ +public static final int C_UOM_VOLUME_ID_AD_Reference_ID=114; +/** Set UOM for Volume. +@param C_UOM_Volume_ID Standard Unit of Measure for Volume */ +public void setC_UOM_Volume_ID (int C_UOM_Volume_ID) +{ +if (C_UOM_Volume_ID <= 0) set_Value ("C_UOM_Volume_ID", null); + else +set_Value ("C_UOM_Volume_ID", new Integer(C_UOM_Volume_ID)); +} +/** Get UOM for Volume. +@return Standard Unit of Measure for Volume */ +public int getC_UOM_Volume_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_Volume_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_UOM_Weight_ID AD_Reference_ID=114 */ +public static final int C_UOM_WEIGHT_ID_AD_Reference_ID=114; +/** Set UOM for Weight. +@param C_UOM_Weight_ID Standard Unit of Measure for Weight */ +public void setC_UOM_Weight_ID (int C_UOM_Weight_ID) +{ +if (C_UOM_Weight_ID <= 0) set_Value ("C_UOM_Weight_ID", null); + else +set_Value ("C_UOM_Weight_ID", new Integer(C_UOM_Weight_ID)); +} +/** Get UOM for Weight. +@return Standard Unit of Measure for Weight */ +public int getC_UOM_Weight_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_Weight_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount calculated from Line Amounts. +@param IsDiscountLineAmt Payment Discount calculation does not include Taxes and Charges */ +public void setIsDiscountLineAmt (boolean IsDiscountLineAmt) +{ +set_Value ("IsDiscountLineAmt", new Boolean(IsDiscountLineAmt)); +} +/** Get Discount calculated from Line Amounts. +@return Payment Discount calculation does not include Taxes and Charges */ +public boolean isDiscountLineAmt() +{ +Object oo = get_Value("IsDiscountLineAmt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Days to keep Log. +@param KeepLogDays Number of days to keep the log entries */ +public void setKeepLogDays (int KeepLogDays) +{ +set_Value ("KeepLogDays", new Integer(KeepLogDays)); +} +/** Get Days to keep Log. +@return Number of days to keep the log entries */ +public int getKeepLogDays() +{ +Integer ii = (Integer)get_Value("KeepLogDays"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_ProductFreight_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTFREIGHT_ID_AD_Reference_ID=162; +/** Set Product for Freight. +@param M_ProductFreight_ID Product for Freight */ +public void setM_ProductFreight_ID (int M_ProductFreight_ID) +{ +if (M_ProductFreight_ID <= 0) set_Value ("M_ProductFreight_ID", null); + else +set_Value ("M_ProductFreight_ID", new Integer(M_ProductFreight_ID)); +} +/** Get Product for Freight. +@return Product for Freight */ +public int getM_ProductFreight_ID() +{ +Integer ii = (Integer)get_Value("M_ProductFreight_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ClientShare.java b/dbPort/src/org/compiere/model/X_AD_ClientShare.java new file mode 100644 index 0000000000..3564bae9fc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ClientShare.java @@ -0,0 +1,191 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ClientShare + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.453 */ +public class X_AD_ClientShare extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ClientShare_ID id +@param trxName transaction +*/ +public X_AD_ClientShare (Properties ctx, int AD_ClientShare_ID, String trxName) +{ +super (ctx, AD_ClientShare_ID, trxName); +/** if (AD_ClientShare_ID == 0) +{ +setAD_ClientShare_ID (0); +setAD_Table_ID (0); +setName (null); +setShareType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ClientShare (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=827 */ +public static final int Table_ID=827; + +/** TableName=AD_ClientShare */ +public static final String Table_Name="AD_ClientShare"; + +protected static KeyNamePair Model = new KeyNamePair(827,"AD_ClientShare"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ClientShare[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Client Share. +@param AD_ClientShare_ID Force (not) sharing of client/org entities */ +public void setAD_ClientShare_ID (int AD_ClientShare_ID) +{ +if (AD_ClientShare_ID < 1) throw new IllegalArgumentException ("AD_ClientShare_ID is mandatory."); +set_ValueNoCheck ("AD_ClientShare_ID", new Integer(AD_ClientShare_ID)); +} +/** Get Client Share. +@return Force (not) sharing of client/org entities */ +public int getAD_ClientShare_ID() +{ +Integer ii = (Integer)get_Value("AD_ClientShare_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** ShareType AD_Reference_ID=365 */ +public static final int SHARETYPE_AD_Reference_ID=365; +/** Client (all shared) = C */ +public static final String SHARETYPE_ClientAllShared = "C"; +/** Org (not shared) = O */ +public static final String SHARETYPE_OrgNotShared = "O"; +/** Client or Org = x */ +public static final String SHARETYPE_ClientOrOrg = "x"; +/** Set Share Type. +@param ShareType Type of sharing */ +public void setShareType (String ShareType) +{ +if (ShareType == null) throw new IllegalArgumentException ("ShareType is mandatory"); +if (ShareType.equals("C") || ShareType.equals("O") || ShareType.equals("x")); + else throw new IllegalArgumentException ("ShareType Invalid value - " + ShareType + " - Reference_ID=365 - C - O - x"); +if (ShareType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ShareType = ShareType.substring(0,0); +} +set_Value ("ShareType", ShareType); +} +/** Get Share Type. +@return Type of sharing */ +public String getShareType() +{ +return (String)get_Value("ShareType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Color.java b/dbPort/src/org/compiere/model/X_AD_Color.java new file mode 100644 index 0000000000..caf553cfd5 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Color.java @@ -0,0 +1,403 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Color + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.484 */ +public class X_AD_Color extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Color_ID id +@param trxName transaction +*/ +public X_AD_Color (Properties ctx, int AD_Color_ID, String trxName) +{ +super (ctx, AD_Color_ID, trxName); +/** if (AD_Color_ID == 0) +{ +setAD_Color_ID (0); +setAlpha (0); +setBlue (0); +setColorType (null); +setGreen (0); +setImageAlpha (Env.ZERO); +setIsDefault (false); +setName (null); +setRed (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Color (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=457 */ +public static final int Table_ID=457; + +/** TableName=AD_Color */ +public static final String Table_Name="AD_Color"; + +protected static KeyNamePair Model = new KeyNamePair(457,"AD_Color"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Color[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Color. +@param AD_Color_ID Color for backgrounds or indicators */ +public void setAD_Color_ID (int AD_Color_ID) +{ +if (AD_Color_ID < 1) throw new IllegalArgumentException ("AD_Color_ID is mandatory."); +set_ValueNoCheck ("AD_Color_ID", new Integer(AD_Color_ID)); +} +/** Get System Color. +@return Color for backgrounds or indicators */ +public int getAD_Color_ID() +{ +Integer ii = (Integer)get_Value("AD_Color_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alpha. +@param Alpha Color Alpha value 0-255 */ +public void setAlpha (int Alpha) +{ +set_Value ("Alpha", new Integer(Alpha)); +} +/** Get Alpha. +@return Color Alpha value 0-255 */ +public int getAlpha() +{ +Integer ii = (Integer)get_Value("Alpha"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set 2nd Alpha. +@param Alpha_1 Alpha value for second color */ +public void setAlpha_1 (int Alpha_1) +{ +set_Value ("Alpha_1", new Integer(Alpha_1)); +} +/** Get 2nd Alpha. +@return Alpha value for second color */ +public int getAlpha_1() +{ +Integer ii = (Integer)get_Value("Alpha_1"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Blue. +@param Blue Color RGB blue value */ +public void setBlue (int Blue) +{ +set_Value ("Blue", new Integer(Blue)); +} +/** Get Blue. +@return Color RGB blue value */ +public int getBlue() +{ +Integer ii = (Integer)get_Value("Blue"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set 2nd Blue. +@param Blue_1 RGB value for second color */ +public void setBlue_1 (int Blue_1) +{ +set_Value ("Blue_1", new Integer(Blue_1)); +} +/** Get 2nd Blue. +@return RGB value for second color */ +public int getBlue_1() +{ +Integer ii = (Integer)get_Value("Blue_1"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ColorType AD_Reference_ID=243 */ +public static final int COLORTYPE_AD_Reference_ID=243; +/** Normal (Flat) = F */ +public static final String COLORTYPE_NormalFlat = "F"; +/** Gradient = G */ +public static final String COLORTYPE_Gradient = "G"; +/** Line = L */ +public static final String COLORTYPE_Line = "L"; +/** Texture (Picture) = T */ +public static final String COLORTYPE_TexturePicture = "T"; +/** Set Color Type. +@param ColorType Color presentation for this color */ +public void setColorType (Object ColorType) +{ +if (ColorType == null) throw new IllegalArgumentException ("ColorType is mandatory"); +if (ColorType.equals("F") || ColorType.equals("G") || ColorType.equals("L") || ColorType.equals("T")); + else throw new IllegalArgumentException ("ColorType Invalid value - " + ColorType + " - Reference_ID=243 - F - G - L - T"); +set_Value ("ColorType", ColorType); +} +/** Get Color Type. +@return Color presentation for this color */ +public Object getColorType() +{ +return get_Value("ColorType"); +} +/** Set Green. +@param Green RGB value */ +public void setGreen (int Green) +{ +set_Value ("Green", new Integer(Green)); +} +/** Get Green. +@return RGB value */ +public int getGreen() +{ +Integer ii = (Integer)get_Value("Green"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set 2nd Green. +@param Green_1 RGB value for second color */ +public void setGreen_1 (int Green_1) +{ +set_Value ("Green_1", new Integer(Green_1)); +} +/** Get 2nd Green. +@return RGB value for second color */ +public int getGreen_1() +{ +Integer ii = (Integer)get_Value("Green_1"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image Alpha . +@param ImageAlpha Image Texture Composite Alpha */ +public void setImageAlpha (BigDecimal ImageAlpha) +{ +if (ImageAlpha == null) throw new IllegalArgumentException ("ImageAlpha is mandatory."); +set_Value ("ImageAlpha", ImageAlpha); +} +/** Get Image Alpha . +@return Image Texture Composite Alpha */ +public BigDecimal getImageAlpha() +{ +BigDecimal bd = (BigDecimal)get_Value("ImageAlpha"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line Distance. +@param LineDistance Distance between lines */ +public void setLineDistance (int LineDistance) +{ +set_Value ("LineDistance", new Integer(LineDistance)); +} +/** Get Line Distance. +@return Distance between lines */ +public int getLineDistance() +{ +Integer ii = (Integer)get_Value("LineDistance"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line Width. +@param LineWidth Width of the lines */ +public void setLineWidth (int LineWidth) +{ +set_Value ("LineWidth", new Integer(LineWidth)); +} +/** Get Line Width. +@return Width of the lines */ +public int getLineWidth() +{ +Integer ii = (Integer)get_Value("LineWidth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Red. +@param Red RGB value */ +public void setRed (int Red) +{ +set_Value ("Red", new Integer(Red)); +} +/** Get Red. +@return RGB value */ +public int getRed() +{ +Integer ii = (Integer)get_Value("Red"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set 2nd Red. +@param Red_1 RGB value for second color */ +public void setRed_1 (int Red_1) +{ +set_Value ("Red_1", new Integer(Red_1)); +} +/** Get 2nd Red. +@return RGB value for second color */ +public int getRed_1() +{ +Integer ii = (Integer)get_Value("Red_1"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Repeat Distance. +@param RepeatDistance Distance in points to repeat gradient color - or zero */ +public void setRepeatDistance (int RepeatDistance) +{ +set_Value ("RepeatDistance", new Integer(RepeatDistance)); +} +/** Get Repeat Distance. +@return Distance in points to repeat gradient color - or zero */ +public int getRepeatDistance() +{ +Integer ii = (Integer)get_Value("RepeatDistance"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** StartPoint AD_Reference_ID=248 */ +public static final int STARTPOINT_AD_Reference_ID=248; +/** North = 1 */ +public static final String STARTPOINT_North = "1"; +/** North East = 2 */ +public static final String STARTPOINT_NorthEast = "2"; +/** East = 3 */ +public static final String STARTPOINT_East = "3"; +/** South East = 4 */ +public static final String STARTPOINT_SouthEast = "4"; +/** South = 5 */ +public static final String STARTPOINT_South = "5"; +/** South West = 6 */ +public static final String STARTPOINT_SouthWest = "6"; +/** West = 7 */ +public static final String STARTPOINT_West = "7"; +/** North West = 8 */ +public static final String STARTPOINT_NorthWest = "8"; +/** Set Start Point. +@param StartPoint Start point of the gradient colors */ +public void setStartPoint (String StartPoint) +{ +if (StartPoint == null) throw new IllegalArgumentException ("StartPoint is mandatory"); +if (StartPoint == null || StartPoint.equals("1") || StartPoint.equals("2") || StartPoint.equals("3") || StartPoint.equals("4") || StartPoint.equals("5") || StartPoint.equals("6") || StartPoint.equals("7") || StartPoint.equals("8")); + else throw new IllegalArgumentException ("StartPoint Invalid value - " + StartPoint + " - Reference_ID=248 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8"); +if (StartPoint != null && StartPoint.length() > 22) +{ +log.warning("Length > 22 - truncated"); +StartPoint = StartPoint.substring(0,21); +} +set_Value ("StartPoint", StartPoint); +} +/** Get Start Point. +@return Start point of the gradient colors */ +public String getStartPoint() +{ +return (String)get_Value("StartPoint"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Column.java b/dbPort/src/org/compiere/model/X_AD_Column.java new file mode 100644 index 0000000000..12ab37ef37 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Column.java @@ -0,0 +1,672 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Column + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.562 */ +public class X_AD_Column extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Column_ID id +@param trxName transaction +*/ +public X_AD_Column (Properties ctx, int AD_Column_ID, String trxName) +{ +super (ctx, AD_Column_ID, trxName); +/** if (AD_Column_ID == 0) +{ +setAD_Column_ID (0); +setAD_Element_ID (0); +setAD_Reference_ID (0); +setAD_Table_ID (0); +setColumnName (null); +setEntityType (null); // U +setIsAlwaysUpdateable (false); // N +setIsEncrypted (null); // N +setIsIdentifier (false); +setIsKey (false); +setIsMandatory (false); +setIsParent (false); +setIsSelectionColumn (false); +setIsTranslated (false); +setIsUpdateable (true); // Y +setName (null); +setVersion (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Column (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=101 */ +public static final int Table_ID=101; + +/** TableName=AD_Column */ +public static final String Table_Name="AD_Column"; + +protected static KeyNamePair Model = new KeyNamePair(101,"AD_Column"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Column[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_ValueNoCheck ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set System Element. +@param AD_Element_ID System Element enables the central maintenance of column description and help. */ +public void setAD_Element_ID (int AD_Element_ID) +{ +if (AD_Element_ID < 1) throw new IllegalArgumentException ("AD_Element_ID is mandatory."); +set_Value ("AD_Element_ID", new Integer(AD_Element_ID)); +} +/** Get System Element. +@return System Element enables the central maintenance of column description and help. */ +public int getAD_Element_ID() +{ +Integer ii = (Integer)get_Value("AD_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_ID AD_Reference_ID=1 */ +public static final int AD_REFERENCE_ID_AD_Reference_ID=1; +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_Value ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_Value_ID AD_Reference_ID=4 */ +public static final int AD_REFERENCE_VALUE_ID_AD_Reference_ID=4; +/** Set Reference Key. +@param AD_Reference_Value_ID Required to specify, if data type is Table or List */ +public void setAD_Reference_Value_ID (int AD_Reference_Value_ID) +{ +if (AD_Reference_Value_ID <= 0) set_Value ("AD_Reference_Value_ID", null); + else +set_Value ("AD_Reference_Value_ID", new Integer(AD_Reference_Value_ID)); +} +/** Get Reference Key. +@return Required to specify, if data type is Table or List */ +public int getAD_Reference_Value_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_Value_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dynamic Validation. +@param AD_Val_Rule_ID Dynamic Validation Rule */ +public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) +{ +if (AD_Val_Rule_ID <= 0) set_Value ("AD_Val_Rule_ID", null); + else +set_Value ("AD_Val_Rule_ID", new Integer(AD_Val_Rule_ID)); +} +/** Get Dynamic Validation. +@return Dynamic Validation Rule */ +public int getAD_Val_Rule_ID() +{ +Integer ii = (Integer)get_Value("AD_Val_Rule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Callout. +@param Callout Fully qualified class names and method - separated by semicolons */ +public void setCallout (String Callout) +{ +if (Callout != null && Callout.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Callout = Callout.substring(0,254); +} +set_Value ("Callout", Callout); +} +/** Get Callout. +@return Fully qualified class names and method - separated by semicolons */ +public String getCallout() +{ +return (String)get_Value("Callout"); +} +/** Set DB Column Name. +@param ColumnName Name of the column in the database */ +public void setColumnName (String ColumnName) +{ +if (ColumnName == null) throw new IllegalArgumentException ("ColumnName is mandatory."); +if (ColumnName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ColumnName = ColumnName.substring(0,39); +} +set_Value ("ColumnName", ColumnName); +} +/** Get DB Column Name. +@return Name of the column in the database */ +public String getColumnName() +{ +return (String)get_Value("ColumnName"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getColumnName()); +} +/** Set Column SQL. +@param ColumnSQL Virtual Column (r/o) */ +public void setColumnSQL (String ColumnSQL) +{ +if (ColumnSQL != null && ColumnSQL.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ColumnSQL = ColumnSQL.substring(0,254); +} +set_Value ("ColumnSQL", ColumnSQL); +} +/** Get Column SQL. +@return Virtual Column (r/o) */ +public String getColumnSQL() +{ +return (String)get_Value("ColumnSQL"); +} +/** Set Default Logic. +@param DefaultValue Default value hierarchy, separated by ; + */ +public void setDefaultValue (String DefaultValue) +{ +if (DefaultValue != null && DefaultValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DefaultValue = DefaultValue.substring(0,1999); +} +set_Value ("DefaultValue", DefaultValue); +} +/** Get Default Logic. +@return Default value hierarchy, separated by ; + */ +public String getDefaultValue() +{ +return (String)get_Value("DefaultValue"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Length. +@param FieldLength Length of the column in the database */ +public void setFieldLength (int FieldLength) +{ +set_Value ("FieldLength", new Integer(FieldLength)); +} +/** Get Length. +@return Length of the column in the database */ +public int getFieldLength() +{ +Integer ii = (Integer)get_Value("FieldLength"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Always Updateable. +@param IsAlwaysUpdateable The column is always updateable, even if the record is not active or processed */ +public void setIsAlwaysUpdateable (boolean IsAlwaysUpdateable) +{ +set_Value ("IsAlwaysUpdateable", new Boolean(IsAlwaysUpdateable)); +} +/** Get Always Updateable. +@return The column is always updateable, even if the record is not active or processed */ +public boolean isAlwaysUpdateable() +{ +Object oo = get_Value("IsAlwaysUpdateable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** IsEncrypted AD_Reference_ID=354 */ +public static final int ISENCRYPTED_AD_Reference_ID=354; +/** Not Encrypted = N */ +public static final String ISENCRYPTED_NotEncrypted = "N"; +/** Encrypted = Y */ +public static final String ISENCRYPTED_Encrypted = "Y"; +/** Set Encrypted. +@param IsEncrypted Display or Storage is encrypted */ +public void setIsEncrypted (String IsEncrypted) +{ +if (IsEncrypted == null) throw new IllegalArgumentException ("IsEncrypted is mandatory"); +if (IsEncrypted.equals("N") || IsEncrypted.equals("Y")); + else throw new IllegalArgumentException ("IsEncrypted Invalid value - " + IsEncrypted + " - Reference_ID=354 - N - Y"); +if (IsEncrypted.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsEncrypted = IsEncrypted.substring(0,0); +} +set_Value ("IsEncrypted", IsEncrypted); +} +/** Get Encrypted. +@return Display or Storage is encrypted */ +public String getIsEncrypted() +{ +return (String)get_Value("IsEncrypted"); +} +/** Set Identifier. +@param IsIdentifier This column is part of the record identifier */ +public void setIsIdentifier (boolean IsIdentifier) +{ +set_Value ("IsIdentifier", new Boolean(IsIdentifier)); +} +/** Get Identifier. +@return This column is part of the record identifier */ +public boolean isIdentifier() +{ +Object oo = get_Value("IsIdentifier"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Key column. +@param IsKey This column is the key in this table */ +public void setIsKey (boolean IsKey) +{ +set_Value ("IsKey", new Boolean(IsKey)); +} +/** Get Key column. +@return This column is the key in this table */ +public boolean isKey() +{ +Object oo = get_Value("IsKey"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory. +@param IsMandatory Data entry is required in this column */ +public void setIsMandatory (boolean IsMandatory) +{ +set_Value ("IsMandatory", new Boolean(IsMandatory)); +} +/** Get Mandatory. +@return Data entry is required in this column */ +public boolean isMandatory() +{ +Object oo = get_Value("IsMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Parent link column. +@param IsParent This column is a link to the parent table (e.g. header from lines) - incl. Association key columns */ +public void setIsParent (boolean IsParent) +{ +set_Value ("IsParent", new Boolean(IsParent)); +} +/** Get Parent link column. +@return This column is a link to the parent table (e.g. header from lines) - incl. Association key columns */ +public boolean isParent() +{ +Object oo = get_Value("IsParent"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Selection Column. +@param IsSelectionColumn Is this column used for finding rows in windows */ +public void setIsSelectionColumn (boolean IsSelectionColumn) +{ +set_Value ("IsSelectionColumn", new Boolean(IsSelectionColumn)); +} +/** Get Selection Column. +@return Is this column used for finding rows in windows */ +public boolean isSelectionColumn() +{ +Object oo = get_Value("IsSelectionColumn"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Synchronize Database. +@param IsSyncDatabase Change database table definition when changing dictionary definition */ +public void setIsSyncDatabase (String IsSyncDatabase) +{ +if (IsSyncDatabase != null && IsSyncDatabase.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsSyncDatabase = IsSyncDatabase.substring(0,0); +} +set_Value ("IsSyncDatabase", IsSyncDatabase); +} +/** Get Synchronize Database. +@return Change database table definition when changing dictionary definition */ +public String getIsSyncDatabase() +{ +return (String)get_Value("IsSyncDatabase"); +} +/** Set Translated. +@param IsTranslated This column is translated */ +public void setIsTranslated (boolean IsTranslated) +{ +set_Value ("IsTranslated", new Boolean(IsTranslated)); +} +/** Get Translated. +@return This column is translated */ +public boolean isTranslated() +{ +Object oo = get_Value("IsTranslated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Updateable. +@param IsUpdateable Determines, if the field can be updated */ +public void setIsUpdateable (boolean IsUpdateable) +{ +set_Value ("IsUpdateable", new Boolean(IsUpdateable)); +} +/** Get Updateable. +@return Determines, if the field can be updated */ +public boolean isUpdateable() +{ +Object oo = get_Value("IsUpdateable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Read Only Logic. +@param ReadOnlyLogic Logic to determine if field is read only (applies only when field is read-write) */ +public void setReadOnlyLogic (String ReadOnlyLogic) +{ +if (ReadOnlyLogic != null && ReadOnlyLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ReadOnlyLogic = ReadOnlyLogic.substring(0,1999); +} +set_Value ("ReadOnlyLogic", ReadOnlyLogic); +} +/** Get Read Only Logic. +@return Logic to determine if field is read only (applies only when field is read-write) */ +public String getReadOnlyLogic() +{ +return (String)get_Value("ReadOnlyLogic"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Value Format. +@param VFormat Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setVFormat (String VFormat) +{ +if (VFormat != null && VFormat.length() > 60) +{ +log.warning("Length > 60 - truncated"); +VFormat = VFormat.substring(0,59); +} +set_Value ("VFormat", VFormat); +} +/** Get Value Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getVFormat() +{ +return (String)get_Value("VFormat"); +} +/** Set Max. Value. +@param ValueMax Maximum Value for a field */ +public void setValueMax (String ValueMax) +{ +if (ValueMax != null && ValueMax.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ValueMax = ValueMax.substring(0,19); +} +set_Value ("ValueMax", ValueMax); +} +/** Get Max. Value. +@return Maximum Value for a field */ +public String getValueMax() +{ +return (String)get_Value("ValueMax"); +} +/** Set Min. Value. +@param ValueMin Minimum Value for a field */ +public void setValueMin (String ValueMin) +{ +if (ValueMin != null && ValueMin.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ValueMin = ValueMin.substring(0,19); +} +set_Value ("ValueMin", ValueMin); +} +/** Get Min. Value. +@return Minimum Value for a field */ +public String getValueMin() +{ +return (String)get_Value("ValueMin"); +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (BigDecimal Version) +{ +if (Version == null) throw new IllegalArgumentException ("Version is mandatory."); +set_Value ("Version", Version); +} +/** Get Version. +@return Version of the table definition */ +public BigDecimal getVersion() +{ +BigDecimal bd = (BigDecimal)get_Value("Version"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Column_Access.java b/dbPort/src/org/compiere/model/X_AD_Column_Access.java new file mode 100644 index 0000000000..803d9a1b1e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Column_Access.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Column_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.656 */ +public class X_AD_Column_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Column_Access_ID id +@param trxName transaction +*/ +public X_AD_Column_Access (Properties ctx, int AD_Column_Access_ID, String trxName) +{ +super (ctx, AD_Column_Access_ID, trxName); +/** if (AD_Column_Access_ID == 0) +{ +setAD_Column_ID (0); +setAD_Role_ID (0); +setIsExclude (true); // Y +setIsReadOnly (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Column_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=571 */ +public static final int Table_ID=571; + +/** TableName=AD_Column_Access */ +public static final String Table_Name="AD_Column_Access"; + +protected static KeyNamePair Model = new KeyNamePair(571,"AD_Column_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Column_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_ValueNoCheck ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Column_ID())); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Exclude. +@param IsExclude Exclude access to the data - if not selected Include access to the data */ +public void setIsExclude (boolean IsExclude) +{ +set_Value ("IsExclude", new Boolean(IsExclude)); +} +/** Get Exclude. +@return Exclude access to the data - if not selected Include access to the data */ +public boolean isExclude() +{ +Object oo = get_Value("IsExclude"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Desktop.java b/dbPort/src/org/compiere/model/X_AD_Desktop.java new file mode 100644 index 0000000000..3d0a1f370b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Desktop.java @@ -0,0 +1,190 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Desktop + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.671 */ +public class X_AD_Desktop extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Desktop_ID id +@param trxName transaction +*/ +public X_AD_Desktop (Properties ctx, int AD_Desktop_ID, String trxName) +{ +super (ctx, AD_Desktop_ID, trxName); +/** if (AD_Desktop_ID == 0) +{ +setAD_Desktop_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Desktop (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=458 */ +public static final int Table_ID=458; + +/** TableName=AD_Desktop */ +public static final String Table_Name="AD_Desktop"; + +protected static KeyNamePair Model = new KeyNamePair(458,"AD_Desktop"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Desktop[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Color. +@param AD_Color_ID Color for backgrounds or indicators */ +public void setAD_Color_ID (Object AD_Color_ID) +{ +set_Value ("AD_Color_ID", AD_Color_ID); +} +/** Get System Color. +@return Color for backgrounds or indicators */ +public Object getAD_Color_ID() +{ +return get_Value("AD_Color_ID"); +} +/** Set Desktop. +@param AD_Desktop_ID Collection of Workbenches */ +public void setAD_Desktop_ID (int AD_Desktop_ID) +{ +if (AD_Desktop_ID < 1) throw new IllegalArgumentException ("AD_Desktop_ID is mandatory."); +set_ValueNoCheck ("AD_Desktop_ID", new Integer(AD_Desktop_ID)); +} +/** Get Desktop. +@return Collection of Workbenches */ +public int getAD_Desktop_ID() +{ +Integer ii = (Integer)get_Value("AD_Desktop_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_DesktopWorkbench.java b/dbPort/src/org/compiere/model/X_AD_DesktopWorkbench.java new file mode 100644 index 0000000000..3785d53966 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_DesktopWorkbench.java @@ -0,0 +1,158 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_DesktopWorkbench + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.687 */ +public class X_AD_DesktopWorkbench extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_DesktopWorkbench_ID id +@param trxName transaction +*/ +public X_AD_DesktopWorkbench (Properties ctx, int AD_DesktopWorkbench_ID, String trxName) +{ +super (ctx, AD_DesktopWorkbench_ID, trxName); +/** if (AD_DesktopWorkbench_ID == 0) +{ +setAD_DesktopWorkbench_ID (0); +setAD_Desktop_ID (0); +setAD_Workbench_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_DesktopWorkbench (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=459 */ +public static final int Table_ID=459; + +/** TableName=AD_DesktopWorkbench */ +public static final String Table_Name="AD_DesktopWorkbench"; + +protected static KeyNamePair Model = new KeyNamePair(459,"AD_DesktopWorkbench"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_DesktopWorkbench[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Desktop Workbench. +@param AD_DesktopWorkbench_ID Desktop Workbench */ +public void setAD_DesktopWorkbench_ID (int AD_DesktopWorkbench_ID) +{ +if (AD_DesktopWorkbench_ID < 1) throw new IllegalArgumentException ("AD_DesktopWorkbench_ID is mandatory."); +set_ValueNoCheck ("AD_DesktopWorkbench_ID", new Integer(AD_DesktopWorkbench_ID)); +} +/** Get Desktop Workbench. +@return Desktop Workbench */ +public int getAD_DesktopWorkbench_ID() +{ +Integer ii = (Integer)get_Value("AD_DesktopWorkbench_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Desktop. +@param AD_Desktop_ID Collection of Workbenches */ +public void setAD_Desktop_ID (int AD_Desktop_ID) +{ +if (AD_Desktop_ID < 1) throw new IllegalArgumentException ("AD_Desktop_ID is mandatory."); +set_ValueNoCheck ("AD_Desktop_ID", new Integer(AD_Desktop_ID)); +} +/** Get Desktop. +@return Collection of Workbenches */ +public int getAD_Desktop_ID() +{ +Integer ii = (Integer)get_Value("AD_Desktop_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workbench. +@param AD_Workbench_ID Collection of windows, reports */ +public void setAD_Workbench_ID (int AD_Workbench_ID) +{ +if (AD_Workbench_ID < 1) throw new IllegalArgumentException ("AD_Workbench_ID is mandatory."); +set_Value ("AD_Workbench_ID", new Integer(AD_Workbench_ID)); +} +/** Get Workbench. +@return Collection of windows, reports */ +public int getAD_Workbench_ID() +{ +Integer ii = (Integer)get_Value("AD_Workbench_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Workbench_ID())); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Element.java b/dbPort/src/org/compiere/model/X_AD_Element.java new file mode 100644 index 0000000000..3d2c61af67 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Element.java @@ -0,0 +1,291 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Element + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.703 */ +public class X_AD_Element extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Element_ID id +@param trxName transaction +*/ +public X_AD_Element (Properties ctx, int AD_Element_ID, String trxName) +{ +super (ctx, AD_Element_ID, trxName); +/** if (AD_Element_ID == 0) +{ +setAD_Element_ID (0); +setColumnName (null); +setEntityType (null); // U +setName (null); +setPrintName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Element (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=276 */ +public static final int Table_ID=276; + +/** TableName=AD_Element */ +public static final String Table_Name="AD_Element"; + +protected static KeyNamePair Model = new KeyNamePair(276,"AD_Element"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Element[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Element. +@param AD_Element_ID System Element enables the central maintenance of column description and help. */ +public void setAD_Element_ID (int AD_Element_ID) +{ +if (AD_Element_ID < 1) throw new IllegalArgumentException ("AD_Element_ID is mandatory."); +set_ValueNoCheck ("AD_Element_ID", new Integer(AD_Element_ID)); +} +/** Get System Element. +@return System Element enables the central maintenance of column description and help. */ +public int getAD_Element_ID() +{ +Integer ii = (Integer)get_Value("AD_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set DB Column Name. +@param ColumnName Name of the column in the database */ +public void setColumnName (String ColumnName) +{ +if (ColumnName == null) throw new IllegalArgumentException ("ColumnName is mandatory."); +if (ColumnName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ColumnName = ColumnName.substring(0,39); +} +set_Value ("ColumnName", ColumnName); +} +/** Get DB Column Name. +@return Name of the column in the database */ +public String getColumnName() +{ +return (String)get_Value("ColumnName"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getColumnName()); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set PO Description. +@param PO_Description Description in PO Screens */ +public void setPO_Description (String PO_Description) +{ +if (PO_Description != null && PO_Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +PO_Description = PO_Description.substring(0,254); +} +set_Value ("PO_Description", PO_Description); +} +/** Get PO Description. +@return Description in PO Screens */ +public String getPO_Description() +{ +return (String)get_Value("PO_Description"); +} +/** Set PO Help. +@param PO_Help Help for PO Screens */ +public void setPO_Help (String PO_Help) +{ +if (PO_Help != null && PO_Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +PO_Help = PO_Help.substring(0,1999); +} +set_Value ("PO_Help", PO_Help); +} +/** Get PO Help. +@return Help for PO Screens */ +public String getPO_Help() +{ +return (String)get_Value("PO_Help"); +} +/** Set PO Name. +@param PO_Name Name on PO Screens */ +public void setPO_Name (String PO_Name) +{ +if (PO_Name != null && PO_Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PO_Name = PO_Name.substring(0,59); +} +set_Value ("PO_Name", PO_Name); +} +/** Get PO Name. +@return Name on PO Screens */ +public String getPO_Name() +{ +return (String)get_Value("PO_Name"); +} +/** Set PO Print name. +@param PO_PrintName Print name on PO Screens/Reports */ +public void setPO_PrintName (String PO_PrintName) +{ +if (PO_PrintName != null && PO_PrintName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PO_PrintName = PO_PrintName.substring(0,59); +} +set_Value ("PO_PrintName", PO_PrintName); +} +/** Get PO Print name. +@return Print name on PO Screens/Reports */ +public String getPO_PrintName() +{ +return (String)get_Value("PO_PrintName"); +} +/** Set Print Text. +@param PrintName The label text to be printed on a document or correspondence. */ +public void setPrintName (String PrintName) +{ +if (PrintName == null) throw new IllegalArgumentException ("PrintName is mandatory."); +if (PrintName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PrintName = PrintName.substring(0,59); +} +set_Value ("PrintName", PrintName); +} +/** Get Print Text. +@return The label text to be printed on a document or correspondence. */ +public String getPrintName() +{ +return (String)get_Value("PrintName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_EntityType.java b/dbPort/src/org/compiere/model/X_AD_EntityType.java new file mode 100644 index 0000000000..c7e69c9ba0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_EntityType.java @@ -0,0 +1,252 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_EntityType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.734 */ +public class X_AD_EntityType extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_EntityType_ID id +@param trxName transaction +*/ +public X_AD_EntityType (Properties ctx, int AD_EntityType_ID, String trxName) +{ +super (ctx, AD_EntityType_ID, trxName); +/** if (AD_EntityType_ID == 0) +{ +setAD_EntityType_ID (0); +setEntityType (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_EntityType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=882 */ +public static final int Table_ID=882; + +/** TableName=AD_EntityType */ +public static final String Table_Name="AD_EntityType"; + +protected static KeyNamePair Model = new KeyNamePair(882,"AD_EntityType"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_EntityType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Entity Type. +@param AD_EntityType_ID System Entity Type */ +public void setAD_EntityType_ID (int AD_EntityType_ID) +{ +if (AD_EntityType_ID < 1) throw new IllegalArgumentException ("AD_EntityType_ID is mandatory."); +set_ValueNoCheck ("AD_EntityType_ID", new Integer(AD_EntityType_ID)); +} +/** Get Entity Type. +@return System Entity Type */ +public int getAD_EntityType_ID() +{ +Integer ii = (Integer)get_Value("AD_EntityType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Classpath. +@param Classpath Extension Classpath */ +public void setClasspath (String Classpath) +{ +if (Classpath != null && Classpath.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Classpath = Classpath.substring(0,254); +} +set_Value ("Classpath", Classpath); +} +/** Get Classpath. +@return Extension Classpath */ +public String getClasspath() +{ +return (String)get_Value("Classpath"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType == null) throw new IllegalArgumentException ("EntityType is mandatory."); +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_ValueNoCheck ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set ModelPackage. +@param ModelPackage Java Package of the model classes */ +public void setModelPackage (String ModelPackage) +{ +if (ModelPackage != null && ModelPackage.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ModelPackage = ModelPackage.substring(0,254); +} +set_Value ("ModelPackage", ModelPackage); +} +/** Get ModelPackage. +@return Java Package of the model classes */ +public String getModelPackage() +{ +return (String)get_Value("ModelPackage"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (String Version) +{ +if (Version != null && Version.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Version = Version.substring(0,19); +} +set_Value ("Version", Version); +} +/** Get Version. +@return Version of the table definition */ +public String getVersion() +{ +return (String)get_Value("Version"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Error.java b/dbPort/src/org/compiere/model/X_AD_Error.java new file mode 100644 index 0000000000..2ae75a6e10 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Error.java @@ -0,0 +1,165 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Error + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.75 */ +public class X_AD_Error extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Error_ID id +@param trxName transaction +*/ +public X_AD_Error (Properties ctx, int AD_Error_ID, String trxName) +{ +super (ctx, AD_Error_ID, trxName); +/** if (AD_Error_ID == 0) +{ +setAD_Error_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Error (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=380 */ +public static final int Table_ID=380; + +/** TableName=AD_Error */ +public static final String Table_Name="AD_Error"; + +protected static KeyNamePair Model = new KeyNamePair(380,"AD_Error"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Error[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Error. +@param AD_Error_ID Error */ +public void setAD_Error_ID (int AD_Error_ID) +{ +if (AD_Error_ID < 1) throw new IllegalArgumentException ("AD_Error_ID is mandatory."); +set_ValueNoCheck ("AD_Error_ID", new Integer(AD_Error_ID)); +} +/** Get Error. +@return Error */ +public int getAD_Error_ID() +{ +Integer ii = (Integer)get_Value("AD_Error_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Language AD_Reference_ID=106 */ +public static final int AD_LANGUAGE_AD_Reference_ID=106; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language != null && AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set Validation code. +@param Code Validation Code */ +public void setCode (String Code) +{ +if (Code != null && Code.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Code = Code.substring(0,1999); +} +set_Value ("Code", Code); +} +/** Get Validation code. +@return Validation Code */ +public String getCode() +{ +return (String)get_Value("Code"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Field.java b/dbPort/src/org/compiere/model/X_AD_Field.java new file mode 100644 index 0000000000..322237479d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Field.java @@ -0,0 +1,504 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Field + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.765 */ +public class X_AD_Field extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Field_ID id +@param trxName transaction +*/ +public X_AD_Field (Properties ctx, int AD_Field_ID, String trxName) +{ +super (ctx, AD_Field_ID, trxName); +/** if (AD_Field_ID == 0) +{ +setAD_Column_ID (0); +setAD_Field_ID (0); +setAD_Tab_ID (0); +setEntityType (null); // U +setIsCentrallyMaintained (true); // Y +setIsDisplayed (true); // Y +setIsEncrypted (false); +setIsFieldOnly (false); +setIsHeading (false); +setIsReadOnly (false); +setIsSameLine (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Field (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=107 */ +public static final int Table_ID=107; + +/** TableName=AD_Field */ +public static final String Table_Name="AD_Field"; + +protected static KeyNamePair Model = new KeyNamePair(107,"AD_Field"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Field[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Field Group. +@param AD_FieldGroup_ID Logical grouping of fields */ +public void setAD_FieldGroup_ID (int AD_FieldGroup_ID) +{ +if (AD_FieldGroup_ID <= 0) set_Value ("AD_FieldGroup_ID", null); + else +set_Value ("AD_FieldGroup_ID", new Integer(AD_FieldGroup_ID)); +} +/** Get Field Group. +@return Logical grouping of fields */ +public int getAD_FieldGroup_ID() +{ +Integer ii = (Integer)get_Value("AD_FieldGroup_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Field. +@param AD_Field_ID Field on a database table */ +public void setAD_Field_ID (int AD_Field_ID) +{ +if (AD_Field_ID < 1) throw new IllegalArgumentException ("AD_Field_ID is mandatory."); +set_ValueNoCheck ("AD_Field_ID", new Integer(AD_Field_ID)); +} +/** Get Field. +@return Field on a database table */ +public int getAD_Field_ID() +{ +Integer ii = (Integer)get_Value("AD_Field_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_ID AD_Reference_ID=1 */ +public static final int AD_REFERENCE_ID_AD_Reference_ID=1; +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID <= 0) set_Value ("AD_Reference_ID", null); + else +set_Value ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tab. +@param AD_Tab_ID Tab within a Window */ +public void setAD_Tab_ID (int AD_Tab_ID) +{ +if (AD_Tab_ID < 1) throw new IllegalArgumentException ("AD_Tab_ID is mandatory."); +set_ValueNoCheck ("AD_Tab_ID", new Integer(AD_Tab_ID)); +} +/** Get Tab. +@return Tab within a Window */ +public int getAD_Tab_ID() +{ +Integer ii = (Integer)get_Value("AD_Tab_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Display Length. +@param DisplayLength Length of the display in characters */ +public void setDisplayLength (int DisplayLength) +{ +set_Value ("DisplayLength", new Integer(DisplayLength)); +} +/** Get Display Length. +@return Length of the display in characters */ +public int getDisplayLength() +{ +Integer ii = (Integer)get_Value("DisplayLength"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Display Logic. +@param DisplayLogic If the Field is displayed, the result determines if the field is actually displayed */ +public void setDisplayLogic (String DisplayLogic) +{ +if (DisplayLogic != null && DisplayLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DisplayLogic = DisplayLogic.substring(0,1999); +} +set_Value ("DisplayLogic", DisplayLogic); +} +/** Get Display Logic. +@return If the Field is displayed, the result determines if the field is actually displayed */ +public String getDisplayLogic() +{ +return (String)get_Value("DisplayLogic"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Centrally maintained. +@param IsCentrallyMaintained Information maintained in System Element table */ +public void setIsCentrallyMaintained (boolean IsCentrallyMaintained) +{ +set_Value ("IsCentrallyMaintained", new Boolean(IsCentrallyMaintained)); +} +/** Get Centrally maintained. +@return Information maintained in System Element table */ +public boolean isCentrallyMaintained() +{ +Object oo = get_Value("IsCentrallyMaintained"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Displayed. +@param IsDisplayed Determines, if this field is displayed */ +public void setIsDisplayed (boolean IsDisplayed) +{ +set_Value ("IsDisplayed", new Boolean(IsDisplayed)); +} +/** Get Displayed. +@return Determines, if this field is displayed */ +public boolean isDisplayed() +{ +Object oo = get_Value("IsDisplayed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Encrypted. +@param IsEncrypted Display or Storage is encrypted */ +public void setIsEncrypted (boolean IsEncrypted) +{ +set_Value ("IsEncrypted", new Boolean(IsEncrypted)); +} +/** Get Encrypted. +@return Display or Storage is encrypted */ +public boolean isEncrypted() +{ +Object oo = get_Value("IsEncrypted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Field Only. +@param IsFieldOnly Label is not displayed */ +public void setIsFieldOnly (boolean IsFieldOnly) +{ +set_Value ("IsFieldOnly", new Boolean(IsFieldOnly)); +} +/** Get Field Only. +@return Label is not displayed */ +public boolean isFieldOnly() +{ +Object oo = get_Value("IsFieldOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Heading only. +@param IsHeading Field without Column - Only label is displayed */ +public void setIsHeading (boolean IsHeading) +{ +set_Value ("IsHeading", new Boolean(IsHeading)); +} +/** Get Heading only. +@return Field without Column - Only label is displayed */ +public boolean isHeading() +{ +Object oo = get_Value("IsHeading"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** IsMandatory AD_Reference_ID=319 */ +public static final int ISMANDATORY_AD_Reference_ID=319; +/** No = N */ +public static final String ISMANDATORY_No = "N"; +/** Yes = Y */ +public static final String ISMANDATORY_Yes = "Y"; +/** Set Mandatory. +@param IsMandatory Data entry is required in this column */ +public void setIsMandatory (String IsMandatory) +{ +if (IsMandatory == null) throw new IllegalArgumentException ("IsMandatory is mandatory"); +if (IsMandatory == null || IsMandatory.equals("N") || IsMandatory.equals("Y")); + else throw new IllegalArgumentException ("IsMandatory Invalid value - " + IsMandatory + " - Reference_ID=319 - N - Y"); +if (IsMandatory != null && IsMandatory.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsMandatory = IsMandatory.substring(0,0); +} +set_Value ("IsMandatory", IsMandatory); +} +/** Get Mandatory. +@return Data entry is required in this column */ +public String getIsMandatory() +{ +return (String)get_Value("IsMandatory"); +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Same Line. +@param IsSameLine Displayed on same line as previous field */ +public void setIsSameLine (boolean IsSameLine) +{ +set_Value ("IsSameLine", new Boolean(IsSameLine)); +} +/** Get Same Line. +@return Displayed on same line as previous field */ +public boolean isSameLine() +{ +Object oo = get_Value("IsSameLine"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** ObscureType AD_Reference_ID=291 */ +public static final int OBSCURETYPE_AD_Reference_ID=291; +/** Obscure Digits but last 4 = 904 */ +public static final String OBSCURETYPE_ObscureDigitsButLast4 = "904"; +/** Obscure Digits but first/last 4 = 944 */ +public static final String OBSCURETYPE_ObscureDigitsButFirstLast4 = "944"; +/** Obscure AlphaNumeric but last 4 = A04 */ +public static final String OBSCURETYPE_ObscureAlphaNumericButLast4 = "A04"; +/** Obscure AlphaNumeric but first/last 4 = A44 */ +public static final String OBSCURETYPE_ObscureAlphaNumericButFirstLast4 = "A44"; +/** Set Obscure. +@param ObscureType Type of obscuring the data (limiting the display) */ +public void setObscureType (String ObscureType) +{ +if (ObscureType == null) throw new IllegalArgumentException ("ObscureType is mandatory"); +if (ObscureType == null || ObscureType.equals("904") || ObscureType.equals("944") || ObscureType.equals("A04") || ObscureType.equals("A44")); + else throw new IllegalArgumentException ("ObscureType Invalid value - " + ObscureType + " - Reference_ID=291 - 904 - 944 - A04 - A44"); +if (ObscureType != null && ObscureType.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ObscureType = ObscureType.substring(0,2); +} +set_Value ("ObscureType", ObscureType); +} +/** Get Obscure. +@return Type of obscuring the data (limiting the display) */ +public String getObscureType() +{ +return (String)get_Value("ObscureType"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record Sort No. +@param SortNo Determines in what order the records are displayed */ +public void setSortNo (BigDecimal SortNo) +{ +set_Value ("SortNo", SortNo); +} +/** Get Record Sort No. +@return Determines in what order the records are displayed */ +public BigDecimal getSortNo() +{ +BigDecimal bd = (BigDecimal)get_Value("SortNo"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_FieldGroup.java b/dbPort/src/org/compiere/model/X_AD_FieldGroup.java new file mode 100644 index 0000000000..2b974eca96 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_FieldGroup.java @@ -0,0 +1,151 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_FieldGroup + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.828 */ +public class X_AD_FieldGroup extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_FieldGroup_ID id +@param trxName transaction +*/ +public X_AD_FieldGroup (Properties ctx, int AD_FieldGroup_ID, String trxName) +{ +super (ctx, AD_FieldGroup_ID, trxName); +/** if (AD_FieldGroup_ID == 0) +{ +setAD_FieldGroup_ID (0); +setEntityType (null); // U +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_FieldGroup (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=414 */ +public static final int Table_ID=414; + +/** TableName=AD_FieldGroup */ +public static final String Table_Name="AD_FieldGroup"; + +protected static KeyNamePair Model = new KeyNamePair(414,"AD_FieldGroup"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_FieldGroup[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Field Group. +@param AD_FieldGroup_ID Logical grouping of fields */ +public void setAD_FieldGroup_ID (int AD_FieldGroup_ID) +{ +if (AD_FieldGroup_ID < 1) throw new IllegalArgumentException ("AD_FieldGroup_ID is mandatory."); +set_ValueNoCheck ("AD_FieldGroup_ID", new Integer(AD_FieldGroup_ID)); +} +/** Get Field Group. +@return Logical grouping of fields */ +public int getAD_FieldGroup_ID() +{ +Integer ii = (Integer)get_Value("AD_FieldGroup_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Find.java b/dbPort/src/org/compiere/model/X_AD_Find.java new file mode 100644 index 0000000000..dc6c2d8198 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Find.java @@ -0,0 +1,250 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Find + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.843 */ +public class X_AD_Find extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Find_ID id +@param trxName transaction +*/ +public X_AD_Find (Properties ctx, int AD_Find_ID, String trxName) +{ +super (ctx, AD_Find_ID, trxName); +/** if (AD_Find_ID == 0) +{ +setAD_Column_ID (0); +setAD_Find_ID (0); +setAndOr (null); // A +setFind_ID (Env.ZERO); +setOperation (null); // == +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Find (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=404 */ +public static final int Table_ID=404; + +/** TableName=AD_Find */ +public static final String Table_Name="AD_Find"; + +protected static KeyNamePair Model = new KeyNamePair(404,"AD_Find"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Find[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Column_ID AD_Reference_ID=251 */ +public static final int AD_COLUMN_ID_AD_Reference_ID=251; +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Find. +@param AD_Find_ID Find */ +public void setAD_Find_ID (int AD_Find_ID) +{ +if (AD_Find_ID < 1) throw new IllegalArgumentException ("AD_Find_ID is mandatory."); +set_ValueNoCheck ("AD_Find_ID", new Integer(AD_Find_ID)); +} +/** Get Find. +@return Find */ +public int getAD_Find_ID() +{ +Integer ii = (Integer)get_Value("AD_Find_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Find_ID())); +} + +/** AndOr AD_Reference_ID=204 */ +public static final int ANDOR_AD_Reference_ID=204; +/** And = A */ +public static final String ANDOR_And = "A"; +/** Or = O */ +public static final String ANDOR_Or = "O"; +/** Set And/Or. +@param AndOr Logical operation: AND or OR */ +public void setAndOr (String AndOr) +{ +if (AndOr == null) throw new IllegalArgumentException ("AndOr is mandatory"); +if (AndOr.equals("A") || AndOr.equals("O")); + else throw new IllegalArgumentException ("AndOr Invalid value - " + AndOr + " - Reference_ID=204 - A - O"); +if (AndOr.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AndOr = AndOr.substring(0,0); +} +set_Value ("AndOr", AndOr); +} +/** Get And/Or. +@return Logical operation: AND or OR */ +public String getAndOr() +{ +return (String)get_Value("AndOr"); +} +/** Set Find_ID. +@param Find_ID Find_ID */ +public void setFind_ID (BigDecimal Find_ID) +{ +if (Find_ID == null) throw new IllegalArgumentException ("Find_ID is mandatory."); +set_Value ("Find_ID", Find_ID); +} +/** Get Find_ID. +@return Find_ID */ +public BigDecimal getFind_ID() +{ +BigDecimal bd = (BigDecimal)get_Value("Find_ID"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** Operation AD_Reference_ID=205 */ +public static final int OPERATION_AD_Reference_ID=205; +/** != = != */ +public static final String OPERATION_NotEq = "!="; +/** < = << */ +public static final String OPERATION_Le = "<<"; +/** <= = <= */ +public static final String OPERATION_LeEq = "<="; +/** = = == */ +public static final String OPERATION_Eq = "=="; +/** >= = >= */ +public static final String OPERATION_GtEq = ">="; +/** > = >> */ +public static final String OPERATION_Gt = ">>"; +/** || = AB */ +public static final String OPERATION_X = "AB"; +/** sql = SQ */ +public static final String OPERATION_Sql = "SQ"; +/** ~ = ~~ */ +public static final String OPERATION_Like = "~~"; +/** Set Operation. +@param Operation Compare Operation */ +public void setOperation (String Operation) +{ +if (Operation == null) throw new IllegalArgumentException ("Operation is mandatory"); +if (Operation.equals("!=") || Operation.equals("<<") || Operation.equals("<=") || Operation.equals("==") || Operation.equals(">=") || Operation.equals(">>") || Operation.equals("AB") || Operation.equals("SQ") || Operation.equals("~~")); + else throw new IllegalArgumentException ("Operation Invalid value - " + Operation + " - Reference_ID=205 - != - << - <= - == - >= - >> - AB - SQ - ~~"); +if (Operation.length() > 2) +{ +log.warning("Length > 2 - truncated"); +Operation = Operation.substring(0,1); +} +set_Value ("Operation", Operation); +} +/** Get Operation. +@return Compare Operation */ +public String getOperation() +{ +return (String)get_Value("Operation"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Value To. +@param Value2 Value To */ +public void setValue2 (String Value2) +{ +if (Value2 != null && Value2.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value2 = Value2.substring(0,39); +} +set_Value ("Value2", Value2); +} +/** Get Value To. +@return Value To */ +public String getValue2() +{ +return (String)get_Value("Value2"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Form.java b/dbPort/src/org/compiere/model/X_AD_Form.java new file mode 100644 index 0000000000..ff15f0b3b2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Form.java @@ -0,0 +1,274 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Form + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.875 */ +public class X_AD_Form extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Form_ID id +@param trxName transaction +*/ +public X_AD_Form (Properties ctx, int AD_Form_ID, String trxName) +{ +super (ctx, AD_Form_ID, trxName); +/** if (AD_Form_ID == 0) +{ +setAD_Form_ID (0); +setAccessLevel (null); +setEntityType (null); // U +setIsBetaFunctionality (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Form (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=376 */ +public static final int Table_ID=376; + +/** TableName=AD_Form */ +public static final String Table_Name="AD_Form"; + +protected static KeyNamePair Model = new KeyNamePair(376,"AD_Form"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Form[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Special Form. +@param AD_Form_ID Special Form */ +public void setAD_Form_ID (int AD_Form_ID) +{ +if (AD_Form_ID < 1) throw new IllegalArgumentException ("AD_Form_ID is mandatory."); +set_ValueNoCheck ("AD_Form_ID", new Integer(AD_Form_ID)); +} +/** Get Special Form. +@return Special Form */ +public int getAD_Form_ID() +{ +Integer ii = (Integer)get_Value("AD_Form_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AccessLevel AD_Reference_ID=5 */ +public static final int ACCESSLEVEL_AD_Reference_ID=5; +/** Organization = 1 */ +public static final String ACCESSLEVEL_Organization = "1"; +/** Client only = 2 */ +public static final String ACCESSLEVEL_ClientOnly = "2"; +/** Client+Organization = 3 */ +public static final String ACCESSLEVEL_ClientPlusOrganization = "3"; +/** System only = 4 */ +public static final String ACCESSLEVEL_SystemOnly = "4"; +/** System+Client = 6 */ +public static final String ACCESSLEVEL_SystemPlusClient = "6"; +/** All = 7 */ +public static final String ACCESSLEVEL_All = "7"; +/** Set Data Access Level. +@param AccessLevel Access Level required */ +public void setAccessLevel (String AccessLevel) +{ +if (AccessLevel == null) throw new IllegalArgumentException ("AccessLevel is mandatory"); +if (AccessLevel.equals("1") || AccessLevel.equals("2") || AccessLevel.equals("3") || AccessLevel.equals("4") || AccessLevel.equals("6") || AccessLevel.equals("7")); + else throw new IllegalArgumentException ("AccessLevel Invalid value - " + AccessLevel + " - Reference_ID=5 - 1 - 2 - 3 - 4 - 6 - 7"); +if (AccessLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccessLevel = AccessLevel.substring(0,0); +} +set_Value ("AccessLevel", AccessLevel); +} +/** Get Data Access Level. +@return Access Level required */ +public String getAccessLevel() +{ +return (String)get_Value("AccessLevel"); +} +/** Set Classname. +@param Classname Java Classname */ +public void setClassname (String Classname) +{ +if (Classname != null && Classname.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Classname = Classname.substring(0,59); +} +set_Value ("Classname", Classname); +} +/** Get Classname. +@return Java Classname */ +public String getClassname() +{ +return (String)get_Value("Classname"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Beta Functionality. +@param IsBetaFunctionality This functionality is considered Beta */ +public void setIsBetaFunctionality (boolean IsBetaFunctionality) +{ +set_Value ("IsBetaFunctionality", new Boolean(IsBetaFunctionality)); +} +/** Get Beta Functionality. +@return This functionality is considered Beta */ +public boolean isBetaFunctionality() +{ +Object oo = get_Value("IsBetaFunctionality"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set jsp URL. +@param JSPURL Web URL of the jsp function */ +public void setJSPURL (String JSPURL) +{ +if (JSPURL != null && JSPURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +JSPURL = JSPURL.substring(0,119); +} +set_Value ("JSPURL", JSPURL); +} +/** Get jsp URL. +@return Web URL of the jsp function */ +public String getJSPURL() +{ +return (String)get_Value("JSPURL"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Form_Access.java b/dbPort/src/org/compiere/model/X_AD_Form_Access.java new file mode 100644 index 0000000000..42b4d6e8ac --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Form_Access.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Form_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.906 */ +public class X_AD_Form_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Form_Access_ID id +@param trxName transaction +*/ +public X_AD_Form_Access (Properties ctx, int AD_Form_Access_ID, String trxName) +{ +super (ctx, AD_Form_Access_ID, trxName); +/** if (AD_Form_Access_ID == 0) +{ +setAD_Form_ID (0); +setAD_Role_ID (0); +setIsReadWrite (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Form_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=378 */ +public static final int Table_ID=378; + +/** TableName=AD_Form_Access */ +public static final String Table_Name="AD_Form_Access"; + +protected static KeyNamePair Model = new KeyNamePair(378,"AD_Form_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Form_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Special Form. +@param AD_Form_ID Special Form */ +public void setAD_Form_ID (int AD_Form_ID) +{ +if (AD_Form_ID < 1) throw new IllegalArgumentException ("AD_Form_ID is mandatory."); +set_ValueNoCheck ("AD_Form_ID", new Integer(AD_Form_ID)); +} +/** Get Special Form. +@return Special Form */ +public int getAD_Form_ID() +{ +Integer ii = (Integer)get_Value("AD_Form_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Write. +@param IsReadWrite Field is read / write */ +public void setIsReadWrite (boolean IsReadWrite) +{ +set_Value ("IsReadWrite", new Boolean(IsReadWrite)); +} +/** Get Read Write. +@return Field is read / write */ +public boolean isReadWrite() +{ +Object oo = get_Value("IsReadWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Image.java b/dbPort/src/org/compiere/model/X_AD_Image.java new file mode 100644 index 0000000000..36b3a578b3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Image.java @@ -0,0 +1,197 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Image + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.906 */ +public class X_AD_Image extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Image_ID id +@param trxName transaction +*/ +public X_AD_Image (Properties ctx, int AD_Image_ID, String trxName) +{ +super (ctx, AD_Image_ID, trxName); +/** if (AD_Image_ID == 0) +{ +setAD_Image_ID (0); +setEntityType (null); // U +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Image (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=461 */ +public static final int Table_ID=461; + +/** TableName=AD_Image */ +public static final String Table_Name="AD_Image"; + +protected static KeyNamePair Model = new KeyNamePair(461,"AD_Image"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Image[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID < 1) throw new IllegalArgumentException ("AD_Image_ID is mandatory."); +set_ValueNoCheck ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ImpFormat.java b/dbPort/src/org/compiere/model/X_AD_ImpFormat.java new file mode 100644 index 0000000000..bd23546252 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ImpFormat.java @@ -0,0 +1,212 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ImpFormat + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.937 */ +public class X_AD_ImpFormat extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ImpFormat_ID id +@param trxName transaction +*/ +public X_AD_ImpFormat (Properties ctx, int AD_ImpFormat_ID, String trxName) +{ +super (ctx, AD_ImpFormat_ID, trxName); +/** if (AD_ImpFormat_ID == 0) +{ +setAD_ImpFormat_ID (0); +setAD_Table_ID (0); +setFormatType (null); +setName (null); +setProcessing (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ImpFormat (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=381 */ +public static final int Table_ID=381; + +/** TableName=AD_ImpFormat */ +public static final String Table_Name="AD_ImpFormat"; + +protected static KeyNamePair Model = new KeyNamePair(381,"AD_ImpFormat"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ImpFormat[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Import Format. +@param AD_ImpFormat_ID Import Format */ +public void setAD_ImpFormat_ID (int AD_ImpFormat_ID) +{ +if (AD_ImpFormat_ID < 1) throw new IllegalArgumentException ("AD_ImpFormat_ID is mandatory."); +set_ValueNoCheck ("AD_ImpFormat_ID", new Integer(AD_ImpFormat_ID)); +} +/** Get Import Format. +@return Import Format */ +public int getAD_ImpFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_ImpFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** FormatType AD_Reference_ID=209 */ +public static final int FORMATTYPE_AD_Reference_ID=209; +/** Comma Separated = C */ +public static final String FORMATTYPE_CommaSeparated = "C"; +/** Fixed Position = F */ +public static final String FORMATTYPE_FixedPosition = "F"; +/** Tab Separated = T */ +public static final String FORMATTYPE_TabSeparated = "T"; +/** XML = X */ +public static final String FORMATTYPE_XML = "X"; +/** Set Format. +@param FormatType Format of the data */ +public void setFormatType (String FormatType) +{ +if (FormatType == null) throw new IllegalArgumentException ("FormatType is mandatory"); +if (FormatType.equals("C") || FormatType.equals("F") || FormatType.equals("T") || FormatType.equals("X")); + else throw new IllegalArgumentException ("FormatType Invalid value - " + FormatType + " - Reference_ID=209 - C - F - T - X"); +if (FormatType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FormatType = FormatType.substring(0,0); +} +set_Value ("FormatType", FormatType); +} +/** Get Format. +@return Format of the data */ +public String getFormatType() +{ +return (String)get_Value("FormatType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ImpFormat_Row.java b/dbPort/src/org/compiere/model/X_AD_ImpFormat_Row.java new file mode 100644 index 0000000000..eb807cf73b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ImpFormat_Row.java @@ -0,0 +1,343 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ImpFormat_Row + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.953 */ +public class X_AD_ImpFormat_Row extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ImpFormat_Row_ID id +@param trxName transaction +*/ +public X_AD_ImpFormat_Row (Properties ctx, int AD_ImpFormat_Row_ID, String trxName) +{ +super (ctx, AD_ImpFormat_Row_ID, trxName); +/** if (AD_ImpFormat_Row_ID == 0) +{ +setAD_Column_ID (0); +setAD_ImpFormat_ID (0); +setAD_ImpFormat_Row_ID (0); +setDataType (null); +setDecimalPoint (null); // . +setDivideBy100 (false); +setName (null); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_ImpFormat_Row WHERE AD_ImpFormat_ID=@AD_ImpFormat_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ImpFormat_Row (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=382 */ +public static final int Table_ID=382; + +/** TableName=AD_ImpFormat_Row */ +public static final String Table_Name="AD_ImpFormat_Row"; + +protected static KeyNamePair Model = new KeyNamePair(382,"AD_ImpFormat_Row"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ImpFormat_Row[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Import Format. +@param AD_ImpFormat_ID Import Format */ +public void setAD_ImpFormat_ID (int AD_ImpFormat_ID) +{ +if (AD_ImpFormat_ID < 1) throw new IllegalArgumentException ("AD_ImpFormat_ID is mandatory."); +set_ValueNoCheck ("AD_ImpFormat_ID", new Integer(AD_ImpFormat_ID)); +} +/** Get Import Format. +@return Import Format */ +public int getAD_ImpFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_ImpFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Format Field. +@param AD_ImpFormat_Row_ID Format Field */ +public void setAD_ImpFormat_Row_ID (int AD_ImpFormat_Row_ID) +{ +if (AD_ImpFormat_Row_ID < 1) throw new IllegalArgumentException ("AD_ImpFormat_Row_ID is mandatory."); +set_ValueNoCheck ("AD_ImpFormat_Row_ID", new Integer(AD_ImpFormat_Row_ID)); +} +/** Get Format Field. +@return Format Field */ +public int getAD_ImpFormat_Row_ID() +{ +Integer ii = (Integer)get_Value("AD_ImpFormat_Row_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Callout. +@param Callout Fully qualified class names and method - separated by semicolons */ +public void setCallout (String Callout) +{ +if (Callout != null && Callout.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Callout = Callout.substring(0,59); +} +set_Value ("Callout", Callout); +} +/** Get Callout. +@return Fully qualified class names and method - separated by semicolons */ +public String getCallout() +{ +return (String)get_Value("Callout"); +} +/** Set Constant Value. +@param ConstantValue Constant value */ +public void setConstantValue (String ConstantValue) +{ +if (ConstantValue != null && ConstantValue.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ConstantValue = ConstantValue.substring(0,59); +} +set_Value ("ConstantValue", ConstantValue); +} +/** Get Constant Value. +@return Constant value */ +public String getConstantValue() +{ +return (String)get_Value("ConstantValue"); +} +/** Set Data Format. +@param DataFormat Format String in Java Notation, e.g. ddMMyy */ +public void setDataFormat (String DataFormat) +{ +if (DataFormat != null && DataFormat.length() > 20) +{ +log.warning("Length > 20 - truncated"); +DataFormat = DataFormat.substring(0,19); +} +set_Value ("DataFormat", DataFormat); +} +/** Get Data Format. +@return Format String in Java Notation, e.g. ddMMyy */ +public String getDataFormat() +{ +return (String)get_Value("DataFormat"); +} + +/** DataType AD_Reference_ID=210 */ +public static final int DATATYPE_AD_Reference_ID=210; +/** Constant = C */ +public static final String DATATYPE_Constant = "C"; +/** Date = D */ +public static final String DATATYPE_Date = "D"; +/** Number = N */ +public static final String DATATYPE_Number = "N"; +/** String = S */ +public static final String DATATYPE_String = "S"; +/** Set Data Type. +@param DataType Type of data */ +public void setDataType (String DataType) +{ +if (DataType == null) throw new IllegalArgumentException ("DataType is mandatory"); +if (DataType.equals("C") || DataType.equals("D") || DataType.equals("N") || DataType.equals("S")); + else throw new IllegalArgumentException ("DataType Invalid value - " + DataType + " - Reference_ID=210 - C - D - N - S"); +if (DataType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DataType = DataType.substring(0,0); +} +set_Value ("DataType", DataType); +} +/** Get Data Type. +@return Type of data */ +public String getDataType() +{ +return (String)get_Value("DataType"); +} +/** Set Decimal Point. +@param DecimalPoint Decimal Point in the data file - if any */ +public void setDecimalPoint (String DecimalPoint) +{ +if (DecimalPoint == null) throw new IllegalArgumentException ("DecimalPoint is mandatory."); +if (DecimalPoint.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DecimalPoint = DecimalPoint.substring(0,0); +} +set_Value ("DecimalPoint", DecimalPoint); +} +/** Get Decimal Point. +@return Decimal Point in the data file - if any */ +public String getDecimalPoint() +{ +return (String)get_Value("DecimalPoint"); +} +/** Set Divide by 100. +@param DivideBy100 Divide number by 100 to get correct amount */ +public void setDivideBy100 (boolean DivideBy100) +{ +set_Value ("DivideBy100", new Boolean(DivideBy100)); +} +/** Get Divide by 100. +@return Divide number by 100 to get correct amount */ +public boolean isDivideBy100() +{ +Object oo = get_Value("DivideBy100"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set End No. +@param EndNo End No */ +public void setEndNo (int EndNo) +{ +set_Value ("EndNo", new Integer(EndNo)); +} +/** Get End No. +@return End No */ +public int getEndNo() +{ +Integer ii = (Integer)get_Value("EndNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Script. +@param Script Dynamic Java Language Script to calculate result */ +public void setScript (String Script) +{ +if (Script != null && Script.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Script = Script.substring(0,1999); +} +set_Value ("Script", Script); +} +/** Get Script. +@return Dynamic Java Language Script to calculate result */ +public String getScript() +{ +return (String)get_Value("Script"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Start No. +@param StartNo Starting number/position */ +public void setStartNo (int StartNo) +{ +set_Value ("StartNo", new Integer(StartNo)); +} +/** Get Start No. +@return Starting number/position */ +public int getStartNo() +{ +Integer ii = (Integer)get_Value("StartNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_InfoColumn.java b/dbPort/src/org/compiere/model/X_AD_InfoColumn.java new file mode 100644 index 0000000000..1f24ba9fec --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_InfoColumn.java @@ -0,0 +1,310 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_InfoColumn + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:52.984 */ +public class X_AD_InfoColumn extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_InfoColumn_ID id +@param trxName transaction +*/ +public X_AD_InfoColumn (Properties ctx, int AD_InfoColumn_ID, String trxName) +{ +super (ctx, AD_InfoColumn_ID, trxName); +/** if (AD_InfoColumn_ID == 0) +{ +setAD_InfoColumn_ID (0); +setAD_InfoWindow_ID (0); +setAD_Reference_ID (0); +setEntityType (null); // U +setIsDisplayed (false); +setIsQueryCriteria (false); +setName (null); +setSelectClause (null); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_InfoColumn (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=897 */ +public static final int Table_ID=897; + +/** TableName=AD_InfoColumn */ +public static final String Table_Name="AD_InfoColumn"; + +protected static KeyNamePair Model = new KeyNamePair(897,"AD_InfoColumn"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_InfoColumn[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Element. +@param AD_Element_ID System Element enables the central maintenance of column description and help. */ +public void setAD_Element_ID (int AD_Element_ID) +{ +if (AD_Element_ID <= 0) set_Value ("AD_Element_ID", null); + else +set_Value ("AD_Element_ID", new Integer(AD_Element_ID)); +} +/** Get System Element. +@return System Element enables the central maintenance of column description and help. */ +public int getAD_Element_ID() +{ +Integer ii = (Integer)get_Value("AD_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Info Column. +@param AD_InfoColumn_ID Info Window Column */ +public void setAD_InfoColumn_ID (int AD_InfoColumn_ID) +{ +if (AD_InfoColumn_ID < 1) throw new IllegalArgumentException ("AD_InfoColumn_ID is mandatory."); +set_ValueNoCheck ("AD_InfoColumn_ID", new Integer(AD_InfoColumn_ID)); +} +/** Get Info Column. +@return Info Window Column */ +public int getAD_InfoColumn_ID() +{ +Integer ii = (Integer)get_Value("AD_InfoColumn_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Info Window. +@param AD_InfoWindow_ID Info and search/select Window */ +public void setAD_InfoWindow_ID (int AD_InfoWindow_ID) +{ +if (AD_InfoWindow_ID < 1) throw new IllegalArgumentException ("AD_InfoWindow_ID is mandatory."); +set_ValueNoCheck ("AD_InfoWindow_ID", new Integer(AD_InfoWindow_ID)); +} +/** Get Info Window. +@return Info and search/select Window */ +public int getAD_InfoWindow_ID() +{ +Integer ii = (Integer)get_Value("AD_InfoWindow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_ID AD_Reference_ID=1 */ +public static final int AD_REFERENCE_ID_AD_Reference_ID=1; +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_Value ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Displayed. +@param IsDisplayed Determines, if this field is displayed */ +public void setIsDisplayed (boolean IsDisplayed) +{ +set_Value ("IsDisplayed", new Boolean(IsDisplayed)); +} +/** Get Displayed. +@return Determines, if this field is displayed */ +public boolean isDisplayed() +{ +Object oo = get_Value("IsDisplayed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Query Criteria. +@param IsQueryCriteria The column is also used as a query criteria */ +public void setIsQueryCriteria (boolean IsQueryCriteria) +{ +set_Value ("IsQueryCriteria", new Boolean(IsQueryCriteria)); +} +/** Get Query Criteria. +@return The column is also used as a query criteria */ +public boolean isQueryCriteria() +{ +Object oo = get_Value("IsQueryCriteria"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sql SELECT. +@param SelectClause SQL SELECT clause */ +public void setSelectClause (String SelectClause) +{ +if (SelectClause == null) throw new IllegalArgumentException ("SelectClause is mandatory."); +if (SelectClause.length() > 255) +{ +log.warning("Length > 255 - truncated"); +SelectClause = SelectClause.substring(0,254); +} +set_Value ("SelectClause", SelectClause); +} +/** Get Sql SELECT. +@return SQL SELECT clause */ +public String getSelectClause() +{ +return (String)get_Value("SelectClause"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_InfoWindow.java b/dbPort/src/org/compiere/model/X_AD_InfoWindow.java new file mode 100644 index 0000000000..1d9c2af1cd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_InfoWindow.java @@ -0,0 +1,255 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_InfoWindow + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.031 */ +public class X_AD_InfoWindow extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_InfoWindow_ID id +@param trxName transaction +*/ +public X_AD_InfoWindow (Properties ctx, int AD_InfoWindow_ID, String trxName) +{ +super (ctx, AD_InfoWindow_ID, trxName); +/** if (AD_InfoWindow_ID == 0) +{ +setAD_InfoWindow_ID (0); +setAD_Table_ID (0); +setEntityType (null); // U +setFromClause (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_InfoWindow (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=895 */ +public static final int Table_ID=895; + +/** TableName=AD_InfoWindow */ +public static final String Table_Name="AD_InfoWindow"; + +protected static KeyNamePair Model = new KeyNamePair(895,"AD_InfoWindow"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_InfoWindow[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Info Window. +@param AD_InfoWindow_ID Info and search/select Window */ +public void setAD_InfoWindow_ID (int AD_InfoWindow_ID) +{ +if (AD_InfoWindow_ID < 1) throw new IllegalArgumentException ("AD_InfoWindow_ID is mandatory."); +set_ValueNoCheck ("AD_InfoWindow_ID", new Integer(AD_InfoWindow_ID)); +} +/** Get Info Window. +@return Info and search/select Window */ +public int getAD_InfoWindow_ID() +{ +Integer ii = (Integer)get_Value("AD_InfoWindow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Sql FROM. +@param FromClause SQL FROM clause */ +public void setFromClause (String FromClause) +{ +if (FromClause == null) throw new IllegalArgumentException ("FromClause is mandatory."); +if (FromClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +FromClause = FromClause.substring(0,1999); +} +set_Value ("FromClause", FromClause); +} +/** Get Sql FROM. +@return SQL FROM clause */ +public String getFromClause() +{ +return (String)get_Value("FromClause"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Other SQL Clause. +@param OtherClause Other SQL Clause */ +public void setOtherClause (String OtherClause) +{ +if (OtherClause != null && OtherClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OtherClause = OtherClause.substring(0,1999); +} +set_Value ("OtherClause", OtherClause); +} +/** Get Other SQL Clause. +@return Other SQL Clause */ +public String getOtherClause() +{ +return (String)get_Value("OtherClause"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Issue.java b/dbPort/src/org/compiere/model/X_AD_Issue.java new file mode 100644 index 0000000000..085d3f4156 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Issue.java @@ -0,0 +1,859 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Issue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.031 */ +public class X_AD_Issue extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Issue_ID id +@param trxName transaction +*/ +public X_AD_Issue (Properties ctx, int AD_Issue_ID, String trxName) +{ +super (ctx, AD_Issue_ID, trxName); +/** if (AD_Issue_ID == 0) +{ +setAD_Issue_ID (0); +setIssueSummary (null); +setName (null); // . +setProcessed (false); // N +setReleaseNo (null); // . +setSystemStatus (null); // E +setUserName (null); // . +setVersion (null); // . +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Issue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=828 */ +public static final int Table_ID=828; + +/** TableName=AD_Issue */ +public static final String Table_Name="AD_Issue"; + +protected static KeyNamePair Model = new KeyNamePair(828,"AD_Issue"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Issue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Special Form. +@param AD_Form_ID Special Form */ +public void setAD_Form_ID (int AD_Form_ID) +{ +if (AD_Form_ID <= 0) set_Value ("AD_Form_ID", null); + else +set_Value ("AD_Form_ID", new Integer(AD_Form_ID)); +} +/** Get Special Form. +@return Special Form */ +public int getAD_Form_ID() +{ +Integer ii = (Integer)get_Value("AD_Form_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set System Issue. +@param AD_Issue_ID Automatically created or manually entered System Issue */ +public void setAD_Issue_ID (int AD_Issue_ID) +{ +if (AD_Issue_ID < 1) throw new IllegalArgumentException ("AD_Issue_ID is mandatory."); +set_ValueNoCheck ("AD_Issue_ID", new Integer(AD_Issue_ID)); +} +/** Get System Issue. +@return Automatically created or manually entered System Issue */ +public int getAD_Issue_ID() +{ +Integer ii = (Integer)get_Value("AD_Issue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID <= 0) set_Value ("AD_Window_ID", null); + else +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_ValueNoCheck ("A_Asset_ID", null); + else +set_ValueNoCheck ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comments. +@param Comments Comments or additional information */ +public void setComments (String Comments) +{ +if (Comments != null && Comments.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Comments = Comments.substring(0,1999); +} +set_Value ("Comments", Comments); +} +/** Get Comments. +@return Comments or additional information */ +public String getComments() +{ +return (String)get_Value("Comments"); +} +/** Set DB Address. +@param DBAddress JDBC URL of the database server */ +public void setDBAddress (String DBAddress) +{ +if (DBAddress != null && DBAddress.length() > 255) +{ +log.warning("Length > 255 - truncated"); +DBAddress = DBAddress.substring(0,254); +} +set_ValueNoCheck ("DBAddress", DBAddress); +} +/** Get DB Address. +@return JDBC URL of the database server */ +public String getDBAddress() +{ +return (String)get_Value("DBAddress"); +} +/** Set Database. +@param DatabaseInfo Database Information */ +public void setDatabaseInfo (String DatabaseInfo) +{ +if (DatabaseInfo != null && DatabaseInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +DatabaseInfo = DatabaseInfo.substring(0,254); +} +set_ValueNoCheck ("DatabaseInfo", DatabaseInfo); +} +/** Get Database. +@return Database Information */ +public String getDatabaseInfo() +{ +return (String)get_Value("DatabaseInfo"); +} +/** Set Error Trace. +@param ErrorTrace System Error Trace */ +public void setErrorTrace (String ErrorTrace) +{ +if (ErrorTrace != null && ErrorTrace.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ErrorTrace = ErrorTrace.substring(0,1999); +} +set_Value ("ErrorTrace", ErrorTrace); +} +/** Get Error Trace. +@return System Error Trace */ +public String getErrorTrace() +{ +return (String)get_Value("ErrorTrace"); +} + +/** IsReproducible AD_Reference_ID=319 */ +public static final int ISREPRODUCIBLE_AD_Reference_ID=319; +/** No = N */ +public static final String ISREPRODUCIBLE_No = "N"; +/** Yes = Y */ +public static final String ISREPRODUCIBLE_Yes = "Y"; +/** Set Reproducible. +@param IsReproducible Problem can re reproduced in Gardenworld */ +public void setIsReproducible (String IsReproducible) +{ +if (IsReproducible == null) throw new IllegalArgumentException ("IsReproducible is mandatory"); +if (IsReproducible == null || IsReproducible.equals("N") || IsReproducible.equals("Y")); + else throw new IllegalArgumentException ("IsReproducible Invalid value - " + IsReproducible + " - Reference_ID=319 - N - Y"); +if (IsReproducible != null && IsReproducible.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsReproducible = IsReproducible.substring(0,0); +} +set_Value ("IsReproducible", IsReproducible); +} +/** Get Reproducible. +@return Problem can re reproduced in Gardenworld */ +public String getIsReproducible() +{ +return (String)get_Value("IsReproducible"); +} + +/** IsVanillaSystem AD_Reference_ID=319 */ +public static final int ISVANILLASYSTEM_AD_Reference_ID=319; +/** No = N */ +public static final String ISVANILLASYSTEM_No = "N"; +/** Yes = Y */ +public static final String ISVANILLASYSTEM_Yes = "Y"; +/** Set Vanilla System. +@param IsVanillaSystem The system was NOT compiled from Source - i.e. standard distribution */ +public void setIsVanillaSystem (String IsVanillaSystem) +{ +if (IsVanillaSystem == null) throw new IllegalArgumentException ("IsVanillaSystem is mandatory"); +if (IsVanillaSystem == null || IsVanillaSystem.equals("N") || IsVanillaSystem.equals("Y")); + else throw new IllegalArgumentException ("IsVanillaSystem Invalid value - " + IsVanillaSystem + " - Reference_ID=319 - N - Y"); +if (IsVanillaSystem != null && IsVanillaSystem.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsVanillaSystem = IsVanillaSystem.substring(0,0); +} +set_Value ("IsVanillaSystem", IsVanillaSystem); +} +/** Get Vanilla System. +@return The system was NOT compiled from Source - i.e. standard distribution */ +public String getIsVanillaSystem() +{ +return (String)get_Value("IsVanillaSystem"); +} + +/** IssueSource AD_Reference_ID=104 */ +public static final int ISSUESOURCE_AD_Reference_ID=104; +/** Workbench = B */ +public static final String ISSUESOURCE_Workbench = "B"; +/** WorkFlow = F */ +public static final String ISSUESOURCE_WorkFlow = "F"; +/** Process = P */ +public static final String ISSUESOURCE_Process = "P"; +/** Report = R */ +public static final String ISSUESOURCE_Report = "R"; +/** Task = T */ +public static final String ISSUESOURCE_Task = "T"; +/** Window = W */ +public static final String ISSUESOURCE_Window = "W"; +/** Form = X */ +public static final String ISSUESOURCE_Form = "X"; +/** Set Source. +@param IssueSource Issue Source */ +public void setIssueSource (String IssueSource) +{ +if (IssueSource == null) throw new IllegalArgumentException ("IssueSource is mandatory"); +if (IssueSource == null || IssueSource.equals("B") || IssueSource.equals("F") || IssueSource.equals("P") || IssueSource.equals("R") || IssueSource.equals("T") || IssueSource.equals("W") || IssueSource.equals("X")); + else throw new IllegalArgumentException ("IssueSource Invalid value - " + IssueSource + " - Reference_ID=104 - B - F - P - R - T - W - X"); +if (IssueSource != null && IssueSource.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IssueSource = IssueSource.substring(0,0); +} +set_Value ("IssueSource", IssueSource); +} +/** Get Source. +@return Issue Source */ +public String getIssueSource() +{ +return (String)get_Value("IssueSource"); +} +/** Set Issue Summary. +@param IssueSummary Issue Summary */ +public void setIssueSummary (String IssueSummary) +{ +if (IssueSummary == null) throw new IllegalArgumentException ("IssueSummary is mandatory."); +if (IssueSummary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +IssueSummary = IssueSummary.substring(0,1999); +} +set_Value ("IssueSummary", IssueSummary); +} +/** Get Issue Summary. +@return Issue Summary */ +public String getIssueSummary() +{ +return (String)get_Value("IssueSummary"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getIssueSummary()); +} +/** Set Java Info. +@param JavaInfo Java Version Info */ +public void setJavaInfo (String JavaInfo) +{ +if (JavaInfo != null && JavaInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +JavaInfo = JavaInfo.substring(0,254); +} +set_ValueNoCheck ("JavaInfo", JavaInfo); +} +/** Get Java Info. +@return Java Version Info */ +public String getJavaInfo() +{ +return (String)get_Value("JavaInfo"); +} +/** Set Line. +@param LineNo Line No */ +public void setLineNo (int LineNo) +{ +set_Value ("LineNo", new Integer(LineNo)); +} +/** Get Line. +@return Line No */ +public int getLineNo() +{ +Integer ii = (Integer)get_Value("LineNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Local Host. +@param Local_Host Local Host Info */ +public void setLocal_Host (String Local_Host) +{ +if (Local_Host != null && Local_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Local_Host = Local_Host.substring(0,119); +} +set_ValueNoCheck ("Local_Host", Local_Host); +} +/** Get Local Host. +@return Local Host Info */ +public String getLocal_Host() +{ +return (String)get_Value("Local_Host"); +} +/** Set Logger. +@param LoggerName Logger Name */ +public void setLoggerName (String LoggerName) +{ +if (LoggerName != null && LoggerName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +LoggerName = LoggerName.substring(0,59); +} +set_Value ("LoggerName", LoggerName); +} +/** Get Logger. +@return Logger Name */ +public String getLoggerName() +{ +return (String)get_Value("LoggerName"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_ValueNoCheck ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Operating System. +@param OperatingSystemInfo Operating System Info */ +public void setOperatingSystemInfo (String OperatingSystemInfo) +{ +if (OperatingSystemInfo != null && OperatingSystemInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +OperatingSystemInfo = OperatingSystemInfo.substring(0,254); +} +set_ValueNoCheck ("OperatingSystemInfo", OperatingSystemInfo); +} +/** Get Operating System. +@return Operating System Info */ +public String getOperatingSystemInfo() +{ +return (String)get_Value("OperatingSystemInfo"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Profile. +@param ProfileInfo Information to help profiling the system for solving support issues */ +public void setProfileInfo (String ProfileInfo) +{ +if (ProfileInfo != null && ProfileInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ProfileInfo = ProfileInfo.substring(0,254); +} +set_ValueNoCheck ("ProfileInfo", ProfileInfo); +} +/** Get Profile. +@return Information to help profiling the system for solving support issues */ +public String getProfileInfo() +{ +return (String)get_Value("ProfileInfo"); +} +/** Set Known Issue. +@param R_IssueKnown_ID Known Issue */ +public void setR_IssueKnown_ID (int R_IssueKnown_ID) +{ +if (R_IssueKnown_ID <= 0) set_Value ("R_IssueKnown_ID", null); + else +set_Value ("R_IssueKnown_ID", new Integer(R_IssueKnown_ID)); +} +/** Get Known Issue. +@return Known Issue */ +public int getR_IssueKnown_ID() +{ +Integer ii = (Integer)get_Value("R_IssueKnown_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Issue Project. +@param R_IssueProject_ID Implementation Projects */ +public void setR_IssueProject_ID (int R_IssueProject_ID) +{ +if (R_IssueProject_ID <= 0) set_Value ("R_IssueProject_ID", null); + else +set_Value ("R_IssueProject_ID", new Integer(R_IssueProject_ID)); +} +/** Get Issue Project. +@return Implementation Projects */ +public int getR_IssueProject_ID() +{ +Integer ii = (Integer)get_Value("R_IssueProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Issue System. +@param R_IssueSystem_ID System creating the issue */ +public void setR_IssueSystem_ID (int R_IssueSystem_ID) +{ +if (R_IssueSystem_ID <= 0) set_Value ("R_IssueSystem_ID", null); + else +set_Value ("R_IssueSystem_ID", new Integer(R_IssueSystem_ID)); +} +/** Get Issue System. +@return System creating the issue */ +public int getR_IssueSystem_ID() +{ +Integer ii = (Integer)get_Value("R_IssueSystem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set IssueUser. +@param R_IssueUser_ID User who reported issues */ +public void setR_IssueUser_ID (int R_IssueUser_ID) +{ +if (R_IssueUser_ID <= 0) set_Value ("R_IssueUser_ID", null); + else +set_Value ("R_IssueUser_ID", new Integer(R_IssueUser_ID)); +} +/** Get IssueUser. +@return User who reported issues */ +public int getR_IssueUser_ID() +{ +Integer ii = (Integer)get_Value("R_IssueUser_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request. +@param R_Request_ID Request from a Business Partner or Prospect */ +public void setR_Request_ID (int R_Request_ID) +{ +if (R_Request_ID <= 0) set_ValueNoCheck ("R_Request_ID", null); + else +set_ValueNoCheck ("R_Request_ID", new Integer(R_Request_ID)); +} +/** Get Request. +@return Request from a Business Partner or Prospect */ +public int getR_Request_ID() +{ +Integer ii = (Integer)get_Value("R_Request_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_ValueNoCheck ("Record_ID", null); + else +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Release No. +@param ReleaseNo Internal Release Number */ +public void setReleaseNo (String ReleaseNo) +{ +if (ReleaseNo == null) throw new IllegalArgumentException ("ReleaseNo is mandatory."); +if (ReleaseNo.length() > 4) +{ +log.warning("Length > 4 - truncated"); +ReleaseNo = ReleaseNo.substring(0,3); +} +set_ValueNoCheck ("ReleaseNo", ReleaseNo); +} +/** Get Release No. +@return Internal Release Number */ +public String getReleaseNo() +{ +return (String)get_Value("ReleaseNo"); +} +/** Set Release Tag. +@param ReleaseTag Release Tag */ +public void setReleaseTag (String ReleaseTag) +{ +if (ReleaseTag != null && ReleaseTag.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ReleaseTag = ReleaseTag.substring(0,59); +} +set_Value ("ReleaseTag", ReleaseTag); +} +/** Get Release Tag. +@return Release Tag */ +public String getReleaseTag() +{ +return (String)get_Value("ReleaseTag"); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_ValueNoCheck ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_ValueNoCheck ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Request Document No. +@param RequestDocumentNo Adempiere Request Document No */ +public void setRequestDocumentNo (String RequestDocumentNo) +{ +if (RequestDocumentNo != null && RequestDocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +RequestDocumentNo = RequestDocumentNo.substring(0,29); +} +set_ValueNoCheck ("RequestDocumentNo", RequestDocumentNo); +} +/** Get Request Document No. +@return Adempiere Request Document No */ +public String getRequestDocumentNo() +{ +return (String)get_Value("RequestDocumentNo"); +} +/** Set Response Text. +@param ResponseText Request Response Text */ +public void setResponseText (String ResponseText) +{ +if (ResponseText != null && ResponseText.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ResponseText = ResponseText.substring(0,1999); +} +set_ValueNoCheck ("ResponseText", ResponseText); +} +/** Get Response Text. +@return Request Response Text */ +public String getResponseText() +{ +return (String)get_Value("ResponseText"); +} +/** Set Source Class. +@param SourceClassName Source Class Name */ +public void setSourceClassName (String SourceClassName) +{ +if (SourceClassName != null && SourceClassName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SourceClassName = SourceClassName.substring(0,59); +} +set_Value ("SourceClassName", SourceClassName); +} +/** Get Source Class. +@return Source Class Name */ +public String getSourceClassName() +{ +return (String)get_Value("SourceClassName"); +} +/** Set Source Method. +@param SourceMethodName Source Method Name */ +public void setSourceMethodName (String SourceMethodName) +{ +if (SourceMethodName != null && SourceMethodName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SourceMethodName = SourceMethodName.substring(0,59); +} +set_Value ("SourceMethodName", SourceMethodName); +} +/** Get Source Method. +@return Source Method Name */ +public String getSourceMethodName() +{ +return (String)get_Value("SourceMethodName"); +} +/** Set Stack Trace. +@param StackTrace System Log Trace */ +public void setStackTrace (String StackTrace) +{ +if (StackTrace != null && StackTrace.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +StackTrace = StackTrace.substring(0,1999); +} +set_Value ("StackTrace", StackTrace); +} +/** Get Stack Trace. +@return System Log Trace */ +public String getStackTrace() +{ +return (String)get_Value("StackTrace"); +} +/** Set Statistics. +@param StatisticsInfo Information to help profiling the system for solving support issues */ +public void setStatisticsInfo (String StatisticsInfo) +{ +if (StatisticsInfo != null && StatisticsInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +StatisticsInfo = StatisticsInfo.substring(0,254); +} +set_ValueNoCheck ("StatisticsInfo", StatisticsInfo); +} +/** Get Statistics. +@return Information to help profiling the system for solving support issues */ +public String getStatisticsInfo() +{ +return (String)get_Value("StatisticsInfo"); +} +/** Set Support EMail. +@param SupportEMail EMail address to send support information and updates to */ +public void setSupportEMail (String SupportEMail) +{ +if (SupportEMail != null && SupportEMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SupportEMail = SupportEMail.substring(0,59); +} +set_Value ("SupportEMail", SupportEMail); +} +/** Get Support EMail. +@return EMail address to send support information and updates to */ +public String getSupportEMail() +{ +return (String)get_Value("SupportEMail"); +} + +/** SystemStatus AD_Reference_ID=374 */ +public static final int SYSTEMSTATUS_AD_Reference_ID=374; +/** Evaluation = E */ +public static final String SYSTEMSTATUS_Evaluation = "E"; +/** Implementation = I */ +public static final String SYSTEMSTATUS_Implementation = "I"; +/** Production = P */ +public static final String SYSTEMSTATUS_Production = "P"; +/** Set System Status. +@param SystemStatus Status of the system - Support priority depends on system status */ +public void setSystemStatus (String SystemStatus) +{ +if (SystemStatus == null) throw new IllegalArgumentException ("SystemStatus is mandatory"); +if (SystemStatus.equals("E") || SystemStatus.equals("I") || SystemStatus.equals("P")); + else throw new IllegalArgumentException ("SystemStatus Invalid value - " + SystemStatus + " - Reference_ID=374 - E - I - P"); +if (SystemStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SystemStatus = SystemStatus.substring(0,0); +} +set_Value ("SystemStatus", SystemStatus); +} +/** Get System Status. +@return Status of the system - Support priority depends on system status */ +public String getSystemStatus() +{ +return (String)get_Value("SystemStatus"); +} +/** Set Registered EMail. +@param UserName Email of the responsible for the System */ +public void setUserName (String UserName) +{ +if (UserName == null) throw new IllegalArgumentException ("UserName is mandatory."); +if (UserName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +UserName = UserName.substring(0,59); +} +set_ValueNoCheck ("UserName", UserName); +} +/** Get Registered EMail. +@return Email of the responsible for the System */ +public String getUserName() +{ +return (String)get_Value("UserName"); +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (String Version) +{ +if (Version == null) throw new IllegalArgumentException ("Version is mandatory."); +if (Version.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Version = Version.substring(0,39); +} +set_ValueNoCheck ("Version", Version); +} +/** Get Version. +@return Version of the table definition */ +public String getVersion() +{ +return (String)get_Value("Version"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_LabelPrinter.java b/dbPort/src/org/compiere/model/X_AD_LabelPrinter.java new file mode 100644 index 0000000000..3bca91972f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_LabelPrinter.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_LabelPrinter + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.093 */ +public class X_AD_LabelPrinter extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_LabelPrinter_ID id +@param trxName transaction +*/ +public X_AD_LabelPrinter (Properties ctx, int AD_LabelPrinter_ID, String trxName) +{ +super (ctx, AD_LabelPrinter_ID, trxName); +/** if (AD_LabelPrinter_ID == 0) +{ +setAD_LabelPrinter_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_LabelPrinter (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=626 */ +public static final int Table_ID=626; + +/** TableName=AD_LabelPrinter */ +public static final String Table_Name="AD_LabelPrinter"; + +protected static KeyNamePair Model = new KeyNamePair(626,"AD_LabelPrinter"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_LabelPrinter[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Label printer. +@param AD_LabelPrinter_ID Label Printer Definition */ +public void setAD_LabelPrinter_ID (int AD_LabelPrinter_ID) +{ +if (AD_LabelPrinter_ID < 1) throw new IllegalArgumentException ("AD_LabelPrinter_ID is mandatory."); +set_ValueNoCheck ("AD_LabelPrinter_ID", new Integer(AD_LabelPrinter_ID)); +} +/** Get Label printer. +@return Label Printer Definition */ +public int getAD_LabelPrinter_ID() +{ +Integer ii = (Integer)get_Value("AD_LabelPrinter_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_LabelPrinterFunction.java b/dbPort/src/org/compiere/model/X_AD_LabelPrinterFunction.java new file mode 100644 index 0000000000..f4ab5c24d6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_LabelPrinterFunction.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_LabelPrinterFunction + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.109 */ +public class X_AD_LabelPrinterFunction extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_LabelPrinterFunction_ID id +@param trxName transaction +*/ +public X_AD_LabelPrinterFunction (Properties ctx, int AD_LabelPrinterFunction_ID, String trxName) +{ +super (ctx, AD_LabelPrinterFunction_ID, trxName); +/** if (AD_LabelPrinterFunction_ID == 0) +{ +setAD_LabelPrinterFunction_ID (0); +setAD_LabelPrinter_ID (0); +setIsXYPosition (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_LabelPrinterFunction (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=624 */ +public static final int Table_ID=624; + +/** TableName=AD_LabelPrinterFunction */ +public static final String Table_Name="AD_LabelPrinterFunction"; + +protected static KeyNamePair Model = new KeyNamePair(624,"AD_LabelPrinterFunction"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_LabelPrinterFunction[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Label printer Function. +@param AD_LabelPrinterFunction_ID Function of Label Printer */ +public void setAD_LabelPrinterFunction_ID (int AD_LabelPrinterFunction_ID) +{ +if (AD_LabelPrinterFunction_ID < 1) throw new IllegalArgumentException ("AD_LabelPrinterFunction_ID is mandatory."); +set_ValueNoCheck ("AD_LabelPrinterFunction_ID", new Integer(AD_LabelPrinterFunction_ID)); +} +/** Get Label printer Function. +@return Function of Label Printer */ +public int getAD_LabelPrinterFunction_ID() +{ +Integer ii = (Integer)get_Value("AD_LabelPrinterFunction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Label printer. +@param AD_LabelPrinter_ID Label Printer Definition */ +public void setAD_LabelPrinter_ID (int AD_LabelPrinter_ID) +{ +if (AD_LabelPrinter_ID < 1) throw new IllegalArgumentException ("AD_LabelPrinter_ID is mandatory."); +set_ValueNoCheck ("AD_LabelPrinter_ID", new Integer(AD_LabelPrinter_ID)); +} +/** Get Label printer. +@return Label Printer Definition */ +public int getAD_LabelPrinter_ID() +{ +Integer ii = (Integer)get_Value("AD_LabelPrinter_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Function Prefix. +@param FunctionPrefix Data sent before the function */ +public void setFunctionPrefix (String FunctionPrefix) +{ +if (FunctionPrefix != null && FunctionPrefix.length() > 40) +{ +log.warning("Length > 40 - truncated"); +FunctionPrefix = FunctionPrefix.substring(0,39); +} +set_Value ("FunctionPrefix", FunctionPrefix); +} +/** Get Function Prefix. +@return Data sent before the function */ +public String getFunctionPrefix() +{ +return (String)get_Value("FunctionPrefix"); +} +/** Set Function Suffix. +@param FunctionSuffix Data sent after the function */ +public void setFunctionSuffix (String FunctionSuffix) +{ +if (FunctionSuffix != null && FunctionSuffix.length() > 40) +{ +log.warning("Length > 40 - truncated"); +FunctionSuffix = FunctionSuffix.substring(0,39); +} +set_Value ("FunctionSuffix", FunctionSuffix); +} +/** Get Function Suffix. +@return Data sent after the function */ +public String getFunctionSuffix() +{ +return (String)get_Value("FunctionSuffix"); +} +/** Set XY Position. +@param IsXYPosition The Function is XY position */ +public void setIsXYPosition (boolean IsXYPosition) +{ +set_Value ("IsXYPosition", new Boolean(IsXYPosition)); +} +/** Get XY Position. +@return The Function is XY position */ +public boolean isXYPosition() +{ +Object oo = get_Value("IsXYPosition"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set XY Separator. +@param XYSeparator The separator between the X and Y function. */ +public void setXYSeparator (String XYSeparator) +{ +if (XYSeparator != null && XYSeparator.length() > 20) +{ +log.warning("Length > 20 - truncated"); +XYSeparator = XYSeparator.substring(0,19); +} +set_Value ("XYSeparator", XYSeparator); +} +/** Get XY Separator. +@return The separator between the X and Y function. */ +public String getXYSeparator() +{ +return (String)get_Value("XYSeparator"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Language.java b/dbPort/src/org/compiere/model/X_AD_Language.java new file mode 100644 index 0000000000..ab3da1bdb1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Language.java @@ -0,0 +1,290 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Language + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.125 */ +public class X_AD_Language extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Language_ID id +@param trxName transaction +*/ +public X_AD_Language (Properties ctx, int AD_Language_ID, String trxName) +{ +super (ctx, AD_Language_ID, trxName); +/** if (AD_Language_ID == 0) +{ +setAD_Language (null); +setAD_Language_ID (0); // @SQL=SELECT NVL(MAX(AD_Language_ID),0)+1 AS DefaultValue FROM AD_Language +setIsBaseLanguage (false); // N +setIsDecimalPoint (false); +setIsSystemLanguage (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Language (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=111 */ +public static final int Table_ID=111; + +/** TableName=AD_Language */ +public static final String Table_Name="AD_Language"; + +protected static KeyNamePair Model = new KeyNamePair(111,"AD_Language"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Language[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language == null) throw new IllegalArgumentException ("AD_Language is mandatory."); +if (AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_ValueNoCheck ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set Language ID. +@param AD_Language_ID Language ID */ +public void setAD_Language_ID (int AD_Language_ID) +{ +if (AD_Language_ID < 1) throw new IllegalArgumentException ("AD_Language_ID is mandatory."); +set_ValueNoCheck ("AD_Language_ID", new Integer(AD_Language_ID)); +} +/** Get Language ID. +@return Language ID */ +public int getAD_Language_ID() +{ +Integer ii = (Integer)get_Value("AD_Language_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set ISO Country Code. +@param CountryCode Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public void setCountryCode (String CountryCode) +{ +if (CountryCode != null && CountryCode.length() > 2) +{ +log.warning("Length > 2 - truncated"); +CountryCode = CountryCode.substring(0,1); +} +set_Value ("CountryCode", CountryCode); +} +/** Get ISO Country Code. +@return Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public String getCountryCode() +{ +return (String)get_Value("CountryCode"); +} +/** Set Date Pattern. +@param DatePattern Java Date Pattern */ +public void setDatePattern (String DatePattern) +{ +if (DatePattern != null && DatePattern.length() > 20) +{ +log.warning("Length > 20 - truncated"); +DatePattern = DatePattern.substring(0,19); +} +set_Value ("DatePattern", DatePattern); +} +/** Get Date Pattern. +@return Java Date Pattern */ +public String getDatePattern() +{ +return (String)get_Value("DatePattern"); +} +/** Set Base Language. +@param IsBaseLanguage The system information is maintained in this language */ +public void setIsBaseLanguage (boolean IsBaseLanguage) +{ +set_ValueNoCheck ("IsBaseLanguage", new Boolean(IsBaseLanguage)); +} +/** Get Base Language. +@return The system information is maintained in this language */ +public boolean isBaseLanguage() +{ +Object oo = get_Value("IsBaseLanguage"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Decimal Point. +@param IsDecimalPoint The number notation has a decimal point (no decimal comma) */ +public void setIsDecimalPoint (boolean IsDecimalPoint) +{ +set_Value ("IsDecimalPoint", new Boolean(IsDecimalPoint)); +} +/** Get Decimal Point. +@return The number notation has a decimal point (no decimal comma) */ +public boolean isDecimalPoint() +{ +Object oo = get_Value("IsDecimalPoint"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set System Language. +@param IsSystemLanguage The screens, etc. are maintained in this Language */ +public void setIsSystemLanguage (boolean IsSystemLanguage) +{ +set_Value ("IsSystemLanguage", new Boolean(IsSystemLanguage)); +} +/** Get System Language. +@return The screens, etc. are maintained in this Language */ +public boolean isSystemLanguage() +{ +Object oo = get_Value("IsSystemLanguage"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set ISO Language Code. +@param LanguageISO Lower-case two-letter ISO-3166 code - http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt */ +public void setLanguageISO (String LanguageISO) +{ +if (LanguageISO != null && LanguageISO.length() > 2) +{ +log.warning("Length > 2 - truncated"); +LanguageISO = LanguageISO.substring(0,1); +} +set_Value ("LanguageISO", LanguageISO); +} +/** Get ISO Language Code. +@return Lower-case two-letter ISO-3166 code - http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt */ +public String getLanguageISO() +{ +return (String)get_Value("LanguageISO"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Time Pattern. +@param TimePattern Java Time Pattern */ +public void setTimePattern (String TimePattern) +{ +if (TimePattern != null && TimePattern.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TimePattern = TimePattern.substring(0,19); +} +set_Value ("TimePattern", TimePattern); +} +/** Get Time Pattern. +@return Java Time Pattern */ +public String getTimePattern() +{ +return (String)get_Value("TimePattern"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Menu.java b/dbPort/src/org/compiere/model/X_AD_Menu.java new file mode 100644 index 0000000000..e89eb0e9c9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Menu.java @@ -0,0 +1,358 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Menu + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.156 */ +public class X_AD_Menu extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Menu_ID id +@param trxName transaction +*/ +public X_AD_Menu (Properties ctx, int AD_Menu_ID, String trxName) +{ +super (ctx, AD_Menu_ID, trxName); +/** if (AD_Menu_ID == 0) +{ +setAD_Menu_ID (0); +setEntityType (null); // U +setIsReadOnly (false); // N +setIsSOTrx (false); +setIsSummary (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Menu (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=116 */ +public static final int Table_ID=116; + +/** TableName=AD_Menu */ +public static final String Table_Name="AD_Menu"; + +protected static KeyNamePair Model = new KeyNamePair(116,"AD_Menu"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Menu[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Special Form. +@param AD_Form_ID Special Form */ +public void setAD_Form_ID (int AD_Form_ID) +{ +if (AD_Form_ID <= 0) set_Value ("AD_Form_ID", null); + else +set_Value ("AD_Form_ID", new Integer(AD_Form_ID)); +} +/** Get Special Form. +@return Special Form */ +public int getAD_Form_ID() +{ +Integer ii = (Integer)get_Value("AD_Form_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Menu. +@param AD_Menu_ID Identifies a Menu */ +public void setAD_Menu_ID (int AD_Menu_ID) +{ +if (AD_Menu_ID < 1) throw new IllegalArgumentException ("AD_Menu_ID is mandatory."); +set_ValueNoCheck ("AD_Menu_ID", new Integer(AD_Menu_ID)); +} +/** Get Menu. +@return Identifies a Menu */ +public int getAD_Menu_ID() +{ +Integer ii = (Integer)get_Value("AD_Menu_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set OS Task. +@param AD_Task_ID Operation System Task */ +public void setAD_Task_ID (int AD_Task_ID) +{ +if (AD_Task_ID <= 0) set_Value ("AD_Task_ID", null); + else +set_Value ("AD_Task_ID", new Integer(AD_Task_ID)); +} +/** Get OS Task. +@return Operation System Task */ +public int getAD_Task_ID() +{ +Integer ii = (Integer)get_Value("AD_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID <= 0) set_Value ("AD_Window_ID", null); + else +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workbench. +@param AD_Workbench_ID Collection of windows, reports */ +public void setAD_Workbench_ID (int AD_Workbench_ID) +{ +if (AD_Workbench_ID <= 0) set_Value ("AD_Workbench_ID", null); + else +set_Value ("AD_Workbench_ID", new Integer(AD_Workbench_ID)); +} +/** Get Workbench. +@return Collection of windows, reports */ +public int getAD_Workbench_ID() +{ +Integer ii = (Integer)get_Value("AD_Workbench_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID <= 0) set_Value ("AD_Workflow_ID", null); + else +set_Value ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Action AD_Reference_ID=104 */ +public static final int ACTION_AD_Reference_ID=104; +/** Workbench = B */ +public static final String ACTION_Workbench = "B"; +/** WorkFlow = F */ +public static final String ACTION_WorkFlow = "F"; +/** Process = P */ +public static final String ACTION_Process = "P"; +/** Report = R */ +public static final String ACTION_Report = "R"; +/** Task = T */ +public static final String ACTION_Task = "T"; +/** Window = W */ +public static final String ACTION_Window = "W"; +/** Form = X */ +public static final String ACTION_Form = "X"; +/** Set Action. +@param Action Indicates the Action to be performed */ +public void setAction (String Action) +{ +if (Action == null) throw new IllegalArgumentException ("Action is mandatory"); +if (Action == null || Action.equals("B") || Action.equals("F") || Action.equals("P") || Action.equals("R") || Action.equals("T") || Action.equals("W") || Action.equals("X")); + else throw new IllegalArgumentException ("Action Invalid value - " + Action + " - Reference_ID=104 - B - F - P - R - T - W - X"); +if (Action != null && Action.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Action = Action.substring(0,0); +} +set_Value ("Action", Action); +} +/** Get Action. +@return Indicates the Action to be performed */ +public String getAction() +{ +return (String)get_Value("Action"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Message.java b/dbPort/src/org/compiere/model/X_AD_Message.java new file mode 100644 index 0000000000..e9ea02d144 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Message.java @@ -0,0 +1,217 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Message + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.171 */ +public class X_AD_Message extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Message_ID id +@param trxName transaction +*/ +public X_AD_Message (Properties ctx, int AD_Message_ID, String trxName) +{ +super (ctx, AD_Message_ID, trxName); +/** if (AD_Message_ID == 0) +{ +setAD_Message_ID (0); +setEntityType (null); // U +setMsgText (null); +setMsgType (null); // I +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Message (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=109 */ +public static final int Table_ID=109; + +/** TableName=AD_Message */ +public static final String Table_Name="AD_Message"; + +protected static KeyNamePair Model = new KeyNamePair(109,"AD_Message"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Message[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Message. +@param AD_Message_ID System Message */ +public void setAD_Message_ID (int AD_Message_ID) +{ +if (AD_Message_ID < 1) throw new IllegalArgumentException ("AD_Message_ID is mandatory."); +set_ValueNoCheck ("AD_Message_ID", new Integer(AD_Message_ID)); +} +/** Get Message. +@return System Message */ +public int getAD_Message_ID() +{ +Integer ii = (Integer)get_Value("AD_Message_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Message Text. +@param MsgText Textual Informational, Menu or Error Message */ +public void setMsgText (String MsgText) +{ +if (MsgText == null) throw new IllegalArgumentException ("MsgText is mandatory."); +if (MsgText.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MsgText = MsgText.substring(0,1999); +} +set_Value ("MsgText", MsgText); +} +/** Get Message Text. +@return Textual Informational, Menu or Error Message */ +public String getMsgText() +{ +return (String)get_Value("MsgText"); +} +/** Set Message Tip. +@param MsgTip Additional tip or help for this message */ +public void setMsgTip (String MsgTip) +{ +if (MsgTip != null && MsgTip.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MsgTip = MsgTip.substring(0,1999); +} +set_Value ("MsgTip", MsgTip); +} +/** Get Message Tip. +@return Additional tip or help for this message */ +public String getMsgTip() +{ +return (String)get_Value("MsgTip"); +} + +/** MsgType AD_Reference_ID=103 */ +public static final int MSGTYPE_AD_Reference_ID=103; +/** Error = E */ +public static final String MSGTYPE_Error = "E"; +/** Information = I */ +public static final String MSGTYPE_Information = "I"; +/** Menu = M */ +public static final String MSGTYPE_Menu = "M"; +/** Set Message Type. +@param MsgType Type of message (Informational, Menu or Error) */ +public void setMsgType (String MsgType) +{ +if (MsgType == null) throw new IllegalArgumentException ("MsgType is mandatory"); +if (MsgType.equals("E") || MsgType.equals("I") || MsgType.equals("M")); + else throw new IllegalArgumentException ("MsgType Invalid value - " + MsgType + " - Reference_ID=103 - E - I - M"); +if (MsgType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MsgType = MsgType.substring(0,0); +} +set_Value ("MsgType", MsgType); +} +/** Get Message Type. +@return Type of message (Informational, Menu or Error) */ +public String getMsgType() +{ +return (String)get_Value("MsgType"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Modification.java b/dbPort/src/org/compiere/model/X_AD_Modification.java new file mode 100644 index 0000000000..16fcacafe7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Modification.java @@ -0,0 +1,219 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Modification + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.187 */ +public class X_AD_Modification extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Modification_ID id +@param trxName transaction +*/ +public X_AD_Modification (Properties ctx, int AD_Modification_ID, String trxName) +{ +super (ctx, AD_Modification_ID, trxName); +/** if (AD_Modification_ID == 0) +{ +setAD_Modification_ID (0); +setEntityType (null); +setName (null); +setSeqNo (0); // @SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_Modification WHERE EntityType='@EntityType@' +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Modification (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=883 */ +public static final int Table_ID=883; + +/** TableName=AD_Modification */ +public static final String Table_Name="AD_Modification"; + +protected static KeyNamePair Model = new KeyNamePair(883,"AD_Modification"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Modification[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Modification. +@param AD_Modification_ID System Modification or Extension */ +public void setAD_Modification_ID (int AD_Modification_ID) +{ +if (AD_Modification_ID < 1) throw new IllegalArgumentException ("AD_Modification_ID is mandatory."); +set_ValueNoCheck ("AD_Modification_ID", new Integer(AD_Modification_ID)); +} +/** Get Modification. +@return System Modification or Extension */ +public int getAD_Modification_ID() +{ +Integer ii = (Integer)get_Value("AD_Modification_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_ValueNoCheck ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (String Version) +{ +if (Version != null && Version.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Version = Version.substring(0,19); +} +set_Value ("Version", Version); +} +/** Get Version. +@return Version of the table definition */ +public String getVersion() +{ +return (String)get_Value("Version"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Note.java b/dbPort/src/org/compiere/model/X_AD_Note.java new file mode 100644 index 0000000000..af2159d1d7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Note.java @@ -0,0 +1,279 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Note + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.203 */ +public class X_AD_Note extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Note_ID id +@param trxName transaction +*/ +public X_AD_Note (Properties ctx, int AD_Note_ID, String trxName) +{ +super (ctx, AD_Note_ID, trxName); +/** if (AD_Note_ID == 0) +{ +setAD_Message_ID (0); +setAD_Note_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Note (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=389 */ +public static final int Table_ID=389; + +/** TableName=AD_Note */ +public static final String Table_Name="AD_Note"; + +protected static KeyNamePair Model = new KeyNamePair(389,"AD_Note"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Note[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Message_ID AD_Reference_ID=102 */ +public static final int AD_MESSAGE_ID_AD_Reference_ID=102; +/** Set Message. +@param AD_Message_ID System Message */ +public void setAD_Message_ID (int AD_Message_ID) +{ +if (AD_Message_ID < 1) throw new IllegalArgumentException ("AD_Message_ID is mandatory."); +set_ValueNoCheck ("AD_Message_ID", new Integer(AD_Message_ID)); +} +/** Get Message. +@return System Message */ +public int getAD_Message_ID() +{ +Integer ii = (Integer)get_Value("AD_Message_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Message_ID())); +} +/** Set Notice. +@param AD_Note_ID System Notice */ +public void setAD_Note_ID (int AD_Note_ID) +{ +if (AD_Note_ID < 1) throw new IllegalArgumentException ("AD_Note_ID is mandatory."); +set_ValueNoCheck ("AD_Note_ID", new Integer(AD_Note_ID)); +} +/** Get Notice. +@return System Notice */ +public int getAD_Note_ID() +{ +Integer ii = (Integer)get_Value("AD_Note_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_ValueNoCheck ("AD_Table_ID", null); + else +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Activity. +@param AD_WF_Activity_ID Workflow Activity */ +public void setAD_WF_Activity_ID (int AD_WF_Activity_ID) +{ +if (AD_WF_Activity_ID <= 0) set_Value ("AD_WF_Activity_ID", null); + else +set_Value ("AD_WF_Activity_ID", new Integer(AD_WF_Activity_ID)); +} +/** Get Workflow Activity. +@return Workflow Activity */ +public int getAD_WF_Activity_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_ValueNoCheck ("Record_ID", null); + else +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Org.java b/dbPort/src/org/compiere/model/X_AD_Org.java new file mode 100644 index 0000000000..b49a3cebf0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Org.java @@ -0,0 +1,167 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Org + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.234 */ +public class X_AD_Org extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Org_ID id +@param trxName transaction +*/ +public X_AD_Org (Properties ctx, int AD_Org_ID, String trxName) +{ +super (ctx, AD_Org_ID, trxName); +/** if (AD_Org_ID == 0) +{ +setIsSummary (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Org (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=155 */ +public static final int Table_ID=155; + +/** TableName=AD_Org */ +public static final String Table_Name="AD_Org"; + +protected static KeyNamePair Model = new KeyNamePair(155,"AD_Org"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Org[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_OrgInfo.java b/dbPort/src/org/compiere/model/X_AD_OrgInfo.java new file mode 100644 index 0000000000..661ffc5208 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_OrgInfo.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_OrgInfo + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.234 */ +public class X_AD_OrgInfo extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_OrgInfo_ID id +@param trxName transaction +*/ +public X_AD_OrgInfo (Properties ctx, int AD_OrgInfo_ID, String trxName) +{ +super (ctx, AD_OrgInfo_ID, trxName); +/** if (AD_OrgInfo_ID == 0) +{ +setDUNS (null); +setTaxID (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_OrgInfo (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=228 */ +public static final int Table_ID=228; + +/** TableName=AD_OrgInfo */ +public static final String Table_Name="AD_OrgInfo"; + +protected static KeyNamePair Model = new KeyNamePair(228,"AD_OrgInfo"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_OrgInfo[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Organization Type. +@param AD_OrgType_ID Organization Type allows you to categorize your organizations */ +public void setAD_OrgType_ID (int AD_OrgType_ID) +{ +if (AD_OrgType_ID <= 0) set_Value ("AD_OrgType_ID", null); + else +set_Value ("AD_OrgType_ID", new Integer(AD_OrgType_ID)); +} +/** Get Organization Type. +@return Organization Type allows you to categorize your organizations */ +public int getAD_OrgType_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set D-U-N-S. +@param DUNS Dun & Bradstreet Number */ +public void setDUNS (String DUNS) +{ +if (DUNS == null) throw new IllegalArgumentException ("DUNS is mandatory."); +if (DUNS.length() > 11) +{ +log.warning("Length > 11 - truncated"); +DUNS = DUNS.substring(0,10); +} +set_Value ("DUNS", DUNS); +} +/** Get D-U-N-S. +@return Dun & Bradstreet Number */ +public String getDUNS() +{ +return (String)get_Value("DUNS"); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID <= 0) set_Value ("M_Warehouse_ID", null); + else +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Parent_Org_ID AD_Reference_ID=130 */ +public static final int PARENT_ORG_ID_AD_Reference_ID=130; +/** Set Parent Organization. +@param Parent_Org_ID Parent (superior) Organization */ +public void setParent_Org_ID (int Parent_Org_ID) +{ +if (Parent_Org_ID <= 0) set_Value ("Parent_Org_ID", null); + else +set_Value ("Parent_Org_ID", new Integer(Parent_Org_ID)); +} +/** Get Parent Organization. +@return Parent (superior) Organization */ +public int getParent_Org_ID() +{ +Integer ii = (Integer)get_Value("Parent_Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Supervisor_ID AD_Reference_ID=286 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=286; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID <= 0) set_Value ("Supervisor_ID", null); + else +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax ID. +@param TaxID Tax Identification */ +public void setTaxID (String TaxID) +{ +if (TaxID == null) throw new IllegalArgumentException ("TaxID is mandatory."); +if (TaxID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TaxID = TaxID.substring(0,19); +} +set_Value ("TaxID", TaxID); +} +/** Get Tax ID. +@return Tax Identification */ +public String getTaxID() +{ +return (String)get_Value("TaxID"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_OrgType.java b/dbPort/src/org/compiere/model/X_AD_OrgType.java new file mode 100644 index 0000000000..6418856794 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_OrgType.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_OrgType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.265 */ +public class X_AD_OrgType extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_OrgType_ID id +@param trxName transaction +*/ +public X_AD_OrgType (Properties ctx, int AD_OrgType_ID, String trxName) +{ +super (ctx, AD_OrgType_ID, trxName); +/** if (AD_OrgType_ID == 0) +{ +setAD_OrgType_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_OrgType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=689 */ +public static final int Table_ID=689; + +/** TableName=AD_OrgType */ +public static final String Table_Name="AD_OrgType"; + +protected static KeyNamePair Model = new KeyNamePair(689,"AD_OrgType"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_OrgType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Organization Type. +@param AD_OrgType_ID Organization Type allows you to categorize your organizations */ +public void setAD_OrgType_ID (int AD_OrgType_ID) +{ +if (AD_OrgType_ID < 1) throw new IllegalArgumentException ("AD_OrgType_ID is mandatory."); +set_ValueNoCheck ("AD_OrgType_ID", new Integer(AD_OrgType_ID)); +} +/** Get Organization Type. +@return Organization Type allows you to categorize your organizations */ +public int getAD_OrgType_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID <= 0) set_Value ("AD_PrintColor_ID", null); + else +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PInstance.java b/dbPort/src/org/compiere/model/X_AD_PInstance.java new file mode 100644 index 0000000000..d421c9095d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PInstance.java @@ -0,0 +1,207 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PInstance + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.265 */ +public class X_AD_PInstance extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PInstance_ID id +@param trxName transaction +*/ +public X_AD_PInstance (Properties ctx, int AD_PInstance_ID, String trxName) +{ +super (ctx, AD_PInstance_ID, trxName); +/** if (AD_PInstance_ID == 0) +{ +setAD_PInstance_ID (0); +setAD_Process_ID (0); +setIsProcessing (false); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PInstance (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=282 */ +public static final int Table_ID=282; + +/** TableName=AD_PInstance */ +public static final String Table_Name="AD_PInstance"; + +protected static KeyNamePair Model = new KeyNamePair(282,"AD_PInstance"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PInstance[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_PInstance_ID())); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID < 1) throw new IllegalArgumentException ("AD_Process_ID is mandatory."); +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Error Msg. +@param ErrorMsg Error Msg */ +public void setErrorMsg (String ErrorMsg) +{ +if (ErrorMsg != null && ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ErrorMsg = ErrorMsg.substring(0,1999); +} +set_Value ("ErrorMsg", ErrorMsg); +} +/** Get Error Msg. +@return Error Msg */ +public String getErrorMsg() +{ +return (String)get_Value("ErrorMsg"); +} +/** Set Processing. +@param IsProcessing Processing */ +public void setIsProcessing (boolean IsProcessing) +{ +set_Value ("IsProcessing", new Boolean(IsProcessing)); +} +/** Get Processing. +@return Processing */ +public boolean isProcessing() +{ +Object oo = get_Value("IsProcessing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Result. +@param Result Result of the action taken */ +public void setResult (int Result) +{ +set_Value ("Result", new Integer(Result)); +} +/** Get Result. +@return Result of the action taken */ +public int getResult() +{ +Integer ii = (Integer)get_Value("Result"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PInstance_Log.java b/dbPort/src/org/compiere/model/X_AD_PInstance_Log.java new file mode 100644 index 0000000000..514407cc7e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PInstance_Log.java @@ -0,0 +1,178 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PInstance_Log + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.281 */ +public class X_AD_PInstance_Log extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PInstance_Log_ID id +@param trxName transaction +*/ +public X_AD_PInstance_Log (Properties ctx, int AD_PInstance_Log_ID, String trxName) +{ +super (ctx, AD_PInstance_Log_ID, trxName); +/** if (AD_PInstance_Log_ID == 0) +{ +setAD_PInstance_ID (0); +setLog_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PInstance_Log (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=578 */ +public static final int Table_ID=578; + +/** TableName=AD_PInstance_Log */ +public static final String Table_Name="AD_PInstance_Log"; + +protected static KeyNamePair Model = new KeyNamePair(578,"AD_PInstance_Log"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PInstance_Log[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Log. +@param Log_ID Log */ +public void setLog_ID (int Log_ID) +{ +if (Log_ID < 1) throw new IllegalArgumentException ("Log_ID is mandatory."); +set_ValueNoCheck ("Log_ID", new Integer(Log_ID)); +} +/** Get Log. +@return Log */ +public int getLog_ID() +{ +Integer ii = (Integer)get_Value("Log_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Date. +@param P_Date Process Parameter */ +public void setP_Date (Timestamp P_Date) +{ +set_ValueNoCheck ("P_Date", P_Date); +} +/** Get Process Date. +@return Process Parameter */ +public Timestamp getP_Date() +{ +return (Timestamp)get_Value("P_Date"); +} +/** Set Process ID. +@param P_ID Process ID */ +public void setP_ID (int P_ID) +{ +if (P_ID <= 0) set_ValueNoCheck ("P_ID", null); + else +set_ValueNoCheck ("P_ID", new Integer(P_ID)); +} +/** Get Process ID. +@return Process ID */ +public int getP_ID() +{ +Integer ii = (Integer)get_Value("P_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Message. +@param P_Msg Process Message */ +public void setP_Msg (String P_Msg) +{ +if (P_Msg != null && P_Msg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +P_Msg = P_Msg.substring(0,1999); +} +set_ValueNoCheck ("P_Msg", P_Msg); +} +/** Get Process Message. +@return Process Message */ +public String getP_Msg() +{ +return (String)get_Value("P_Msg"); +} +/** Set Process Number. +@param P_Number Process Parameter */ +public void setP_Number (BigDecimal P_Number) +{ +set_ValueNoCheck ("P_Number", P_Number); +} +/** Get Process Number. +@return Process Parameter */ +public BigDecimal getP_Number() +{ +BigDecimal bd = (BigDecimal)get_Value("P_Number"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PInstance_Para.java b/dbPort/src/org/compiere/model/X_AD_PInstance_Para.java new file mode 100644 index 0000000000..568d4f133f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PInstance_Para.java @@ -0,0 +1,263 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PInstance_Para + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.296 */ +public class X_AD_PInstance_Para extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PInstance_Para_ID id +@param trxName transaction +*/ +public X_AD_PInstance_Para (Properties ctx, int AD_PInstance_Para_ID, String trxName) +{ +super (ctx, AD_PInstance_Para_ID, trxName); +/** if (AD_PInstance_Para_ID == 0) +{ +setAD_PInstance_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PInstance_Para (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=283 */ +public static final int Table_ID=283; + +/** TableName=AD_PInstance_Para */ +public static final String Table_Name="AD_PInstance_Para"; + +protected static KeyNamePair Model = new KeyNamePair(283,"AD_PInstance_Para"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PInstance_Para[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Info. +@param Info Information */ +public void setInfo (String Info) +{ +if (Info != null && Info.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Info = Info.substring(0,59); +} +set_Value ("Info", Info); +} +/** Get Info. +@return Information */ +public String getInfo() +{ +return (String)get_Value("Info"); +} +/** Set Info To. +@param Info_To Info To */ +public void setInfo_To (String Info_To) +{ +if (Info_To != null && Info_To.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Info_To = Info_To.substring(0,59); +} +set_Value ("Info_To", Info_To); +} +/** Get Info To. +@return Info To */ +public String getInfo_To() +{ +return (String)get_Value("Info_To"); +} +/** Set Process Date. +@param P_Date Process Parameter */ +public void setP_Date (Timestamp P_Date) +{ +set_Value ("P_Date", P_Date); +} +/** Get Process Date. +@return Process Parameter */ +public Timestamp getP_Date() +{ +return (Timestamp)get_Value("P_Date"); +} +/** Set Process Date To. +@param P_Date_To Process Parameter */ +public void setP_Date_To (Timestamp P_Date_To) +{ +set_Value ("P_Date_To", P_Date_To); +} +/** Get Process Date To. +@return Process Parameter */ +public Timestamp getP_Date_To() +{ +return (Timestamp)get_Value("P_Date_To"); +} +/** Set Process Number. +@param P_Number Process Parameter */ +public void setP_Number (BigDecimal P_Number) +{ +set_Value ("P_Number", P_Number); +} +/** Get Process Number. +@return Process Parameter */ +public BigDecimal getP_Number() +{ +BigDecimal bd = (BigDecimal)get_Value("P_Number"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Process Number To. +@param P_Number_To Process Parameter */ +public void setP_Number_To (BigDecimal P_Number_To) +{ +set_Value ("P_Number_To", P_Number_To); +} +/** Get Process Number To. +@return Process Parameter */ +public BigDecimal getP_Number_To() +{ +BigDecimal bd = (BigDecimal)get_Value("P_Number_To"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Process String. +@param P_String Process Parameter */ +public void setP_String (String P_String) +{ +if (P_String != null && P_String.length() > 60) +{ +log.warning("Length > 60 - truncated"); +P_String = P_String.substring(0,59); +} +set_Value ("P_String", P_String); +} +/** Get Process String. +@return Process Parameter */ +public String getP_String() +{ +return (String)get_Value("P_String"); +} +/** Set Process String To. +@param P_String_To Process Parameter */ +public void setP_String_To (String P_String_To) +{ +if (P_String_To != null && P_String_To.length() > 60) +{ +log.warning("Length > 60 - truncated"); +P_String_To = P_String_To.substring(0,59); +} +set_Value ("P_String_To", P_String_To); +} +/** Get Process String To. +@return Process Parameter */ +public String getP_String_To() +{ +return (String)get_Value("P_String_To"); +} +/** Set Parameter Name. +@param ParameterName Parameter Name */ +public void setParameterName (String ParameterName) +{ +if (ParameterName != null && ParameterName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ParameterName = ParameterName.substring(0,59); +} +set_Value ("ParameterName", ParameterName); +} +/** Get Parameter Name. +@return Parameter Name */ +public String getParameterName() +{ +return (String)get_Value("ParameterName"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getParameterName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_ValueNoCheck ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Preference.java b/dbPort/src/org/compiere/model/X_AD_Preference.java new file mode 100644 index 0000000000..2cc5479835 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Preference.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Preference + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.328 */ +public class X_AD_Preference extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Preference_ID id +@param trxName transaction +*/ +public X_AD_Preference (Properties ctx, int AD_Preference_ID, String trxName) +{ +super (ctx, AD_Preference_ID, trxName); +/** if (AD_Preference_ID == 0) +{ +setAD_Preference_ID (0); +setAttribute (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Preference (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=195 */ +public static final int Table_ID=195; + +/** TableName=AD_Preference */ +public static final String Table_Name="AD_Preference"; + +protected static KeyNamePair Model = new KeyNamePair(195,"AD_Preference"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Preference[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Preference. +@param AD_Preference_ID Personal Value Preference */ +public void setAD_Preference_ID (int AD_Preference_ID) +{ +if (AD_Preference_ID < 1) throw new IllegalArgumentException ("AD_Preference_ID is mandatory."); +set_ValueNoCheck ("AD_Preference_ID", new Integer(AD_Preference_ID)); +} +/** Get Preference. +@return Personal Value Preference */ +public int getAD_Preference_ID() +{ +Integer ii = (Integer)get_Value("AD_Preference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID <= 0) set_Value ("AD_Window_ID", null); + else +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute. +@param Attribute Attribute */ +public void setAttribute (String Attribute) +{ +if (Attribute == null) throw new IllegalArgumentException ("Attribute is mandatory."); +if (Attribute.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Attribute = Attribute.substring(0,59); +} +set_Value ("Attribute", Attribute); +} +/** Get Attribute. +@return Attribute */ +public String getAttribute() +{ +return (String)get_Value("Attribute"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getAttribute()); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Value = Value.substring(0,59); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintColor.java b/dbPort/src/org/compiere/model/X_AD_PrintColor.java new file mode 100644 index 0000000000..8cbf85d475 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintColor.java @@ -0,0 +1,166 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintColor + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.343 */ +public class X_AD_PrintColor extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintColor_ID id +@param trxName transaction +*/ +public X_AD_PrintColor (Properties ctx, int AD_PrintColor_ID, String trxName) +{ +super (ctx, AD_PrintColor_ID, trxName); +/** if (AD_PrintColor_ID == 0) +{ +setAD_PrintColor_ID (0); +setCode (null); +setIsDefault (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintColor (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=490 */ +public static final int Table_ID=490; + +/** TableName=AD_PrintColor */ +public static final String Table_Name="AD_PrintColor"; + +protected static KeyNamePair Model = new KeyNamePair(490,"AD_PrintColor"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintColor[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID < 1) throw new IllegalArgumentException ("AD_PrintColor_ID is mandatory."); +set_ValueNoCheck ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Validation code. +@param Code Validation Code */ +public void setCode (String Code) +{ +if (Code == null) throw new IllegalArgumentException ("Code is mandatory."); +if (Code.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Code = Code.substring(0,1999); +} +set_Value ("Code", Code); +} +/** Get Validation code. +@return Validation Code */ +public String getCode() +{ +return (String)get_Value("Code"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintFont.java b/dbPort/src/org/compiere/model/X_AD_PrintFont.java new file mode 100644 index 0000000000..a8a96bc77f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintFont.java @@ -0,0 +1,166 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintFont + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.343 */ +public class X_AD_PrintFont extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintFont_ID id +@param trxName transaction +*/ +public X_AD_PrintFont (Properties ctx, int AD_PrintFont_ID, String trxName) +{ +super (ctx, AD_PrintFont_ID, trxName); +/** if (AD_PrintFont_ID == 0) +{ +setAD_PrintFont_ID (0); +setCode (null); +setIsDefault (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintFont (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=491 */ +public static final int Table_ID=491; + +/** TableName=AD_PrintFont */ +public static final String Table_Name="AD_PrintFont"; + +protected static KeyNamePair Model = new KeyNamePair(491,"AD_PrintFont"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintFont[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Font. +@param AD_PrintFont_ID Maintain Print Font */ +public void setAD_PrintFont_ID (int AD_PrintFont_ID) +{ +if (AD_PrintFont_ID < 1) throw new IllegalArgumentException ("AD_PrintFont_ID is mandatory."); +set_ValueNoCheck ("AD_PrintFont_ID", new Integer(AD_PrintFont_ID)); +} +/** Get Print Font. +@return Maintain Print Font */ +public int getAD_PrintFont_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFont_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Validation code. +@param Code Validation Code */ +public void setCode (String Code) +{ +if (Code == null) throw new IllegalArgumentException ("Code is mandatory."); +if (Code.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Code = Code.substring(0,1999); +} +set_Value ("Code", Code); +} +/** Get Validation code. +@return Validation Code */ +public String getCode() +{ +return (String)get_Value("Code"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintForm.java b/dbPort/src/org/compiere/model/X_AD_PrintForm.java new file mode 100644 index 0000000000..8b10ca6bcf --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintForm.java @@ -0,0 +1,335 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintForm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.359 */ +public class X_AD_PrintForm extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintForm_ID id +@param trxName transaction +*/ +public X_AD_PrintForm (Properties ctx, int AD_PrintForm_ID, String trxName) +{ +super (ctx, AD_PrintForm_ID, trxName); +/** if (AD_PrintForm_ID == 0) +{ +setAD_PrintForm_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintForm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=454 */ +public static final int Table_ID=454; + +/** TableName=AD_PrintForm */ +public static final String Table_Name="AD_PrintForm"; + +protected static KeyNamePair Model = new KeyNamePair(454,"AD_PrintForm"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintForm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Form. +@param AD_PrintForm_ID Form */ +public void setAD_PrintForm_ID (int AD_PrintForm_ID) +{ +if (AD_PrintForm_ID < 1) throw new IllegalArgumentException ("AD_PrintForm_ID is mandatory."); +set_ValueNoCheck ("AD_PrintForm_ID", new Integer(AD_PrintForm_ID)); +} +/** Get Print Form. +@return Form */ +public int getAD_PrintForm_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintForm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** Invoice_MailText_ID AD_Reference_ID=274 */ +public static final int INVOICE_MAILTEXT_ID_AD_Reference_ID=274; +/** Set Invoice Mail Text. +@param Invoice_MailText_ID Email text used for sending invoices */ +public void setInvoice_MailText_ID (int Invoice_MailText_ID) +{ +if (Invoice_MailText_ID <= 0) set_Value ("Invoice_MailText_ID", null); + else +set_Value ("Invoice_MailText_ID", new Integer(Invoice_MailText_ID)); +} +/** Get Invoice Mail Text. +@return Email text used for sending invoices */ +public int getInvoice_MailText_ID() +{ +Integer ii = (Integer)get_Value("Invoice_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Invoice_PrintFormat_ID AD_Reference_ID=261 */ +public static final int INVOICE_PRINTFORMAT_ID_AD_Reference_ID=261; +/** Set Invoice Print Format. +@param Invoice_PrintFormat_ID Print Format for printing Invoices */ +public void setInvoice_PrintFormat_ID (int Invoice_PrintFormat_ID) +{ +if (Invoice_PrintFormat_ID <= 0) set_Value ("Invoice_PrintFormat_ID", null); + else +set_Value ("Invoice_PrintFormat_ID", new Integer(Invoice_PrintFormat_ID)); +} +/** Get Invoice Print Format. +@return Print Format for printing Invoices */ +public int getInvoice_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Invoice_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Order_MailText_ID AD_Reference_ID=274 */ +public static final int ORDER_MAILTEXT_ID_AD_Reference_ID=274; +/** Set Order Mail Text. +@param Order_MailText_ID Email text used for sending order acknowledgements or quotations */ +public void setOrder_MailText_ID (int Order_MailText_ID) +{ +if (Order_MailText_ID <= 0) set_Value ("Order_MailText_ID", null); + else +set_Value ("Order_MailText_ID", new Integer(Order_MailText_ID)); +} +/** Get Order Mail Text. +@return Email text used for sending order acknowledgements or quotations */ +public int getOrder_MailText_ID() +{ +Integer ii = (Integer)get_Value("Order_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Order_PrintFormat_ID AD_Reference_ID=262 */ +public static final int ORDER_PRINTFORMAT_ID_AD_Reference_ID=262; +/** Set Order Print Format. +@param Order_PrintFormat_ID Print Format for Orders, Quotes, Offers */ +public void setOrder_PrintFormat_ID (int Order_PrintFormat_ID) +{ +if (Order_PrintFormat_ID <= 0) set_Value ("Order_PrintFormat_ID", null); + else +set_Value ("Order_PrintFormat_ID", new Integer(Order_PrintFormat_ID)); +} +/** Get Order Print Format. +@return Print Format for Orders, Quotes, Offers */ +public int getOrder_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Order_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Project_MailText_ID AD_Reference_ID=274 */ +public static final int PROJECT_MAILTEXT_ID_AD_Reference_ID=274; +/** Set Project Mail Text. +@param Project_MailText_ID Standard text for Project EMails */ +public void setProject_MailText_ID (int Project_MailText_ID) +{ +if (Project_MailText_ID <= 0) set_Value ("Project_MailText_ID", null); + else +set_Value ("Project_MailText_ID", new Integer(Project_MailText_ID)); +} +/** Get Project Mail Text. +@return Standard text for Project EMails */ +public int getProject_MailText_ID() +{ +Integer ii = (Integer)get_Value("Project_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Project_PrintFormat_ID AD_Reference_ID=259 */ +public static final int PROJECT_PRINTFORMAT_ID_AD_Reference_ID=259; +/** Set Project Print Format. +@param Project_PrintFormat_ID Standard Project Print Format */ +public void setProject_PrintFormat_ID (int Project_PrintFormat_ID) +{ +if (Project_PrintFormat_ID <= 0) set_Value ("Project_PrintFormat_ID", null); + else +set_Value ("Project_PrintFormat_ID", new Integer(Project_PrintFormat_ID)); +} +/** Get Project Print Format. +@return Standard Project Print Format */ +public int getProject_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Project_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Remittance_MailText_ID AD_Reference_ID=274 */ +public static final int REMITTANCE_MAILTEXT_ID_AD_Reference_ID=274; +/** Set Remittance Mail Text. +@param Remittance_MailText_ID Email text used for sending payment remittances */ +public void setRemittance_MailText_ID (int Remittance_MailText_ID) +{ +if (Remittance_MailText_ID <= 0) set_Value ("Remittance_MailText_ID", null); + else +set_Value ("Remittance_MailText_ID", new Integer(Remittance_MailText_ID)); +} +/** Get Remittance Mail Text. +@return Email text used for sending payment remittances */ +public int getRemittance_MailText_ID() +{ +Integer ii = (Integer)get_Value("Remittance_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Remittance_PrintFormat_ID AD_Reference_ID=268 */ +public static final int REMITTANCE_PRINTFORMAT_ID_AD_Reference_ID=268; +/** Set Remittance Print Format. +@param Remittance_PrintFormat_ID Print Format for separate Remittances */ +public void setRemittance_PrintFormat_ID (int Remittance_PrintFormat_ID) +{ +if (Remittance_PrintFormat_ID <= 0) set_Value ("Remittance_PrintFormat_ID", null); + else +set_Value ("Remittance_PrintFormat_ID", new Integer(Remittance_PrintFormat_ID)); +} +/** Get Remittance Print Format. +@return Print Format for separate Remittances */ +public int getRemittance_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Remittance_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Shipment_MailText_ID AD_Reference_ID=274 */ +public static final int SHIPMENT_MAILTEXT_ID_AD_Reference_ID=274; +/** Set Shipment Mail Text. +@param Shipment_MailText_ID Email text used for sending delivery notes */ +public void setShipment_MailText_ID (int Shipment_MailText_ID) +{ +if (Shipment_MailText_ID <= 0) set_Value ("Shipment_MailText_ID", null); + else +set_Value ("Shipment_MailText_ID", new Integer(Shipment_MailText_ID)); +} +/** Get Shipment Mail Text. +@return Email text used for sending delivery notes */ +public int getShipment_MailText_ID() +{ +Integer ii = (Integer)get_Value("Shipment_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Shipment_PrintFormat_ID AD_Reference_ID=263 */ +public static final int SHIPMENT_PRINTFORMAT_ID_AD_Reference_ID=263; +/** Set Shipment Print Format. +@param Shipment_PrintFormat_ID Print Format for Shipments, Receipts, Pick Lists */ +public void setShipment_PrintFormat_ID (int Shipment_PrintFormat_ID) +{ +if (Shipment_PrintFormat_ID <= 0) set_Value ("Shipment_PrintFormat_ID", null); + else +set_Value ("Shipment_PrintFormat_ID", new Integer(Shipment_PrintFormat_ID)); +} +/** Get Shipment Print Format. +@return Print Format for Shipments, Receipts, Pick Lists */ +public int getShipment_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Shipment_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintFormat.java b/dbPort/src/org/compiere/model/X_AD_PrintFormat.java new file mode 100644 index 0000000000..a8c41011d0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintFormat.java @@ -0,0 +1,381 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintFormat + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.39 */ +public class X_AD_PrintFormat extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintFormat_ID id +@param trxName transaction +*/ +public X_AD_PrintFormat (Properties ctx, int AD_PrintFormat_ID, String trxName) +{ +super (ctx, AD_PrintFormat_ID, trxName); +/** if (AD_PrintFormat_ID == 0) +{ +setAD_PrintColor_ID (0); +setAD_PrintFont_ID (0); +setAD_PrintFormat_ID (0); // 0 +setAD_PrintPaper_ID (0); +setAD_Table_ID (0); +setFooterMargin (0); +setHeaderMargin (0); +setIsDefault (false); +setIsForm (false); +setIsStandardHeaderFooter (true); // Y +setIsTableBased (true); // Y +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintFormat (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=493 */ +public static final int Table_ID=493; + +/** TableName=AD_PrintFormat */ +public static final String Table_Name="AD_PrintFormat"; + +protected static KeyNamePair Model = new KeyNamePair(493,"AD_PrintFormat"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintFormat[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID < 1) throw new IllegalArgumentException ("AD_PrintColor_ID is mandatory."); +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Font. +@param AD_PrintFont_ID Maintain Print Font */ +public void setAD_PrintFont_ID (int AD_PrintFont_ID) +{ +if (AD_PrintFont_ID < 1) throw new IllegalArgumentException ("AD_PrintFont_ID is mandatory."); +set_Value ("AD_PrintFont_ID", new Integer(AD_PrintFont_ID)); +} +/** Get Print Font. +@return Maintain Print Font */ +public int getAD_PrintFont_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFont_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID < 1) throw new IllegalArgumentException ("AD_PrintFormat_ID is mandatory."); +set_ValueNoCheck ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Paper. +@param AD_PrintPaper_ID Printer paper definition */ +public void setAD_PrintPaper_ID (int AD_PrintPaper_ID) +{ +if (AD_PrintPaper_ID < 1) throw new IllegalArgumentException ("AD_PrintPaper_ID is mandatory."); +set_Value ("AD_PrintPaper_ID", new Integer(AD_PrintPaper_ID)); +} +/** Get Print Paper. +@return Printer paper definition */ +public int getAD_PrintPaper_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintPaper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Table Format. +@param AD_PrintTableFormat_ID Table Format in Reports */ +public void setAD_PrintTableFormat_ID (int AD_PrintTableFormat_ID) +{ +if (AD_PrintTableFormat_ID <= 0) set_Value ("AD_PrintTableFormat_ID", null); + else +set_Value ("AD_PrintTableFormat_ID", new Integer(AD_PrintTableFormat_ID)); +} +/** Get Print Table Format. +@return Table Format in Reports */ +public int getAD_PrintTableFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintTableFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report View. +@param AD_ReportView_ID View used to generate this report */ +public void setAD_ReportView_ID (int AD_ReportView_ID) +{ +if (AD_ReportView_ID <= 0) set_ValueNoCheck ("AD_ReportView_ID", null); + else +set_ValueNoCheck ("AD_ReportView_ID", new Integer(AD_ReportView_ID)); +} +/** Get Report View. +@return View used to generate this report */ +public int getAD_ReportView_ID() +{ +Integer ii = (Integer)get_Value("AD_ReportView_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Create Copy. +@param CreateCopy Create Copy */ +public void setCreateCopy (String CreateCopy) +{ +if (CreateCopy != null && CreateCopy.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateCopy = CreateCopy.substring(0,0); +} +set_Value ("CreateCopy", CreateCopy); +} +/** Get Create Copy. +@return Create Copy */ +public String getCreateCopy() +{ +return (String)get_Value("CreateCopy"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Footer Margin. +@param FooterMargin Margin of the Footer in 1/72 of an inch */ +public void setFooterMargin (int FooterMargin) +{ +set_Value ("FooterMargin", new Integer(FooterMargin)); +} +/** Get Footer Margin. +@return Margin of the Footer in 1/72 of an inch */ +public int getFooterMargin() +{ +Integer ii = (Integer)get_Value("FooterMargin"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Header Margin. +@param HeaderMargin Margin of the Header in 1/72 of an inch */ +public void setHeaderMargin (int HeaderMargin) +{ +set_Value ("HeaderMargin", new Integer(HeaderMargin)); +} +/** Get Header Margin. +@return Margin of the Header in 1/72 of an inch */ +public int getHeaderMargin() +{ +Integer ii = (Integer)get_Value("HeaderMargin"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Form. +@param IsForm If Selected, a Form is printed, if not selected a columnar List report */ +public void setIsForm (boolean IsForm) +{ +set_Value ("IsForm", new Boolean(IsForm)); +} +/** Get Form. +@return If Selected, a Form is printed, if not selected a columnar List report */ +public boolean isForm() +{ +Object oo = get_Value("IsForm"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Standard Header/Footer. +@param IsStandardHeaderFooter The standard Header and Footer is used */ +public void setIsStandardHeaderFooter (boolean IsStandardHeaderFooter) +{ +set_Value ("IsStandardHeaderFooter", new Boolean(IsStandardHeaderFooter)); +} +/** Get Standard Header/Footer. +@return The standard Header and Footer is used */ +public boolean isStandardHeaderFooter() +{ +Object oo = get_Value("IsStandardHeaderFooter"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Table Based. +@param IsTableBased Table based List Reporting */ +public void setIsTableBased (boolean IsTableBased) +{ +set_ValueNoCheck ("IsTableBased", new Boolean(IsTableBased)); +} +/** Get Table Based. +@return Table based List Reporting */ +public boolean isTableBased() +{ +Object oo = get_Value("IsTableBased"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Printer Name. +@param PrinterName Name of the Printer */ +public void setPrinterName (String PrinterName) +{ +if (PrinterName != null && PrinterName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +PrinterName = PrinterName.substring(0,39); +} +set_Value ("PrinterName", PrinterName); +} +/** Get Printer Name. +@return Name of the Printer */ +public String getPrinterName() +{ +return (String)get_Value("PrinterName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintFormatItem.java b/dbPort/src/org/compiere/model/X_AD_PrintFormatItem.java new file mode 100644 index 0000000000..f7526bdfbc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintFormatItem.java @@ -0,0 +1,1125 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintFormatItem + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.421 */ +public class X_AD_PrintFormatItem extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintFormatItem_ID id +@param trxName transaction +*/ +public X_AD_PrintFormatItem (Properties ctx, int AD_PrintFormatItem_ID, String trxName) +{ +super (ctx, AD_PrintFormatItem_ID, trxName); +/** if (AD_PrintFormatItem_ID == 0) +{ +setAD_Column_ID (0); +setAD_PrintFormatChild_ID (0); +setAD_PrintFormatItem_ID (0); +setAD_PrintFormat_ID (0); +setFieldAlignmentType (null); // D +setImageIsAttached (false); +setIsAveraged (false); +setIsCentrallyMaintained (false); +setIsCounted (false); +setIsDeviationCalc (false); +setIsFilledRectangle (false); // N +setIsFixedWidth (false); +setIsGroupBy (false); +setIsHeightOneLine (true); // Y +setIsImageField (false); +setIsMaxCalc (false); +setIsMinCalc (false); +setIsNextLine (true); // Y +setIsNextPage (false); +setIsOrderBy (false); +setIsPageBreak (false); +setIsPrinted (true); // Y +setIsRelativePosition (true); // Y +setIsRunningTotal (false); +setIsSetNLPosition (false); +setIsSummarized (false); +setIsSuppressNull (false); +setIsVarianceCalc (false); +setLineAlignmentType (null); // X +setMaxHeight (0); +setMaxWidth (0); +setName (null); +setPrintAreaType (null); // C +setPrintFormatType (null); // F +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_PrintFormatItem WHERE AD_PrintFormat_ID=@AD_PrintFormat_ID@ +setSortNo (0); +setXPosition (0); +setXSpace (0); +setYPosition (0); +setYSpace (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintFormatItem (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=489 */ +public static final int Table_ID=489; + +/** TableName=AD_PrintFormatItem */ +public static final String Table_Name="AD_PrintFormatItem"; + +protected static KeyNamePair Model = new KeyNamePair(489,"AD_PrintFormatItem"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintFormatItem[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID <= 0) set_Value ("AD_PrintColor_ID", null); + else +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Font. +@param AD_PrintFont_ID Maintain Print Font */ +public void setAD_PrintFont_ID (int AD_PrintFont_ID) +{ +if (AD_PrintFont_ID <= 0) set_Value ("AD_PrintFont_ID", null); + else +set_Value ("AD_PrintFont_ID", new Integer(AD_PrintFont_ID)); +} +/** Get Print Font. +@return Maintain Print Font */ +public int getAD_PrintFont_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFont_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_PrintFormatChild_ID AD_Reference_ID=259 */ +public static final int AD_PRINTFORMATCHILD_ID_AD_Reference_ID=259; +/** Set Included Print Format. +@param AD_PrintFormatChild_ID Print format that is included here. */ +public void setAD_PrintFormatChild_ID (int AD_PrintFormatChild_ID) +{ +if (AD_PrintFormatChild_ID < 1) throw new IllegalArgumentException ("AD_PrintFormatChild_ID is mandatory."); +set_Value ("AD_PrintFormatChild_ID", new Integer(AD_PrintFormatChild_ID)); +} +/** Get Included Print Format. +@return Print format that is included here. */ +public int getAD_PrintFormatChild_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormatChild_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Format Item. +@param AD_PrintFormatItem_ID Item/Column in the Print format */ +public void setAD_PrintFormatItem_ID (int AD_PrintFormatItem_ID) +{ +if (AD_PrintFormatItem_ID < 1) throw new IllegalArgumentException ("AD_PrintFormatItem_ID is mandatory."); +set_ValueNoCheck ("AD_PrintFormatItem_ID", new Integer(AD_PrintFormatItem_ID)); +} +/** Get Print Format Item. +@return Item/Column in the Print format */ +public int getAD_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID < 1) throw new IllegalArgumentException ("AD_PrintFormat_ID is mandatory."); +set_ValueNoCheck ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Graph. +@param AD_PrintGraph_ID Graph included in Reports */ +public void setAD_PrintGraph_ID (int AD_PrintGraph_ID) +{ +if (AD_PrintGraph_ID <= 0) set_Value ("AD_PrintGraph_ID", null); + else +set_Value ("AD_PrintGraph_ID", new Integer(AD_PrintGraph_ID)); +} +/** Get Graph. +@return Graph included in Reports */ +public int getAD_PrintGraph_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintGraph_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Arc Diameter. +@param ArcDiameter Arc Diameter for rounded Rectangles */ +public void setArcDiameter (int ArcDiameter) +{ +set_Value ("ArcDiameter", new Integer(ArcDiameter)); +} +/** Get Arc Diameter. +@return Arc Diameter for rounded Rectangles */ +public int getArcDiameter() +{ +Integer ii = (Integer)get_Value("ArcDiameter"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** BarcodeType AD_Reference_ID=377 */ +public static final int BARCODETYPE_AD_Reference_ID=377; +/** Code 128 A character set = 28A */ +public static final String BARCODETYPE_Code128ACharacterSet = "28A"; +/** Code 128 B character set = 28B */ +public static final String BARCODETYPE_Code128BCharacterSet = "28B"; +/** Code 128 C character set = 28C */ +public static final String BARCODETYPE_Code128CCharacterSet = "28C"; +/** Codabar 2 of 7 linear = 2o9 */ +public static final String BARCODETYPE_Codabar2Of7Linear = "2o9"; +/** Code 39 3 of 9 linear with Checksum = 3O9 */ +public static final String BARCODETYPE_Code393Of9LinearWithChecksum = "3O9"; +/** Code 39 3 of 9 linear w/o Checksum = 3o9 */ +public static final String BARCODETYPE_Code393Of9LinearWOChecksum = "3o9"; +/** PDF417 two dimensional = 417 */ +public static final String BARCODETYPE_PDF417TwoDimensional = "417"; +/** SCC-14 shipping code UCC/EAN 128 = C14 */ +public static final String BARCODETYPE_SCC_14ShippingCodeUCCEAN128 = "C14"; +/** SSCC-18 number UCC/EAN 128 = C18 */ +public static final String BARCODETYPE_SSCC_18NumberUCCEAN128 = "C18"; +/** Code 128 dynamically switching = C28 */ +public static final String BARCODETYPE_Code128DynamicallySwitching = "C28"; +/** Code 39 linear with Checksum = C39 */ +public static final String BARCODETYPE_Code39LinearWithChecksum = "C39"; +/** Codeabar linear = COD */ +public static final String BARCODETYPE_CodeabarLinear = "COD"; +/** EAN 128 = E28 */ +public static final String BARCODETYPE_EAN128 = "E28"; +/** Global Trade Item No GTIN UCC/EAN 128 = GTN */ +public static final String BARCODETYPE_GlobalTradeItemNoGTINUCCEAN128 = "GTN"; +/** Codabar Monarch linear = MON */ +public static final String BARCODETYPE_CodabarMonarchLinear = "MON"; +/** Codabar NW-7 linear = NW7 */ +public static final String BARCODETYPE_CodabarNW_7Linear = "NW7"; +/** Shipment ID number UCC/EAN 128 = SID */ +public static final String BARCODETYPE_ShipmentIDNumberUCCEAN128 = "SID"; +/** UCC 128 = U28 */ +public static final String BARCODETYPE_UCC128 = "U28"; +/** Code 39 USD3 with Checksum = US3 */ +public static final String BARCODETYPE_Code39USD3WithChecksum = "US3"; +/** Codabar USD-4 linear = US4 */ +public static final String BARCODETYPE_CodabarUSD_4Linear = "US4"; +/** US Postal Service UCC/EAN 128 = USP */ +public static final String BARCODETYPE_USPostalServiceUCCEAN128 = "USP"; +/** Code 39 linear w/o Checksum = c39 */ +public static final String BARCODETYPE_Code39LinearWOChecksum = "c39"; +/** Code 39 USD3 w/o Checksum = us3 */ +public static final String BARCODETYPE_Code39USD3WOChecksum = "us3"; +/** Set Barcode Type. +@param BarcodeType Type of barcode */ +public void setBarcodeType (String BarcodeType) +{ +if (BarcodeType == null) throw new IllegalArgumentException ("BarcodeType is mandatory"); +if (BarcodeType == null || BarcodeType.equals("28A") || BarcodeType.equals("28B") || BarcodeType.equals("28C") || BarcodeType.equals("2o9") || BarcodeType.equals("3O9") || BarcodeType.equals("3o9") || BarcodeType.equals("417") || BarcodeType.equals("C14") || BarcodeType.equals("C18") || BarcodeType.equals("C28") || BarcodeType.equals("C39") || BarcodeType.equals("COD") || BarcodeType.equals("E28") || BarcodeType.equals("GTN") || BarcodeType.equals("MON") || BarcodeType.equals("NW7") || BarcodeType.equals("SID") || BarcodeType.equals("U28") || BarcodeType.equals("US3") || BarcodeType.equals("US4") || BarcodeType.equals("USP") || BarcodeType.equals("c39") || BarcodeType.equals("us3")); + else throw new IllegalArgumentException ("BarcodeType Invalid value - " + BarcodeType + " - Reference_ID=377 - 28A - 28B - 28C - 2o9 - 3O9 - 3o9 - 417 - C14 - C18 - C28 - C39 - COD - E28 - GTN - MON - NW7 - SID - U28 - US3 - US4 - USP - c39 - us3"); +if (BarcodeType != null && BarcodeType.length() > 3) +{ +log.warning("Length > 3 - truncated"); +BarcodeType = BarcodeType.substring(0,2); +} +set_Value ("BarcodeType", BarcodeType); +} +/** Get Barcode Type. +@return Type of barcode */ +public String getBarcodeType() +{ +return (String)get_Value("BarcodeType"); +} +/** Set Below Column. +@param BelowColumn Print this column below the column index entered */ +public void setBelowColumn (int BelowColumn) +{ +set_Value ("BelowColumn", new Integer(BelowColumn)); +} +/** Get Below Column. +@return Print this column below the column index entered */ +public int getBelowColumn() +{ +Integer ii = (Integer)get_Value("BelowColumn"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FieldAlignmentType AD_Reference_ID=253 */ +public static final int FIELDALIGNMENTTYPE_AD_Reference_ID=253; +/** Block = B */ +public static final String FIELDALIGNMENTTYPE_Block = "B"; +/** Center = C */ +public static final String FIELDALIGNMENTTYPE_Center = "C"; +/** Default = D */ +public static final String FIELDALIGNMENTTYPE_Default = "D"; +/** Leading (left) = L */ +public static final String FIELDALIGNMENTTYPE_LeadingLeft = "L"; +/** Trailing (right) = T */ +public static final String FIELDALIGNMENTTYPE_TrailingRight = "T"; +/** Set Field Alignment. +@param FieldAlignmentType Field Text Alignment */ +public void setFieldAlignmentType (String FieldAlignmentType) +{ +if (FieldAlignmentType == null) throw new IllegalArgumentException ("FieldAlignmentType is mandatory"); +if (FieldAlignmentType.equals("B") || FieldAlignmentType.equals("C") || FieldAlignmentType.equals("D") || FieldAlignmentType.equals("L") || FieldAlignmentType.equals("T")); + else throw new IllegalArgumentException ("FieldAlignmentType Invalid value - " + FieldAlignmentType + " - Reference_ID=253 - B - C - D - L - T"); +if (FieldAlignmentType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FieldAlignmentType = FieldAlignmentType.substring(0,0); +} +set_Value ("FieldAlignmentType", FieldAlignmentType); +} +/** Get Field Alignment. +@return Field Text Alignment */ +public String getFieldAlignmentType() +{ +return (String)get_Value("FieldAlignmentType"); +} +/** Set Image attached. +@param ImageIsAttached The image to be printed is attached to the record */ +public void setImageIsAttached (boolean ImageIsAttached) +{ +set_Value ("ImageIsAttached", new Boolean(ImageIsAttached)); +} +/** Get Image attached. +@return The image to be printed is attached to the record */ +public boolean isImageIsAttached() +{ +Object oo = get_Value("ImageIsAttached"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Calculate Mean (?). +@param IsAveraged Calculate Average of numeric content or length */ +public void setIsAveraged (boolean IsAveraged) +{ +set_Value ("IsAveraged", new Boolean(IsAveraged)); +} +/** Get Calculate Mean (?). +@return Calculate Average of numeric content or length */ +public boolean isAveraged() +{ +Object oo = get_Value("IsAveraged"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Centrally maintained. +@param IsCentrallyMaintained Information maintained in System Element table */ +public void setIsCentrallyMaintained (boolean IsCentrallyMaintained) +{ +set_Value ("IsCentrallyMaintained", new Boolean(IsCentrallyMaintained)); +} +/** Get Centrally maintained. +@return Information maintained in System Element table */ +public boolean isCentrallyMaintained() +{ +Object oo = get_Value("IsCentrallyMaintained"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Calculate Count (?). +@param IsCounted Count number of not empty elements */ +public void setIsCounted (boolean IsCounted) +{ +set_Value ("IsCounted", new Boolean(IsCounted)); +} +/** Get Calculate Count (?). +@return Count number of not empty elements */ +public boolean isCounted() +{ +Object oo = get_Value("IsCounted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Calculate Deviation (?). +@param IsDeviationCalc Calculate Standard Deviation */ +public void setIsDeviationCalc (boolean IsDeviationCalc) +{ +set_Value ("IsDeviationCalc", new Boolean(IsDeviationCalc)); +} +/** Get Calculate Deviation (?). +@return Calculate Standard Deviation */ +public boolean isDeviationCalc() +{ +Object oo = get_Value("IsDeviationCalc"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Fill Shape. +@param IsFilledRectangle Fill the shape with the color selected */ +public void setIsFilledRectangle (boolean IsFilledRectangle) +{ +set_Value ("IsFilledRectangle", new Boolean(IsFilledRectangle)); +} +/** Get Fill Shape. +@return Fill the shape with the color selected */ +public boolean isFilledRectangle() +{ +Object oo = get_Value("IsFilledRectangle"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Fixed Width. +@param IsFixedWidth Column has a fixed width */ +public void setIsFixedWidth (boolean IsFixedWidth) +{ +set_Value ("IsFixedWidth", new Boolean(IsFixedWidth)); +} +/** Get Fixed Width. +@return Column has a fixed width */ +public boolean isFixedWidth() +{ +Object oo = get_Value("IsFixedWidth"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Group by. +@param IsGroupBy After a group change, totals, etc. are printed */ +public void setIsGroupBy (boolean IsGroupBy) +{ +set_Value ("IsGroupBy", new Boolean(IsGroupBy)); +} +/** Get Group by. +@return After a group change, totals, etc. are printed */ +public boolean isGroupBy() +{ +Object oo = get_Value("IsGroupBy"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set One Line Only. +@param IsHeightOneLine If selected, only one line is printed */ +public void setIsHeightOneLine (boolean IsHeightOneLine) +{ +set_Value ("IsHeightOneLine", new Boolean(IsHeightOneLine)); +} +/** Get One Line Only. +@return If selected, only one line is printed */ +public boolean isHeightOneLine() +{ +Object oo = get_Value("IsHeightOneLine"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Image Field. +@param IsImageField The image is retrieved from the data column */ +public void setIsImageField (boolean IsImageField) +{ +set_Value ("IsImageField", new Boolean(IsImageField)); +} +/** Get Image Field. +@return The image is retrieved from the data column */ +public boolean isImageField() +{ +Object oo = get_Value("IsImageField"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Calculate Maximim (?). +@param IsMaxCalc Calculate the maximim amount */ +public void setIsMaxCalc (boolean IsMaxCalc) +{ +set_Value ("IsMaxCalc", new Boolean(IsMaxCalc)); +} +/** Get Calculate Maximim (?). +@return Calculate the maximim amount */ +public boolean isMaxCalc() +{ +Object oo = get_Value("IsMaxCalc"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Calculate Minimum (?). +@param IsMinCalc Calculate the minimum amount */ +public void setIsMinCalc (boolean IsMinCalc) +{ +set_Value ("IsMinCalc", new Boolean(IsMinCalc)); +} +/** Get Calculate Minimum (?). +@return Calculate the minimum amount */ +public boolean isMinCalc() +{ +Object oo = get_Value("IsMinCalc"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Next Line. +@param IsNextLine Print item on next line */ +public void setIsNextLine (boolean IsNextLine) +{ +set_Value ("IsNextLine", new Boolean(IsNextLine)); +} +/** Get Next Line. +@return Print item on next line */ +public boolean isNextLine() +{ +Object oo = get_Value("IsNextLine"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Next Page. +@param IsNextPage The column is printed on the next page */ +public void setIsNextPage (boolean IsNextPage) +{ +set_Value ("IsNextPage", new Boolean(IsNextPage)); +} +/** Get Next Page. +@return The column is printed on the next page */ +public boolean isNextPage() +{ +Object oo = get_Value("IsNextPage"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Order by. +@param IsOrderBy Include in sort order */ +public void setIsOrderBy (boolean IsOrderBy) +{ +set_Value ("IsOrderBy", new Boolean(IsOrderBy)); +} +/** Get Order by. +@return Include in sort order */ +public boolean isOrderBy() +{ +Object oo = get_Value("IsOrderBy"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Page break. +@param IsPageBreak Start with new page */ +public void setIsPageBreak (boolean IsPageBreak) +{ +set_Value ("IsPageBreak", new Boolean(IsPageBreak)); +} +/** Get Page break. +@return Start with new page */ +public boolean isPageBreak() +{ +Object oo = get_Value("IsPageBreak"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Relative Position. +@param IsRelativePosition The item is relative positioned (not absolute) */ +public void setIsRelativePosition (boolean IsRelativePosition) +{ +set_Value ("IsRelativePosition", new Boolean(IsRelativePosition)); +} +/** Get Relative Position. +@return The item is relative positioned (not absolute) */ +public boolean isRelativePosition() +{ +Object oo = get_Value("IsRelativePosition"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Running Total. +@param IsRunningTotal Create a running total (sum) */ +public void setIsRunningTotal (boolean IsRunningTotal) +{ +set_Value ("IsRunningTotal", new Boolean(IsRunningTotal)); +} +/** Get Running Total. +@return Create a running total (sum) */ +public boolean isRunningTotal() +{ +Object oo = get_Value("IsRunningTotal"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Set NL Position. +@param IsSetNLPosition Set New Line Position */ +public void setIsSetNLPosition (boolean IsSetNLPosition) +{ +set_Value ("IsSetNLPosition", new Boolean(IsSetNLPosition)); +} +/** Get Set NL Position. +@return Set New Line Position */ +public boolean isSetNLPosition() +{ +Object oo = get_Value("IsSetNLPosition"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Calculate Sum (?). +@param IsSummarized Calculate the Sum of numeric content or length */ +public void setIsSummarized (boolean IsSummarized) +{ +set_Value ("IsSummarized", new Boolean(IsSummarized)); +} +/** Get Calculate Sum (?). +@return Calculate the Sum of numeric content or length */ +public boolean isSummarized() +{ +Object oo = get_Value("IsSummarized"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Suppress Null. +@param IsSuppressNull Suppress columns or elements with NULL value */ +public void setIsSuppressNull (boolean IsSuppressNull) +{ +set_Value ("IsSuppressNull", new Boolean(IsSuppressNull)); +} +/** Get Suppress Null. +@return Suppress columns or elements with NULL value */ +public boolean isSuppressNull() +{ +Object oo = get_Value("IsSuppressNull"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Calculate Variance (?ïŋ―). +@param IsVarianceCalc Calculate Variance */ +public void setIsVarianceCalc (boolean IsVarianceCalc) +{ +set_Value ("IsVarianceCalc", new Boolean(IsVarianceCalc)); +} +/** Get Calculate Variance (?ïŋ―). +@return Calculate Variance */ +public boolean isVarianceCalc() +{ +Object oo = get_Value("IsVarianceCalc"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** LineAlignmentType AD_Reference_ID=254 */ +public static final int LINEALIGNMENTTYPE_AD_Reference_ID=254; +/** Center = C */ +public static final String LINEALIGNMENTTYPE_Center = "C"; +/** Leading (left) = L */ +public static final String LINEALIGNMENTTYPE_LeadingLeft = "L"; +/** Trailing (right) = T */ +public static final String LINEALIGNMENTTYPE_TrailingRight = "T"; +/** None = X */ +public static final String LINEALIGNMENTTYPE_None = "X"; +/** Set Line Alignment. +@param LineAlignmentType Line Alignment */ +public void setLineAlignmentType (String LineAlignmentType) +{ +if (LineAlignmentType == null) throw new IllegalArgumentException ("LineAlignmentType is mandatory"); +if (LineAlignmentType.equals("C") || LineAlignmentType.equals("L") || LineAlignmentType.equals("T") || LineAlignmentType.equals("X")); + else throw new IllegalArgumentException ("LineAlignmentType Invalid value - " + LineAlignmentType + " - Reference_ID=254 - C - L - T - X"); +if (LineAlignmentType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LineAlignmentType = LineAlignmentType.substring(0,0); +} +set_Value ("LineAlignmentType", LineAlignmentType); +} +/** Get Line Alignment. +@return Line Alignment */ +public String getLineAlignmentType() +{ +return (String)get_Value("LineAlignmentType"); +} +/** Set Line Width. +@param LineWidth Width of the lines */ +public void setLineWidth (int LineWidth) +{ +set_Value ("LineWidth", new Integer(LineWidth)); +} +/** Get Line Width. +@return Width of the lines */ +public int getLineWidth() +{ +Integer ii = (Integer)get_Value("LineWidth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Max Height. +@param MaxHeight Maximum Height in 1/72 if an inch - 0 = no restriction */ +public void setMaxHeight (int MaxHeight) +{ +set_Value ("MaxHeight", new Integer(MaxHeight)); +} +/** Get Max Height. +@return Maximum Height in 1/72 if an inch - 0 = no restriction */ +public int getMaxHeight() +{ +Integer ii = (Integer)get_Value("MaxHeight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Max Width. +@param MaxWidth Maximum Width in 1/72 if an inch - 0 = no restriction */ +public void setMaxWidth (int MaxWidth) +{ +set_Value ("MaxWidth", new Integer(MaxWidth)); +} +/** Get Max Width. +@return Maximum Width in 1/72 if an inch - 0 = no restriction */ +public int getMaxWidth() +{ +Integer ii = (Integer)get_Value("MaxWidth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** PrintAreaType AD_Reference_ID=256 */ +public static final int PRINTAREATYPE_AD_Reference_ID=256; +/** Content = C */ +public static final String PRINTAREATYPE_Content = "C"; +/** Footer = F */ +public static final String PRINTAREATYPE_Footer = "F"; +/** Header = H */ +public static final String PRINTAREATYPE_Header = "H"; +/** Set Area. +@param PrintAreaType Print Area */ +public void setPrintAreaType (String PrintAreaType) +{ +if (PrintAreaType == null) throw new IllegalArgumentException ("PrintAreaType is mandatory"); +if (PrintAreaType.equals("C") || PrintAreaType.equals("F") || PrintAreaType.equals("H")); + else throw new IllegalArgumentException ("PrintAreaType Invalid value - " + PrintAreaType + " - Reference_ID=256 - C - F - H"); +if (PrintAreaType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PrintAreaType = PrintAreaType.substring(0,0); +} +set_Value ("PrintAreaType", PrintAreaType); +} +/** Get Area. +@return Print Area */ +public String getPrintAreaType() +{ +return (String)get_Value("PrintAreaType"); +} + +/** PrintFormatType AD_Reference_ID=255 */ +public static final int PRINTFORMATTYPE_AD_Reference_ID=255; +/** Field = F */ +public static final String PRINTFORMATTYPE_Field = "F"; +/** Image = I */ +public static final String PRINTFORMATTYPE_Image = "I"; +/** Line = L */ +public static final String PRINTFORMATTYPE_Line = "L"; +/** Print Format = P */ +public static final String PRINTFORMATTYPE_PrintFormat = "P"; +/** Rectangle = R */ +public static final String PRINTFORMATTYPE_Rectangle = "R"; +/** Text = T */ +public static final String PRINTFORMATTYPE_Text = "T"; +/** Set Format Type. +@param PrintFormatType Print Format Type */ +public void setPrintFormatType (String PrintFormatType) +{ +if (PrintFormatType == null) throw new IllegalArgumentException ("PrintFormatType is mandatory"); +if (PrintFormatType.equals("F") || PrintFormatType.equals("I") || PrintFormatType.equals("L") || PrintFormatType.equals("P") || PrintFormatType.equals("R") || PrintFormatType.equals("T")); + else throw new IllegalArgumentException ("PrintFormatType Invalid value - " + PrintFormatType + " - Reference_ID=255 - F - I - L - P - R - T"); +if (PrintFormatType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PrintFormatType = PrintFormatType.substring(0,0); +} +set_Value ("PrintFormatType", PrintFormatType); +} +/** Get Format Type. +@return Print Format Type */ +public String getPrintFormatType() +{ +return (String)get_Value("PrintFormatType"); +} +/** Set Print Text. +@param PrintName The label text to be printed on a document or correspondence. */ +public void setPrintName (String PrintName) +{ +if (PrintName != null && PrintName.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +PrintName = PrintName.substring(0,1999); +} +set_Value ("PrintName", PrintName); +} +/** Get Print Text. +@return The label text to be printed on a document or correspondence. */ +public String getPrintName() +{ +return (String)get_Value("PrintName"); +} +/** Set Print Label Suffix. +@param PrintNameSuffix The label text to be printed on a document or correspondence after the field */ +public void setPrintNameSuffix (String PrintNameSuffix) +{ +if (PrintNameSuffix != null && PrintNameSuffix.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PrintNameSuffix = PrintNameSuffix.substring(0,59); +} +set_Value ("PrintNameSuffix", PrintNameSuffix); +} +/** Get Print Label Suffix. +@return The label text to be printed on a document or correspondence after the field */ +public String getPrintNameSuffix() +{ +return (String)get_Value("PrintNameSuffix"); +} +/** Set Running Total Lines. +@param RunningTotalLines Create Running Total Lines (page break) every x lines */ +public void setRunningTotalLines (int RunningTotalLines) +{ +set_Value ("RunningTotalLines", new Integer(RunningTotalLines)); +} +/** Get Running Total Lines. +@return Create Running Total Lines (page break) every x lines */ +public int getRunningTotalLines() +{ +Integer ii = (Integer)get_Value("RunningTotalLines"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ShapeType AD_Reference_ID=333 */ +public static final int SHAPETYPE_AD_Reference_ID=333; +/** 3D Rectangle = 3 */ +public static final String SHAPETYPE_3DRectangle = "3"; +/** Normal Rectangle = N */ +public static final String SHAPETYPE_NormalRectangle = "N"; +/** Oval = O */ +public static final String SHAPETYPE_Oval = "O"; +/** Round Rectangle = R */ +public static final String SHAPETYPE_RoundRectangle = "R"; +/** Set Shape Type. +@param ShapeType Type of the shape to be painted */ +public void setShapeType (String ShapeType) +{ +if (ShapeType == null) throw new IllegalArgumentException ("ShapeType is mandatory"); +if (ShapeType == null || ShapeType.equals("3") || ShapeType.equals("N") || ShapeType.equals("O") || ShapeType.equals("R")); + else throw new IllegalArgumentException ("ShapeType Invalid value - " + ShapeType + " - Reference_ID=333 - 3 - N - O - R"); +if (ShapeType != null && ShapeType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ShapeType = ShapeType.substring(0,0); +} +set_Value ("ShapeType", ShapeType); +} +/** Get Shape Type. +@return Type of the shape to be painted */ +public String getShapeType() +{ +return (String)get_Value("ShapeType"); +} +/** Set Record Sort No. +@param SortNo Determines in what order the records are displayed */ +public void setSortNo (int SortNo) +{ +set_Value ("SortNo", new Integer(SortNo)); +} +/** Get Record Sort No. +@return Determines in what order the records are displayed */ +public int getSortNo() +{ +Integer ii = (Integer)get_Value("SortNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set X Position. +@param XPosition Absolute X (horizontal) position in 1/72 of an inch */ +public void setXPosition (int XPosition) +{ +set_Value ("XPosition", new Integer(XPosition)); +} +/** Get X Position. +@return Absolute X (horizontal) position in 1/72 of an inch */ +public int getXPosition() +{ +Integer ii = (Integer)get_Value("XPosition"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set X Space. +@param XSpace Relative X (horizontal) space in 1/72 of an inch */ +public void setXSpace (int XSpace) +{ +set_Value ("XSpace", new Integer(XSpace)); +} +/** Get X Space. +@return Relative X (horizontal) space in 1/72 of an inch */ +public int getXSpace() +{ +Integer ii = (Integer)get_Value("XSpace"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Y Position. +@param YPosition Absolute Y (vertical) position in 1/72 of an inch */ +public void setYPosition (int YPosition) +{ +set_Value ("YPosition", new Integer(YPosition)); +} +/** Get Y Position. +@return Absolute Y (vertical) position in 1/72 of an inch */ +public int getYPosition() +{ +Integer ii = (Integer)get_Value("YPosition"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Y Space. +@param YSpace Relative Y (vertical) space in 1/72 of an inch */ +public void setYSpace (int YSpace) +{ +set_Value ("YSpace", new Integer(YSpace)); +} +/** Get Y Space. +@return Relative Y (vertical) space in 1/72 of an inch */ +public int getYSpace() +{ +Integer ii = (Integer)get_Value("YSpace"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintGraph.java b/dbPort/src/org/compiere/model/X_AD_PrintGraph.java new file mode 100644 index 0000000000..1af651a3aa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintGraph.java @@ -0,0 +1,305 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintGraph + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.515 */ +public class X_AD_PrintGraph extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintGraph_ID id +@param trxName transaction +*/ +public X_AD_PrintGraph (Properties ctx, int AD_PrintGraph_ID, String trxName) +{ +super (ctx, AD_PrintGraph_ID, trxName); +/** if (AD_PrintGraph_ID == 0) +{ +setAD_PrintFormat_ID (0); // 0 +setAD_PrintGraph_ID (0); +setData_PrintFormatItem_ID (0); +setDescription_PrintFormatItem_ID (0); +setGraphType (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintGraph (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=521 */ +public static final int Table_ID=521; + +/** TableName=AD_PrintGraph */ +public static final String Table_Name="AD_PrintGraph"; + +protected static KeyNamePair Model = new KeyNamePair(521,"AD_PrintGraph"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintGraph[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID < 1) throw new IllegalArgumentException ("AD_PrintFormat_ID is mandatory."); +set_Value ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Graph. +@param AD_PrintGraph_ID Graph included in Reports */ +public void setAD_PrintGraph_ID (int AD_PrintGraph_ID) +{ +if (AD_PrintGraph_ID < 1) throw new IllegalArgumentException ("AD_PrintGraph_ID is mandatory."); +set_ValueNoCheck ("AD_PrintGraph_ID", new Integer(AD_PrintGraph_ID)); +} +/** Get Graph. +@return Graph included in Reports */ +public int getAD_PrintGraph_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintGraph_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Data1_PrintFormatItem_ID AD_Reference_ID=264 */ +public static final int DATA1_PRINTFORMATITEM_ID_AD_Reference_ID=264; +/** Set Data Column 2. +@param Data1_PrintFormatItem_ID Data Column for Line Charts */ +public void setData1_PrintFormatItem_ID (int Data1_PrintFormatItem_ID) +{ +if (Data1_PrintFormatItem_ID <= 0) set_Value ("Data1_PrintFormatItem_ID", null); + else +set_Value ("Data1_PrintFormatItem_ID", new Integer(Data1_PrintFormatItem_ID)); +} +/** Get Data Column 2. +@return Data Column for Line Charts */ +public int getData1_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("Data1_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Data2_PrintFormatItem_ID AD_Reference_ID=264 */ +public static final int DATA2_PRINTFORMATITEM_ID_AD_Reference_ID=264; +/** Set Data Column 3. +@param Data2_PrintFormatItem_ID Data Column for Line Charts */ +public void setData2_PrintFormatItem_ID (int Data2_PrintFormatItem_ID) +{ +if (Data2_PrintFormatItem_ID <= 0) set_Value ("Data2_PrintFormatItem_ID", null); + else +set_Value ("Data2_PrintFormatItem_ID", new Integer(Data2_PrintFormatItem_ID)); +} +/** Get Data Column 3. +@return Data Column for Line Charts */ +public int getData2_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("Data2_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Data3_PrintFormatItem_ID AD_Reference_ID=264 */ +public static final int DATA3_PRINTFORMATITEM_ID_AD_Reference_ID=264; +/** Set Data Column 4. +@param Data3_PrintFormatItem_ID Data Column for Line Charts */ +public void setData3_PrintFormatItem_ID (int Data3_PrintFormatItem_ID) +{ +if (Data3_PrintFormatItem_ID <= 0) set_Value ("Data3_PrintFormatItem_ID", null); + else +set_Value ("Data3_PrintFormatItem_ID", new Integer(Data3_PrintFormatItem_ID)); +} +/** Get Data Column 4. +@return Data Column for Line Charts */ +public int getData3_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("Data3_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Data4_PrintFormatItem_ID AD_Reference_ID=264 */ +public static final int DATA4_PRINTFORMATITEM_ID_AD_Reference_ID=264; +/** Set Data Column 5. +@param Data4_PrintFormatItem_ID Data Column for Line Charts */ +public void setData4_PrintFormatItem_ID (int Data4_PrintFormatItem_ID) +{ +if (Data4_PrintFormatItem_ID <= 0) set_Value ("Data4_PrintFormatItem_ID", null); + else +set_Value ("Data4_PrintFormatItem_ID", new Integer(Data4_PrintFormatItem_ID)); +} +/** Get Data Column 5. +@return Data Column for Line Charts */ +public int getData4_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("Data4_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Data_PrintFormatItem_ID AD_Reference_ID=264 */ +public static final int DATA_PRINTFORMATITEM_ID_AD_Reference_ID=264; +/** Set Data Column. +@param Data_PrintFormatItem_ID Data Column for Pie and Line Charts */ +public void setData_PrintFormatItem_ID (int Data_PrintFormatItem_ID) +{ +if (Data_PrintFormatItem_ID < 1) throw new IllegalArgumentException ("Data_PrintFormatItem_ID is mandatory."); +set_Value ("Data_PrintFormatItem_ID", new Integer(Data_PrintFormatItem_ID)); +} +/** Get Data Column. +@return Data Column for Pie and Line Charts */ +public int getData_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("Data_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** Description_PrintFormatItem_ID AD_Reference_ID=264 */ +public static final int DESCRIPTION_PRINTFORMATITEM_ID_AD_Reference_ID=264; +/** Set Description Column. +@param Description_PrintFormatItem_ID Description Column for Pie/Line/Bar Charts */ +public void setDescription_PrintFormatItem_ID (int Description_PrintFormatItem_ID) +{ +if (Description_PrintFormatItem_ID < 1) throw new IllegalArgumentException ("Description_PrintFormatItem_ID is mandatory."); +set_Value ("Description_PrintFormatItem_ID", new Integer(Description_PrintFormatItem_ID)); +} +/** Get Description Column. +@return Description Column for Pie/Line/Bar Charts */ +public int getDescription_PrintFormatItem_ID() +{ +Integer ii = (Integer)get_Value("Description_PrintFormatItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** GraphType AD_Reference_ID=265 */ +public static final int GRAPHTYPE_AD_Reference_ID=265; +/** Bar Chart = B */ +public static final String GRAPHTYPE_BarChart = "B"; +/** Line Chart = L */ +public static final String GRAPHTYPE_LineChart = "L"; +/** Pie Chart = P */ +public static final String GRAPHTYPE_PieChart = "P"; +/** Set Graph Type. +@param GraphType Type of graph to be painted */ +public void setGraphType (String GraphType) +{ +if (GraphType == null) throw new IllegalArgumentException ("GraphType is mandatory"); +if (GraphType.equals("B") || GraphType.equals("L") || GraphType.equals("P")); + else throw new IllegalArgumentException ("GraphType Invalid value - " + GraphType + " - Reference_ID=265 - B - L - P"); +if (GraphType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GraphType = GraphType.substring(0,0); +} +set_Value ("GraphType", GraphType); +} +/** Get Graph Type. +@return Type of graph to be painted */ +public String getGraphType() +{ +return (String)get_Value("GraphType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintLabel.java b/dbPort/src/org/compiere/model/X_AD_PrintLabel.java new file mode 100644 index 0000000000..dd19cb67bd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintLabel.java @@ -0,0 +1,243 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintLabel + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.562 */ +public class X_AD_PrintLabel extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintLabel_ID id +@param trxName transaction +*/ +public X_AD_PrintLabel (Properties ctx, int AD_PrintLabel_ID, String trxName) +{ +super (ctx, AD_PrintLabel_ID, trxName); +/** if (AD_PrintLabel_ID == 0) +{ +setAD_LabelPrinter_ID (0); +setAD_PrintLabel_ID (0); +setAD_Table_ID (0); +setIsLandscape (false); +setLabelHeight (0); +setLabelWidth (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintLabel (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=570 */ +public static final int Table_ID=570; + +/** TableName=AD_PrintLabel */ +public static final String Table_Name="AD_PrintLabel"; + +protected static KeyNamePair Model = new KeyNamePair(570,"AD_PrintLabel"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintLabel[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Label printer. +@param AD_LabelPrinter_ID Label Printer Definition */ +public void setAD_LabelPrinter_ID (int AD_LabelPrinter_ID) +{ +if (AD_LabelPrinter_ID < 1) throw new IllegalArgumentException ("AD_LabelPrinter_ID is mandatory."); +set_Value ("AD_LabelPrinter_ID", new Integer(AD_LabelPrinter_ID)); +} +/** Get Label printer. +@return Label Printer Definition */ +public int getAD_LabelPrinter_ID() +{ +Integer ii = (Integer)get_Value("AD_LabelPrinter_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Label. +@param AD_PrintLabel_ID Label Format to print */ +public void setAD_PrintLabel_ID (int AD_PrintLabel_ID) +{ +if (AD_PrintLabel_ID < 1) throw new IllegalArgumentException ("AD_PrintLabel_ID is mandatory."); +set_ValueNoCheck ("AD_PrintLabel_ID", new Integer(AD_PrintLabel_ID)); +} +/** Get Print Label. +@return Label Format to print */ +public int getAD_PrintLabel_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintLabel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Landscape. +@param IsLandscape Landscape orientation */ +public void setIsLandscape (boolean IsLandscape) +{ +set_Value ("IsLandscape", new Boolean(IsLandscape)); +} +/** Get Landscape. +@return Landscape orientation */ +public boolean isLandscape() +{ +Object oo = get_Value("IsLandscape"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Label Height. +@param LabelHeight Height of the label */ +public void setLabelHeight (int LabelHeight) +{ +set_Value ("LabelHeight", new Integer(LabelHeight)); +} +/** Get Label Height. +@return Height of the label */ +public int getLabelHeight() +{ +Integer ii = (Integer)get_Value("LabelHeight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Label Width. +@param LabelWidth Width of the Label */ +public void setLabelWidth (int LabelWidth) +{ +set_Value ("LabelWidth", new Integer(LabelWidth)); +} +/** Get Label Width. +@return Width of the Label */ +public int getLabelWidth() +{ +Integer ii = (Integer)get_Value("LabelWidth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Printer Name. +@param PrinterName Name of the Printer */ +public void setPrinterName (String PrinterName) +{ +if (PrinterName != null && PrinterName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +PrinterName = PrinterName.substring(0,39); +} +set_Value ("PrinterName", PrinterName); +} +/** Get Printer Name. +@return Name of the Printer */ +public String getPrinterName() +{ +return (String)get_Value("PrinterName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintLabelLine.java b/dbPort/src/org/compiere/model/X_AD_PrintLabelLine.java new file mode 100644 index 0000000000..4a32f32a6a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintLabelLine.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintLabelLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.562 */ +public class X_AD_PrintLabelLine extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintLabelLine_ID id +@param trxName transaction +*/ +public X_AD_PrintLabelLine (Properties ctx, int AD_PrintLabelLine_ID, String trxName) +{ +super (ctx, AD_PrintLabelLine_ID, trxName); +/** if (AD_PrintLabelLine_ID == 0) +{ +setAD_LabelPrinterFunction_ID (0); +setAD_PrintLabelLine_ID (0); +setAD_PrintLabel_ID (0); +setLabelFormatType (null); // F +setName (null); +setSeqNo (0); +setXPosition (0); +setYPosition (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintLabelLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=569 */ +public static final int Table_ID=569; + +/** TableName=AD_PrintLabelLine */ +public static final String Table_Name="AD_PrintLabelLine"; + +protected static KeyNamePair Model = new KeyNamePair(569,"AD_PrintLabelLine"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintLabelLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Label printer Function. +@param AD_LabelPrinterFunction_ID Function of Label Printer */ +public void setAD_LabelPrinterFunction_ID (int AD_LabelPrinterFunction_ID) +{ +if (AD_LabelPrinterFunction_ID < 1) throw new IllegalArgumentException ("AD_LabelPrinterFunction_ID is mandatory."); +set_Value ("AD_LabelPrinterFunction_ID", new Integer(AD_LabelPrinterFunction_ID)); +} +/** Get Label printer Function. +@return Function of Label Printer */ +public int getAD_LabelPrinterFunction_ID() +{ +Integer ii = (Integer)get_Value("AD_LabelPrinterFunction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Label Line. +@param AD_PrintLabelLine_ID Print Label Line Format */ +public void setAD_PrintLabelLine_ID (int AD_PrintLabelLine_ID) +{ +if (AD_PrintLabelLine_ID < 1) throw new IllegalArgumentException ("AD_PrintLabelLine_ID is mandatory."); +set_ValueNoCheck ("AD_PrintLabelLine_ID", new Integer(AD_PrintLabelLine_ID)); +} +/** Get Print Label Line. +@return Print Label Line Format */ +public int getAD_PrintLabelLine_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintLabelLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Print Label. +@param AD_PrintLabel_ID Label Format to print */ +public void setAD_PrintLabel_ID (int AD_PrintLabel_ID) +{ +if (AD_PrintLabel_ID < 1) throw new IllegalArgumentException ("AD_PrintLabel_ID is mandatory."); +set_ValueNoCheck ("AD_PrintLabel_ID", new Integer(AD_PrintLabel_ID)); +} +/** Get Print Label. +@return Label Format to print */ +public int getAD_PrintLabel_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintLabel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** LabelFormatType AD_Reference_ID=280 */ +public static final int LABELFORMATTYPE_AD_Reference_ID=280; +/** Field = F */ +public static final String LABELFORMATTYPE_Field = "F"; +/** Text = T */ +public static final String LABELFORMATTYPE_Text = "T"; +/** Set Label Format Type. +@param LabelFormatType Label Format Type */ +public void setLabelFormatType (String LabelFormatType) +{ +if (LabelFormatType == null) throw new IllegalArgumentException ("LabelFormatType is mandatory"); +if (LabelFormatType.equals("F") || LabelFormatType.equals("T")); + else throw new IllegalArgumentException ("LabelFormatType Invalid value - " + LabelFormatType + " - Reference_ID=280 - F - T"); +if (LabelFormatType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LabelFormatType = LabelFormatType.substring(0,0); +} +set_Value ("LabelFormatType", LabelFormatType); +} +/** Get Label Format Type. +@return Label Format Type */ +public String getLabelFormatType() +{ +return (String)get_Value("LabelFormatType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Print Text. +@param PrintName The label text to be printed on a document or correspondence. */ +public void setPrintName (String PrintName) +{ +if (PrintName != null && PrintName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PrintName = PrintName.substring(0,59); +} +set_Value ("PrintName", PrintName); +} +/** Get Print Text. +@return The label text to be printed on a document or correspondence. */ +public String getPrintName() +{ +return (String)get_Value("PrintName"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +/** Set X Position. +@param XPosition Absolute X (horizontal) position in 1/72 of an inch */ +public void setXPosition (int XPosition) +{ +set_Value ("XPosition", new Integer(XPosition)); +} +/** Get X Position. +@return Absolute X (horizontal) position in 1/72 of an inch */ +public int getXPosition() +{ +Integer ii = (Integer)get_Value("XPosition"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Y Position. +@param YPosition Absolute Y (vertical) position in 1/72 of an inch */ +public void setYPosition (int YPosition) +{ +set_Value ("YPosition", new Integer(YPosition)); +} +/** Get Y Position. +@return Absolute Y (vertical) position in 1/72 of an inch */ +public int getYPosition() +{ +Integer ii = (Integer)get_Value("YPosition"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintPaper.java b/dbPort/src/org/compiere/model/X_AD_PrintPaper.java new file mode 100644 index 0000000000..c2bd4ee8a7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintPaper.java @@ -0,0 +1,335 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintPaper + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.593 */ +public class X_AD_PrintPaper extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintPaper_ID id +@param trxName transaction +*/ +public X_AD_PrintPaper (Properties ctx, int AD_PrintPaper_ID, String trxName) +{ +super (ctx, AD_PrintPaper_ID, trxName); +/** if (AD_PrintPaper_ID == 0) +{ +setAD_PrintPaper_ID (0); +setCode (null); // iso-a4 +setIsDefault (false); +setIsLandscape (true); // Y +setMarginBottom (0); // 36 +setMarginLeft (0); // 36 +setMarginRight (0); // 36 +setMarginTop (0); // 36 +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintPaper (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=492 */ +public static final int Table_ID=492; + +/** TableName=AD_PrintPaper */ +public static final String Table_Name="AD_PrintPaper"; + +protected static KeyNamePair Model = new KeyNamePair(492,"AD_PrintPaper"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintPaper[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Paper. +@param AD_PrintPaper_ID Printer paper definition */ +public void setAD_PrintPaper_ID (int AD_PrintPaper_ID) +{ +if (AD_PrintPaper_ID < 1) throw new IllegalArgumentException ("AD_PrintPaper_ID is mandatory."); +set_ValueNoCheck ("AD_PrintPaper_ID", new Integer(AD_PrintPaper_ID)); +} +/** Get Print Paper. +@return Printer paper definition */ +public int getAD_PrintPaper_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintPaper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Validation code. +@param Code Validation Code */ +public void setCode (String Code) +{ +if (Code == null) throw new IllegalArgumentException ("Code is mandatory."); +if (Code.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Code = Code.substring(0,1999); +} +set_Value ("Code", Code); +} +/** Get Validation code. +@return Validation Code */ +public String getCode() +{ +return (String)get_Value("Code"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DimensionUnits AD_Reference_ID=375 */ +public static final int DIMENSIONUNITS_AD_Reference_ID=375; +/** Inch = I */ +public static final String DIMENSIONUNITS_Inch = "I"; +/** MM = M */ +public static final String DIMENSIONUNITS_MM = "M"; +/** Set Dimension Units. +@param DimensionUnits Units of Dimension */ +public void setDimensionUnits (String DimensionUnits) +{ +if (DimensionUnits == null) throw new IllegalArgumentException ("DimensionUnits is mandatory"); +if (DimensionUnits == null || DimensionUnits.equals("I") || DimensionUnits.equals("M")); + else throw new IllegalArgumentException ("DimensionUnits Invalid value - " + DimensionUnits + " - Reference_ID=375 - I - M"); +if (DimensionUnits != null && DimensionUnits.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DimensionUnits = DimensionUnits.substring(0,0); +} +set_Value ("DimensionUnits", DimensionUnits); +} +/** Get Dimension Units. +@return Units of Dimension */ +public String getDimensionUnits() +{ +return (String)get_Value("DimensionUnits"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Landscape. +@param IsLandscape Landscape orientation */ +public void setIsLandscape (boolean IsLandscape) +{ +set_Value ("IsLandscape", new Boolean(IsLandscape)); +} +/** Get Landscape. +@return Landscape orientation */ +public boolean isLandscape() +{ +Object oo = get_Value("IsLandscape"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Bottom Margin. +@param MarginBottom Bottom Space in 1/72 inch */ +public void setMarginBottom (int MarginBottom) +{ +set_Value ("MarginBottom", new Integer(MarginBottom)); +} +/** Get Bottom Margin. +@return Bottom Space in 1/72 inch */ +public int getMarginBottom() +{ +Integer ii = (Integer)get_Value("MarginBottom"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Left Margin. +@param MarginLeft Left Space in 1/72 inch */ +public void setMarginLeft (int MarginLeft) +{ +set_Value ("MarginLeft", new Integer(MarginLeft)); +} +/** Get Left Margin. +@return Left Space in 1/72 inch */ +public int getMarginLeft() +{ +Integer ii = (Integer)get_Value("MarginLeft"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Right Margin. +@param MarginRight Right Space in 1/72 inch */ +public void setMarginRight (int MarginRight) +{ +set_Value ("MarginRight", new Integer(MarginRight)); +} +/** Get Right Margin. +@return Right Space in 1/72 inch */ +public int getMarginRight() +{ +Integer ii = (Integer)get_Value("MarginRight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Top Margin. +@param MarginTop Top Space in 1/72 inch */ +public void setMarginTop (int MarginTop) +{ +set_Value ("MarginTop", new Integer(MarginTop)); +} +/** Get Top Margin. +@return Top Space in 1/72 inch */ +public int getMarginTop() +{ +Integer ii = (Integer)get_Value("MarginTop"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Size X. +@param SizeX X (horizontal) dimension size */ +public void setSizeX (BigDecimal SizeX) +{ +set_Value ("SizeX", SizeX); +} +/** Get Size X. +@return X (horizontal) dimension size */ +public BigDecimal getSizeX() +{ +BigDecimal bd = (BigDecimal)get_Value("SizeX"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Size Y. +@param SizeY Y (vertical) dimension size */ +public void setSizeY (BigDecimal SizeY) +{ +set_Value ("SizeY", SizeY); +} +/** Get Size Y. +@return Y (vertical) dimension size */ +public BigDecimal getSizeY() +{ +BigDecimal bd = (BigDecimal)get_Value("SizeY"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_PrintTableFormat.java b/dbPort/src/org/compiere/model/X_AD_PrintTableFormat.java new file mode 100644 index 0000000000..f3221ae8f8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_PrintTableFormat.java @@ -0,0 +1,638 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_PrintTableFormat + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.609 */ +public class X_AD_PrintTableFormat extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_PrintTableFormat_ID id +@param trxName transaction +*/ +public X_AD_PrintTableFormat (Properties ctx, int AD_PrintTableFormat_ID, String trxName) +{ +super (ctx, AD_PrintTableFormat_ID, trxName); +/** if (AD_PrintTableFormat_ID == 0) +{ +setAD_PrintTableFormat_ID (0); +setIsDefault (false); +setIsPaintBoundaryLines (false); +setIsPaintHLines (false); +setIsPaintHeaderLines (true); // Y +setIsPaintVLines (false); +setIsPrintFunctionSymbols (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_PrintTableFormat (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=523 */ +public static final int Table_ID=523; + +/** TableName=AD_PrintTableFormat */ +public static final String Table_Name="AD_PrintTableFormat"; + +protected static KeyNamePair Model = new KeyNamePair(523,"AD_PrintTableFormat"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_PrintTableFormat[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Table Format. +@param AD_PrintTableFormat_ID Table Format in Reports */ +public void setAD_PrintTableFormat_ID (int AD_PrintTableFormat_ID) +{ +if (AD_PrintTableFormat_ID < 1) throw new IllegalArgumentException ("AD_PrintTableFormat_ID is mandatory."); +set_ValueNoCheck ("AD_PrintTableFormat_ID", new Integer(AD_PrintTableFormat_ID)); +} +/** Get Print Table Format. +@return Table Format in Reports */ +public int getAD_PrintTableFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintTableFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Footer Center. +@param FooterCenter Content of the center portion of the footer. */ +public void setFooterCenter (String FooterCenter) +{ +if (FooterCenter != null && FooterCenter.length() > 255) +{ +log.warning("Length > 255 - truncated"); +FooterCenter = FooterCenter.substring(0,254); +} +set_Value ("FooterCenter", FooterCenter); +} +/** Get Footer Center. +@return Content of the center portion of the footer. */ +public String getFooterCenter() +{ +return (String)get_Value("FooterCenter"); +} +/** Set Footer Left. +@param FooterLeft Content of the left portion of the footer. */ +public void setFooterLeft (String FooterLeft) +{ +if (FooterLeft != null && FooterLeft.length() > 255) +{ +log.warning("Length > 255 - truncated"); +FooterLeft = FooterLeft.substring(0,254); +} +set_Value ("FooterLeft", FooterLeft); +} +/** Get Footer Left. +@return Content of the left portion of the footer. */ +public String getFooterLeft() +{ +return (String)get_Value("FooterLeft"); +} +/** Set Footer Right. +@param FooterRight Content of the right portion of the footer. */ +public void setFooterRight (String FooterRight) +{ +if (FooterRight != null && FooterRight.length() > 255) +{ +log.warning("Length > 255 - truncated"); +FooterRight = FooterRight.substring(0,254); +} +set_Value ("FooterRight", FooterRight); +} +/** Get Footer Right. +@return Content of the right portion of the footer. */ +public String getFooterRight() +{ +return (String)get_Value("FooterRight"); +} + +/** FunctBG_PrintColor_ID AD_Reference_ID=266 */ +public static final int FUNCTBG_PRINTCOLOR_ID_AD_Reference_ID=266; +/** Set Function BG Color. +@param FunctBG_PrintColor_ID Function Background Color */ +public void setFunctBG_PrintColor_ID (int FunctBG_PrintColor_ID) +{ +if (FunctBG_PrintColor_ID <= 0) set_Value ("FunctBG_PrintColor_ID", null); + else +set_Value ("FunctBG_PrintColor_ID", new Integer(FunctBG_PrintColor_ID)); +} +/** Get Function BG Color. +@return Function Background Color */ +public int getFunctBG_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("FunctBG_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FunctFG_PrintColor_ID AD_Reference_ID=266 */ +public static final int FUNCTFG_PRINTCOLOR_ID_AD_Reference_ID=266; +/** Set Function Color. +@param FunctFG_PrintColor_ID Function Foreground Color */ +public void setFunctFG_PrintColor_ID (int FunctFG_PrintColor_ID) +{ +if (FunctFG_PrintColor_ID <= 0) set_Value ("FunctFG_PrintColor_ID", null); + else +set_Value ("FunctFG_PrintColor_ID", new Integer(FunctFG_PrintColor_ID)); +} +/** Get Function Color. +@return Function Foreground Color */ +public int getFunctFG_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("FunctFG_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Funct_PrintFont_ID AD_Reference_ID=267 */ +public static final int FUNCT_PRINTFONT_ID_AD_Reference_ID=267; +/** Set Function Font. +@param Funct_PrintFont_ID Function row Font */ +public void setFunct_PrintFont_ID (int Funct_PrintFont_ID) +{ +if (Funct_PrintFont_ID <= 0) set_Value ("Funct_PrintFont_ID", null); + else +set_Value ("Funct_PrintFont_ID", new Integer(Funct_PrintFont_ID)); +} +/** Get Function Font. +@return Function row Font */ +public int getFunct_PrintFont_ID() +{ +Integer ii = (Integer)get_Value("Funct_PrintFont_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** HdrLine_PrintColor_ID AD_Reference_ID=266 */ +public static final int HDRLINE_PRINTCOLOR_ID_AD_Reference_ID=266; +/** Set Header Line Color. +@param HdrLine_PrintColor_ID Table header row line color */ +public void setHdrLine_PrintColor_ID (int HdrLine_PrintColor_ID) +{ +if (HdrLine_PrintColor_ID <= 0) set_Value ("HdrLine_PrintColor_ID", null); + else +set_Value ("HdrLine_PrintColor_ID", new Integer(HdrLine_PrintColor_ID)); +} +/** Get Header Line Color. +@return Table header row line color */ +public int getHdrLine_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("HdrLine_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Header Stroke. +@param HdrStroke Width of the Header Line Stroke */ +public void setHdrStroke (BigDecimal HdrStroke) +{ +set_Value ("HdrStroke", HdrStroke); +} +/** Get Header Stroke. +@return Width of the Header Line Stroke */ +public BigDecimal getHdrStroke() +{ +BigDecimal bd = (BigDecimal)get_Value("HdrStroke"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** HdrStrokeType AD_Reference_ID=312 */ +public static final int HDRSTROKETYPE_AD_Reference_ID=312; +/** Dash-Dotted Line = 2 */ +public static final String HDRSTROKETYPE_Dash_DottedLine = "2"; +/** Dashed Line = D */ +public static final String HDRSTROKETYPE_DashedLine = "D"; +/** Solid Line = S */ +public static final String HDRSTROKETYPE_SolidLine = "S"; +/** Dotted Line = d */ +public static final String HDRSTROKETYPE_DottedLine = "d"; +/** Set Header Stroke Type. +@param HdrStrokeType Type of the Header Line Stroke */ +public void setHdrStrokeType (String HdrStrokeType) +{ +if (HdrStrokeType == null) throw new IllegalArgumentException ("HdrStrokeType is mandatory"); +if (HdrStrokeType == null || HdrStrokeType.equals("2") || HdrStrokeType.equals("D") || HdrStrokeType.equals("S") || HdrStrokeType.equals("d")); + else throw new IllegalArgumentException ("HdrStrokeType Invalid value - " + HdrStrokeType + " - Reference_ID=312 - 2 - D - S - d"); +if (HdrStrokeType != null && HdrStrokeType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +HdrStrokeType = HdrStrokeType.substring(0,0); +} +set_Value ("HdrStrokeType", HdrStrokeType); +} +/** Get Header Stroke Type. +@return Type of the Header Line Stroke */ +public String getHdrStrokeType() +{ +return (String)get_Value("HdrStrokeType"); +} + +/** HdrTextBG_PrintColor_ID AD_Reference_ID=266 */ +public static final int HDRTEXTBG_PRINTCOLOR_ID_AD_Reference_ID=266; +/** Set Header Row BG Color. +@param HdrTextBG_PrintColor_ID Background color of header row */ +public void setHdrTextBG_PrintColor_ID (int HdrTextBG_PrintColor_ID) +{ +if (HdrTextBG_PrintColor_ID <= 0) set_Value ("HdrTextBG_PrintColor_ID", null); + else +set_Value ("HdrTextBG_PrintColor_ID", new Integer(HdrTextBG_PrintColor_ID)); +} +/** Get Header Row BG Color. +@return Background color of header row */ +public int getHdrTextBG_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("HdrTextBG_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** HdrTextFG_PrintColor_ID AD_Reference_ID=266 */ +public static final int HDRTEXTFG_PRINTCOLOR_ID_AD_Reference_ID=266; +/** Set Header Row Color. +@param HdrTextFG_PrintColor_ID Foreground color if the table header row */ +public void setHdrTextFG_PrintColor_ID (int HdrTextFG_PrintColor_ID) +{ +if (HdrTextFG_PrintColor_ID <= 0) set_Value ("HdrTextFG_PrintColor_ID", null); + else +set_Value ("HdrTextFG_PrintColor_ID", new Integer(HdrTextFG_PrintColor_ID)); +} +/** Get Header Row Color. +@return Foreground color if the table header row */ +public int getHdrTextFG_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("HdrTextFG_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Hdr_PrintFont_ID AD_Reference_ID=267 */ +public static final int HDR_PRINTFONT_ID_AD_Reference_ID=267; +/** Set Header Row Font. +@param Hdr_PrintFont_ID Header row Font */ +public void setHdr_PrintFont_ID (int Hdr_PrintFont_ID) +{ +if (Hdr_PrintFont_ID <= 0) set_Value ("Hdr_PrintFont_ID", null); + else +set_Value ("Hdr_PrintFont_ID", new Integer(Hdr_PrintFont_ID)); +} +/** Get Header Row Font. +@return Header row Font */ +public int getHdr_PrintFont_ID() +{ +Integer ii = (Integer)get_Value("Hdr_PrintFont_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Header Center. +@param HeaderCenter Content of the center portion of the header. */ +public void setHeaderCenter (String HeaderCenter) +{ +if (HeaderCenter != null && HeaderCenter.length() > 255) +{ +log.warning("Length > 255 - truncated"); +HeaderCenter = HeaderCenter.substring(0,254); +} +set_Value ("HeaderCenter", HeaderCenter); +} +/** Get Header Center. +@return Content of the center portion of the header. */ +public String getHeaderCenter() +{ +return (String)get_Value("HeaderCenter"); +} +/** Set Header Left. +@param HeaderLeft Content of the left portion of the header. */ +public void setHeaderLeft (String HeaderLeft) +{ +if (HeaderLeft != null && HeaderLeft.length() > 255) +{ +log.warning("Length > 255 - truncated"); +HeaderLeft = HeaderLeft.substring(0,254); +} +set_Value ("HeaderLeft", HeaderLeft); +} +/** Get Header Left. +@return Content of the left portion of the header. */ +public String getHeaderLeft() +{ +return (String)get_Value("HeaderLeft"); +} +/** Set Header Right. +@param HeaderRight Content of the right portion of the header. */ +public void setHeaderRight (String HeaderRight) +{ +if (HeaderRight != null && HeaderRight.length() > 255) +{ +log.warning("Length > 255 - truncated"); +HeaderRight = HeaderRight.substring(0,254); +} +set_Value ("HeaderRight", HeaderRight); +} +/** Get Header Right. +@return Content of the right portion of the header. */ +public String getHeaderRight() +{ +return (String)get_Value("HeaderRight"); +} +/** Set Image attached. +@param ImageIsAttached The image to be printed is attached to the record */ +public void setImageIsAttached (boolean ImageIsAttached) +{ +set_Value ("ImageIsAttached", new Boolean(ImageIsAttached)); +} +/** Get Image attached. +@return The image to be printed is attached to the record */ +public boolean isImageIsAttached() +{ +Object oo = get_Value("ImageIsAttached"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Paint Boundary Lines. +@param IsPaintBoundaryLines Paint table boundary lines */ +public void setIsPaintBoundaryLines (boolean IsPaintBoundaryLines) +{ +set_Value ("IsPaintBoundaryLines", new Boolean(IsPaintBoundaryLines)); +} +/** Get Paint Boundary Lines. +@return Paint table boundary lines */ +public boolean isPaintBoundaryLines() +{ +Object oo = get_Value("IsPaintBoundaryLines"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Paint Horizontal Lines. +@param IsPaintHLines Paint horizontal lines */ +public void setIsPaintHLines (boolean IsPaintHLines) +{ +set_Value ("IsPaintHLines", new Boolean(IsPaintHLines)); +} +/** Get Paint Horizontal Lines. +@return Paint horizontal lines */ +public boolean isPaintHLines() +{ +Object oo = get_Value("IsPaintHLines"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Paint Header Lines. +@param IsPaintHeaderLines Paint Lines over/under the Header Line */ +public void setIsPaintHeaderLines (boolean IsPaintHeaderLines) +{ +set_Value ("IsPaintHeaderLines", new Boolean(IsPaintHeaderLines)); +} +/** Get Paint Header Lines. +@return Paint Lines over/under the Header Line */ +public boolean isPaintHeaderLines() +{ +Object oo = get_Value("IsPaintHeaderLines"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Paint Vertical Lines. +@param IsPaintVLines Paint vertical lines */ +public void setIsPaintVLines (boolean IsPaintVLines) +{ +set_Value ("IsPaintVLines", new Boolean(IsPaintVLines)); +} +/** Get Paint Vertical Lines. +@return Paint vertical lines */ +public boolean isPaintVLines() +{ +Object oo = get_Value("IsPaintVLines"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Print Function Symbols. +@param IsPrintFunctionSymbols Print Symbols for Functions (Sum, Average, Count) */ +public void setIsPrintFunctionSymbols (boolean IsPrintFunctionSymbols) +{ +set_Value ("IsPrintFunctionSymbols", new Boolean(IsPrintFunctionSymbols)); +} +/** Get Print Function Symbols. +@return Print Symbols for Functions (Sum, Average, Count) */ +public boolean isPrintFunctionSymbols() +{ +Object oo = get_Value("IsPrintFunctionSymbols"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line Stroke. +@param LineStroke Width of the Line Stroke */ +public void setLineStroke (BigDecimal LineStroke) +{ +set_Value ("LineStroke", LineStroke); +} +/** Get Line Stroke. +@return Width of the Line Stroke */ +public BigDecimal getLineStroke() +{ +BigDecimal bd = (BigDecimal)get_Value("LineStroke"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** LineStrokeType AD_Reference_ID=312 */ +public static final int LINESTROKETYPE_AD_Reference_ID=312; +/** Dash-Dotted Line = 2 */ +public static final String LINESTROKETYPE_Dash_DottedLine = "2"; +/** Dashed Line = D */ +public static final String LINESTROKETYPE_DashedLine = "D"; +/** Solid Line = S */ +public static final String LINESTROKETYPE_SolidLine = "S"; +/** Dotted Line = d */ +public static final String LINESTROKETYPE_DottedLine = "d"; +/** Set Line Stroke Type. +@param LineStrokeType Type of the Line Stroke */ +public void setLineStrokeType (String LineStrokeType) +{ +if (LineStrokeType == null) throw new IllegalArgumentException ("LineStrokeType is mandatory"); +if (LineStrokeType == null || LineStrokeType.equals("2") || LineStrokeType.equals("D") || LineStrokeType.equals("S") || LineStrokeType.equals("d")); + else throw new IllegalArgumentException ("LineStrokeType Invalid value - " + LineStrokeType + " - Reference_ID=312 - 2 - D - S - d"); +if (LineStrokeType != null && LineStrokeType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LineStrokeType = LineStrokeType.substring(0,0); +} +set_Value ("LineStrokeType", LineStrokeType); +} +/** Get Line Stroke Type. +@return Type of the Line Stroke */ +public String getLineStrokeType() +{ +return (String)get_Value("LineStrokeType"); +} + +/** Line_PrintColor_ID AD_Reference_ID=266 */ +public static final int LINE_PRINTCOLOR_ID_AD_Reference_ID=266; +/** Set Line Color. +@param Line_PrintColor_ID Table line color */ +public void setLine_PrintColor_ID (int Line_PrintColor_ID) +{ +if (Line_PrintColor_ID <= 0) set_Value ("Line_PrintColor_ID", null); + else +set_Value ("Line_PrintColor_ID", new Integer(Line_PrintColor_ID)); +} +/** Get Line Color. +@return Table line color */ +public int getLine_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("Line_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Private_Access.java b/dbPort/src/org/compiere/model/X_AD_Private_Access.java new file mode 100644 index 0000000000..734f9daa50 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Private_Access.java @@ -0,0 +1,135 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Private_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.671 */ +public class X_AD_Private_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Private_Access_ID id +@param trxName transaction +*/ +public X_AD_Private_Access (Properties ctx, int AD_Private_Access_ID, String trxName) +{ +super (ctx, AD_Private_Access_ID, trxName); +/** if (AD_Private_Access_ID == 0) +{ +setAD_Table_ID (0); +setAD_User_ID (0); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Private_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=627 */ +public static final int Table_ID=627; + +/** TableName=AD_Private_Access */ +public static final String Table_Name="AD_Private_Access"; + +protected static KeyNamePair Model = new KeyNamePair(627,"AD_Private_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Private_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Process.java b/dbPort/src/org/compiere/model/X_AD_Process.java new file mode 100644 index 0000000000..d3e3dfbebe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Process.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Process + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.671 */ +public class X_AD_Process extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Process_ID id +@param trxName transaction +*/ +public X_AD_Process (Properties ctx, int AD_Process_ID, String trxName) +{ +super (ctx, AD_Process_ID, trxName); +/** if (AD_Process_ID == 0) +{ +setAD_Process_ID (0); +setAccessLevel (null); +setEntityType (null); // U +setIsBetaFunctionality (false); +setIsReport (false); +setIsServerProcess (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Process (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=284 */ +public static final int Table_ID=284; + +/** TableName=AD_Process */ +public static final String Table_Name="AD_Process"; + +protected static KeyNamePair Model = new KeyNamePair(284,"AD_Process"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Process[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID <= 0) set_Value ("AD_PrintFormat_ID", null); + else +set_Value ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID < 1) throw new IllegalArgumentException ("AD_Process_ID is mandatory."); +set_ValueNoCheck ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report View. +@param AD_ReportView_ID View used to generate this report */ +public void setAD_ReportView_ID (int AD_ReportView_ID) +{ +if (AD_ReportView_ID <= 0) set_Value ("AD_ReportView_ID", null); + else +set_Value ("AD_ReportView_ID", new Integer(AD_ReportView_ID)); +} +/** Get Report View. +@return View used to generate this report */ +public int getAD_ReportView_ID() +{ +Integer ii = (Integer)get_Value("AD_ReportView_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID <= 0) set_Value ("AD_Workflow_ID", null); + else +set_Value ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AccessLevel AD_Reference_ID=5 */ +public static final int ACCESSLEVEL_AD_Reference_ID=5; +/** Organization = 1 */ +public static final String ACCESSLEVEL_Organization = "1"; +/** Client only = 2 */ +public static final String ACCESSLEVEL_ClientOnly = "2"; +/** Client+Organization = 3 */ +public static final String ACCESSLEVEL_ClientPlusOrganization = "3"; +/** System only = 4 */ +public static final String ACCESSLEVEL_SystemOnly = "4"; +/** System+Client = 6 */ +public static final String ACCESSLEVEL_SystemPlusClient = "6"; +/** All = 7 */ +public static final String ACCESSLEVEL_All = "7"; +/** Set Data Access Level. +@param AccessLevel Access Level required */ +public void setAccessLevel (String AccessLevel) +{ +if (AccessLevel == null) throw new IllegalArgumentException ("AccessLevel is mandatory"); +if (AccessLevel.equals("1") || AccessLevel.equals("2") || AccessLevel.equals("3") || AccessLevel.equals("4") || AccessLevel.equals("6") || AccessLevel.equals("7")); + else throw new IllegalArgumentException ("AccessLevel Invalid value - " + AccessLevel + " - Reference_ID=5 - 1 - 2 - 3 - 4 - 6 - 7"); +if (AccessLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccessLevel = AccessLevel.substring(0,0); +} +set_Value ("AccessLevel", AccessLevel); +} +/** Get Data Access Level. +@return Access Level required */ +public String getAccessLevel() +{ +return (String)get_Value("AccessLevel"); +} +/** Set Classname. +@param Classname Java Classname */ +public void setClassname (String Classname) +{ +if (Classname != null && Classname.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Classname = Classname.substring(0,59); +} +set_Value ("Classname", Classname); +} +/** Get Classname. +@return Java Classname */ +public String getClassname() +{ +return (String)get_Value("Classname"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Beta Functionality. +@param IsBetaFunctionality This functionality is considered Beta */ +public void setIsBetaFunctionality (boolean IsBetaFunctionality) +{ +set_Value ("IsBetaFunctionality", new Boolean(IsBetaFunctionality)); +} +/** Get Beta Functionality. +@return This functionality is considered Beta */ +public boolean isBetaFunctionality() +{ +Object oo = get_Value("IsBetaFunctionality"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Direct print. +@param IsDirectPrint Print without dialog */ +public void setIsDirectPrint (boolean IsDirectPrint) +{ +set_Value ("IsDirectPrint", new Boolean(IsDirectPrint)); +} +/** Get Direct print. +@return Print without dialog */ +public boolean isDirectPrint() +{ +Object oo = get_Value("IsDirectPrint"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Report. +@param IsReport Indicates a Report record */ +public void setIsReport (boolean IsReport) +{ +set_Value ("IsReport", new Boolean(IsReport)); +} +/** Get Report. +@return Indicates a Report record */ +public boolean isReport() +{ +Object oo = get_Value("IsReport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Server Process. +@param IsServerProcess Run this Process on Server only */ +public void setIsServerProcess (boolean IsServerProcess) +{ +set_Value ("IsServerProcess", new Boolean(IsServerProcess)); +} +/** Get Server Process. +@return Run this Process on Server only */ +public boolean isServerProcess() +{ +Object oo = get_Value("IsServerProcess"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Procedure. +@param ProcedureName Name of the Database Procedure */ +public void setProcedureName (String ProcedureName) +{ +if (ProcedureName != null && ProcedureName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProcedureName = ProcedureName.substring(0,59); +} +set_Value ("ProcedureName", ProcedureName); +} +/** Get Procedure. +@return Name of the Database Procedure */ +public String getProcedureName() +{ +return (String)get_Value("ProcedureName"); +} +/** Set Statistic Count. +@param Statistic_Count Internal statistics how often the entity was used */ +public void setStatistic_Count (int Statistic_Count) +{ +set_Value ("Statistic_Count", new Integer(Statistic_Count)); +} +/** Get Statistic Count. +@return Internal statistics how often the entity was used */ +public int getStatistic_Count() +{ +Integer ii = (Integer)get_Value("Statistic_Count"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Statistic Seconds. +@param Statistic_Seconds Internal statistics how many seconds a process took */ +public void setStatistic_Seconds (int Statistic_Seconds) +{ +set_Value ("Statistic_Seconds", new Integer(Statistic_Seconds)); +} +/** Get Statistic Seconds. +@return Internal statistics how many seconds a process took */ +public int getStatistic_Seconds() +{ +Integer ii = (Integer)get_Value("Statistic_Seconds"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +/** Set Workflow Key. +@param WorkflowValue Key of the Workflow to start */ +public void setWorkflowValue (String WorkflowValue) +{ +if (WorkflowValue != null && WorkflowValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +WorkflowValue = WorkflowValue.substring(0,39); +} +set_Value ("WorkflowValue", WorkflowValue); +} +/** Get Workflow Key. +@return Key of the Workflow to start */ +public String getWorkflowValue() +{ +return (String)get_Value("WorkflowValue"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Process_Access.java b/dbPort/src/org/compiere/model/X_AD_Process_Access.java new file mode 100644 index 0000000000..dc138e48ce --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Process_Access.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Process_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.703 */ +public class X_AD_Process_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Process_Access_ID id +@param trxName transaction +*/ +public X_AD_Process_Access (Properties ctx, int AD_Process_Access_ID, String trxName) +{ +super (ctx, AD_Process_Access_ID, trxName); +/** if (AD_Process_Access_ID == 0) +{ +setAD_Process_ID (0); +setAD_Role_ID (0); +setIsReadWrite (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Process_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=197 */ +public static final int Table_ID=197; + +/** TableName=AD_Process_Access */ +public static final String Table_Name="AD_Process_Access"; + +protected static KeyNamePair Model = new KeyNamePair(197,"AD_Process_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Process_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID < 1) throw new IllegalArgumentException ("AD_Process_ID is mandatory."); +set_ValueNoCheck ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Write. +@param IsReadWrite Field is read / write */ +public void setIsReadWrite (boolean IsReadWrite) +{ +set_Value ("IsReadWrite", new Boolean(IsReadWrite)); +} +/** Get Read Write. +@return Field is read / write */ +public boolean isReadWrite() +{ +Object oo = get_Value("IsReadWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Process_Para.java b/dbPort/src/org/compiere/model/X_AD_Process_Para.java new file mode 100644 index 0000000000..acfb7afc3b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Process_Para.java @@ -0,0 +1,470 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Process_Para + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.718 */ +public class X_AD_Process_Para extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Process_Para_ID id +@param trxName transaction +*/ +public X_AD_Process_Para (Properties ctx, int AD_Process_Para_ID, String trxName) +{ +super (ctx, AD_Process_Para_ID, trxName); +/** if (AD_Process_Para_ID == 0) +{ +setAD_Process_ID (0); +setAD_Process_Para_ID (0); +setAD_Reference_ID (0); +setColumnName (null); +setEntityType (null); // U +setFieldLength (0); +setIsCentrallyMaintained (true); // Y +setIsMandatory (false); +setIsRange (false); +setName (null); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_Process_Para WHERE AD_Process_ID=@AD_Process_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Process_Para (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=285 */ +public static final int Table_ID=285; + +/** TableName=AD_Process_Para */ +public static final String Table_Name="AD_Process_Para"; + +protected static KeyNamePair Model = new KeyNamePair(285,"AD_Process_Para"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Process_Para[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Element. +@param AD_Element_ID System Element enables the central maintenance of column description and help. */ +public void setAD_Element_ID (int AD_Element_ID) +{ +if (AD_Element_ID <= 0) set_Value ("AD_Element_ID", null); + else +set_Value ("AD_Element_ID", new Integer(AD_Element_ID)); +} +/** Get System Element. +@return System Element enables the central maintenance of column description and help. */ +public int getAD_Element_ID() +{ +Integer ii = (Integer)get_Value("AD_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID < 1) throw new IllegalArgumentException ("AD_Process_ID is mandatory."); +set_ValueNoCheck ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Parameter. +@param AD_Process_Para_ID Process Parameter */ +public void setAD_Process_Para_ID (int AD_Process_Para_ID) +{ +if (AD_Process_Para_ID < 1) throw new IllegalArgumentException ("AD_Process_Para_ID is mandatory."); +set_ValueNoCheck ("AD_Process_Para_ID", new Integer(AD_Process_Para_ID)); +} +/** Get Process Parameter. +@return Process Parameter */ +public int getAD_Process_Para_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_Para_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_ID AD_Reference_ID=1 */ +public static final int AD_REFERENCE_ID_AD_Reference_ID=1; +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_Value ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_Value_ID AD_Reference_ID=4 */ +public static final int AD_REFERENCE_VALUE_ID_AD_Reference_ID=4; +/** Set Reference Key. +@param AD_Reference_Value_ID Required to specify, if data type is Table or List */ +public void setAD_Reference_Value_ID (int AD_Reference_Value_ID) +{ +if (AD_Reference_Value_ID <= 0) set_Value ("AD_Reference_Value_ID", null); + else +set_Value ("AD_Reference_Value_ID", new Integer(AD_Reference_Value_ID)); +} +/** Get Reference Key. +@return Required to specify, if data type is Table or List */ +public int getAD_Reference_Value_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_Value_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dynamic Validation. +@param AD_Val_Rule_ID Dynamic Validation Rule */ +public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) +{ +if (AD_Val_Rule_ID <= 0) set_Value ("AD_Val_Rule_ID", null); + else +set_Value ("AD_Val_Rule_ID", new Integer(AD_Val_Rule_ID)); +} +/** Get Dynamic Validation. +@return Dynamic Validation Rule */ +public int getAD_Val_Rule_ID() +{ +Integer ii = (Integer)get_Value("AD_Val_Rule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set DB Column Name. +@param ColumnName Name of the column in the database */ +public void setColumnName (String ColumnName) +{ +if (ColumnName == null) throw new IllegalArgumentException ("ColumnName is mandatory."); +if (ColumnName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ColumnName = ColumnName.substring(0,39); +} +set_Value ("ColumnName", ColumnName); +} +/** Get DB Column Name. +@return Name of the column in the database */ +public String getColumnName() +{ +return (String)get_Value("ColumnName"); +} +/** Set Default Logic. +@param DefaultValue Default value hierarchy, separated by ; + */ +public void setDefaultValue (String DefaultValue) +{ +if (DefaultValue != null && DefaultValue.length() > 255) +{ +log.warning("Length > 255 - truncated"); +DefaultValue = DefaultValue.substring(0,254); +} +set_Value ("DefaultValue", DefaultValue); +} +/** Get Default Logic. +@return Default value hierarchy, separated by ; + */ +public String getDefaultValue() +{ +return (String)get_Value("DefaultValue"); +} +/** Set Default Logic 2. +@param DefaultValue2 Default value hierarchy, separated by ; + */ +public void setDefaultValue2 (String DefaultValue2) +{ +if (DefaultValue2 != null && DefaultValue2.length() > 255) +{ +log.warning("Length > 255 - truncated"); +DefaultValue2 = DefaultValue2.substring(0,254); +} +set_Value ("DefaultValue2", DefaultValue2); +} +/** Get Default Logic 2. +@return Default value hierarchy, separated by ; + */ +public String getDefaultValue2() +{ +return (String)get_Value("DefaultValue2"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Length. +@param FieldLength Length of the column in the database */ +public void setFieldLength (int FieldLength) +{ +set_Value ("FieldLength", new Integer(FieldLength)); +} +/** Get Length. +@return Length of the column in the database */ +public int getFieldLength() +{ +Integer ii = (Integer)get_Value("FieldLength"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Centrally maintained. +@param IsCentrallyMaintained Information maintained in System Element table */ +public void setIsCentrallyMaintained (boolean IsCentrallyMaintained) +{ +set_Value ("IsCentrallyMaintained", new Boolean(IsCentrallyMaintained)); +} +/** Get Centrally maintained. +@return Information maintained in System Element table */ +public boolean isCentrallyMaintained() +{ +Object oo = get_Value("IsCentrallyMaintained"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory. +@param IsMandatory Data entry is required in this column */ +public void setIsMandatory (boolean IsMandatory) +{ +set_Value ("IsMandatory", new Boolean(IsMandatory)); +} +/** Get Mandatory. +@return Data entry is required in this column */ +public boolean isMandatory() +{ +Object oo = get_Value("IsMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Range. +@param IsRange The parameter is a range of values */ +public void setIsRange (boolean IsRange) +{ +set_Value ("IsRange", new Boolean(IsRange)); +} +/** Get Range. +@return The parameter is a range of values */ +public boolean isRange() +{ +Object oo = get_Value("IsRange"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Value Format. +@param VFormat Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setVFormat (String VFormat) +{ +if (VFormat != null && VFormat.length() > 20) +{ +log.warning("Length > 20 - truncated"); +VFormat = VFormat.substring(0,19); +} +set_Value ("VFormat", VFormat); +} +/** Get Value Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getVFormat() +{ +return (String)get_Value("VFormat"); +} +/** Set Max. Value. +@param ValueMax Maximum Value for a field */ +public void setValueMax (String ValueMax) +{ +if (ValueMax != null && ValueMax.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ValueMax = ValueMax.substring(0,19); +} +set_Value ("ValueMax", ValueMax); +} +/** Get Max. Value. +@return Maximum Value for a field */ +public String getValueMax() +{ +return (String)get_Value("ValueMax"); +} +/** Set Min. Value. +@param ValueMin Minimum Value for a field */ +public void setValueMin (String ValueMin) +{ +if (ValueMin != null && ValueMin.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ValueMin = ValueMin.substring(0,19); +} +set_Value ("ValueMin", ValueMin); +} +/** Get Min. Value. +@return Minimum Value for a field */ +public String getValueMin() +{ +return (String)get_Value("ValueMin"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Record_Access.java b/dbPort/src/org/compiere/model/X_AD_Record_Access.java new file mode 100644 index 0000000000..1c4f1036f6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Record_Access.java @@ -0,0 +1,198 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Record_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.734 */ +public class X_AD_Record_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Record_Access_ID id +@param trxName transaction +*/ +public X_AD_Record_Access (Properties ctx, int AD_Record_Access_ID, String trxName) +{ +super (ctx, AD_Record_Access_ID, trxName); +/** if (AD_Record_Access_ID == 0) +{ +setAD_Role_ID (0); +setAD_Table_ID (0); +setIsDependentEntities (false); // N +setIsExclude (true); // Y +setIsReadOnly (false); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Record_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=567 */ +public static final int Table_ID=567; + +/** TableName=AD_Record_Access */ +public static final String Table_Name="AD_Record_Access"; + +protected static KeyNamePair Model = new KeyNamePair(567,"AD_Record_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Record_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Table_ID())); +} +/** Set Dependent Entities. +@param IsDependentEntities Also check access in dependent entities */ +public void setIsDependentEntities (boolean IsDependentEntities) +{ +set_Value ("IsDependentEntities", new Boolean(IsDependentEntities)); +} +/** Get Dependent Entities. +@return Also check access in dependent entities */ +public boolean isDependentEntities() +{ +Object oo = get_Value("IsDependentEntities"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Exclude. +@param IsExclude Exclude access to the data - if not selected Include access to the data */ +public void setIsExclude (boolean IsExclude) +{ +set_Value ("IsExclude", new Boolean(IsExclude)); +} +/** Get Exclude. +@return Exclude access to the data - if not selected Include access to the data */ +public boolean isExclude() +{ +Object oo = get_Value("IsExclude"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Ref_List.java b/dbPort/src/org/compiere/model/X_AD_Ref_List.java new file mode 100644 index 0000000000..587b549d4d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Ref_List.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Ref_List + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.75 */ +public class X_AD_Ref_List extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Ref_List_ID id +@param trxName transaction +*/ +public X_AD_Ref_List (Properties ctx, int AD_Ref_List_ID, String trxName) +{ +super (ctx, AD_Ref_List_ID, trxName); +/** if (AD_Ref_List_ID == 0) +{ +setAD_Ref_List_ID (0); +setAD_Reference_ID (0); +setEntityType (null); // U +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Ref_List (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=104 */ +public static final int Table_ID=104; + +/** TableName=AD_Ref_List */ +public static final String Table_Name="AD_Ref_List"; + +protected static KeyNamePair Model = new KeyNamePair(104,"AD_Ref_List"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Ref_List[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Reference List. +@param AD_Ref_List_ID Reference List based on Table */ +public void setAD_Ref_List_ID (int AD_Ref_List_ID) +{ +if (AD_Ref_List_ID < 1) throw new IllegalArgumentException ("AD_Ref_List_ID is mandatory."); +set_ValueNoCheck ("AD_Ref_List_ID", new Integer(AD_Ref_List_ID)); +} +/** Get Reference List. +@return Reference List based on Table */ +public int getAD_Ref_List_ID() +{ +Integer ii = (Integer)get_Value("AD_Ref_List_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_ValueNoCheck ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Value = Value.substring(0,59); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Ref_Table.java b/dbPort/src/org/compiere/model/X_AD_Ref_Table.java new file mode 100644 index 0000000000..45007314df --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Ref_Table.java @@ -0,0 +1,237 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Ref_Table + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.765 */ +public class X_AD_Ref_Table extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Ref_Table_ID id +@param trxName transaction +*/ +public X_AD_Ref_Table (Properties ctx, int AD_Ref_Table_ID, String trxName) +{ +super (ctx, AD_Ref_Table_ID, trxName); +/** if (AD_Ref_Table_ID == 0) +{ +setAD_Display (0); +setAD_Key (0); +setAD_Reference_ID (0); +setAD_Table_ID (0); +setEntityType (null); // U +setIsValueDisplayed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Ref_Table (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=103 */ +public static final int Table_ID=103; + +/** TableName=AD_Ref_Table */ +public static final String Table_Name="AD_Ref_Table"; + +protected static KeyNamePair Model = new KeyNamePair(103,"AD_Ref_Table"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Ref_Table[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Display AD_Reference_ID=3 */ +public static final int AD_DISPLAY_AD_Reference_ID=3; +/** Set Display column. +@param AD_Display Column that will display */ +public void setAD_Display (int AD_Display) +{ +set_Value ("AD_Display", new Integer(AD_Display)); +} +/** Get Display column. +@return Column that will display */ +public int getAD_Display() +{ +Integer ii = (Integer)get_Value("AD_Display"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Key AD_Reference_ID=3 */ +public static final int AD_KEY_AD_Reference_ID=3; +/** Set Key column. +@param AD_Key Unique identifier of a record */ +public void setAD_Key (int AD_Key) +{ +set_Value ("AD_Key", new Integer(AD_Key)); +} +/** Get Key column. +@return Unique identifier of a record */ +public int getAD_Key() +{ +Integer ii = (Integer)get_Value("AD_Key"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_ValueNoCheck ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Reference_ID())); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Display Value. +@param IsValueDisplayed Displays Value column with the Display column */ +public void setIsValueDisplayed (boolean IsValueDisplayed) +{ +set_Value ("IsValueDisplayed", new Boolean(IsValueDisplayed)); +} +/** Get Display Value. +@return Displays Value column with the Display column */ +public boolean isValueDisplayed() +{ +Object oo = get_Value("IsValueDisplayed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sql ORDER BY. +@param OrderByClause Fully qualified ORDER BY clause */ +public void setOrderByClause (String OrderByClause) +{ +if (OrderByClause != null && OrderByClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OrderByClause = OrderByClause.substring(0,1999); +} +set_Value ("OrderByClause", OrderByClause); +} +/** Get Sql ORDER BY. +@return Fully qualified ORDER BY clause */ +public String getOrderByClause() +{ +return (String)get_Value("OrderByClause"); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Reference.java b/dbPort/src/org/compiere/model/X_AD_Reference.java new file mode 100644 index 0000000000..b516b994da --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Reference.java @@ -0,0 +1,234 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Reference + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.781 */ +public class X_AD_Reference extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Reference_ID id +@param trxName transaction +*/ +public X_AD_Reference (Properties ctx, int AD_Reference_ID, String trxName) +{ +super (ctx, AD_Reference_ID, trxName); +/** if (AD_Reference_ID == 0) +{ +setAD_Reference_ID (0); +setEntityType (null); // U +setName (null); +setValidationType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Reference (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=102 */ +public static final int Table_ID=102; + +/** TableName=AD_Reference */ +public static final String Table_Name="AD_Reference"; + +protected static KeyNamePair Model = new KeyNamePair(102,"AD_Reference"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Reference[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_ValueNoCheck ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Value Format. +@param VFormat Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setVFormat (String VFormat) +{ +if (VFormat != null && VFormat.length() > 40) +{ +log.warning("Length > 40 - truncated"); +VFormat = VFormat.substring(0,39); +} +set_Value ("VFormat", VFormat); +} +/** Get Value Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getVFormat() +{ +return (String)get_Value("VFormat"); +} + +/** ValidationType AD_Reference_ID=2 */ +public static final int VALIDATIONTYPE_AD_Reference_ID=2; +/** DataType = D */ +public static final String VALIDATIONTYPE_DataType = "D"; +/** List Validation = L */ +public static final String VALIDATIONTYPE_ListValidation = "L"; +/** Table Validation = T */ +public static final String VALIDATIONTYPE_TableValidation = "T"; +/** Set Validation type. +@param ValidationType Different method of validating data */ +public void setValidationType (String ValidationType) +{ +if (ValidationType == null) throw new IllegalArgumentException ("ValidationType is mandatory"); +if (ValidationType.equals("D") || ValidationType.equals("L") || ValidationType.equals("T")); + else throw new IllegalArgumentException ("ValidationType Invalid value - " + ValidationType + " - Reference_ID=2 - D - L - T"); +if (ValidationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ValidationType = ValidationType.substring(0,0); +} +set_Value ("ValidationType", ValidationType); +} +/** Get Validation type. +@return Different method of validating data */ +public String getValidationType() +{ +return (String)get_Value("ValidationType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Registration.java b/dbPort/src/org/compiere/model/X_AD_Registration.java new file mode 100644 index 0000000000..5c7080ec90 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Registration.java @@ -0,0 +1,386 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Registration + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.796 */ +public class X_AD_Registration extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Registration_ID id +@param trxName transaction +*/ +public X_AD_Registration (Properties ctx, int AD_Registration_ID, String trxName) +{ +super (ctx, AD_Registration_ID, trxName); +/** if (AD_Registration_ID == 0) +{ +setAD_Registration_ID (0); // 0 +setAD_System_ID (0); // 0 +setIsAllowPublish (true); // Y +setIsAllowStatistics (true); // Y +setIsInProduction (false); +setIsRegistered (false); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Registration (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=625 */ +public static final int Table_ID=625; + +/** TableName=AD_Registration */ +public static final String Table_Name="AD_Registration"; + +protected static KeyNamePair Model = new KeyNamePair(625,"AD_Registration"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Registration[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Registration. +@param AD_Registration_ID System Registration */ +public void setAD_Registration_ID (int AD_Registration_ID) +{ +if (AD_Registration_ID < 1) throw new IllegalArgumentException ("AD_Registration_ID is mandatory."); +set_ValueNoCheck ("AD_Registration_ID", new Integer(AD_Registration_ID)); +} +/** Get System Registration. +@return System Registration */ +public int getAD_Registration_ID() +{ +Integer ii = (Integer)get_Value("AD_Registration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set System. +@param AD_System_ID System Definition */ +public void setAD_System_ID (int AD_System_ID) +{ +if (AD_System_ID < 1) throw new IllegalArgumentException ("AD_System_ID is mandatory."); +set_ValueNoCheck ("AD_System_ID", new Integer(AD_System_ID)); +} +/** Get System. +@return System Definition */ +public int getAD_System_ID() +{ +Integer ii = (Integer)get_Value("AD_System_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Industry Info. +@param IndustryInfo Information of the industry (e.g. professional service, distribution of furnitures, ..) */ +public void setIndustryInfo (String IndustryInfo) +{ +if (IndustryInfo != null && IndustryInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +IndustryInfo = IndustryInfo.substring(0,254); +} +set_Value ("IndustryInfo", IndustryInfo); +} +/** Get Industry Info. +@return Information of the industry (e.g. professional service, distribution of furnitures, ..) */ +public String getIndustryInfo() +{ +return (String)get_Value("IndustryInfo"); +} +/** Set Allowed to be Published. +@param IsAllowPublish You allow to publish the information, not just statistical summary info */ +public void setIsAllowPublish (boolean IsAllowPublish) +{ +set_Value ("IsAllowPublish", new Boolean(IsAllowPublish)); +} +/** Get Allowed to be Published. +@return You allow to publish the information, not just statistical summary info */ +public boolean isAllowPublish() +{ +Object oo = get_Value("IsAllowPublish"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Maintain Statistics. +@param IsAllowStatistics Maintain general statistics */ +public void setIsAllowStatistics (boolean IsAllowStatistics) +{ +set_Value ("IsAllowStatistics", new Boolean(IsAllowStatistics)); +} +/** Get Maintain Statistics. +@return Maintain general statistics */ +public boolean isAllowStatistics() +{ +Object oo = get_Value("IsAllowStatistics"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Production. +@param IsInProduction The system is in production */ +public void setIsInProduction (boolean IsInProduction) +{ +set_Value ("IsInProduction", new Boolean(IsInProduction)); +} +/** Get In Production. +@return The system is in production */ +public boolean isInProduction() +{ +Object oo = get_Value("IsInProduction"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Registered. +@param IsRegistered The application is registered. */ +public void setIsRegistered (boolean IsRegistered) +{ +set_ValueNoCheck ("IsRegistered", new Boolean(IsRegistered)); +} +/** Get Registered. +@return The application is registered. */ +public boolean isRegistered() +{ +Object oo = get_Value("IsRegistered"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Employees. +@param NumberEmployees Number of employees */ +public void setNumberEmployees (int NumberEmployees) +{ +set_Value ("NumberEmployees", new Integer(NumberEmployees)); +} +/** Get Employees. +@return Number of employees */ +public int getNumberEmployees() +{ +Integer ii = (Integer)get_Value("NumberEmployees"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Platform Info. +@param PlatformInfo Information about Server and Client Platform */ +public void setPlatformInfo (String PlatformInfo) +{ +if (PlatformInfo != null && PlatformInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +PlatformInfo = PlatformInfo.substring(0,254); +} +set_Value ("PlatformInfo", PlatformInfo); +} +/** Get Platform Info. +@return Information about Server and Client Platform */ +public String getPlatformInfo() +{ +return (String)get_Value("PlatformInfo"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_ValueNoCheck ("Record_ID", null); + else +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_ValueNoCheck ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_ValueNoCheck ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Sales Volume in 1.000. +@param SalesVolume Total Volume of Sales in Thousands of Currency */ +public void setSalesVolume (int SalesVolume) +{ +set_Value ("SalesVolume", new Integer(SalesVolume)); +} +/** Get Sales Volume in 1.000. +@return Total Volume of Sales in Thousands of Currency */ +public int getSalesVolume() +{ +Integer ii = (Integer)get_Value("SalesVolume"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Start Implementation/Production. +@param StartProductionDate The day you started the implementation (if implementing) - or production (went life) with Adempiere */ +public void setStartProductionDate (Timestamp StartProductionDate) +{ +set_Value ("StartProductionDate", StartProductionDate); +} +/** Get Start Implementation/Production. +@return The day you started the implementation (if implementing) - or production (went life) with Adempiere */ +public Timestamp getStartProductionDate() +{ +return (Timestamp)get_Value("StartProductionDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Replication.java b/dbPort/src/org/compiere/model/X_AD_Replication.java new file mode 100644 index 0000000000..768e097d41 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Replication.java @@ -0,0 +1,361 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Replication + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.812 */ +public class X_AD_Replication extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Replication_ID id +@param trxName transaction +*/ +public X_AD_Replication (Properties ctx, int AD_Replication_ID, String trxName) +{ +super (ctx, AD_Replication_ID, trxName); +/** if (AD_Replication_ID == 0) +{ +setAD_ReplicationStrategy_ID (0); +setAD_Replication_ID (0); +setHostAddress (null); +setHostPort (0); // 80 +setIsRMIoverHTTP (true); // Y +setName (null); +setRemote_Client_ID (0); +setRemote_Org_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Replication (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=605 */ +public static final int Table_ID=605; + +/** TableName=AD_Replication */ +public static final String Table_Name="AD_Replication"; + +protected static KeyNamePair Model = new KeyNamePair(605,"AD_Replication"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Replication[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Replication Strategy. +@param AD_ReplicationStrategy_ID Data Replication Strategy */ +public void setAD_ReplicationStrategy_ID (int AD_ReplicationStrategy_ID) +{ +if (AD_ReplicationStrategy_ID < 1) throw new IllegalArgumentException ("AD_ReplicationStrategy_ID is mandatory."); +set_Value ("AD_ReplicationStrategy_ID", new Integer(AD_ReplicationStrategy_ID)); +} +/** Get Replication Strategy. +@return Data Replication Strategy */ +public int getAD_ReplicationStrategy_ID() +{ +Integer ii = (Integer)get_Value("AD_ReplicationStrategy_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Replication. +@param AD_Replication_ID Data Replication Target */ +public void setAD_Replication_ID (int AD_Replication_ID) +{ +if (AD_Replication_ID < 1) throw new IllegalArgumentException ("AD_Replication_ID is mandatory."); +set_ValueNoCheck ("AD_Replication_ID", new Integer(AD_Replication_ID)); +} +/** Get Replication. +@return Data Replication Target */ +public int getAD_Replication_ID() +{ +Integer ii = (Integer)get_Value("AD_Replication_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_ValueNoCheck ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Host Address. +@param HostAddress Host Address URL or DNS */ +public void setHostAddress (String HostAddress) +{ +if (HostAddress == null) throw new IllegalArgumentException ("HostAddress is mandatory."); +if (HostAddress.length() > 60) +{ +log.warning("Length > 60 - truncated"); +HostAddress = HostAddress.substring(0,59); +} +set_Value ("HostAddress", HostAddress); +} +/** Get Host Address. +@return Host Address URL or DNS */ +public String getHostAddress() +{ +return (String)get_Value("HostAddress"); +} +/** Set Host port. +@param HostPort Host Communication Port */ +public void setHostPort (int HostPort) +{ +set_Value ("HostPort", new Integer(HostPort)); +} +/** Get Host port. +@return Host Communication Port */ +public int getHostPort() +{ +Integer ii = (Integer)get_Value("HostPort"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set ID Range End. +@param IDRangeEnd End if the ID Range used */ +public void setIDRangeEnd (BigDecimal IDRangeEnd) +{ +set_Value ("IDRangeEnd", IDRangeEnd); +} +/** Get ID Range End. +@return End if the ID Range used */ +public BigDecimal getIDRangeEnd() +{ +BigDecimal bd = (BigDecimal)get_Value("IDRangeEnd"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set ID Range Start. +@param IDRangeStart Start of the ID Range used */ +public void setIDRangeStart (BigDecimal IDRangeStart) +{ +set_Value ("IDRangeStart", IDRangeStart); +} +/** Get ID Range Start. +@return Start of the ID Range used */ +public BigDecimal getIDRangeStart() +{ +BigDecimal bd = (BigDecimal)get_Value("IDRangeStart"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tunnel via HTTP. +@param IsRMIoverHTTP Connect to Server via HTTP Tunnel */ +public void setIsRMIoverHTTP (boolean IsRMIoverHTTP) +{ +set_Value ("IsRMIoverHTTP", new Boolean(IsRMIoverHTTP)); +} +/** Get Tunnel via HTTP. +@return Connect to Server via HTTP Tunnel */ +public boolean isRMIoverHTTP() +{ +Object oo = get_Value("IsRMIoverHTTP"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Prefix. +@param Prefix Prefix before the sequence number */ +public void setPrefix (String Prefix) +{ +if (Prefix != null && Prefix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Prefix = Prefix.substring(0,9); +} +set_Value ("Prefix", Prefix); +} +/** Get Prefix. +@return Prefix before the sequence number */ +public String getPrefix() +{ +return (String)get_Value("Prefix"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** Remote_Client_ID AD_Reference_ID=129 */ +public static final int REMOTE_CLIENT_ID_AD_Reference_ID=129; +/** Set Remote Client. +@param Remote_Client_ID Remote Client to be used to replicate / synchronize data with. */ +public void setRemote_Client_ID (int Remote_Client_ID) +{ +if (Remote_Client_ID < 1) throw new IllegalArgumentException ("Remote_Client_ID is mandatory."); +set_ValueNoCheck ("Remote_Client_ID", new Integer(Remote_Client_ID)); +} +/** Get Remote Client. +@return Remote Client to be used to replicate / synchronize data with. */ +public int getRemote_Client_ID() +{ +Integer ii = (Integer)get_Value("Remote_Client_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Remote_Org_ID AD_Reference_ID=276 */ +public static final int REMOTE_ORG_ID_AD_Reference_ID=276; +/** Set Remote Organization. +@param Remote_Org_ID Remote Organization to be used to replicate / synchronize data with. */ +public void setRemote_Org_ID (int Remote_Org_ID) +{ +if (Remote_Org_ID < 1) throw new IllegalArgumentException ("Remote_Org_ID is mandatory."); +set_ValueNoCheck ("Remote_Org_ID", new Integer(Remote_Org_ID)); +} +/** Get Remote Organization. +@return Remote Organization to be used to replicate / synchronize data with. */ +public int getRemote_Org_ID() +{ +Integer ii = (Integer)get_Value("Remote_Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Suffix. +@param Suffix Suffix after the number */ +public void setSuffix (String Suffix) +{ +if (Suffix != null && Suffix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Suffix = Suffix.substring(0,9); +} +set_Value ("Suffix", Suffix); +} +/** Get Suffix. +@return Suffix after the number */ +public String getSuffix() +{ +return (String)get_Value("Suffix"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ReplicationStrategy.java b/dbPort/src/org/compiere/model/X_AD_ReplicationStrategy.java new file mode 100644 index 0000000000..01f604a946 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ReplicationStrategy.java @@ -0,0 +1,185 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ReplicationStrategy + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.828 */ +public class X_AD_ReplicationStrategy extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ReplicationStrategy_ID id +@param trxName transaction +*/ +public X_AD_ReplicationStrategy (Properties ctx, int AD_ReplicationStrategy_ID, String trxName) +{ +super (ctx, AD_ReplicationStrategy_ID, trxName); +/** if (AD_ReplicationStrategy_ID == 0) +{ +setAD_ReplicationStrategy_ID (0); +setEntityType (null); // U +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ReplicationStrategy (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=602 */ +public static final int Table_ID=602; + +/** TableName=AD_ReplicationStrategy */ +public static final String Table_Name="AD_ReplicationStrategy"; + +protected static KeyNamePair Model = new KeyNamePair(602,"AD_ReplicationStrategy"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ReplicationStrategy[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Replication Strategy. +@param AD_ReplicationStrategy_ID Data Replication Strategy */ +public void setAD_ReplicationStrategy_ID (int AD_ReplicationStrategy_ID) +{ +if (AD_ReplicationStrategy_ID < 1) throw new IllegalArgumentException ("AD_ReplicationStrategy_ID is mandatory."); +set_ValueNoCheck ("AD_ReplicationStrategy_ID", new Integer(AD_ReplicationStrategy_ID)); +} +/** Get Replication Strategy. +@return Data Replication Strategy */ +public int getAD_ReplicationStrategy_ID() +{ +Integer ii = (Integer)get_Value("AD_ReplicationStrategy_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ReplicationTable.java b/dbPort/src/org/compiere/model/X_AD_ReplicationTable.java new file mode 100644 index 0000000000..2c11eca4a2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ReplicationTable.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ReplicationTable + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.843 */ +public class X_AD_ReplicationTable extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ReplicationTable_ID id +@param trxName transaction +*/ +public X_AD_ReplicationTable (Properties ctx, int AD_ReplicationTable_ID, String trxName) +{ +super (ctx, AD_ReplicationTable_ID, trxName); +/** if (AD_ReplicationTable_ID == 0) +{ +setAD_ReplicationStrategy_ID (0); +setAD_ReplicationTable_ID (0); +setAD_Table_ID (0); +setEntityType (null); // U +setReplicationType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ReplicationTable (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=601 */ +public static final int Table_ID=601; + +/** TableName=AD_ReplicationTable */ +public static final String Table_Name="AD_ReplicationTable"; + +protected static KeyNamePair Model = new KeyNamePair(601,"AD_ReplicationTable"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ReplicationTable[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Replication Strategy. +@param AD_ReplicationStrategy_ID Data Replication Strategy */ +public void setAD_ReplicationStrategy_ID (int AD_ReplicationStrategy_ID) +{ +if (AD_ReplicationStrategy_ID < 1) throw new IllegalArgumentException ("AD_ReplicationStrategy_ID is mandatory."); +set_ValueNoCheck ("AD_ReplicationStrategy_ID", new Integer(AD_ReplicationStrategy_ID)); +} +/** Get Replication Strategy. +@return Data Replication Strategy */ +public int getAD_ReplicationStrategy_ID() +{ +Integer ii = (Integer)get_Value("AD_ReplicationStrategy_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_ReplicationStrategy_ID())); +} +/** Set Replication Table. +@param AD_ReplicationTable_ID Data Replication Strategy Table Info */ +public void setAD_ReplicationTable_ID (int AD_ReplicationTable_ID) +{ +if (AD_ReplicationTable_ID < 1) throw new IllegalArgumentException ("AD_ReplicationTable_ID is mandatory."); +set_ValueNoCheck ("AD_ReplicationTable_ID", new Integer(AD_ReplicationTable_ID)); +} +/** Get Replication Table. +@return Data Replication Strategy Table Info */ +public int getAD_ReplicationTable_ID() +{ +Integer ii = (Integer)get_Value("AD_ReplicationTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} + +/** ReplicationType AD_Reference_ID=126 */ +public static final int REPLICATIONTYPE_AD_Reference_ID=126; +/** Local = L */ +public static final String REPLICATIONTYPE_Local = "L"; +/** Merge = M */ +public static final String REPLICATIONTYPE_Merge = "M"; +/** Reference = R */ +public static final String REPLICATIONTYPE_Reference = "R"; +/** Set Replication Type. +@param ReplicationType Type of Data Replication */ +public void setReplicationType (String ReplicationType) +{ +if (ReplicationType == null) throw new IllegalArgumentException ("ReplicationType is mandatory"); +if (ReplicationType.equals("L") || ReplicationType.equals("M") || ReplicationType.equals("R")); + else throw new IllegalArgumentException ("ReplicationType Invalid value - " + ReplicationType + " - Reference_ID=126 - L - M - R"); +if (ReplicationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ReplicationType = ReplicationType.substring(0,0); +} +set_Value ("ReplicationType", ReplicationType); +} +/** Get Replication Type. +@return Type of Data Replication */ +public String getReplicationType() +{ +return (String)get_Value("ReplicationType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Replication_Log.java b/dbPort/src/org/compiere/model/X_AD_Replication_Log.java new file mode 100644 index 0000000000..1cbd00bdfe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Replication_Log.java @@ -0,0 +1,177 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Replication_Log + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.875 */ +public class X_AD_Replication_Log extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Replication_Log_ID id +@param trxName transaction +*/ +public X_AD_Replication_Log (Properties ctx, int AD_Replication_Log_ID, String trxName) +{ +super (ctx, AD_Replication_Log_ID, trxName); +/** if (AD_Replication_Log_ID == 0) +{ +setAD_Replication_Log_ID (0); +setAD_Replication_Run_ID (0); +setIsReplicated (false); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Replication_Log (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=604 */ +public static final int Table_ID=604; + +/** TableName=AD_Replication_Log */ +public static final String Table_Name="AD_Replication_Log"; + +protected static KeyNamePair Model = new KeyNamePair(604,"AD_Replication_Log"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Replication_Log[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Replication Table. +@param AD_ReplicationTable_ID Data Replication Strategy Table Info */ +public void setAD_ReplicationTable_ID (int AD_ReplicationTable_ID) +{ +if (AD_ReplicationTable_ID <= 0) set_Value ("AD_ReplicationTable_ID", null); + else +set_Value ("AD_ReplicationTable_ID", new Integer(AD_ReplicationTable_ID)); +} +/** Get Replication Table. +@return Data Replication Strategy Table Info */ +public int getAD_ReplicationTable_ID() +{ +Integer ii = (Integer)get_Value("AD_ReplicationTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Replication Log. +@param AD_Replication_Log_ID Data Replication Log Details */ +public void setAD_Replication_Log_ID (int AD_Replication_Log_ID) +{ +if (AD_Replication_Log_ID < 1) throw new IllegalArgumentException ("AD_Replication_Log_ID is mandatory."); +set_ValueNoCheck ("AD_Replication_Log_ID", new Integer(AD_Replication_Log_ID)); +} +/** Get Replication Log. +@return Data Replication Log Details */ +public int getAD_Replication_Log_ID() +{ +Integer ii = (Integer)get_Value("AD_Replication_Log_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Replication Run. +@param AD_Replication_Run_ID Data Replication Run */ +public void setAD_Replication_Run_ID (int AD_Replication_Run_ID) +{ +if (AD_Replication_Run_ID < 1) throw new IllegalArgumentException ("AD_Replication_Run_ID is mandatory."); +set_ValueNoCheck ("AD_Replication_Run_ID", new Integer(AD_Replication_Run_ID)); +} +/** Get Replication Run. +@return Data Replication Run */ +public int getAD_Replication_Run_ID() +{ +Integer ii = (Integer)get_Value("AD_Replication_Run_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Replication_Run_ID())); +} +/** Set Replicated. +@param IsReplicated The data is successfully replicated */ +public void setIsReplicated (boolean IsReplicated) +{ +set_Value ("IsReplicated", new Boolean(IsReplicated)); +} +/** Get Replicated. +@return The data is successfully replicated */ +public boolean isReplicated() +{ +Object oo = get_Value("IsReplicated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Message. +@param P_Msg Process Message */ +public void setP_Msg (String P_Msg) +{ +if (P_Msg != null && P_Msg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +P_Msg = P_Msg.substring(0,1999); +} +set_Value ("P_Msg", P_Msg); +} +/** Get Process Message. +@return Process Message */ +public String getP_Msg() +{ +return (String)get_Value("P_Msg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Replication_Run.java b/dbPort/src/org/compiere/model/X_AD_Replication_Run.java new file mode 100644 index 0000000000..fb69e7ab54 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Replication_Run.java @@ -0,0 +1,180 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Replication_Run + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.875 */ +public class X_AD_Replication_Run extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Replication_Run_ID id +@param trxName transaction +*/ +public X_AD_Replication_Run (Properties ctx, int AD_Replication_Run_ID, String trxName) +{ +super (ctx, AD_Replication_Run_ID, trxName); +/** if (AD_Replication_Run_ID == 0) +{ +setAD_Replication_ID (0); +setAD_Replication_Run_ID (0); +setIsReplicated (false); // N +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Replication_Run (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=603 */ +public static final int Table_ID=603; + +/** TableName=AD_Replication_Run */ +public static final String Table_Name="AD_Replication_Run"; + +protected static KeyNamePair Model = new KeyNamePair(603,"AD_Replication_Run"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Replication_Run[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Replication. +@param AD_Replication_ID Data Replication Target */ +public void setAD_Replication_ID (int AD_Replication_ID) +{ +if (AD_Replication_ID < 1) throw new IllegalArgumentException ("AD_Replication_ID is mandatory."); +set_ValueNoCheck ("AD_Replication_ID", new Integer(AD_Replication_ID)); +} +/** Get Replication. +@return Data Replication Target */ +public int getAD_Replication_ID() +{ +Integer ii = (Integer)get_Value("AD_Replication_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Replication Run. +@param AD_Replication_Run_ID Data Replication Run */ +public void setAD_Replication_Run_ID (int AD_Replication_Run_ID) +{ +if (AD_Replication_Run_ID < 1) throw new IllegalArgumentException ("AD_Replication_Run_ID is mandatory."); +set_ValueNoCheck ("AD_Replication_Run_ID", new Integer(AD_Replication_Run_ID)); +} +/** Get Replication Run. +@return Data Replication Run */ +public int getAD_Replication_Run_ID() +{ +Integer ii = (Integer)get_Value("AD_Replication_Run_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Replicated. +@param IsReplicated The data is successfully replicated */ +public void setIsReplicated (boolean IsReplicated) +{ +set_ValueNoCheck ("IsReplicated", new Boolean(IsReplicated)); +} +/** Get Replicated. +@return The data is successfully replicated */ +public boolean isReplicated() +{ +Object oo = get_Value("IsReplicated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ReportView.java b/dbPort/src/org/compiere/model/X_AD_ReportView.java new file mode 100644 index 0000000000..e48755dd4c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ReportView.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ReportView + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.89 */ +public class X_AD_ReportView extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ReportView_ID id +@param trxName transaction +*/ +public X_AD_ReportView (Properties ctx, int AD_ReportView_ID, String trxName) +{ +super (ctx, AD_ReportView_ID, trxName); +/** if (AD_ReportView_ID == 0) +{ +setAD_ReportView_ID (0); +setAD_Table_ID (0); +setEntityType (null); // U +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ReportView (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=361 */ +public static final int Table_ID=361; + +/** TableName=AD_ReportView */ +public static final String Table_Name="AD_ReportView"; + +protected static KeyNamePair Model = new KeyNamePair(361,"AD_ReportView"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ReportView[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Report View. +@param AD_ReportView_ID View used to generate this report */ +public void setAD_ReportView_ID (int AD_ReportView_ID) +{ +if (AD_ReportView_ID < 1) throw new IllegalArgumentException ("AD_ReportView_ID is mandatory."); +set_ValueNoCheck ("AD_ReportView_ID", new Integer(AD_ReportView_ID)); +} +/** Get Report View. +@return View used to generate this report */ +public int getAD_ReportView_ID() +{ +Integer ii = (Integer)get_Value("AD_ReportView_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sql ORDER BY. +@param OrderByClause Fully qualified ORDER BY clause */ +public void setOrderByClause (String OrderByClause) +{ +if (OrderByClause != null && OrderByClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OrderByClause = OrderByClause.substring(0,1999); +} +set_Value ("OrderByClause", OrderByClause); +} +/** Get Sql ORDER BY. +@return Fully qualified ORDER BY clause */ +public String getOrderByClause() +{ +return (String)get_Value("OrderByClause"); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_ReportView_Col.java b/dbPort/src/org/compiere/model/X_AD_ReportView_Col.java new file mode 100644 index 0000000000..70354827d0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_ReportView_Col.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_ReportView_Col + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.906 */ +public class X_AD_ReportView_Col extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_ReportView_Col_ID id +@param trxName transaction +*/ +public X_AD_ReportView_Col (Properties ctx, int AD_ReportView_Col_ID, String trxName) +{ +super (ctx, AD_ReportView_Col_ID, trxName); +/** if (AD_ReportView_Col_ID == 0) +{ +setAD_ReportView_Col_ID (0); +setAD_ReportView_ID (0); +setFunctionColumn (null); +setIsGroupFunction (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_ReportView_Col (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=428 */ +public static final int Table_ID=428; + +/** TableName=AD_ReportView_Col */ +public static final String Table_Name="AD_ReportView_Col"; + +protected static KeyNamePair Model = new KeyNamePair(428,"AD_ReportView_Col"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_ReportView_Col[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report view Column. +@param AD_ReportView_Col_ID Report view Column */ +public void setAD_ReportView_Col_ID (int AD_ReportView_Col_ID) +{ +if (AD_ReportView_Col_ID < 1) throw new IllegalArgumentException ("AD_ReportView_Col_ID is mandatory."); +set_ValueNoCheck ("AD_ReportView_Col_ID", new Integer(AD_ReportView_Col_ID)); +} +/** Get Report view Column. +@return Report view Column */ +public int getAD_ReportView_Col_ID() +{ +Integer ii = (Integer)get_Value("AD_ReportView_Col_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report View. +@param AD_ReportView_ID View used to generate this report */ +public void setAD_ReportView_ID (int AD_ReportView_ID) +{ +if (AD_ReportView_ID < 1) throw new IllegalArgumentException ("AD_ReportView_ID is mandatory."); +set_ValueNoCheck ("AD_ReportView_ID", new Integer(AD_ReportView_ID)); +} +/** Get Report View. +@return View used to generate this report */ +public int getAD_ReportView_ID() +{ +Integer ii = (Integer)get_Value("AD_ReportView_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_ReportView_ID())); +} +/** Set Function Column. +@param FunctionColumn Overwrite Column with Function */ +public void setFunctionColumn (String FunctionColumn) +{ +if (FunctionColumn == null) throw new IllegalArgumentException ("FunctionColumn is mandatory."); +if (FunctionColumn.length() > 60) +{ +log.warning("Length > 60 - truncated"); +FunctionColumn = FunctionColumn.substring(0,59); +} +set_Value ("FunctionColumn", FunctionColumn); +} +/** Get Function Column. +@return Overwrite Column with Function */ +public String getFunctionColumn() +{ +return (String)get_Value("FunctionColumn"); +} +/** Set SQL Group Function. +@param IsGroupFunction This function will generate a Group By Clause */ +public void setIsGroupFunction (boolean IsGroupFunction) +{ +set_Value ("IsGroupFunction", new Boolean(IsGroupFunction)); +} +/** Get SQL Group Function. +@return This function will generate a Group By Clause */ +public boolean isGroupFunction() +{ +Object oo = get_Value("IsGroupFunction"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Role.java b/dbPort/src/org/compiere/model/X_AD_Role.java new file mode 100644 index 0000000000..66cb06b2fe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Role.java @@ -0,0 +1,566 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Role + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.921 */ +public class X_AD_Role extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Role_ID id +@param trxName transaction +*/ +public X_AD_Role (Properties ctx, int AD_Role_ID, String trxName) +{ +super (ctx, AD_Role_ID, trxName); +/** if (AD_Role_ID == 0) +{ +setAD_Role_ID (0); +setConfirmQueryRecords (0); // 0 +setIsAccessAllOrgs (false); // N +setIsCanApproveOwnDoc (false); +setIsCanExport (true); // Y +setIsCanReport (true); // Y +setIsChangeLog (false); // N +setIsManual (false); +setIsPersonalAccess (false); // N +setIsPersonalLock (false); // N +setIsShowAcct (false); // N +setIsUseUserOrgAccess (false); // N +setMaxQueryRecords (0); // 0 +setName (null); +setOverwritePriceLimit (false); // N +setPreferenceType (null); // O +setUserLevel (null); // O +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Role (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=156 */ +public static final int Table_ID=156; + +/** TableName=AD_Role */ +public static final String Table_Name="AD_Role"; + +protected static KeyNamePair Model = new KeyNamePair(156,"AD_Role"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Role[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Menu_ID AD_Reference_ID=184 */ +public static final int AD_TREE_MENU_ID_AD_Reference_ID=184; +/** Set Menu Tree. +@param AD_Tree_Menu_ID Tree of the menu */ +public void setAD_Tree_Menu_ID (int AD_Tree_Menu_ID) +{ +if (AD_Tree_Menu_ID <= 0) set_Value ("AD_Tree_Menu_ID", null); + else +set_Value ("AD_Tree_Menu_ID", new Integer(AD_Tree_Menu_ID)); +} +/** Get Menu Tree. +@return Tree of the menu */ +public int getAD_Tree_Menu_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Menu_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Org_ID AD_Reference_ID=184 */ +public static final int AD_TREE_ORG_ID_AD_Reference_ID=184; +/** Set Organization Tree. +@param AD_Tree_Org_ID Tree to determine organizational hierarchy */ +public void setAD_Tree_Org_ID (int AD_Tree_Org_ID) +{ +if (AD_Tree_Org_ID <= 0) set_Value ("AD_Tree_Org_ID", null); + else +set_Value ("AD_Tree_Org_ID", new Integer(AD_Tree_Org_ID)); +} +/** Get Organization Tree. +@return Tree to determine organizational hierarchy */ +public int getAD_Tree_Org_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Approval Amount. +@param AmtApproval The approval amount limit for this role */ +public void setAmtApproval (BigDecimal AmtApproval) +{ +set_Value ("AmtApproval", AmtApproval); +} +/** Get Approval Amount. +@return The approval amount limit for this role */ +public BigDecimal getAmtApproval() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtApproval"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Confirm Query Records. +@param ConfirmQueryRecords Require Confirmation if more records will be returned by the query (If not defined 500) */ +public void setConfirmQueryRecords (int ConfirmQueryRecords) +{ +set_Value ("ConfirmQueryRecords", new Integer(ConfirmQueryRecords)); +} +/** Get Confirm Query Records. +@return Require Confirmation if more records will be returned by the query (If not defined 500) */ +public int getConfirmQueryRecords() +{ +Integer ii = (Integer)get_Value("ConfirmQueryRecords"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ConnectionProfile AD_Reference_ID=364 */ +public static final int CONNECTIONPROFILE_AD_Reference_ID=364; +/** LAN = L */ +public static final String CONNECTIONPROFILE_LAN = "L"; +/** Terminal Server = T */ +public static final String CONNECTIONPROFILE_TerminalServer = "T"; +/** VPN = V */ +public static final String CONNECTIONPROFILE_VPN = "V"; +/** WAN = W */ +public static final String CONNECTIONPROFILE_WAN = "W"; +/** Set Connection Profile. +@param ConnectionProfile How a Java Client connects to the server(s) */ +public void setConnectionProfile (String ConnectionProfile) +{ +if (ConnectionProfile == null) throw new IllegalArgumentException ("ConnectionProfile is mandatory"); +if (ConnectionProfile == null || ConnectionProfile.equals("L") || ConnectionProfile.equals("T") || ConnectionProfile.equals("V") || ConnectionProfile.equals("W")); + else throw new IllegalArgumentException ("ConnectionProfile Invalid value - " + ConnectionProfile + " - Reference_ID=364 - L - T - V - W"); +if (ConnectionProfile != null && ConnectionProfile.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConnectionProfile = ConnectionProfile.substring(0,0); +} +set_Value ("ConnectionProfile", ConnectionProfile); +} +/** Get Connection Profile. +@return How a Java Client connects to the server(s) */ +public String getConnectionProfile() +{ +return (String)get_Value("ConnectionProfile"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Access all Orgs. +@param IsAccessAllOrgs Access all Organizations (no org access control) of the client */ +public void setIsAccessAllOrgs (boolean IsAccessAllOrgs) +{ +set_Value ("IsAccessAllOrgs", new Boolean(IsAccessAllOrgs)); +} +/** Get Access all Orgs. +@return Access all Organizations (no org access control) of the client */ +public boolean isAccessAllOrgs() +{ +Object oo = get_Value("IsAccessAllOrgs"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Approve own Documents. +@param IsCanApproveOwnDoc Users with this role can approve their own documents */ +public void setIsCanApproveOwnDoc (boolean IsCanApproveOwnDoc) +{ +set_Value ("IsCanApproveOwnDoc", new Boolean(IsCanApproveOwnDoc)); +} +/** Get Approve own Documents. +@return Users with this role can approve their own documents */ +public boolean isCanApproveOwnDoc() +{ +Object oo = get_Value("IsCanApproveOwnDoc"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Can Export. +@param IsCanExport Users with this role can export data */ +public void setIsCanExport (boolean IsCanExport) +{ +set_Value ("IsCanExport", new Boolean(IsCanExport)); +} +/** Get Can Export. +@return Users with this role can export data */ +public boolean isCanExport() +{ +Object oo = get_Value("IsCanExport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Can Report. +@param IsCanReport Users with this role can create reports */ +public void setIsCanReport (boolean IsCanReport) +{ +set_Value ("IsCanReport", new Boolean(IsCanReport)); +} +/** Get Can Report. +@return Users with this role can create reports */ +public boolean isCanReport() +{ +Object oo = get_Value("IsCanReport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Maintain Change Log. +@param IsChangeLog Maintain a log of changes */ +public void setIsChangeLog (boolean IsChangeLog) +{ +set_Value ("IsChangeLog", new Boolean(IsChangeLog)); +} +/** Get Maintain Change Log. +@return Maintain a log of changes */ +public boolean isChangeLog() +{ +Object oo = get_Value("IsChangeLog"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Personal Access. +@param IsPersonalAccess Allow access to all personal records */ +public void setIsPersonalAccess (boolean IsPersonalAccess) +{ +set_Value ("IsPersonalAccess", new Boolean(IsPersonalAccess)); +} +/** Get Personal Access. +@return Allow access to all personal records */ +public boolean isPersonalAccess() +{ +Object oo = get_Value("IsPersonalAccess"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Personal Lock. +@param IsPersonalLock Allow users with role to lock access to personal records */ +public void setIsPersonalLock (boolean IsPersonalLock) +{ +set_Value ("IsPersonalLock", new Boolean(IsPersonalLock)); +} +/** Get Personal Lock. +@return Allow users with role to lock access to personal records */ +public boolean isPersonalLock() +{ +Object oo = get_Value("IsPersonalLock"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Show Accounting. +@param IsShowAcct Users with this role can see accounting information */ +public void setIsShowAcct (boolean IsShowAcct) +{ +set_Value ("IsShowAcct", new Boolean(IsShowAcct)); +} +/** Get Show Accounting. +@return Users with this role can see accounting information */ +public boolean isShowAcct() +{ +Object oo = get_Value("IsShowAcct"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Use User Org Access. +@param IsUseUserOrgAccess Use Org Access defined by user instead of Role Org Access */ +public void setIsUseUserOrgAccess (boolean IsUseUserOrgAccess) +{ +set_Value ("IsUseUserOrgAccess", new Boolean(IsUseUserOrgAccess)); +} +/** Get Use User Org Access. +@return Use Org Access defined by user instead of Role Org Access */ +public boolean isUseUserOrgAccess() +{ +Object oo = get_Value("IsUseUserOrgAccess"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Max Query Records. +@param MaxQueryRecords If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records */ +public void setMaxQueryRecords (int MaxQueryRecords) +{ +set_Value ("MaxQueryRecords", new Integer(MaxQueryRecords)); +} +/** Get Max Query Records. +@return If defined, you cannot query more records as defined - the query criteria needs to be changed to query less records */ +public int getMaxQueryRecords() +{ +Integer ii = (Integer)get_Value("MaxQueryRecords"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Overwrite Price Limit. +@param OverwritePriceLimit Overwrite Price Limit if the Price List enforces the Price Limit */ +public void setOverwritePriceLimit (boolean OverwritePriceLimit) +{ +set_Value ("OverwritePriceLimit", new Boolean(OverwritePriceLimit)); +} +/** Get Overwrite Price Limit. +@return Overwrite Price Limit if the Price List enforces the Price Limit */ +public boolean isOverwritePriceLimit() +{ +Object oo = get_Value("OverwritePriceLimit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PreferenceType AD_Reference_ID=330 */ +public static final int PREFERENCETYPE_AD_Reference_ID=330; +/** Client = C */ +public static final String PREFERENCETYPE_Client = "C"; +/** None = N */ +public static final String PREFERENCETYPE_None = "N"; +/** Organization = O */ +public static final String PREFERENCETYPE_Organization = "O"; +/** User = U */ +public static final String PREFERENCETYPE_User = "U"; +/** Set Preference Level. +@param PreferenceType Determines what preferences the user can set */ +public void setPreferenceType (String PreferenceType) +{ +if (PreferenceType == null) throw new IllegalArgumentException ("PreferenceType is mandatory"); +if (PreferenceType.equals("C") || PreferenceType.equals("N") || PreferenceType.equals("O") || PreferenceType.equals("U")); + else throw new IllegalArgumentException ("PreferenceType Invalid value - " + PreferenceType + " - Reference_ID=330 - C - N - O - U"); +if (PreferenceType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PreferenceType = PreferenceType.substring(0,0); +} +set_Value ("PreferenceType", PreferenceType); +} +/** Get Preference Level. +@return Determines what preferences the user can set */ +public String getPreferenceType() +{ +return (String)get_Value("PreferenceType"); +} + +/** Supervisor_ID AD_Reference_ID=286 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=286; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID <= 0) set_Value ("Supervisor_ID", null); + else +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** UserLevel AD_Reference_ID=226 */ +public static final int USERLEVEL_AD_Reference_ID=226; +/** Organization = O */ +public static final String USERLEVEL_Organization = " O"; +/** Client = C */ +public static final String USERLEVEL_Client = " C "; +/** Client+Organization = CO */ +public static final String USERLEVEL_ClientPlusOrganization = " CO"; +/** System = S */ +public static final String USERLEVEL_System = "S "; +/** Set User Level. +@param UserLevel System Client Organization */ +public void setUserLevel (String UserLevel) +{ +if (UserLevel == null) throw new IllegalArgumentException ("UserLevel is mandatory"); +if (UserLevel.equals(" O") || UserLevel.equals(" C ") || UserLevel.equals(" CO") || UserLevel.equals("S ")); + else throw new IllegalArgumentException ("UserLevel Invalid value - " + UserLevel + " - Reference_ID=226 - O - C - CO - S "); +if (UserLevel.length() > 3) +{ +log.warning("Length > 3 - truncated"); +UserLevel = UserLevel.substring(0,2); +} +set_Value ("UserLevel", UserLevel); +} +/** Get User Level. +@return System Client Organization */ +public String getUserLevel() +{ +return (String)get_Value("UserLevel"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Role_OrgAccess.java b/dbPort/src/org/compiere/model/X_AD_Role_OrgAccess.java new file mode 100644 index 0000000000..2dc8f988f9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Role_OrgAccess.java @@ -0,0 +1,122 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Role_OrgAccess + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.953 */ +public class X_AD_Role_OrgAccess extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Role_OrgAccess_ID id +@param trxName transaction +*/ +public X_AD_Role_OrgAccess (Properties ctx, int AD_Role_OrgAccess_ID, String trxName) +{ +super (ctx, AD_Role_OrgAccess_ID, trxName); +/** if (AD_Role_OrgAccess_ID == 0) +{ +setAD_Role_ID (0); +setIsReadOnly (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Role_OrgAccess (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=422 */ +public static final int Table_ID=422; + +/** TableName=AD_Role_OrgAccess */ +public static final String Table_Name="AD_Role_OrgAccess"; + +protected static KeyNamePair Model = new KeyNamePair(422,"AD_Role_OrgAccess"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Role_OrgAccess[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Scheduler.java b/dbPort/src/org/compiere/model/X_AD_Scheduler.java new file mode 100644 index 0000000000..90630255fa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Scheduler.java @@ -0,0 +1,363 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Scheduler + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.968 */ +public class X_AD_Scheduler extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Scheduler_ID id +@param trxName transaction +*/ +public X_AD_Scheduler (Properties ctx, int AD_Scheduler_ID, String trxName) +{ +super (ctx, AD_Scheduler_ID, trxName); +/** if (AD_Scheduler_ID == 0) +{ +setAD_Process_ID (0); +setAD_Scheduler_ID (0); +setFrequency (0); +setFrequencyType (null); +setKeepLogDays (0); // 7 +setName (null); +setScheduleType (null); // F +setSupervisor_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Scheduler (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=688 */ +public static final int Table_ID=688; + +/** TableName=AD_Scheduler */ +public static final String Table_Name="AD_Scheduler"; + +protected static KeyNamePair Model = new KeyNamePair(688,"AD_Scheduler"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Scheduler[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID < 1) throw new IllegalArgumentException ("AD_Process_ID is mandatory."); +set_ValueNoCheck ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Scheduler. +@param AD_Scheduler_ID Schedule Processes */ +public void setAD_Scheduler_ID (int AD_Scheduler_ID) +{ +if (AD_Scheduler_ID < 1) throw new IllegalArgumentException ("AD_Scheduler_ID is mandatory."); +set_ValueNoCheck ("AD_Scheduler_ID", new Integer(AD_Scheduler_ID)); +} +/** Get Scheduler. +@return Schedule Processes */ +public int getAD_Scheduler_ID() +{ +Integer ii = (Integer)get_Value("AD_Scheduler_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +set_Value ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=221 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=221; +/** Day = D */ +public static final String FREQUENCYTYPE_Day = "D"; +/** Hour = H */ +public static final String FREQUENCYTYPE_Hour = "H"; +/** Minute = M */ +public static final String FREQUENCYTYPE_Minute = "M"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("H") || FrequencyType.equals("M")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=221 - D - H - M"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Days to keep Log. +@param KeepLogDays Number of days to keep the log entries */ +public void setKeepLogDays (int KeepLogDays) +{ +set_Value ("KeepLogDays", new Integer(KeepLogDays)); +} +/** Get Days to keep Log. +@return Number of days to keep the log entries */ +public int getKeepLogDays() +{ +Integer ii = (Integer)get_Value("KeepLogDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Day of the Month. +@param MonthDay Day of the month 1 to 28/29/30/31 */ +public void setMonthDay (int MonthDay) +{ +set_Value ("MonthDay", new Integer(MonthDay)); +} +/** Get Day of the Month. +@return Day of the month 1 to 28/29/30/31 */ +public int getMonthDay() +{ +Integer ii = (Integer)get_Value("MonthDay"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** ScheduleType AD_Reference_ID=318 */ +public static final int SCHEDULETYPE_AD_Reference_ID=318; +/** Frequency = F */ +public static final String SCHEDULETYPE_Frequency = "F"; +/** Month Day = M */ +public static final String SCHEDULETYPE_MonthDay = "M"; +/** Week Day = W */ +public static final String SCHEDULETYPE_WeekDay = "W"; +/** Set Schedule Type. +@param ScheduleType Type of schedule */ +public void setScheduleType (String ScheduleType) +{ +if (ScheduleType == null) throw new IllegalArgumentException ("ScheduleType is mandatory"); +if (ScheduleType.equals("F") || ScheduleType.equals("M") || ScheduleType.equals("W")); + else throw new IllegalArgumentException ("ScheduleType Invalid value - " + ScheduleType + " - Reference_ID=318 - F - M - W"); +if (ScheduleType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ScheduleType = ScheduleType.substring(0,0); +} +set_Value ("ScheduleType", ScheduleType); +} +/** Get Schedule Type. +@return Type of schedule */ +public String getScheduleType() +{ +return (String)get_Value("ScheduleType"); +} + +/** Supervisor_ID AD_Reference_ID=316 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=316; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID < 1) throw new IllegalArgumentException ("Supervisor_ID is mandatory."); +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** WeekDay AD_Reference_ID=167 */ +public static final int WEEKDAY_AD_Reference_ID=167; +/** Monday = 1 */ +public static final String WEEKDAY_Monday = "1"; +/** Tuesday = 2 */ +public static final String WEEKDAY_Tuesday = "2"; +/** Wednesday = 3 */ +public static final String WEEKDAY_Wednesday = "3"; +/** Thursday = 4 */ +public static final String WEEKDAY_Thursday = "4"; +/** Friday = 5 */ +public static final String WEEKDAY_Friday = "5"; +/** Saturday = 6 */ +public static final String WEEKDAY_Saturday = "6"; +/** Sunday = 7 */ +public static final String WEEKDAY_Sunday = "7"; +/** Set Day of the Week. +@param WeekDay Day of the Week */ +public void setWeekDay (String WeekDay) +{ +if (WeekDay == null) throw new IllegalArgumentException ("WeekDay is mandatory"); +if (WeekDay == null || WeekDay.equals("1") || WeekDay.equals("2") || WeekDay.equals("3") || WeekDay.equals("4") || WeekDay.equals("5") || WeekDay.equals("6") || WeekDay.equals("7")); + else throw new IllegalArgumentException ("WeekDay Invalid value - " + WeekDay + " - Reference_ID=167 - 1 - 2 - 3 - 4 - 5 - 6 - 7"); +if (WeekDay != null && WeekDay.length() > 1) +{ +log.warning("Length > 1 - truncated"); +WeekDay = WeekDay.substring(0,0); +} +set_Value ("WeekDay", WeekDay); +} +/** Get Day of the Week. +@return Day of the Week */ +public String getWeekDay() +{ +return (String)get_Value("WeekDay"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_SchedulerLog.java b/dbPort/src/org/compiere/model/X_AD_SchedulerLog.java new file mode 100644 index 0000000000..dc17009dda --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_SchedulerLog.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_SchedulerLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:53.984 */ +public class X_AD_SchedulerLog extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_SchedulerLog_ID id +@param trxName transaction +*/ +public X_AD_SchedulerLog (Properties ctx, int AD_SchedulerLog_ID, String trxName) +{ +super (ctx, AD_SchedulerLog_ID, trxName); +/** if (AD_SchedulerLog_ID == 0) +{ +setAD_SchedulerLog_ID (0); +setAD_Scheduler_ID (0); +setIsError (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_SchedulerLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=687 */ +public static final int Table_ID=687; + +/** TableName=AD_SchedulerLog */ +public static final String Table_Name="AD_SchedulerLog"; + +protected static KeyNamePair Model = new KeyNamePair(687,"AD_SchedulerLog"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_SchedulerLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Scheduler Log. +@param AD_SchedulerLog_ID Result of the execution of the Scheduler */ +public void setAD_SchedulerLog_ID (int AD_SchedulerLog_ID) +{ +if (AD_SchedulerLog_ID < 1) throw new IllegalArgumentException ("AD_SchedulerLog_ID is mandatory."); +set_ValueNoCheck ("AD_SchedulerLog_ID", new Integer(AD_SchedulerLog_ID)); +} +/** Get Scheduler Log. +@return Result of the execution of the Scheduler */ +public int getAD_SchedulerLog_ID() +{ +Integer ii = (Integer)get_Value("AD_SchedulerLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Scheduler. +@param AD_Scheduler_ID Schedule Processes */ +public void setAD_Scheduler_ID (int AD_Scheduler_ID) +{ +if (AD_Scheduler_ID < 1) throw new IllegalArgumentException ("AD_Scheduler_ID is mandatory."); +set_ValueNoCheck ("AD_Scheduler_ID", new Integer(AD_Scheduler_ID)); +} +/** Get Scheduler. +@return Schedule Processes */ +public int getAD_Scheduler_ID() +{ +Integer ii = (Integer)get_Value("AD_Scheduler_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Error. +@param IsError An Error occured in the execution */ +public void setIsError (boolean IsError) +{ +set_Value ("IsError", new Boolean(IsError)); +} +/** Get Error. +@return An Error occured in the execution */ +public boolean isError() +{ +Object oo = get_Value("IsError"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_SchedulerRecipient.java b/dbPort/src/org/compiere/model/X_AD_SchedulerRecipient.java new file mode 100644 index 0000000000..37034f93d3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_SchedulerRecipient.java @@ -0,0 +1,157 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_SchedulerRecipient + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.0 */ +public class X_AD_SchedulerRecipient extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_SchedulerRecipient_ID id +@param trxName transaction +*/ +public X_AD_SchedulerRecipient (Properties ctx, int AD_SchedulerRecipient_ID, String trxName) +{ +super (ctx, AD_SchedulerRecipient_ID, trxName); +/** if (AD_SchedulerRecipient_ID == 0) +{ +setAD_SchedulerRecipient_ID (0); +setAD_Scheduler_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_SchedulerRecipient (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=704 */ +public static final int Table_ID=704; + +/** TableName=AD_SchedulerRecipient */ +public static final String Table_Name="AD_SchedulerRecipient"; + +protected static KeyNamePair Model = new KeyNamePair(704,"AD_SchedulerRecipient"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_SchedulerRecipient[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID <= 0) set_Value ("AD_Role_ID", null); + else +set_Value ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Scheduler Recipient. +@param AD_SchedulerRecipient_ID Recipient of the Scheduler Notification */ +public void setAD_SchedulerRecipient_ID (int AD_SchedulerRecipient_ID) +{ +if (AD_SchedulerRecipient_ID < 1) throw new IllegalArgumentException ("AD_SchedulerRecipient_ID is mandatory."); +set_ValueNoCheck ("AD_SchedulerRecipient_ID", new Integer(AD_SchedulerRecipient_ID)); +} +/** Get Scheduler Recipient. +@return Recipient of the Scheduler Notification */ +public int getAD_SchedulerRecipient_ID() +{ +Integer ii = (Integer)get_Value("AD_SchedulerRecipient_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Scheduler. +@param AD_Scheduler_ID Schedule Processes */ +public void setAD_Scheduler_ID (int AD_Scheduler_ID) +{ +if (AD_Scheduler_ID < 1) throw new IllegalArgumentException ("AD_Scheduler_ID is mandatory."); +set_ValueNoCheck ("AD_Scheduler_ID", new Integer(AD_Scheduler_ID)); +} +/** Get Scheduler. +@return Schedule Processes */ +public int getAD_Scheduler_ID() +{ +Integer ii = (Integer)get_Value("AD_Scheduler_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Scheduler_Para.java b/dbPort/src/org/compiere/model/X_AD_Scheduler_Para.java new file mode 100644 index 0000000000..14c218dd96 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Scheduler_Para.java @@ -0,0 +1,153 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Scheduler_Para + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.015 */ +public class X_AD_Scheduler_Para extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Scheduler_Para_ID id +@param trxName transaction +*/ +public X_AD_Scheduler_Para (Properties ctx, int AD_Scheduler_Para_ID, String trxName) +{ +super (ctx, AD_Scheduler_Para_ID, trxName); +/** if (AD_Scheduler_Para_ID == 0) +{ +setAD_Process_Para_ID (0); +setAD_Scheduler_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Scheduler_Para (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=698 */ +public static final int Table_ID=698; + +/** TableName=AD_Scheduler_Para */ +public static final String Table_Name="AD_Scheduler_Para"; + +protected static KeyNamePair Model = new KeyNamePair(698,"AD_Scheduler_Para"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Scheduler_Para[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Parameter. +@param AD_Process_Para_ID Process Parameter */ +public void setAD_Process_Para_ID (int AD_Process_Para_ID) +{ +if (AD_Process_Para_ID < 1) throw new IllegalArgumentException ("AD_Process_Para_ID is mandatory."); +set_ValueNoCheck ("AD_Process_Para_ID", new Integer(AD_Process_Para_ID)); +} +/** Get Process Parameter. +@return Process Parameter */ +public int getAD_Process_Para_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_Para_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Scheduler. +@param AD_Scheduler_ID Schedule Processes */ +public void setAD_Scheduler_ID (int AD_Scheduler_ID) +{ +if (AD_Scheduler_ID < 1) throw new IllegalArgumentException ("AD_Scheduler_ID is mandatory."); +set_ValueNoCheck ("AD_Scheduler_ID", new Integer(AD_Scheduler_ID)); +} +/** Get Scheduler. +@return Schedule Processes */ +public int getAD_Scheduler_ID() +{ +Integer ii = (Integer)get_Value("AD_Scheduler_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default Parameter. +@param ParameterDefault Default value of the parameter */ +public void setParameterDefault (String ParameterDefault) +{ +if (ParameterDefault != null && ParameterDefault.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ParameterDefault = ParameterDefault.substring(0,59); +} +set_Value ("ParameterDefault", ParameterDefault); +} +/** Get Default Parameter. +@return Default value of the parameter */ +public String getParameterDefault() +{ +return (String)get_Value("ParameterDefault"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Sequence.java b/dbPort/src/org/compiere/model/X_AD_Sequence.java new file mode 100644 index 0000000000..42492ff67a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Sequence.java @@ -0,0 +1,331 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Sequence + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.015 */ +public class X_AD_Sequence extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Sequence_ID id +@param trxName transaction +*/ +public X_AD_Sequence (Properties ctx, int AD_Sequence_ID, String trxName) +{ +super (ctx, AD_Sequence_ID, trxName); +/** if (AD_Sequence_ID == 0) +{ +setAD_Sequence_ID (0); +setCurrentNext (0); // 1000000 +setCurrentNextSys (0); // 100 +setIncrementNo (0); // 1 +setIsAutoSequence (false); +setName (null); +setStartNo (0); // 1000000 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Sequence (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=115 */ +public static final int Table_ID=115; + +/** TableName=AD_Sequence */ +public static final String Table_Name="AD_Sequence"; + +protected static KeyNamePair Model = new KeyNamePair(115,"AD_Sequence"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Sequence[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Sequence. +@param AD_Sequence_ID Document Sequence */ +public void setAD_Sequence_ID (int AD_Sequence_ID) +{ +if (AD_Sequence_ID < 1) throw new IllegalArgumentException ("AD_Sequence_ID is mandatory."); +set_ValueNoCheck ("AD_Sequence_ID", new Integer(AD_Sequence_ID)); +} +/** Get Sequence. +@return Document Sequence */ +public int getAD_Sequence_ID() +{ +Integer ii = (Integer)get_Value("AD_Sequence_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Current Next. +@param CurrentNext The next number to be used */ +public void setCurrentNext (int CurrentNext) +{ +set_Value ("CurrentNext", new Integer(CurrentNext)); +} +/** Get Current Next. +@return The next number to be used */ +public int getCurrentNext() +{ +Integer ii = (Integer)get_Value("CurrentNext"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Current Next (System). +@param CurrentNextSys Next sequence for system use */ +public void setCurrentNextSys (int CurrentNextSys) +{ +set_Value ("CurrentNextSys", new Integer(CurrentNextSys)); +} +/** Get Current Next (System). +@return Next sequence for system use */ +public int getCurrentNextSys() +{ +Integer ii = (Integer)get_Value("CurrentNextSys"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Increment. +@param IncrementNo The number to increment the last document number by */ +public void setIncrementNo (int IncrementNo) +{ +set_Value ("IncrementNo", new Integer(IncrementNo)); +} +/** Get Increment. +@return The number to increment the last document number by */ +public int getIncrementNo() +{ +Integer ii = (Integer)get_Value("IncrementNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activate Audit. +@param IsAudited Activate Audit Trail of what numbers are generated */ +public void setIsAudited (boolean IsAudited) +{ +set_Value ("IsAudited", new Boolean(IsAudited)); +} +/** Get Activate Audit. +@return Activate Audit Trail of what numbers are generated */ +public boolean isAudited() +{ +Object oo = get_Value("IsAudited"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Auto numbering. +@param IsAutoSequence Automatically assign the next number */ +public void setIsAutoSequence (boolean IsAutoSequence) +{ +set_Value ("IsAutoSequence", new Boolean(IsAutoSequence)); +} +/** Get Auto numbering. +@return Automatically assign the next number */ +public boolean isAutoSequence() +{ +Object oo = get_Value("IsAutoSequence"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Used for Record ID. +@param IsTableID The document number will be used as the record key */ +public void setIsTableID (boolean IsTableID) +{ +set_Value ("IsTableID", new Boolean(IsTableID)); +} +/** Get Used for Record ID. +@return The document number will be used as the record key */ +public boolean isTableID() +{ +Object oo = get_Value("IsTableID"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Prefix. +@param Prefix Prefix before the sequence number */ +public void setPrefix (String Prefix) +{ +if (Prefix != null && Prefix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Prefix = Prefix.substring(0,9); +} +set_Value ("Prefix", Prefix); +} +/** Get Prefix. +@return Prefix before the sequence number */ +public String getPrefix() +{ +return (String)get_Value("Prefix"); +} +/** Set Restart sequence every Year. +@param StartNewYear Restart the sequence with Start on every 1/1 */ +public void setStartNewYear (boolean StartNewYear) +{ +set_Value ("StartNewYear", new Boolean(StartNewYear)); +} +/** Get Restart sequence every Year. +@return Restart the sequence with Start on every 1/1 */ +public boolean isStartNewYear() +{ +Object oo = get_Value("StartNewYear"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Start No. +@param StartNo Starting number/position */ +public void setStartNo (int StartNo) +{ +set_Value ("StartNo", new Integer(StartNo)); +} +/** Get Start No. +@return Starting number/position */ +public int getStartNo() +{ +Integer ii = (Integer)get_Value("StartNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Suffix. +@param Suffix Suffix after the number */ +public void setSuffix (String Suffix) +{ +if (Suffix != null && Suffix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Suffix = Suffix.substring(0,9); +} +set_Value ("Suffix", Suffix); +} +/** Get Suffix. +@return Suffix after the number */ +public String getSuffix() +{ +return (String)get_Value("Suffix"); +} +/** Set Value Format. +@param VFormat Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setVFormat (String VFormat) +{ +if (VFormat != null && VFormat.length() > 40) +{ +log.warning("Length > 40 - truncated"); +VFormat = VFormat.substring(0,39); +} +set_Value ("VFormat", VFormat); +} +/** Get Value Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getVFormat() +{ +return (String)get_Value("VFormat"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Sequence_Audit.java b/dbPort/src/org/compiere/model/X_AD_Sequence_Audit.java new file mode 100644 index 0000000000..24198a4ed1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Sequence_Audit.java @@ -0,0 +1,154 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Sequence_Audit + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.031 */ +public class X_AD_Sequence_Audit extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Sequence_Audit_ID id +@param trxName transaction +*/ +public X_AD_Sequence_Audit (Properties ctx, int AD_Sequence_Audit_ID, String trxName) +{ +super (ctx, AD_Sequence_Audit_ID, trxName); +/** if (AD_Sequence_Audit_ID == 0) +{ +setAD_Sequence_ID (0); +setAD_Table_ID (0); +setDocumentNo (null); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Sequence_Audit (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=121 */ +public static final int Table_ID=121; + +/** TableName=AD_Sequence_Audit */ +public static final String Table_Name="AD_Sequence_Audit"; + +protected static KeyNamePair Model = new KeyNamePair(121,"AD_Sequence_Audit"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Sequence_Audit[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Sequence. +@param AD_Sequence_ID Document Sequence */ +public void setAD_Sequence_ID (int AD_Sequence_ID) +{ +if (AD_Sequence_ID < 1) throw new IllegalArgumentException ("AD_Sequence_ID is mandatory."); +set_ValueNoCheck ("AD_Sequence_ID", new Integer(AD_Sequence_ID)); +} +/** Get Sequence. +@return Document Sequence */ +public int getAD_Sequence_ID() +{ +Integer ii = (Integer)get_Value("AD_Sequence_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Sequence_No.java b/dbPort/src/org/compiere/model/X_AD_Sequence_No.java new file mode 100644 index 0000000000..83e325df04 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Sequence_No.java @@ -0,0 +1,137 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Sequence_No + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.046 */ +public class X_AD_Sequence_No extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Sequence_No_ID id +@param trxName transaction +*/ +public X_AD_Sequence_No (Properties ctx, int AD_Sequence_No_ID, String trxName) +{ +super (ctx, AD_Sequence_No_ID, trxName); +/** if (AD_Sequence_No_ID == 0) +{ +setAD_Sequence_ID (0); +setCalendarYear (null); +setCurrentNext (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Sequence_No (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=122 */ +public static final int Table_ID=122; + +/** TableName=AD_Sequence_No */ +public static final String Table_Name="AD_Sequence_No"; + +protected static KeyNamePair Model = new KeyNamePair(122,"AD_Sequence_No"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Sequence_No[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Sequence. +@param AD_Sequence_ID Document Sequence */ +public void setAD_Sequence_ID (int AD_Sequence_ID) +{ +if (AD_Sequence_ID < 1) throw new IllegalArgumentException ("AD_Sequence_ID is mandatory."); +set_ValueNoCheck ("AD_Sequence_ID", new Integer(AD_Sequence_ID)); +} +/** Get Sequence. +@return Document Sequence */ +public int getAD_Sequence_ID() +{ +Integer ii = (Integer)get_Value("AD_Sequence_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Year. +@param CalendarYear Calendar Year */ +public void setCalendarYear (String CalendarYear) +{ +if (CalendarYear == null) throw new IllegalArgumentException ("CalendarYear is mandatory."); +if (CalendarYear.length() > 4) +{ +log.warning("Length > 4 - truncated"); +CalendarYear = CalendarYear.substring(0,3); +} +set_ValueNoCheck ("CalendarYear", CalendarYear); +} +/** Get Year. +@return Calendar Year */ +public String getCalendarYear() +{ +return (String)get_Value("CalendarYear"); +} +/** Set Current Next. +@param CurrentNext The next number to be used */ +public void setCurrentNext (int CurrentNext) +{ +set_Value ("CurrentNext", new Integer(CurrentNext)); +} +/** Get Current Next. +@return The next number to be used */ +public int getCurrentNext() +{ +Integer ii = (Integer)get_Value("CurrentNext"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Session.java b/dbPort/src/org/compiere/model/X_AD_Session.java new file mode 100644 index 0000000000..fcd128992c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Session.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Session + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.062 */ +public class X_AD_Session extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Session_ID id +@param trxName transaction +*/ +public X_AD_Session (Properties ctx, int AD_Session_ID, String trxName) +{ +super (ctx, AD_Session_ID, trxName); +/** if (AD_Session_ID == 0) +{ +setAD_Session_ID (0); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Session (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=566 */ +public static final int Table_ID=566; + +/** TableName=AD_Session */ +public static final String Table_Name="AD_Session"; + +protected static KeyNamePair Model = new KeyNamePair(566,"AD_Session"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Session[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Session. +@param AD_Session_ID User Session Online or Web */ +public void setAD_Session_ID (int AD_Session_ID) +{ +if (AD_Session_ID < 1) throw new IllegalArgumentException ("AD_Session_ID is mandatory."); +set_ValueNoCheck ("AD_Session_ID", new Integer(AD_Session_ID)); +} +/** Get Session. +@return User Session Online or Web */ +public int getAD_Session_ID() +{ +Integer ii = (Integer)get_Value("AD_Session_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Session_ID())); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_ValueNoCheck ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_ValueNoCheck ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Web Session. +@param WebSession Web Session ID */ +public void setWebSession (String WebSession) +{ +if (WebSession != null && WebSession.length() > 40) +{ +log.warning("Length > 40 - truncated"); +WebSession = WebSession.substring(0,39); +} +set_ValueNoCheck ("WebSession", WebSession); +} +/** Get Web Session. +@return Web Session ID */ +public String getWebSession() +{ +return (String)get_Value("WebSession"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_System.java b/dbPort/src/org/compiere/model/X_AD_System.java new file mode 100644 index 0000000000..7fa1272caa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_System.java @@ -0,0 +1,643 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_System + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.078 */ +public class X_AD_System extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_System_ID id +@param trxName transaction +*/ +public X_AD_System (Properties ctx, int AD_System_ID, String trxName) +{ +super (ctx, AD_System_ID, trxName); +/** if (AD_System_ID == 0) +{ +setAD_System_ID (0); // 0 +setInfo (null); +setIsAllowStatistics (false); +setIsAutoErrorReport (true); // Y +setName (null); +setPassword (null); +setReplicationType (null); // L +setSystemStatus (null); // E +setUserName (null); +setVersion (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_System (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=531 */ +public static final int Table_ID=531; + +/** TableName=AD_System */ +public static final String Table_Name="AD_System"; + +protected static KeyNamePair Model = new KeyNamePair(531,"AD_System"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_System[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System. +@param AD_System_ID System Definition */ +public void setAD_System_ID (int AD_System_ID) +{ +if (AD_System_ID < 1) throw new IllegalArgumentException ("AD_System_ID is mandatory."); +set_ValueNoCheck ("AD_System_ID", new Integer(AD_System_ID)); +} +/** Get System. +@return System Definition */ +public int getAD_System_ID() +{ +Integer ii = (Integer)get_Value("AD_System_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Custom Prefix. +@param CustomPrefix Prefix for Custom entities */ +public void setCustomPrefix (String CustomPrefix) +{ +if (CustomPrefix != null && CustomPrefix.length() > 60) +{ +log.warning("Length > 60 - truncated"); +CustomPrefix = CustomPrefix.substring(0,59); +} +set_Value ("CustomPrefix", CustomPrefix); +} +/** Get Custom Prefix. +@return Prefix for Custom entities */ +public String getCustomPrefix() +{ +return (String)get_Value("CustomPrefix"); +} +/** Set DB Address. +@param DBAddress JDBC URL of the database server */ +public void setDBAddress (String DBAddress) +{ +if (DBAddress != null && DBAddress.length() > 255) +{ +log.warning("Length > 255 - truncated"); +DBAddress = DBAddress.substring(0,254); +} +set_Value ("DBAddress", DBAddress); +} +/** Get DB Address. +@return JDBC URL of the database server */ +public String getDBAddress() +{ +return (String)get_Value("DBAddress"); +} +/** Set Database Name. +@param DBInstance Database Name */ +public void setDBInstance (String DBInstance) +{ +if (DBInstance != null && DBInstance.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DBInstance = DBInstance.substring(0,59); +} +set_Value ("DBInstance", DBInstance); +} +/** Get Database Name. +@return Database Name */ +public String getDBInstance() +{ +return (String)get_Value("DBInstance"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Encryption Class. +@param EncryptionKey Encryption Class used for securing data content */ +public void setEncryptionKey (String EncryptionKey) +{ +if (EncryptionKey != null && EncryptionKey.length() > 255) +{ +log.warning("Length > 255 - truncated"); +EncryptionKey = EncryptionKey.substring(0,254); +} +set_ValueNoCheck ("EncryptionKey", EncryptionKey); +} +/** Get Encryption Class. +@return Encryption Class used for securing data content */ +public String getEncryptionKey() +{ +return (String)get_Value("EncryptionKey"); +} +/** Set ID Range End. +@param IDRangeEnd End if the ID Range used */ +public void setIDRangeEnd (BigDecimal IDRangeEnd) +{ +set_Value ("IDRangeEnd", IDRangeEnd); +} +/** Get ID Range End. +@return End if the ID Range used */ +public BigDecimal getIDRangeEnd() +{ +BigDecimal bd = (BigDecimal)get_Value("IDRangeEnd"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set ID Range Start. +@param IDRangeStart Start of the ID Range used */ +public void setIDRangeStart (BigDecimal IDRangeStart) +{ +set_Value ("IDRangeStart", IDRangeStart); +} +/** Get ID Range Start. +@return Start of the ID Range used */ +public BigDecimal getIDRangeStart() +{ +BigDecimal bd = (BigDecimal)get_Value("IDRangeStart"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Info. +@param Info Information */ +public void setInfo (String Info) +{ +if (Info == null) throw new IllegalArgumentException ("Info is mandatory."); +if (Info.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Info = Info.substring(0,254); +} +set_ValueNoCheck ("Info", Info); +} +/** Get Info. +@return Information */ +public String getInfo() +{ +return (String)get_Value("Info"); +} +/** Set Maintain Statistics. +@param IsAllowStatistics Maintain general statistics */ +public void setIsAllowStatistics (boolean IsAllowStatistics) +{ +set_Value ("IsAllowStatistics", new Boolean(IsAllowStatistics)); +} +/** Get Maintain Statistics. +@return Maintain general statistics */ +public boolean isAllowStatistics() +{ +Object oo = get_Value("IsAllowStatistics"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Error Reporting. +@param IsAutoErrorReport Automatically report Errors */ +public void setIsAutoErrorReport (boolean IsAutoErrorReport) +{ +set_Value ("IsAutoErrorReport", new Boolean(IsAutoErrorReport)); +} +/** Get Error Reporting. +@return Automatically report Errors */ +public boolean isAutoErrorReport() +{ +Object oo = get_Value("IsAutoErrorReport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Just Migrated. +@param IsJustMigrated Value set by Migration for post-Migation tasks. */ +public void setIsJustMigrated (boolean IsJustMigrated) +{ +set_Value ("IsJustMigrated", new Boolean(IsJustMigrated)); +} +/** Get Just Migrated. +@return Value set by Migration for post-Migation tasks. */ +public boolean isJustMigrated() +{ +Object oo = get_Value("IsJustMigrated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set LDAP Domain. +@param LDAPDomain Directory service domain name - e.g. adempiere.org */ +public void setLDAPDomain (String LDAPDomain) +{ +if (LDAPDomain != null && LDAPDomain.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LDAPDomain = LDAPDomain.substring(0,254); +} +set_Value ("LDAPDomain", LDAPDomain); +} +/** Get LDAP Domain. +@return Directory service domain name - e.g. adempiere.org */ +public String getLDAPDomain() +{ +return (String)get_Value("LDAPDomain"); +} +/** Set LDAP URL. +@param LDAPHost Connection String to LDAP server starting with ldap:// */ +public void setLDAPHost (String LDAPHost) +{ +if (LDAPHost != null && LDAPHost.length() > 60) +{ +log.warning("Length > 60 - truncated"); +LDAPHost = LDAPHost.substring(0,59); +} +set_Value ("LDAPHost", LDAPHost); +} +/** Get LDAP URL. +@return Connection String to LDAP server starting with ldap:// */ +public String getLDAPHost() +{ +return (String)get_Value("LDAPHost"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Processors. +@param NoProcessors Number of Database Processors */ +public void setNoProcessors (int NoProcessors) +{ +set_Value ("NoProcessors", new Integer(NoProcessors)); +} +/** Get Processors. +@return Number of Database Processors */ +public int getNoProcessors() +{ +Integer ii = (Integer)get_Value("NoProcessors"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Old Name. +@param OldName Old Name */ +public void setOldName (String OldName) +{ +if (OldName != null && OldName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +OldName = OldName.substring(0,59); +} +set_ValueNoCheck ("OldName", OldName); +} +/** Get Old Name. +@return Old Name */ +public String getOldName() +{ +return (String)get_Value("OldName"); +} +/** Set Password. +@param Password Password of any length (case sensitive) */ +public void setPassword (String Password) +{ +if (Password == null) throw new IllegalArgumentException ("Password is mandatory."); +if (Password.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Password = Password.substring(0,19); +} +set_Value ("Password", Password); +} +/** Get Password. +@return Password of any length (case sensitive) */ +public String getPassword() +{ +return (String)get_Value("Password"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Profile. +@param ProfileInfo Information to help profiling the system for solving support issues */ +public void setProfileInfo (String ProfileInfo) +{ +if (ProfileInfo != null && ProfileInfo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProfileInfo = ProfileInfo.substring(0,59); +} +set_ValueNoCheck ("ProfileInfo", ProfileInfo); +} +/** Get Profile. +@return Information to help profiling the system for solving support issues */ +public String getProfileInfo() +{ +return (String)get_Value("ProfileInfo"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_Value ("Record_ID", null); + else +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Release No. +@param ReleaseNo Internal Release Number */ +public void setReleaseNo (String ReleaseNo) +{ +if (ReleaseNo != null && ReleaseNo.length() > 4) +{ +log.warning("Length > 4 - truncated"); +ReleaseNo = ReleaseNo.substring(0,3); +} +set_ValueNoCheck ("ReleaseNo", ReleaseNo); +} +/** Get Release No. +@return Internal Release Number */ +public String getReleaseNo() +{ +return (String)get_Value("ReleaseNo"); +} + +/** ReplicationType AD_Reference_ID=126 */ +public static final int REPLICATIONTYPE_AD_Reference_ID=126; +/** Local = L */ +public static final String REPLICATIONTYPE_Local = "L"; +/** Merge = M */ +public static final String REPLICATIONTYPE_Merge = "M"; +/** Reference = R */ +public static final String REPLICATIONTYPE_Reference = "R"; +/** Set Replication Type. +@param ReplicationType Type of Data Replication */ +public void setReplicationType (String ReplicationType) +{ +if (ReplicationType == null) throw new IllegalArgumentException ("ReplicationType is mandatory"); +if (ReplicationType.equals("L") || ReplicationType.equals("M") || ReplicationType.equals("R")); + else throw new IllegalArgumentException ("ReplicationType Invalid value - " + ReplicationType + " - Reference_ID=126 - L - M - R"); +if (ReplicationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ReplicationType = ReplicationType.substring(0,0); +} +set_Value ("ReplicationType", ReplicationType); +} +/** Get Replication Type. +@return Type of Data Replication */ +public String getReplicationType() +{ +return (String)get_Value("ReplicationType"); +} +/** Set Statistics. +@param StatisticsInfo Information to help profiling the system for solving support issues */ +public void setStatisticsInfo (String StatisticsInfo) +{ +if (StatisticsInfo != null && StatisticsInfo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +StatisticsInfo = StatisticsInfo.substring(0,59); +} +set_ValueNoCheck ("StatisticsInfo", StatisticsInfo); +} +/** Get Statistics. +@return Information to help profiling the system for solving support issues */ +public String getStatisticsInfo() +{ +return (String)get_Value("StatisticsInfo"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Summary = Summary.substring(0,254); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} +/** Set Support EMail. +@param SupportEMail EMail address to send support information and updates to */ +public void setSupportEMail (String SupportEMail) +{ +if (SupportEMail != null && SupportEMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SupportEMail = SupportEMail.substring(0,59); +} +set_Value ("SupportEMail", SupportEMail); +} +/** Get Support EMail. +@return EMail address to send support information and updates to */ +public String getSupportEMail() +{ +return (String)get_Value("SupportEMail"); +} +/** Set Support Expires. +@param SupportExpDate Date when the Adempiere support expires */ +public void setSupportExpDate (Timestamp SupportExpDate) +{ +set_ValueNoCheck ("SupportExpDate", SupportExpDate); +} +/** Get Support Expires. +@return Date when the Adempiere support expires */ +public Timestamp getSupportExpDate() +{ +return (Timestamp)get_Value("SupportExpDate"); +} +/** Set Internal Users. +@param SupportUnits Number of Internal Users for Adempiere Support */ +public void setSupportUnits (int SupportUnits) +{ +set_ValueNoCheck ("SupportUnits", new Integer(SupportUnits)); +} +/** Get Internal Users. +@return Number of Internal Users for Adempiere Support */ +public int getSupportUnits() +{ +Integer ii = (Integer)get_Value("SupportUnits"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SystemStatus AD_Reference_ID=374 */ +public static final int SYSTEMSTATUS_AD_Reference_ID=374; +/** Evaluation = E */ +public static final String SYSTEMSTATUS_Evaluation = "E"; +/** Implementation = I */ +public static final String SYSTEMSTATUS_Implementation = "I"; +/** Production = P */ +public static final String SYSTEMSTATUS_Production = "P"; +/** Set System Status. +@param SystemStatus Status of the system - Support priority depends on system status */ +public void setSystemStatus (String SystemStatus) +{ +if (SystemStatus == null) throw new IllegalArgumentException ("SystemStatus is mandatory"); +if (SystemStatus.equals("E") || SystemStatus.equals("I") || SystemStatus.equals("P")); + else throw new IllegalArgumentException ("SystemStatus Invalid value - " + SystemStatus + " - Reference_ID=374 - E - I - P"); +if (SystemStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SystemStatus = SystemStatus.substring(0,0); +} +set_Value ("SystemStatus", SystemStatus); +} +/** Get System Status. +@return Status of the system - Support priority depends on system status */ +public String getSystemStatus() +{ +return (String)get_Value("SystemStatus"); +} +/** Set Registered EMail. +@param UserName Email of the responsible for the System */ +public void setUserName (String UserName) +{ +if (UserName == null) throw new IllegalArgumentException ("UserName is mandatory."); +if (UserName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +UserName = UserName.substring(0,59); +} +set_Value ("UserName", UserName); +} +/** Get Registered EMail. +@return Email of the responsible for the System */ +public String getUserName() +{ +return (String)get_Value("UserName"); +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (String Version) +{ +if (Version == null) throw new IllegalArgumentException ("Version is mandatory."); +if (Version.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Version = Version.substring(0,19); +} +set_ValueNoCheck ("Version", Version); +} +/** Get Version. +@return Version of the table definition */ +public String getVersion() +{ +return (String)get_Value("Version"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Tab.java b/dbPort/src/org/compiere/model/X_AD_Tab.java new file mode 100644 index 0000000000..82f390a94e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Tab.java @@ -0,0 +1,625 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Tab + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.125 */ +public class X_AD_Tab extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Tab_ID id +@param trxName transaction +*/ +public X_AD_Tab (Properties ctx, int AD_Tab_ID, String trxName) +{ +super (ctx, AD_Tab_ID, trxName); +/** if (AD_Tab_ID == 0) +{ +setAD_Tab_ID (0); +setAD_Table_ID (0); +setAD_Window_ID (0); +setEntityType (null); // U +setHasTree (false); +setIsAdvancedTab (false); // N +setIsInsertRecord (true); // Y +setIsReadOnly (false); +setIsSingleRow (false); +setIsSortTab (false); // N +setIsTranslationTab (false); +setName (null); +setSeqNo (0); // @SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_Tab WHERE AD_Window_ID=@AD_Window_ID@ +setTabLevel (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Tab (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=106 */ +public static final int Table_ID=106; + +/** TableName=AD_Tab */ +public static final String Table_Name="AD_Tab"; + +protected static KeyNamePair Model = new KeyNamePair(106,"AD_Tab"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Tab[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_ColumnSortOrder_ID AD_Reference_ID=257 */ +public static final int AD_COLUMNSORTORDER_ID_AD_Reference_ID=257; +/** Set Order Column. +@param AD_ColumnSortOrder_ID Column determining the order */ +public void setAD_ColumnSortOrder_ID (int AD_ColumnSortOrder_ID) +{ +if (AD_ColumnSortOrder_ID <= 0) set_Value ("AD_ColumnSortOrder_ID", null); + else +set_Value ("AD_ColumnSortOrder_ID", new Integer(AD_ColumnSortOrder_ID)); +} +/** Get Order Column. +@return Column determining the order */ +public int getAD_ColumnSortOrder_ID() +{ +Integer ii = (Integer)get_Value("AD_ColumnSortOrder_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_ColumnSortYesNo_ID AD_Reference_ID=258 */ +public static final int AD_COLUMNSORTYESNO_ID_AD_Reference_ID=258; +/** Set Included Column. +@param AD_ColumnSortYesNo_ID Column determining if a Table Column is included in Ordering */ +public void setAD_ColumnSortYesNo_ID (int AD_ColumnSortYesNo_ID) +{ +if (AD_ColumnSortYesNo_ID <= 0) set_Value ("AD_ColumnSortYesNo_ID", null); + else +set_Value ("AD_ColumnSortYesNo_ID", new Integer(AD_ColumnSortYesNo_ID)); +} +/** Get Included Column. +@return Column determining if a Table Column is included in Ordering */ +public int getAD_ColumnSortYesNo_ID() +{ +Integer ii = (Integer)get_Value("AD_ColumnSortYesNo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tab. +@param AD_Tab_ID Tab within a Window */ +public void setAD_Tab_ID (int AD_Tab_ID) +{ +if (AD_Tab_ID < 1) throw new IllegalArgumentException ("AD_Tab_ID is mandatory."); +set_ValueNoCheck ("AD_Tab_ID", new Integer(AD_Tab_ID)); +} +/** Get Tab. +@return Tab within a Window */ +public int getAD_Tab_ID() +{ +Integer ii = (Integer)get_Value("AD_Tab_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID < 1) throw new IllegalArgumentException ("AD_Window_ID is mandatory."); +set_ValueNoCheck ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commit Warning. +@param CommitWarning Warning displayed when saving */ +public void setCommitWarning (String CommitWarning) +{ +if (CommitWarning != null && CommitWarning.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +CommitWarning = CommitWarning.substring(0,1999); +} +set_Value ("CommitWarning", CommitWarning); +} +/** Get Commit Warning. +@return Warning displayed when saving */ +public String getCommitWarning() +{ +return (String)get_Value("CommitWarning"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Display Logic. +@param DisplayLogic If the Field is displayed, the result determines if the field is actually displayed */ +public void setDisplayLogic (String DisplayLogic) +{ +if (DisplayLogic != null && DisplayLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DisplayLogic = DisplayLogic.substring(0,1999); +} +set_Value ("DisplayLogic", DisplayLogic); +} +/** Get Display Logic. +@return If the Field is displayed, the result determines if the field is actually displayed */ +public String getDisplayLogic() +{ +return (String)get_Value("DisplayLogic"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Has Tree. +@param HasTree Window has Tree Graph */ +public void setHasTree (boolean HasTree) +{ +set_Value ("HasTree", new Boolean(HasTree)); +} +/** Get Has Tree. +@return Window has Tree Graph */ +public boolean isHasTree() +{ +Object oo = get_Value("HasTree"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Import Fields. +@param ImportFields Create Fields from Table Columns */ +public void setImportFields (String ImportFields) +{ +if (ImportFields != null && ImportFields.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ImportFields = ImportFields.substring(0,0); +} +set_Value ("ImportFields", ImportFields); +} +/** Get Import Fields. +@return Create Fields from Table Columns */ +public String getImportFields() +{ +return (String)get_Value("ImportFields"); +} + +/** Included_Tab_ID AD_Reference_ID=278 */ +public static final int INCLUDED_TAB_ID_AD_Reference_ID=278; +/** Set Included Tab. +@param Included_Tab_ID Included Tab in this Tab (Master Dateail) */ +public void setIncluded_Tab_ID (int Included_Tab_ID) +{ +if (Included_Tab_ID <= 0) set_Value ("Included_Tab_ID", null); + else +set_Value ("Included_Tab_ID", new Integer(Included_Tab_ID)); +} +/** Get Included Tab. +@return Included Tab in this Tab (Master Dateail) */ +public int getIncluded_Tab_ID() +{ +Integer ii = (Integer)get_Value("Included_Tab_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Advanced Tab. +@param IsAdvancedTab This Tab contains advanced Functionality */ +public void setIsAdvancedTab (boolean IsAdvancedTab) +{ +set_Value ("IsAdvancedTab", new Boolean(IsAdvancedTab)); +} +/** Get Advanced Tab. +@return This Tab contains advanced Functionality */ +public boolean isAdvancedTab() +{ +Object oo = get_Value("IsAdvancedTab"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accounting Tab. +@param IsInfoTab This Tab contains accounting information */ +public void setIsInfoTab (boolean IsInfoTab) +{ +set_Value ("IsInfoTab", new Boolean(IsInfoTab)); +} +/** Get Accounting Tab. +@return This Tab contains accounting information */ +public boolean isInfoTab() +{ +Object oo = get_Value("IsInfoTab"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Insert Record. +@param IsInsertRecord The user can insert a new Record */ +public void setIsInsertRecord (boolean IsInsertRecord) +{ +set_Value ("IsInsertRecord", new Boolean(IsInsertRecord)); +} +/** Get Insert Record. +@return The user can insert a new Record */ +public boolean isInsertRecord() +{ +Object oo = get_Value("IsInsertRecord"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Single Row Layout. +@param IsSingleRow Default for toggle between Single- and Multi-Row (Grid) Layout */ +public void setIsSingleRow (boolean IsSingleRow) +{ +set_Value ("IsSingleRow", new Boolean(IsSingleRow)); +} +/** Get Single Row Layout. +@return Default for toggle between Single- and Multi-Row (Grid) Layout */ +public boolean isSingleRow() +{ +Object oo = get_Value("IsSingleRow"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Order Tab. +@param IsSortTab The Tab determines the Order */ +public void setIsSortTab (boolean IsSortTab) +{ +set_Value ("IsSortTab", new Boolean(IsSortTab)); +} +/** Get Order Tab. +@return The Tab determines the Order */ +public boolean isSortTab() +{ +Object oo = get_Value("IsSortTab"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set TranslationTab. +@param IsTranslationTab This Tab contains translation information */ +public void setIsTranslationTab (boolean IsTranslationTab) +{ +set_Value ("IsTranslationTab", new Boolean(IsTranslationTab)); +} +/** Get TranslationTab. +@return This Tab contains translation information */ +public boolean isTranslationTab() +{ +Object oo = get_Value("IsTranslationTab"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sql ORDER BY. +@param OrderByClause Fully qualified ORDER BY clause */ +public void setOrderByClause (String OrderByClause) +{ +if (OrderByClause != null && OrderByClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OrderByClause = OrderByClause.substring(0,1999); +} +set_Value ("OrderByClause", OrderByClause); +} +/** Get Sql ORDER BY. +@return Fully qualified ORDER BY clause */ +public String getOrderByClause() +{ +return (String)get_Value("OrderByClause"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only Logic. +@param ReadOnlyLogic Logic to determine if field is read only (applies only when field is read-write) */ +public void setReadOnlyLogic (String ReadOnlyLogic) +{ +if (ReadOnlyLogic != null && ReadOnlyLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ReadOnlyLogic = ReadOnlyLogic.substring(0,1999); +} +set_Value ("ReadOnlyLogic", ReadOnlyLogic); +} +/** Get Read Only Logic. +@return Logic to determine if field is read only (applies only when field is read-write) */ +public String getReadOnlyLogic() +{ +return (String)get_Value("ReadOnlyLogic"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tab Level. +@param TabLevel Hierarchical Tab Level (0 = top) */ +public void setTabLevel (int TabLevel) +{ +set_Value ("TabLevel", new Integer(TabLevel)); +} +/** Get Tab Level. +@return Hierarchical Tab Level (0 = top) */ +public int getTabLevel() +{ +Integer ii = (Integer)get_Value("TabLevel"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Table.java b/dbPort/src/org/compiere/model/X_AD_Table.java new file mode 100644 index 0000000000..4dde4791f2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Table.java @@ -0,0 +1,447 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Table + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.187 */ +public class X_AD_Table extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Table_ID id +@param trxName transaction +*/ +public X_AD_Table (Properties ctx, int AD_Table_ID, String trxName) +{ +super (ctx, AD_Table_ID, trxName); +/** if (AD_Table_ID == 0) +{ +setAD_Table_ID (0); +setAccessLevel (null); // 4 +setEntityType (null); // U +setIsChangeLog (false); +setIsDeleteable (true); // Y +setIsHighVolume (false); +setIsSecurityEnabled (false); +setIsView (false); // N +setName (null); +setReplicationType (null); // L +setTableName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Table (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=100 */ +public static final int Table_ID=100; + +/** TableName=AD_Table */ +public static final String Table_Name="AD_Table"; + +protected static KeyNamePair Model = new KeyNamePair(100,"AD_Table"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Table[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dynamic Validation. +@param AD_Val_Rule_ID Dynamic Validation Rule */ +public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) +{ +if (AD_Val_Rule_ID <= 0) set_Value ("AD_Val_Rule_ID", null); + else +set_Value ("AD_Val_Rule_ID", new Integer(AD_Val_Rule_ID)); +} +/** Get Dynamic Validation. +@return Dynamic Validation Rule */ +public int getAD_Val_Rule_ID() +{ +Integer ii = (Integer)get_Value("AD_Val_Rule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID <= 0) set_Value ("AD_Window_ID", null); + else +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AccessLevel AD_Reference_ID=5 */ +public static final int ACCESSLEVEL_AD_Reference_ID=5; +/** Organization = 1 */ +public static final String ACCESSLEVEL_Organization = "1"; +/** Client only = 2 */ +public static final String ACCESSLEVEL_ClientOnly = "2"; +/** Client+Organization = 3 */ +public static final String ACCESSLEVEL_ClientPlusOrganization = "3"; +/** System only = 4 */ +public static final String ACCESSLEVEL_SystemOnly = "4"; +/** System+Client = 6 */ +public static final String ACCESSLEVEL_SystemPlusClient = "6"; +/** All = 7 */ +public static final String ACCESSLEVEL_All = "7"; +/** Set Data Access Level. +@param AccessLevel Access Level required */ +public void setAccessLevel (String AccessLevel) +{ +if (AccessLevel == null) throw new IllegalArgumentException ("AccessLevel is mandatory"); +if (AccessLevel.equals("1") || AccessLevel.equals("2") || AccessLevel.equals("3") || AccessLevel.equals("4") || AccessLevel.equals("6") || AccessLevel.equals("7")); + else throw new IllegalArgumentException ("AccessLevel Invalid value - " + AccessLevel + " - Reference_ID=5 - 1 - 2 - 3 - 4 - 6 - 7"); +if (AccessLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccessLevel = AccessLevel.substring(0,0); +} +set_Value ("AccessLevel", AccessLevel); +} +/** Get Data Access Level. +@return Access Level required */ +public String getAccessLevel() +{ +return (String)get_Value("AccessLevel"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Import Table. +@param ImportTable Import Table Columns from Database */ +public void setImportTable (String ImportTable) +{ +if (ImportTable != null && ImportTable.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ImportTable = ImportTable.substring(0,0); +} +set_Value ("ImportTable", ImportTable); +} +/** Get Import Table. +@return Import Table Columns from Database */ +public String getImportTable() +{ +return (String)get_Value("ImportTable"); +} +/** Set Maintain Change Log. +@param IsChangeLog Maintain a log of changes */ +public void setIsChangeLog (boolean IsChangeLog) +{ +set_Value ("IsChangeLog", new Boolean(IsChangeLog)); +} +/** Get Maintain Change Log. +@return Maintain a log of changes */ +public boolean isChangeLog() +{ +Object oo = get_Value("IsChangeLog"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Records deleteable. +@param IsDeleteable Indicates if records can be deleted from the database */ +public void setIsDeleteable (boolean IsDeleteable) +{ +set_Value ("IsDeleteable", new Boolean(IsDeleteable)); +} +/** Get Records deleteable. +@return Indicates if records can be deleted from the database */ +public boolean isDeleteable() +{ +Object oo = get_Value("IsDeleteable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set High Volume. +@param IsHighVolume Use Search instead of Pick list */ +public void setIsHighVolume (boolean IsHighVolume) +{ +set_Value ("IsHighVolume", new Boolean(IsHighVolume)); +} +/** Get High Volume. +@return Use Search instead of Pick list */ +public boolean isHighVolume() +{ +Object oo = get_Value("IsHighVolume"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Security enabled. +@param IsSecurityEnabled If security is enabled, user access to data can be restricted via Roles */ +public void setIsSecurityEnabled (boolean IsSecurityEnabled) +{ +set_Value ("IsSecurityEnabled", new Boolean(IsSecurityEnabled)); +} +/** Get Security enabled. +@return If security is enabled, user access to data can be restricted via Roles */ +public boolean isSecurityEnabled() +{ +Object oo = get_Value("IsSecurityEnabled"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set View. +@param IsView This is a view */ +public void setIsView (boolean IsView) +{ +set_Value ("IsView", new Boolean(IsView)); +} +/** Get View. +@return This is a view */ +public boolean isView() +{ +Object oo = get_Value("IsView"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sequence. +@param LoadSeq Sequence */ +public void setLoadSeq (int LoadSeq) +{ +set_ValueNoCheck ("LoadSeq", new Integer(LoadSeq)); +} +/** Get Sequence. +@return Sequence */ +public int getLoadSeq() +{ +Integer ii = (Integer)get_Value("LoadSeq"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} + +/** PO_Window_ID AD_Reference_ID=284 */ +public static final int PO_WINDOW_ID_AD_Reference_ID=284; +/** Set PO Window. +@param PO_Window_ID Purchase Order Window */ +public void setPO_Window_ID (int PO_Window_ID) +{ +if (PO_Window_ID <= 0) set_Value ("PO_Window_ID", null); + else +set_Value ("PO_Window_ID", new Integer(PO_Window_ID)); +} +/** Get PO Window. +@return Purchase Order Window */ +public int getPO_Window_ID() +{ +Integer ii = (Integer)get_Value("PO_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ReplicationType AD_Reference_ID=126 */ +public static final int REPLICATIONTYPE_AD_Reference_ID=126; +/** Local = L */ +public static final String REPLICATIONTYPE_Local = "L"; +/** Merge = M */ +public static final String REPLICATIONTYPE_Merge = "M"; +/** Reference = R */ +public static final String REPLICATIONTYPE_Reference = "R"; +/** Set Replication Type. +@param ReplicationType Type of Data Replication */ +public void setReplicationType (String ReplicationType) +{ +if (ReplicationType == null) throw new IllegalArgumentException ("ReplicationType is mandatory"); +if (ReplicationType.equals("L") || ReplicationType.equals("M") || ReplicationType.equals("R")); + else throw new IllegalArgumentException ("ReplicationType Invalid value - " + ReplicationType + " - Reference_ID=126 - L - M - R"); +if (ReplicationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ReplicationType = ReplicationType.substring(0,0); +} +set_Value ("ReplicationType", ReplicationType); +} +/** Get Replication Type. +@return Type of Data Replication */ +public String getReplicationType() +{ +return (String)get_Value("ReplicationType"); +} +/** Set DB Table Name. +@param TableName Name of the table in the database */ +public void setTableName (String TableName) +{ +if (TableName == null) throw new IllegalArgumentException ("TableName is mandatory."); +if (TableName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +TableName = TableName.substring(0,39); +} +set_Value ("TableName", TableName); +} +/** Get DB Table Name. +@return Name of the table in the database */ +public String getTableName() +{ +return (String)get_Value("TableName"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getTableName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Table_Access.java b/dbPort/src/org/compiere/model/X_AD_Table_Access.java new file mode 100644 index 0000000000..e1602e06c3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Table_Access.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Table_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.218 */ +public class X_AD_Table_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Table_Access_ID id +@param trxName transaction +*/ +public X_AD_Table_Access (Properties ctx, int AD_Table_Access_ID, String trxName) +{ +super (ctx, AD_Table_Access_ID, trxName); +/** if (AD_Table_Access_ID == 0) +{ +setAD_Role_ID (0); +setAD_Table_ID (0); +setAccessTypeRule (null); // A +setIsCanExport (false); +setIsCanReport (false); +setIsExclude (true); // Y +setIsReadOnly (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Table_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=565 */ +public static final int Table_ID=565; + +/** TableName=AD_Table_Access */ +public static final String Table_Name="AD_Table_Access"; + +protected static KeyNamePair Model = new KeyNamePair(565,"AD_Table_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Table_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Table_ID())); +} + +/** AccessTypeRule AD_Reference_ID=293 */ +public static final int ACCESSTYPERULE_AD_Reference_ID=293; +/** Accessing = A */ +public static final String ACCESSTYPERULE_Accessing = "A"; +/** Exporting = E */ +public static final String ACCESSTYPERULE_Exporting = "E"; +/** Reporting = R */ +public static final String ACCESSTYPERULE_Reporting = "R"; +/** Set Access Type. +@param AccessTypeRule The type of access for this rule */ +public void setAccessTypeRule (String AccessTypeRule) +{ +if (AccessTypeRule == null) throw new IllegalArgumentException ("AccessTypeRule is mandatory"); +if (AccessTypeRule.equals("A") || AccessTypeRule.equals("E") || AccessTypeRule.equals("R")); + else throw new IllegalArgumentException ("AccessTypeRule Invalid value - " + AccessTypeRule + " - Reference_ID=293 - A - E - R"); +if (AccessTypeRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccessTypeRule = AccessTypeRule.substring(0,0); +} +set_ValueNoCheck ("AccessTypeRule", AccessTypeRule); +} +/** Get Access Type. +@return The type of access for this rule */ +public String getAccessTypeRule() +{ +return (String)get_Value("AccessTypeRule"); +} +/** Set Can Export. +@param IsCanExport Users with this role can export data */ +public void setIsCanExport (boolean IsCanExport) +{ +set_Value ("IsCanExport", new Boolean(IsCanExport)); +} +/** Get Can Export. +@return Users with this role can export data */ +public boolean isCanExport() +{ +Object oo = get_Value("IsCanExport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Can Report. +@param IsCanReport Users with this role can create reports */ +public void setIsCanReport (boolean IsCanReport) +{ +set_Value ("IsCanReport", new Boolean(IsCanReport)); +} +/** Get Can Report. +@return Users with this role can create reports */ +public boolean isCanReport() +{ +Object oo = get_Value("IsCanReport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Exclude. +@param IsExclude Exclude access to the data - if not selected Include access to the data */ +public void setIsExclude (boolean IsExclude) +{ +set_Value ("IsExclude", new Boolean(IsExclude)); +} +/** Get Exclude. +@return Exclude access to the data - if not selected Include access to the data */ +public boolean isExclude() +{ +Object oo = get_Value("IsExclude"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Task.java b/dbPort/src/org/compiere/model/X_AD_Task.java new file mode 100644 index 0000000000..7d2c65dd9e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Task.java @@ -0,0 +1,259 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Task + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.234 */ +public class X_AD_Task extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Task_ID id +@param trxName transaction +*/ +public X_AD_Task (Properties ctx, int AD_Task_ID, String trxName) +{ +super (ctx, AD_Task_ID, trxName); +/** if (AD_Task_ID == 0) +{ +setAD_Task_ID (0); +setAccessLevel (null); +setEntityType (null); // U +setIsServerProcess (false); // N +setName (null); +setOS_Command (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Task (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=118 */ +public static final int Table_ID=118; + +/** TableName=AD_Task */ +public static final String Table_Name="AD_Task"; + +protected static KeyNamePair Model = new KeyNamePair(118,"AD_Task"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Task[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set OS Task. +@param AD_Task_ID Operation System Task */ +public void setAD_Task_ID (int AD_Task_ID) +{ +if (AD_Task_ID < 1) throw new IllegalArgumentException ("AD_Task_ID is mandatory."); +set_ValueNoCheck ("AD_Task_ID", new Integer(AD_Task_ID)); +} +/** Get OS Task. +@return Operation System Task */ +public int getAD_Task_ID() +{ +Integer ii = (Integer)get_Value("AD_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AccessLevel AD_Reference_ID=5 */ +public static final int ACCESSLEVEL_AD_Reference_ID=5; +/** Organization = 1 */ +public static final String ACCESSLEVEL_Organization = "1"; +/** Client only = 2 */ +public static final String ACCESSLEVEL_ClientOnly = "2"; +/** Client+Organization = 3 */ +public static final String ACCESSLEVEL_ClientPlusOrganization = "3"; +/** System only = 4 */ +public static final String ACCESSLEVEL_SystemOnly = "4"; +/** System+Client = 6 */ +public static final String ACCESSLEVEL_SystemPlusClient = "6"; +/** All = 7 */ +public static final String ACCESSLEVEL_All = "7"; +/** Set Data Access Level. +@param AccessLevel Access Level required */ +public void setAccessLevel (String AccessLevel) +{ +if (AccessLevel == null) throw new IllegalArgumentException ("AccessLevel is mandatory"); +if (AccessLevel.equals("1") || AccessLevel.equals("2") || AccessLevel.equals("3") || AccessLevel.equals("4") || AccessLevel.equals("6") || AccessLevel.equals("7")); + else throw new IllegalArgumentException ("AccessLevel Invalid value - " + AccessLevel + " - Reference_ID=5 - 1 - 2 - 3 - 4 - 6 - 7"); +if (AccessLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccessLevel = AccessLevel.substring(0,0); +} +set_Value ("AccessLevel", AccessLevel); +} +/** Get Data Access Level. +@return Access Level required */ +public String getAccessLevel() +{ +return (String)get_Value("AccessLevel"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Server Process. +@param IsServerProcess Run this Process on Server only */ +public void setIsServerProcess (boolean IsServerProcess) +{ +set_Value ("IsServerProcess", new Boolean(IsServerProcess)); +} +/** Get Server Process. +@return Run this Process on Server only */ +public boolean isServerProcess() +{ +Object oo = get_Value("IsServerProcess"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set OS Command. +@param OS_Command Operating System Command */ +public void setOS_Command (String OS_Command) +{ +if (OS_Command == null) throw new IllegalArgumentException ("OS_Command is mandatory."); +if (OS_Command.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OS_Command = OS_Command.substring(0,1999); +} +set_Value ("OS_Command", OS_Command); +} +/** Get OS Command. +@return Operating System Command */ +public String getOS_Command() +{ +return (String)get_Value("OS_Command"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TaskInstance.java b/dbPort/src/org/compiere/model/X_AD_TaskInstance.java new file mode 100644 index 0000000000..6382e78f85 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TaskInstance.java @@ -0,0 +1,125 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TaskInstance + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.25 */ +public class X_AD_TaskInstance extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TaskInstance_ID id +@param trxName transaction +*/ +public X_AD_TaskInstance (Properties ctx, int AD_TaskInstance_ID, String trxName) +{ +super (ctx, AD_TaskInstance_ID, trxName); +/** if (AD_TaskInstance_ID == 0) +{ +setAD_TaskInstance_ID (0); +setAD_Task_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TaskInstance (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=125 */ +public static final int Table_ID=125; + +/** TableName=AD_TaskInstance */ +public static final String Table_Name="AD_TaskInstance"; + +protected static KeyNamePair Model = new KeyNamePair(125,"AD_TaskInstance"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TaskInstance[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Task Instance. +@param AD_TaskInstance_ID Task Instance */ +public void setAD_TaskInstance_ID (int AD_TaskInstance_ID) +{ +if (AD_TaskInstance_ID < 1) throw new IllegalArgumentException ("AD_TaskInstance_ID is mandatory."); +set_ValueNoCheck ("AD_TaskInstance_ID", new Integer(AD_TaskInstance_ID)); +} +/** Get Task Instance. +@return Task Instance */ +public int getAD_TaskInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_TaskInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_TaskInstance_ID())); +} +/** Set OS Task. +@param AD_Task_ID Operation System Task */ +public void setAD_Task_ID (int AD_Task_ID) +{ +if (AD_Task_ID < 1) throw new IllegalArgumentException ("AD_Task_ID is mandatory."); +set_Value ("AD_Task_ID", new Integer(AD_Task_ID)); +} +/** Get OS Task. +@return Operation System Task */ +public int getAD_Task_ID() +{ +Integer ii = (Integer)get_Value("AD_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Task_Access.java b/dbPort/src/org/compiere/model/X_AD_Task_Access.java new file mode 100644 index 0000000000..14a0e63f70 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Task_Access.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Task_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.265 */ +public class X_AD_Task_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Task_Access_ID id +@param trxName transaction +*/ +public X_AD_Task_Access (Properties ctx, int AD_Task_Access_ID, String trxName) +{ +super (ctx, AD_Task_Access_ID, trxName); +/** if (AD_Task_Access_ID == 0) +{ +setAD_Role_ID (0); +setAD_Task_ID (0); +setIsReadWrite (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Task_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=199 */ +public static final int Table_ID=199; + +/** TableName=AD_Task_Access */ +public static final String Table_Name="AD_Task_Access"; + +protected static KeyNamePair Model = new KeyNamePair(199,"AD_Task_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Task_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set OS Task. +@param AD_Task_ID Operation System Task */ +public void setAD_Task_ID (int AD_Task_ID) +{ +if (AD_Task_ID < 1) throw new IllegalArgumentException ("AD_Task_ID is mandatory."); +set_ValueNoCheck ("AD_Task_ID", new Integer(AD_Task_ID)); +} +/** Get OS Task. +@return Operation System Task */ +public int getAD_Task_ID() +{ +Integer ii = (Integer)get_Value("AD_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Write. +@param IsReadWrite Field is read / write */ +public void setIsReadWrite (boolean IsReadWrite) +{ +set_Value ("IsReadWrite", new Boolean(IsReadWrite)); +} +/** Get Read Write. +@return Field is read / write */ +public boolean isReadWrite() +{ +Object oo = get_Value("IsReadWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Tree.java b/dbPort/src/org/compiere/model/X_AD_Tree.java new file mode 100644 index 0000000000..503e6059ae --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Tree.java @@ -0,0 +1,263 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Tree + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.265 */ +public class X_AD_Tree extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Tree_ID id +@param trxName transaction +*/ +public X_AD_Tree (Properties ctx, int AD_Tree_ID, String trxName) +{ +super (ctx, AD_Tree_ID, trxName); +/** if (AD_Tree_ID == 0) +{ +setAD_Tree_ID (0); +setIsAllNodes (false); +setIsDefault (false); // N +setName (null); +setTreeType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Tree (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=288 */ +public static final int Table_ID=288; + +/** TableName=AD_Tree */ +public static final String Table_Name="AD_Tree"; + +protected static KeyNamePair Model = new KeyNamePair(288,"AD_Tree"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Tree[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set All Nodes. +@param IsAllNodes All Nodes are included (Complete Tree) */ +public void setIsAllNodes (boolean IsAllNodes) +{ +set_Value ("IsAllNodes", new Boolean(IsAllNodes)); +} +/** Get All Nodes. +@return All Nodes are included (Complete Tree) */ +public boolean isAllNodes() +{ +Object oo = get_Value("IsAllNodes"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** TreeType AD_Reference_ID=120 */ +public static final int TREETYPE_AD_Reference_ID=120; +/** Activity = AY */ +public static final String TREETYPE_Activity = "AY"; +/** BoM = BB */ +public static final String TREETYPE_BoM = "BB"; +/** BPartner = BP */ +public static final String TREETYPE_BPartner = "BP"; +/** CM Container = CC */ +public static final String TREETYPE_CMContainer = "CC"; +/** CM Media = CM */ +public static final String TREETYPE_CMMedia = "CM"; +/** CM Container Stage = CS */ +public static final String TREETYPE_CMContainerStage = "CS"; +/** CM Template = CT */ +public static final String TREETYPE_CMTemplate = "CT"; +/** Element Value = EV */ +public static final String TREETYPE_ElementValue = "EV"; +/** Campaign = MC */ +public static final String TREETYPE_Campaign = "MC"; +/** Menu = MM */ +public static final String TREETYPE_Menu = "MM"; +/** Organization = OO */ +public static final String TREETYPE_Organization = "OO"; +/** Product Category = PC */ +public static final String TREETYPE_ProductCategory = "PC"; +/** Project = PJ */ +public static final String TREETYPE_Project = "PJ"; +/** Product = PR */ +public static final String TREETYPE_Product = "PR"; +/** Sales Region = SR */ +public static final String TREETYPE_SalesRegion = "SR"; +/** User 1 = U1 */ +public static final String TREETYPE_User1 = "U1"; +/** User 2 = U2 */ +public static final String TREETYPE_User2 = "U2"; +/** User 3 = U3 */ +public static final String TREETYPE_User3 = "U3"; +/** User 4 = U4 */ +public static final String TREETYPE_User4 = "U4"; +/** Set Type | Area. +@param TreeType Element this tree is built on (i.e Product, Business Partner) */ +public void setTreeType (String TreeType) +{ +if (TreeType == null) throw new IllegalArgumentException ("TreeType is mandatory"); +if (TreeType.equals("AY") || TreeType.equals("BB") || TreeType.equals("BP") || TreeType.equals("CC") || TreeType.equals("CM") || TreeType.equals("CS") || TreeType.equals("CT") || TreeType.equals("EV") || TreeType.equals("MC") || TreeType.equals("MM") || TreeType.equals("OO") || TreeType.equals("PC") || TreeType.equals("PJ") || TreeType.equals("PR") || TreeType.equals("SR") || TreeType.equals("U1") || TreeType.equals("U2") || TreeType.equals("U3") || TreeType.equals("U4")); + else throw new IllegalArgumentException ("TreeType Invalid value - " + TreeType + " - Reference_ID=120 - AY - BB - BP - CC - CM - CS - CT - EV - MC - MM - OO - PC - PJ - PR - SR - U1 - U2 - U3 - U4"); +if (TreeType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +TreeType = TreeType.substring(0,1); +} +set_ValueNoCheck ("TreeType", TreeType); +} +/** Get Type | Area. +@return Element this tree is built on (i.e Product, Business Partner) */ +public String getTreeType() +{ +return (String)get_Value("TreeType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeBar.java b/dbPort/src/org/compiere/model/X_AD_TreeBar.java new file mode 100644 index 0000000000..622767e918 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeBar.java @@ -0,0 +1,141 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeBar + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.281 */ +public class X_AD_TreeBar extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeBar_ID id +@param trxName transaction +*/ +public X_AD_TreeBar (Properties ctx, int AD_TreeBar_ID, String trxName) +{ +super (ctx, AD_TreeBar_ID, trxName); +/** if (AD_TreeBar_ID == 0) +{ +setAD_Tree_ID (0); +setAD_User_ID (0); +setNode_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeBar (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=456 */ +public static final int Table_ID=456; + +/** TableName=AD_TreeBar */ +public static final String Table_Name="AD_TreeBar"; + +protected static KeyNamePair Model = new KeyNamePair(456,"AD_TreeBar"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeBar[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_Value ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getNode_ID())); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNode.java b/dbPort/src/org/compiere/model/X_AD_TreeNode.java new file mode 100644 index 0000000000..9bcc947ea8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNode.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNode + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.296 */ +public class X_AD_TreeNode extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNode_ID id +@param trxName transaction +*/ +public X_AD_TreeNode (Properties ctx, int AD_TreeNode_ID, String trxName) +{ +super (ctx, AD_TreeNode_ID, trxName); +/** if (AD_TreeNode_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNode (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=289 */ +public static final int Table_ID=289; + +/** TableName=AD_TreeNode */ +public static final String Table_Name="AD_TreeNode"; + +protected static KeyNamePair Model = new KeyNamePair(289,"AD_TreeNode"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNode[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID <= 0) set_Value ("Parent_ID", null); + else +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeBP.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeBP.java new file mode 100644 index 0000000000..4c1a99928c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeBP.java @@ -0,0 +1,151 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeBP + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.296 */ +public class X_AD_TreeNodeBP extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeBP_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeBP (Properties ctx, int AD_TreeNodeBP_ID, String trxName) +{ +super (ctx, AD_TreeNodeBP_ID, trxName); +/** if (AD_TreeNodeBP_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeBP (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=451 */ +public static final int Table_ID=451; + +/** TableName=AD_TreeNodeBP */ +public static final String Table_Name="AD_TreeNodeBP"; + +protected static KeyNamePair Model = new KeyNamePair(451,"AD_TreeNodeBP"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeBP[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID <= 0) set_Value ("Parent_ID", null); + else +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeCMC.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMC.java new file mode 100644 index 0000000000..37f9631c5a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMC.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeCMC + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.312 */ +public class X_AD_TreeNodeCMC extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeCMC_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeCMC (Properties ctx, int AD_TreeNodeCMC_ID, String trxName) +{ +super (ctx, AD_TreeNodeCMC_ID, trxName); +/** if (AD_TreeNodeCMC_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeCMC (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=845 */ +public static final int Table_ID=845; + +/** TableName=AD_TreeNodeCMC */ +public static final String Table_Name="AD_TreeNodeCMC"; + +protected static KeyNamePair Model = new KeyNamePair(845,"AD_TreeNodeCMC"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeCMC[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeCMM.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMM.java new file mode 100644 index 0000000000..97d91c9298 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMM.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeCMM + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.312 */ +public class X_AD_TreeNodeCMM extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeCMM_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeCMM (Properties ctx, int AD_TreeNodeCMM_ID, String trxName) +{ +super (ctx, AD_TreeNodeCMM_ID, trxName); +/** if (AD_TreeNodeCMM_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeCMM (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=846 */ +public static final int Table_ID=846; + +/** TableName=AD_TreeNodeCMM */ +public static final String Table_Name="AD_TreeNodeCMM"; + +protected static KeyNamePair Model = new KeyNamePair(846,"AD_TreeNodeCMM"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeCMM[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeCMS.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMS.java new file mode 100644 index 0000000000..a1f264cc96 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMS.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeCMS + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.328 */ +public class X_AD_TreeNodeCMS extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeCMS_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeCMS (Properties ctx, int AD_TreeNodeCMS_ID, String trxName) +{ +super (ctx, AD_TreeNodeCMS_ID, trxName); +/** if (AD_TreeNodeCMS_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeCMS (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=847 */ +public static final int Table_ID=847; + +/** TableName=AD_TreeNodeCMS */ +public static final String Table_Name="AD_TreeNodeCMS"; + +protected static KeyNamePair Model = new KeyNamePair(847,"AD_TreeNodeCMS"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeCMS[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeCMT.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMT.java new file mode 100644 index 0000000000..b1b115b9be --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeCMT.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeCMT + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.343 */ +public class X_AD_TreeNodeCMT extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeCMT_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeCMT (Properties ctx, int AD_TreeNodeCMT_ID, String trxName) +{ +super (ctx, AD_TreeNodeCMT_ID, trxName); +/** if (AD_TreeNodeCMT_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeCMT (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=848 */ +public static final int Table_ID=848; + +/** TableName=AD_TreeNodeCMT */ +public static final String Table_Name="AD_TreeNodeCMT"; + +protected static KeyNamePair Model = new KeyNamePair(848,"AD_TreeNodeCMT"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeCMT[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeMM.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeMM.java new file mode 100644 index 0000000000..73f304375e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeMM.java @@ -0,0 +1,151 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeMM + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.359 */ +public class X_AD_TreeNodeMM extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeMM_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeMM (Properties ctx, int AD_TreeNodeMM_ID, String trxName) +{ +super (ctx, AD_TreeNodeMM_ID, trxName); +/** if (AD_TreeNodeMM_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeMM (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=452 */ +public static final int Table_ID=452; + +/** TableName=AD_TreeNodeMM */ +public static final String Table_Name="AD_TreeNodeMM"; + +protected static KeyNamePair Model = new KeyNamePair(452,"AD_TreeNodeMM"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeMM[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID <= 0) set_Value ("Parent_ID", null); + else +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodePR.java b/dbPort/src/org/compiere/model/X_AD_TreeNodePR.java new file mode 100644 index 0000000000..80b5a34822 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodePR.java @@ -0,0 +1,151 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodePR + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.359 */ +public class X_AD_TreeNodePR extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodePR_ID id +@param trxName transaction +*/ +public X_AD_TreeNodePR (Properties ctx, int AD_TreeNodePR_ID, String trxName) +{ +super (ctx, AD_TreeNodePR_ID, trxName); +/** if (AD_TreeNodePR_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodePR (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=453 */ +public static final int Table_ID=453; + +/** TableName=AD_TreeNodePR */ +public static final String Table_Name="AD_TreeNodePR"; + +protected static KeyNamePair Model = new KeyNamePair(453,"AD_TreeNodePR"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodePR[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID <= 0) set_Value ("Parent_ID", null); + else +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeU1.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeU1.java new file mode 100644 index 0000000000..7b5340e24d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeU1.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeU1 + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.375 */ +public class X_AD_TreeNodeU1 extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeU1_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeU1 (Properties ctx, int AD_TreeNodeU1_ID, String trxName) +{ +super (ctx, AD_TreeNodeU1_ID, trxName); +/** if (AD_TreeNodeU1_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeU1 (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=852 */ +public static final int Table_ID=852; + +/** TableName=AD_TreeNodeU1 */ +public static final String Table_Name="AD_TreeNodeU1"; + +protected static KeyNamePair Model = new KeyNamePair(852,"AD_TreeNodeU1"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeU1[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeU2.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeU2.java new file mode 100644 index 0000000000..ff4d155608 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeU2.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeU2 + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.39 */ +public class X_AD_TreeNodeU2 extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeU2_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeU2 (Properties ctx, int AD_TreeNodeU2_ID, String trxName) +{ +super (ctx, AD_TreeNodeU2_ID, trxName); +/** if (AD_TreeNodeU2_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeU2 (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=851 */ +public static final int Table_ID=851; + +/** TableName=AD_TreeNodeU2 */ +public static final String Table_Name="AD_TreeNodeU2"; + +protected static KeyNamePair Model = new KeyNamePair(851,"AD_TreeNodeU2"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeU2[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeU3.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeU3.java new file mode 100644 index 0000000000..285ad03f5a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeU3.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeU3 + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.406 */ +public class X_AD_TreeNodeU3 extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeU3_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeU3 (Properties ctx, int AD_TreeNodeU3_ID, String trxName) +{ +super (ctx, AD_TreeNodeU3_ID, trxName); +/** if (AD_TreeNodeU3_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeU3 (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=850 */ +public static final int Table_ID=850; + +/** TableName=AD_TreeNodeU3 */ +public static final String Table_Name="AD_TreeNodeU3"; + +protected static KeyNamePair Model = new KeyNamePair(850,"AD_TreeNodeU3"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeU3[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_TreeNodeU4.java b/dbPort/src/org/compiere/model/X_AD_TreeNodeU4.java new file mode 100644 index 0000000000..4617a8cddc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_TreeNodeU4.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_TreeNodeU4 + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.406 */ +public class X_AD_TreeNodeU4 extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_TreeNodeU4_ID id +@param trxName transaction +*/ +public X_AD_TreeNodeU4 (Properties ctx, int AD_TreeNodeU4_ID, String trxName) +{ +super (ctx, AD_TreeNodeU4_ID, trxName); +/** if (AD_TreeNodeU4_ID == 0) +{ +setAD_Tree_ID (0); +setNode_ID (0); +setParent_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_TreeNodeU4 (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=849 */ +public static final int Table_ID=849; + +/** TableName=AD_TreeNodeU4 */ +public static final String Table_Name="AD_TreeNodeU4"; + +protected static KeyNamePair Model = new KeyNamePair(849,"AD_TreeNodeU4"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_TreeNodeU4[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node_ID. +@param Node_ID Node_ID */ +public void setNode_ID (int Node_ID) +{ +if (Node_ID < 0) throw new IllegalArgumentException ("Node_ID is mandatory."); +set_ValueNoCheck ("Node_ID", new Integer(Node_ID)); +} +/** Get Node_ID. +@return Node_ID */ +public int getNode_ID() +{ +Integer ii = (Integer)get_Value("Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent. +@param Parent_ID Parent of Entity */ +public void setParent_ID (int Parent_ID) +{ +if (Parent_ID < 1) throw new IllegalArgumentException ("Parent_ID is mandatory."); +set_Value ("Parent_ID", new Integer(Parent_ID)); +} +/** Get Parent. +@return Parent of Entity */ +public int getParent_ID() +{ +Integer ii = (Integer)get_Value("Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_User.java b/dbPort/src/org/compiere/model/X_AD_User.java new file mode 100644 index 0000000000..342500087b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_User.java @@ -0,0 +1,587 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_User + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.421 */ +public class X_AD_User extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_User_ID id +@param trxName transaction +*/ +public X_AD_User (Properties ctx, int AD_User_ID, String trxName) +{ +super (ctx, AD_User_ID, trxName); +/** if (AD_User_ID == 0) +{ +setAD_User_ID (0); +setIsFullBPAccess (true); // Y +setName (null); +setNotificationType (null); // E +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_User (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=114 */ +public static final int Table_ID=114; + +/** TableName=AD_User */ +public static final String Table_Name="AD_User"; + +protected static KeyNamePair Model = new KeyNamePair(114,"AD_User"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_User[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Birthday. +@param Birthday Birthday or Anniversary day */ +public void setBirthday (Timestamp Birthday) +{ +set_Value ("Birthday", Birthday); +} +/** Get Birthday. +@return Birthday or Anniversary day */ +public Timestamp getBirthday() +{ +return (Timestamp)get_Value("Birthday"); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Greeting. +@param C_Greeting_ID Greeting to print on correspondence */ +public void setC_Greeting_ID (int C_Greeting_ID) +{ +if (C_Greeting_ID <= 0) set_Value ("C_Greeting_ID", null); + else +set_Value ("C_Greeting_ID", new Integer(C_Greeting_ID)); +} +/** Get Greeting. +@return Greeting to print on correspondence */ +public int getC_Greeting_ID() +{ +Integer ii = (Integer)get_Value("C_Greeting_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Position. +@param C_Job_ID Job Position */ +public void setC_Job_ID (int C_Job_ID) +{ +if (C_Job_ID <= 0) set_Value ("C_Job_ID", null); + else +set_Value ("C_Job_ID", new Integer(C_Job_ID)); +} +/** Get Position. +@return Job Position */ +public int getC_Job_ID() +{ +Integer ii = (Integer)get_Value("C_Job_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comments. +@param Comments Comments or additional information */ +public void setComments (String Comments) +{ +if (Comments != null && Comments.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Comments = Comments.substring(0,1999); +} +set_Value ("Comments", Comments); +} +/** Get Comments. +@return Comments or additional information */ +public String getComments() +{ +return (String)get_Value("Comments"); +} + +/** ConnectionProfile AD_Reference_ID=364 */ +public static final int CONNECTIONPROFILE_AD_Reference_ID=364; +/** LAN = L */ +public static final String CONNECTIONPROFILE_LAN = "L"; +/** Terminal Server = T */ +public static final String CONNECTIONPROFILE_TerminalServer = "T"; +/** VPN = V */ +public static final String CONNECTIONPROFILE_VPN = "V"; +/** WAN = W */ +public static final String CONNECTIONPROFILE_WAN = "W"; +/** Set Connection Profile. +@param ConnectionProfile How a Java Client connects to the server(s) */ +public void setConnectionProfile (String ConnectionProfile) +{ +if (ConnectionProfile == null) throw new IllegalArgumentException ("ConnectionProfile is mandatory"); +if (ConnectionProfile == null || ConnectionProfile.equals("L") || ConnectionProfile.equals("T") || ConnectionProfile.equals("V") || ConnectionProfile.equals("W")); + else throw new IllegalArgumentException ("ConnectionProfile Invalid value - " + ConnectionProfile + " - Reference_ID=364 - L - T - V - W"); +if (ConnectionProfile != null && ConnectionProfile.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConnectionProfile = ConnectionProfile.substring(0,0); +} +set_Value ("ConnectionProfile", ConnectionProfile); +} +/** Get Connection Profile. +@return How a Java Client connects to the server(s) */ +public String getConnectionProfile() +{ +return (String)get_Value("ConnectionProfile"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set EMail User ID. +@param EMailUser User Name (ID) in the Mail System */ +public void setEMailUser (String EMailUser) +{ +if (EMailUser != null && EMailUser.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMailUser = EMailUser.substring(0,59); +} +set_Value ("EMailUser", EMailUser); +} +/** Get EMail User ID. +@return User Name (ID) in the Mail System */ +public String getEMailUser() +{ +return (String)get_Value("EMailUser"); +} +/** Set EMail User Password. +@param EMailUserPW Password of your email user id */ +public void setEMailUserPW (String EMailUserPW) +{ +if (EMailUserPW != null && EMailUserPW.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EMailUserPW = EMailUserPW.substring(0,19); +} +set_ValueE ("EMailUserPW", EMailUserPW); +} +/** Get EMail User Password. +@return Password of your email user id */ +public String getEMailUserPW() +{ +return (String)get_ValueE("EMailUserPW"); +} +/** Set Verification Info. +@param EMailVerify Verification information of EMail Address */ +public void setEMailVerify (String EMailVerify) +{ +if (EMailVerify != null && EMailVerify.length() > 40) +{ +log.warning("Length > 40 - truncated"); +EMailVerify = EMailVerify.substring(0,39); +} +set_ValueNoCheck ("EMailVerify", EMailVerify); +} +/** Get Verification Info. +@return Verification information of EMail Address */ +public String getEMailVerify() +{ +return (String)get_Value("EMailVerify"); +} +/** Set EMail Verify. +@param EMailVerifyDate Date Email was verified */ +public void setEMailVerifyDate (Timestamp EMailVerifyDate) +{ +set_ValueNoCheck ("EMailVerifyDate", EMailVerifyDate); +} +/** Get EMail Verify. +@return Date Email was verified */ +public Timestamp getEMailVerifyDate() +{ +return (Timestamp)get_Value("EMailVerifyDate"); +} +/** Set Fax. +@param Fax Facsimile number */ +public void setFax (String Fax) +{ +if (Fax != null && Fax.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Fax = Fax.substring(0,39); +} +set_Value ("Fax", Fax); +} +/** Get Fax. +@return Facsimile number */ +public String getFax() +{ +return (String)get_Value("Fax"); +} +/** Set Full BP Access. +@param IsFullBPAccess The user/concat has full access to Business Partner information and resources */ +public void setIsFullBPAccess (boolean IsFullBPAccess) +{ +set_Value ("IsFullBPAccess", new Boolean(IsFullBPAccess)); +} +/** Get Full BP Access. +@return The user/concat has full access to Business Partner information and resources */ +public boolean isFullBPAccess() +{ +Object oo = get_Value("IsFullBPAccess"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set LDAP User Name. +@param LDAPUser User Name used for authorization via LDAP (directory) services */ +public void setLDAPUser (String LDAPUser) +{ +if (LDAPUser != null && LDAPUser.length() > 60) +{ +log.warning("Length > 60 - truncated"); +LDAPUser = LDAPUser.substring(0,59); +} +set_Value ("LDAPUser", LDAPUser); +} +/** Get LDAP User Name. +@return User Name used for authorization via LDAP (directory) services */ +public String getLDAPUser() +{ +return (String)get_Value("LDAPUser"); +} +/** Set Last Contact. +@param LastContact Date this individual was last contacted */ +public void setLastContact (Timestamp LastContact) +{ +set_Value ("LastContact", LastContact); +} +/** Get Last Contact. +@return Date this individual was last contacted */ +public Timestamp getLastContact() +{ +return (Timestamp)get_Value("LastContact"); +} +/** Set Last Result. +@param LastResult Result of last contact */ +public void setLastResult (String LastResult) +{ +if (LastResult != null && LastResult.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LastResult = LastResult.substring(0,254); +} +set_Value ("LastResult", LastResult); +} +/** Get Last Result. +@return Result of last contact */ +public String getLastResult() +{ +return (String)get_Value("LastResult"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** NotificationType AD_Reference_ID=344 */ +public static final int NOTIFICATIONTYPE_AD_Reference_ID=344; +/** EMail+Notice = B */ +public static final String NOTIFICATIONTYPE_EMailPlusNotice = "B"; +/** EMail = E */ +public static final String NOTIFICATIONTYPE_EMail = "E"; +/** Notice = N */ +public static final String NOTIFICATIONTYPE_Notice = "N"; +/** None = X */ +public static final String NOTIFICATIONTYPE_None = "X"; +/** Set Notification Type. +@param NotificationType Type of Notifications */ +public void setNotificationType (String NotificationType) +{ +if (NotificationType == null) throw new IllegalArgumentException ("NotificationType is mandatory"); +if (NotificationType.equals("B") || NotificationType.equals("E") || NotificationType.equals("N") || NotificationType.equals("X")); + else throw new IllegalArgumentException ("NotificationType Invalid value - " + NotificationType + " - Reference_ID=344 - B - E - N - X"); +if (NotificationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +NotificationType = NotificationType.substring(0,0); +} +set_Value ("NotificationType", NotificationType); +} +/** Get Notification Type. +@return Type of Notifications */ +public String getNotificationType() +{ +return (String)get_Value("NotificationType"); +} +/** Set Password. +@param Password Password of any length (case sensitive) */ +public void setPassword (String Password) +{ +if (Password != null && Password.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Password = Password.substring(0,39); +} +set_ValueE ("Password", Password); +} +/** Get Password. +@return Password of any length (case sensitive) */ +public String getPassword() +{ +return (String)get_ValueE("Password"); +} +/** Set Phone. +@param Phone Identifies a telephone number */ +public void setPhone (String Phone) +{ +if (Phone != null && Phone.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone = Phone.substring(0,39); +} +set_Value ("Phone", Phone); +} +/** Get Phone. +@return Identifies a telephone number */ +public String getPhone() +{ +return (String)get_Value("Phone"); +} +/** Set 2nd Phone. +@param Phone2 Identifies an alternate telephone number. */ +public void setPhone2 (String Phone2) +{ +if (Phone2 != null && Phone2.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone2 = Phone2.substring(0,39); +} +set_Value ("Phone2", Phone2); +} +/** Get 2nd Phone. +@return Identifies an alternate telephone number. */ +public String getPhone2() +{ +return (String)get_Value("Phone2"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** Supervisor_ID AD_Reference_ID=110 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=110; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID <= 0) set_Value ("Supervisor_ID", null); + else +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title != null && Title.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Title = Title.substring(0,39); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_UserBPAccess.java b/dbPort/src/org/compiere/model/X_AD_UserBPAccess.java new file mode 100644 index 0000000000..2d30672f73 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_UserBPAccess.java @@ -0,0 +1,234 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_UserBPAccess + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.453 */ +public class X_AD_UserBPAccess extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_UserBPAccess_ID id +@param trxName transaction +*/ +public X_AD_UserBPAccess (Properties ctx, int AD_UserBPAccess_ID, String trxName) +{ +super (ctx, AD_UserBPAccess_ID, trxName); +/** if (AD_UserBPAccess_ID == 0) +{ +setAD_UserBPAccess_ID (0); +setAD_User_ID (0); +setBPAccessType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_UserBPAccess (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=813 */ +public static final int Table_ID=813; + +/** TableName=AD_UserBPAccess */ +public static final String Table_Name="AD_UserBPAccess"; + +protected static KeyNamePair Model = new KeyNamePair(813,"AD_UserBPAccess"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_UserBPAccess[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User BP Access. +@param AD_UserBPAccess_ID User/concat access to Business Partner information and resources */ +public void setAD_UserBPAccess_ID (int AD_UserBPAccess_ID) +{ +if (AD_UserBPAccess_ID < 1) throw new IllegalArgumentException ("AD_UserBPAccess_ID is mandatory."); +set_ValueNoCheck ("AD_UserBPAccess_ID", new Integer(AD_UserBPAccess_ID)); +} +/** Get User BP Access. +@return User/concat access to Business Partner information and resources */ +public int getAD_UserBPAccess_ID() +{ +Integer ii = (Integer)get_Value("AD_UserBPAccess_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** BPAccessType AD_Reference_ID=358 */ +public static final int BPACCESSTYPE_AD_Reference_ID=358; +/** Assets, Download = A */ +public static final String BPACCESSTYPE_AssetsDownload = "A"; +/** Business Documents = B */ +public static final String BPACCESSTYPE_BusinessDocuments = "B"; +/** Requests = R */ +public static final String BPACCESSTYPE_Requests = "R"; +/** Set Access Type. +@param BPAccessType Type of Access of the user/contact to Business Partner information and resources */ +public void setBPAccessType (String BPAccessType) +{ +if (BPAccessType == null) throw new IllegalArgumentException ("BPAccessType is mandatory"); +if (BPAccessType.equals("A") || BPAccessType.equals("B") || BPAccessType.equals("R")); + else throw new IllegalArgumentException ("BPAccessType Invalid value - " + BPAccessType + " - Reference_ID=358 - A - B - R"); +if (BPAccessType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BPAccessType = BPAccessType.substring(0,0); +} +set_Value ("BPAccessType", BPAccessType); +} +/** Get Access Type. +@return Type of Access of the user/contact to Business Partner information and resources */ +public String getBPAccessType() +{ +return (String)get_Value("BPAccessType"); +} + +/** DocBaseType AD_Reference_ID=183 */ +public static final int DOCBASETYPE_AD_Reference_ID=183; +/** AP Credit Memo = APC */ +public static final String DOCBASETYPE_APCreditMemo = "APC"; +/** AP Invoice = API */ +public static final String DOCBASETYPE_APInvoice = "API"; +/** AP Payment = APP */ +public static final String DOCBASETYPE_APPayment = "APP"; +/** AR Credit Memo = ARC */ +public static final String DOCBASETYPE_ARCreditMemo = "ARC"; +/** AR Pro Forma Invoice = ARF */ +public static final String DOCBASETYPE_ARProFormaInvoice = "ARF"; +/** AR Invoice = ARI */ +public static final String DOCBASETYPE_ARInvoice = "ARI"; +/** AR Receipt = ARR */ +public static final String DOCBASETYPE_ARReceipt = "ARR"; +/** Payment Allocation = CMA */ +public static final String DOCBASETYPE_PaymentAllocation = "CMA"; +/** Bank Statement = CMB */ +public static final String DOCBASETYPE_BankStatement = "CMB"; +/** Cash Journal = CMC */ +public static final String DOCBASETYPE_CashJournal = "CMC"; +/** GL Document = GLD */ +public static final String DOCBASETYPE_GLDocument = "GLD"; +/** GL Journal = GLJ */ +public static final String DOCBASETYPE_GLJournal = "GLJ"; +/** Material Physical Inventory = MMI */ +public static final String DOCBASETYPE_MaterialPhysicalInventory = "MMI"; +/** Material Movement = MMM */ +public static final String DOCBASETYPE_MaterialMovement = "MMM"; +/** Material Production = MMP */ +public static final String DOCBASETYPE_MaterialProduction = "MMP"; +/** Material Receipt = MMR */ +public static final String DOCBASETYPE_MaterialReceipt = "MMR"; +/** Material Delivery = MMS */ +public static final String DOCBASETYPE_MaterialDelivery = "MMS"; +/** Match Invoice = MXI */ +public static final String DOCBASETYPE_MatchInvoice = "MXI"; +/** Match PO = MXP */ +public static final String DOCBASETYPE_MatchPO = "MXP"; +/** Project Issue = PJI */ +public static final String DOCBASETYPE_ProjectIssue = "PJI"; +/** Purchase Order = POO */ +public static final String DOCBASETYPE_PurchaseOrder = "POO"; +/** Purchase Requisition = POR */ +public static final String DOCBASETYPE_PurchaseRequisition = "POR"; +/** Sales Order = SOO */ +public static final String DOCBASETYPE_SalesOrder = "SOO"; +/** Set Document BaseType. +@param DocBaseType Logical type of document */ +public void setDocBaseType (String DocBaseType) +{ +if (DocBaseType == null) throw new IllegalArgumentException ("DocBaseType is mandatory"); +if (DocBaseType == null || DocBaseType.equals("APC") || DocBaseType.equals("API") || DocBaseType.equals("APP") || DocBaseType.equals("ARC") || DocBaseType.equals("ARF") || DocBaseType.equals("ARI") || DocBaseType.equals("ARR") || DocBaseType.equals("CMA") || DocBaseType.equals("CMB") || DocBaseType.equals("CMC") || DocBaseType.equals("GLD") || DocBaseType.equals("GLJ") || DocBaseType.equals("MMI") || DocBaseType.equals("MMM") || DocBaseType.equals("MMP") || DocBaseType.equals("MMR") || DocBaseType.equals("MMS") || DocBaseType.equals("MXI") || DocBaseType.equals("MXP") || DocBaseType.equals("PJI") || DocBaseType.equals("POO") || DocBaseType.equals("POR") || DocBaseType.equals("SOO")); + else throw new IllegalArgumentException ("DocBaseType Invalid value - " + DocBaseType + " - Reference_ID=183 - APC - API - APP - ARC - ARF - ARI - ARR - CMA - CMB - CMC - GLD - GLJ - MMI - MMM - MMP - MMR - MMS - MXI - MXP - PJI - POO - POR - SOO"); +if (DocBaseType != null && DocBaseType.length() > 10) +{ +log.warning("Length > 10 - truncated"); +DocBaseType = DocBaseType.substring(0,9); +} +set_Value ("DocBaseType", DocBaseType); +} +/** Get Document BaseType. +@return Logical type of document */ +public String getDocBaseType() +{ +return (String)get_Value("DocBaseType"); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_Value ("R_RequestType_ID", null); + else +set_Value ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_UserDef_Field.java b/dbPort/src/org/compiere/model/X_AD_UserDef_Field.java new file mode 100644 index 0000000000..7934f8c1b6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_UserDef_Field.java @@ -0,0 +1,352 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_UserDef_Field + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.484 */ +public class X_AD_UserDef_Field extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_UserDef_Field_ID id +@param trxName transaction +*/ +public X_AD_UserDef_Field (Properties ctx, int AD_UserDef_Field_ID, String trxName) +{ +super (ctx, AD_UserDef_Field_ID, trxName); +/** if (AD_UserDef_Field_ID == 0) +{ +setAD_Field_ID (0); +setAD_UserDef_Field_ID (0); +setAD_UserDef_Tab_ID (0); +setDefaultValue (null); +setIsDisplayed (false); +setIsReadOnly (false); +setIsSameLine (false); +setName (null); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_UserDef_Field (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=464 */ +public static final int Table_ID=464; + +/** TableName=AD_UserDef_Field */ +public static final String Table_Name="AD_UserDef_Field"; + +protected static KeyNamePair Model = new KeyNamePair(464,"AD_UserDef_Field"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_UserDef_Field[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Field. +@param AD_Field_ID Field on a database table */ +public void setAD_Field_ID (int AD_Field_ID) +{ +if (AD_Field_ID < 1) throw new IllegalArgumentException ("AD_Field_ID is mandatory."); +set_Value ("AD_Field_ID", new Integer(AD_Field_ID)); +} +/** Get Field. +@return Field on a database table */ +public int getAD_Field_ID() +{ +Integer ii = (Integer)get_Value("AD_Field_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User defined Field. +@param AD_UserDef_Field_ID User defined Field */ +public void setAD_UserDef_Field_ID (int AD_UserDef_Field_ID) +{ +if (AD_UserDef_Field_ID < 1) throw new IllegalArgumentException ("AD_UserDef_Field_ID is mandatory."); +set_ValueNoCheck ("AD_UserDef_Field_ID", new Integer(AD_UserDef_Field_ID)); +} +/** Get User defined Field. +@return User defined Field */ +public int getAD_UserDef_Field_ID() +{ +Integer ii = (Integer)get_Value("AD_UserDef_Field_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User defined Tab. +@param AD_UserDef_Tab_ID User defined Tab */ +public void setAD_UserDef_Tab_ID (int AD_UserDef_Tab_ID) +{ +if (AD_UserDef_Tab_ID < 1) throw new IllegalArgumentException ("AD_UserDef_Tab_ID is mandatory."); +set_ValueNoCheck ("AD_UserDef_Tab_ID", new Integer(AD_UserDef_Tab_ID)); +} +/** Get User defined Tab. +@return User defined Tab */ +public int getAD_UserDef_Tab_ID() +{ +Integer ii = (Integer)get_Value("AD_UserDef_Tab_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Default Logic. +@param DefaultValue Default value hierarchy, separated by ; + */ +public void setDefaultValue (String DefaultValue) +{ +if (DefaultValue == null) throw new IllegalArgumentException ("DefaultValue is mandatory."); +if (DefaultValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DefaultValue = DefaultValue.substring(0,1999); +} +set_Value ("DefaultValue", DefaultValue); +} +/** Get Default Logic. +@return Default value hierarchy, separated by ; + */ +public String getDefaultValue() +{ +return (String)get_Value("DefaultValue"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Display Length. +@param DisplayLength Length of the display in characters */ +public void setDisplayLength (int DisplayLength) +{ +set_Value ("DisplayLength", new Integer(DisplayLength)); +} +/** Get Display Length. +@return Length of the display in characters */ +public int getDisplayLength() +{ +Integer ii = (Integer)get_Value("DisplayLength"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Display Logic. +@param DisplayLogic If the Field is displayed, the result determines if the field is actually displayed */ +public void setDisplayLogic (String DisplayLogic) +{ +if (DisplayLogic != null && DisplayLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DisplayLogic = DisplayLogic.substring(0,1999); +} +set_Value ("DisplayLogic", DisplayLogic); +} +/** Get Display Logic. +@return If the Field is displayed, the result determines if the field is actually displayed */ +public String getDisplayLogic() +{ +return (String)get_Value("DisplayLogic"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Displayed. +@param IsDisplayed Determines, if this field is displayed */ +public void setIsDisplayed (boolean IsDisplayed) +{ +set_Value ("IsDisplayed", new Boolean(IsDisplayed)); +} +/** Get Displayed. +@return Determines, if this field is displayed */ +public boolean isDisplayed() +{ +Object oo = get_Value("IsDisplayed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Same Line. +@param IsSameLine Displayed on same line as previous field */ +public void setIsSameLine (boolean IsSameLine) +{ +set_Value ("IsSameLine", new Boolean(IsSameLine)); +} +/** Get Same Line. +@return Displayed on same line as previous field */ +public boolean isSameLine() +{ +Object oo = get_Value("IsSameLine"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Updateable. +@param IsUpdateable Determines, if the field can be updated */ +public void setIsUpdateable (boolean IsUpdateable) +{ +set_Value ("IsUpdateable", new Boolean(IsUpdateable)); +} +/** Get Updateable. +@return Determines, if the field can be updated */ +public boolean isUpdateable() +{ +Object oo = get_Value("IsUpdateable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record Sort No. +@param SortNo Determines in what order the records are displayed */ +public void setSortNo (int SortNo) +{ +set_Value ("SortNo", new Integer(SortNo)); +} +/** Get Record Sort No. +@return Determines in what order the records are displayed */ +public int getSortNo() +{ +Integer ii = (Integer)get_Value("SortNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_UserDef_Tab.java b/dbPort/src/org/compiere/model/X_AD_UserDef_Tab.java new file mode 100644 index 0000000000..5f52b6fd64 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_UserDef_Tab.java @@ -0,0 +1,251 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_UserDef_Tab + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.5 */ +public class X_AD_UserDef_Tab extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_UserDef_Tab_ID id +@param trxName transaction +*/ +public X_AD_UserDef_Tab (Properties ctx, int AD_UserDef_Tab_ID, String trxName) +{ +super (ctx, AD_UserDef_Tab_ID, trxName); +/** if (AD_UserDef_Tab_ID == 0) +{ +setAD_Tab_ID (0); +setAD_UserDef_Tab_ID (0); +setAD_UserDef_Win_ID (0); +setIsMultiRowOnly (false); +setIsReadOnly (false); +setIsSingleRow (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_UserDef_Tab (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=466 */ +public static final int Table_ID=466; + +/** TableName=AD_UserDef_Tab */ +public static final String Table_Name="AD_UserDef_Tab"; + +protected static KeyNamePair Model = new KeyNamePair(466,"AD_UserDef_Tab"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_UserDef_Tab[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tab. +@param AD_Tab_ID Tab within a Window */ +public void setAD_Tab_ID (int AD_Tab_ID) +{ +if (AD_Tab_ID < 1) throw new IllegalArgumentException ("AD_Tab_ID is mandatory."); +set_Value ("AD_Tab_ID", new Integer(AD_Tab_ID)); +} +/** Get Tab. +@return Tab within a Window */ +public int getAD_Tab_ID() +{ +Integer ii = (Integer)get_Value("AD_Tab_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User defined Tab. +@param AD_UserDef_Tab_ID User defined Tab */ +public void setAD_UserDef_Tab_ID (int AD_UserDef_Tab_ID) +{ +if (AD_UserDef_Tab_ID < 1) throw new IllegalArgumentException ("AD_UserDef_Tab_ID is mandatory."); +set_ValueNoCheck ("AD_UserDef_Tab_ID", new Integer(AD_UserDef_Tab_ID)); +} +/** Get User defined Tab. +@return User defined Tab */ +public int getAD_UserDef_Tab_ID() +{ +Integer ii = (Integer)get_Value("AD_UserDef_Tab_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User defined Window. +@param AD_UserDef_Win_ID User defined Window */ +public void setAD_UserDef_Win_ID (int AD_UserDef_Win_ID) +{ +if (AD_UserDef_Win_ID < 1) throw new IllegalArgumentException ("AD_UserDef_Win_ID is mandatory."); +set_ValueNoCheck ("AD_UserDef_Win_ID", new Integer(AD_UserDef_Win_ID)); +} +/** Get User defined Window. +@return User defined Window */ +public int getAD_UserDef_Win_ID() +{ +Integer ii = (Integer)get_Value("AD_UserDef_Win_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Multi Row Only. +@param IsMultiRowOnly This applies to Multi-Row view only */ +public void setIsMultiRowOnly (boolean IsMultiRowOnly) +{ +set_Value ("IsMultiRowOnly", new Boolean(IsMultiRowOnly)); +} +/** Get Multi Row Only. +@return This applies to Multi-Row view only */ +public boolean isMultiRowOnly() +{ +Object oo = get_Value("IsMultiRowOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Single Row Layout. +@param IsSingleRow Default for toggle between Single- and Multi-Row (Grid) Layout */ +public void setIsSingleRow (boolean IsSingleRow) +{ +set_Value ("IsSingleRow", new Boolean(IsSingleRow)); +} +/** Get Single Row Layout. +@return Default for toggle between Single- and Multi-Row (Grid) Layout */ +public boolean isSingleRow() +{ +Object oo = get_Value("IsSingleRow"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_UserDef_Win.java b/dbPort/src/org/compiere/model/X_AD_UserDef_Win.java new file mode 100644 index 0000000000..539fffcaea --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_UserDef_Win.java @@ -0,0 +1,288 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_UserDef_Win + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.515 */ +public class X_AD_UserDef_Win extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_UserDef_Win_ID id +@param trxName transaction +*/ +public X_AD_UserDef_Win (Properties ctx, int AD_UserDef_Win_ID, String trxName) +{ +super (ctx, AD_UserDef_Win_ID, trxName); +/** if (AD_UserDef_Win_ID == 0) +{ +setAD_Language (null); +setAD_UserDef_Win_ID (0); +setAD_Window_ID (0); +setIsDefault (false); +setIsReadOnly (false); +setIsUserUpdateable (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_UserDef_Win (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=467 */ +public static final int Table_ID=467; + +/** TableName=AD_UserDef_Win */ +public static final String Table_Name="AD_UserDef_Win"; + +protected static KeyNamePair Model = new KeyNamePair(467,"AD_UserDef_Win"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_UserDef_Win[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=106 */ +public static final int AD_LANGUAGE_AD_Reference_ID=106; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID <= 0) set_Value ("AD_Role_ID", null); + else +set_Value ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User defined Window. +@param AD_UserDef_Win_ID User defined Window */ +public void setAD_UserDef_Win_ID (int AD_UserDef_Win_ID) +{ +if (AD_UserDef_Win_ID < 1) throw new IllegalArgumentException ("AD_UserDef_Win_ID is mandatory."); +set_ValueNoCheck ("AD_UserDef_Win_ID", new Integer(AD_UserDef_Win_ID)); +} +/** Get User defined Window. +@return User defined Window */ +public int getAD_UserDef_Win_ID() +{ +Integer ii = (Integer)get_Value("AD_UserDef_Win_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID < 1) throw new IllegalArgumentException ("AD_Window_ID is mandatory."); +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set User updateable. +@param IsUserUpdateable The field can be updated by the user */ +public void setIsUserUpdateable (boolean IsUserUpdateable) +{ +set_Value ("IsUserUpdateable", new Boolean(IsUserUpdateable)); +} +/** Get User updateable. +@return The field can be updated by the user */ +public boolean isUserUpdateable() +{ +Object oo = get_Value("IsUserUpdateable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_UserMail.java b/dbPort/src/org/compiere/model/X_AD_UserMail.java new file mode 100644 index 0000000000..9b311c45a6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_UserMail.java @@ -0,0 +1,252 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_UserMail + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.546 */ +public class X_AD_UserMail extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_UserMail_ID id +@param trxName transaction +*/ +public X_AD_UserMail (Properties ctx, int AD_UserMail_ID, String trxName) +{ +super (ctx, AD_UserMail_ID, trxName); +/** if (AD_UserMail_ID == 0) +{ +setAD_UserMail_ID (0); +setAD_User_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_UserMail (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=782 */ +public static final int Table_ID=782; + +/** TableName=AD_UserMail */ +public static final String Table_Name="AD_UserMail"; + +protected static KeyNamePair Model = new KeyNamePair(782,"AD_UserMail"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_UserMail[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User Mail. +@param AD_UserMail_ID Mail sent to the user */ +public void setAD_UserMail_ID (int AD_UserMail_ID) +{ +if (AD_UserMail_ID < 1) throw new IllegalArgumentException ("AD_UserMail_ID is mandatory."); +set_ValueNoCheck ("AD_UserMail_ID", new Integer(AD_UserMail_ID)); +} +/** Get User Mail. +@return Mail sent to the user */ +public int getAD_UserMail_ID() +{ +Integer ii = (Integer)get_Value("AD_UserMail_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +/** Set Delivery Confirmation. +@param DeliveryConfirmation EMail Delivery confirmation */ +public void setDeliveryConfirmation (String DeliveryConfirmation) +{ +if (DeliveryConfirmation != null && DeliveryConfirmation.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DeliveryConfirmation = DeliveryConfirmation.substring(0,119); +} +set_ValueNoCheck ("DeliveryConfirmation", DeliveryConfirmation); +} +/** Get Delivery Confirmation. +@return EMail Delivery confirmation */ +public String getDeliveryConfirmation() +{ +return (String)get_Value("DeliveryConfirmation"); +} + +/** IsDelivered AD_Reference_ID=319 */ +public static final int ISDELIVERED_AD_Reference_ID=319; +/** No = N */ +public static final String ISDELIVERED_No = "N"; +/** Yes = Y */ +public static final String ISDELIVERED_Yes = "Y"; +/** Set Delivered. +@param IsDelivered Delivered */ +public void setIsDelivered (String IsDelivered) +{ +if (IsDelivered == null) throw new IllegalArgumentException ("IsDelivered is mandatory"); +if (IsDelivered == null || IsDelivered.equals("N") || IsDelivered.equals("Y")); + else throw new IllegalArgumentException ("IsDelivered Invalid value - " + IsDelivered + " - Reference_ID=319 - N - Y"); +if (IsDelivered != null && IsDelivered.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsDelivered = IsDelivered.substring(0,0); +} +set_ValueNoCheck ("IsDelivered", IsDelivered); +} +/** Get Delivered. +@return Delivered */ +public String getIsDelivered() +{ +return (String)get_Value("IsDelivered"); +} +/** Set Mail Text. +@param MailText Text used for Mail message */ +public void setMailText (String MailText) +{ +if (MailText != null && MailText.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MailText = MailText.substring(0,1999); +} +set_Value ("MailText", MailText); +} +/** Get Mail Text. +@return Text used for Mail message */ +public String getMailText() +{ +return (String)get_Value("MailText"); +} +/** Set Message ID. +@param MessageID EMail Message ID */ +public void setMessageID (String MessageID) +{ +if (MessageID != null && MessageID.length() > 120) +{ +log.warning("Length > 120 - truncated"); +MessageID = MessageID.substring(0,119); +} +set_ValueNoCheck ("MessageID", MessageID); +} +/** Get Message ID. +@return EMail Message ID */ +public String getMessageID() +{ +return (String)get_Value("MessageID"); +} +/** Set Mail Template. +@param R_MailText_ID Text templates for mailings */ +public void setR_MailText_ID (int R_MailText_ID) +{ +if (R_MailText_ID <= 0) set_ValueNoCheck ("R_MailText_ID", null); + else +set_ValueNoCheck ("R_MailText_ID", new Integer(R_MailText_ID)); +} +/** Get Mail Template. +@return Text templates for mailings */ +public int getR_MailText_ID() +{ +Integer ii = (Integer)get_Value("R_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Subject. +@param Subject Email Message Subject */ +public void setSubject (String Subject) +{ +if (Subject != null && Subject.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Subject = Subject.substring(0,254); +} +set_Value ("Subject", Subject); +} +/** Get Subject. +@return Email Message Subject */ +public String getSubject() +{ +return (String)get_Value("Subject"); +} +/** Set Mail Message. +@param W_MailMsg_ID Web Store Mail Message Template */ +public void setW_MailMsg_ID (int W_MailMsg_ID) +{ +if (W_MailMsg_ID <= 0) set_ValueNoCheck ("W_MailMsg_ID", null); + else +set_ValueNoCheck ("W_MailMsg_ID", new Integer(W_MailMsg_ID)); +} +/** Get Mail Message. +@return Web Store Mail Message Template */ +public int getW_MailMsg_ID() +{ +Integer ii = (Integer)get_Value("W_MailMsg_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_UserQuery.java b/dbPort/src/org/compiere/model/X_AD_UserQuery.java new file mode 100644 index 0000000000..8aee167c9b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_UserQuery.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_UserQuery + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.593 */ +public class X_AD_UserQuery extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_UserQuery_ID id +@param trxName transaction +*/ +public X_AD_UserQuery (Properties ctx, int AD_UserQuery_ID, String trxName) +{ +super (ctx, AD_UserQuery_ID, trxName); +/** if (AD_UserQuery_ID == 0) +{ +setAD_Table_ID (0); +setAD_UserQuery_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_UserQuery (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=814 */ +public static final int Table_ID=814; + +/** TableName=AD_UserQuery */ +public static final String Table_Name="AD_UserQuery"; + +protected static KeyNamePair Model = new KeyNamePair(814,"AD_UserQuery"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_UserQuery[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Query. +@param AD_UserQuery_ID Saved User Query */ +public void setAD_UserQuery_ID (int AD_UserQuery_ID) +{ +if (AD_UserQuery_ID < 1) throw new IllegalArgumentException ("AD_UserQuery_ID is mandatory."); +set_ValueNoCheck ("AD_UserQuery_ID", new Integer(AD_UserQuery_ID)); +} +/** Get User Query. +@return Saved User Query */ +public int getAD_UserQuery_ID() +{ +Integer ii = (Integer)get_Value("AD_UserQuery_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Validation code. +@param Code Validation Code */ +public void setCode (String Code) +{ +set_Value ("Code", Code); +} +/** Get Validation code. +@return Validation Code */ +public String getCode() +{ +return (String)get_Value("Code"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_User_OrgAccess.java b/dbPort/src/org/compiere/model/X_AD_User_OrgAccess.java new file mode 100644 index 0000000000..6306b0c4e7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_User_OrgAccess.java @@ -0,0 +1,122 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_User_OrgAccess + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.593 */ +public class X_AD_User_OrgAccess extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_User_OrgAccess_ID id +@param trxName transaction +*/ +public X_AD_User_OrgAccess (Properties ctx, int AD_User_OrgAccess_ID, String trxName) +{ +super (ctx, AD_User_OrgAccess_ID, trxName); +/** if (AD_User_OrgAccess_ID == 0) +{ +setAD_User_ID (0); +setIsReadOnly (false); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_User_OrgAccess (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=769 */ +public static final int Table_ID=769; + +/** TableName=AD_User_OrgAccess */ +public static final String Table_Name="AD_User_OrgAccess"; + +protected static KeyNamePair Model = new KeyNamePair(769,"AD_User_OrgAccess"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_User_OrgAccess[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Only. +@param IsReadOnly Field is read only */ +public void setIsReadOnly (boolean IsReadOnly) +{ +set_Value ("IsReadOnly", new Boolean(IsReadOnly)); +} +/** Get Read Only. +@return Field is read only */ +public boolean isReadOnly() +{ +Object oo = get_Value("IsReadOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_User_Roles.java b/dbPort/src/org/compiere/model/X_AD_User_Roles.java new file mode 100644 index 0000000000..50ada21b79 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_User_Roles.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_User_Roles + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.609 */ +public class X_AD_User_Roles extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_User_Roles_ID id +@param trxName transaction +*/ +public X_AD_User_Roles (Properties ctx, int AD_User_Roles_ID, String trxName) +{ +super (ctx, AD_User_Roles_ID, trxName); +/** if (AD_User_Roles_ID == 0) +{ +setAD_Role_ID (0); +setAD_User_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_User_Roles (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=157 */ +public static final int Table_ID=157; + +/** TableName=AD_User_Roles */ +public static final String Table_Name="AD_User_Roles"; + +protected static KeyNamePair Model = new KeyNamePair(157,"AD_User_Roles"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_User_Roles[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_User_Substitute.java b/dbPort/src/org/compiere/model/X_AD_User_Substitute.java new file mode 100644 index 0000000000..db9d394508 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_User_Substitute.java @@ -0,0 +1,204 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_User_Substitute + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.625 */ +public class X_AD_User_Substitute extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_User_Substitute_ID id +@param trxName transaction +*/ +public X_AD_User_Substitute (Properties ctx, int AD_User_Substitute_ID, String trxName) +{ +super (ctx, AD_User_Substitute_ID, trxName); +/** if (AD_User_Substitute_ID == 0) +{ +setAD_User_ID (0); +setAD_User_Substitute_ID (0); +setName (null); +setSubstitute_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_User_Substitute (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=642 */ +public static final int Table_ID=642; + +/** TableName=AD_User_Substitute */ +public static final String Table_Name="AD_User_Substitute"; + +protected static KeyNamePair Model = new KeyNamePair(642,"AD_User_Substitute"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_User_Substitute[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Substitute. +@param AD_User_Substitute_ID Substitute of the user */ +public void setAD_User_Substitute_ID (int AD_User_Substitute_ID) +{ +if (AD_User_Substitute_ID < 1) throw new IllegalArgumentException ("AD_User_Substitute_ID is mandatory."); +set_ValueNoCheck ("AD_User_Substitute_ID", new Integer(AD_User_Substitute_ID)); +} +/** Get User Substitute. +@return Substitute of the user */ +public int getAD_User_Substitute_ID() +{ +Integer ii = (Integer)get_Value("AD_User_Substitute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Substitute_ID AD_Reference_ID=110 */ +public static final int SUBSTITUTE_ID_AD_Reference_ID=110; +/** Set Substitute. +@param Substitute_ID Entity which can be used in place of this entity */ +public void setSubstitute_ID (int Substitute_ID) +{ +if (Substitute_ID < 1) throw new IllegalArgumentException ("Substitute_ID is mandatory."); +set_Value ("Substitute_ID", new Integer(Substitute_ID)); +} +/** Get Substitute. +@return Entity which can be used in place of this entity */ +public int getSubstitute_ID() +{ +Integer ii = (Integer)get_Value("Substitute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Val_Rule.java b/dbPort/src/org/compiere/model/X_AD_Val_Rule.java new file mode 100644 index 0000000000..9d4c8206c8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Val_Rule.java @@ -0,0 +1,215 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Val_Rule + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.64 */ +public class X_AD_Val_Rule extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Val_Rule_ID id +@param trxName transaction +*/ +public X_AD_Val_Rule (Properties ctx, int AD_Val_Rule_ID, String trxName) +{ +super (ctx, AD_Val_Rule_ID, trxName); +/** if (AD_Val_Rule_ID == 0) +{ +setAD_Val_Rule_ID (0); +setEntityType (null); // U +setName (null); +setType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Val_Rule (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=108 */ +public static final int Table_ID=108; + +/** TableName=AD_Val_Rule */ +public static final String Table_Name="AD_Val_Rule"; + +protected static KeyNamePair Model = new KeyNamePair(108,"AD_Val_Rule"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Val_Rule[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Dynamic Validation. +@param AD_Val_Rule_ID Dynamic Validation Rule */ +public void setAD_Val_Rule_ID (int AD_Val_Rule_ID) +{ +if (AD_Val_Rule_ID < 1) throw new IllegalArgumentException ("AD_Val_Rule_ID is mandatory."); +set_ValueNoCheck ("AD_Val_Rule_ID", new Integer(AD_Val_Rule_ID)); +} +/** Get Dynamic Validation. +@return Dynamic Validation Rule */ +public int getAD_Val_Rule_ID() +{ +Integer ii = (Integer)get_Value("AD_Val_Rule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Validation code. +@param Code Validation Code */ +public void setCode (String Code) +{ +if (Code != null && Code.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Code = Code.substring(0,1999); +} +set_Value ("Code", Code); +} +/** Get Validation code. +@return Validation Code */ +public String getCode() +{ +return (String)get_Value("Code"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Type AD_Reference_ID=101 */ +public static final int TYPE_AD_Reference_ID=101; +/** Java Script = E */ +public static final String TYPE_JavaScript = "E"; +/** Java Language = J */ +public static final String TYPE_JavaLanguage = "J"; +/** SQL = S */ +public static final String TYPE_SQL = "S"; +/** Set Type. +@param Type Type of Validation (SQL, Java Script, Java Language) */ +public void setType (String Type) +{ +if (Type == null) throw new IllegalArgumentException ("Type is mandatory"); +if (Type.equals("E") || Type.equals("J") || Type.equals("S")); + else throw new IllegalArgumentException ("Type Invalid value - " + Type + " - Reference_ID=101 - E - J - S"); +if (Type.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Type = Type.substring(0,0); +} +set_Value ("Type", Type); +} +/** Get Type. +@return Type of Validation (SQL, Java Script, Java Language) */ +public String getType() +{ +return (String)get_Value("Type"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_Activity.java b/dbPort/src/org/compiere/model/X_AD_WF_Activity.java new file mode 100644 index 0000000000..a006eadc99 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_Activity.java @@ -0,0 +1,382 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_Activity + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.656 */ +public class X_AD_WF_Activity extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_Activity_ID id +@param trxName transaction +*/ +public X_AD_WF_Activity (Properties ctx, int AD_WF_Activity_ID, String trxName) +{ +super (ctx, AD_WF_Activity_ID, trxName); +/** if (AD_WF_Activity_ID == 0) +{ +setAD_Table_ID (0); +setAD_WF_Activity_ID (0); +setAD_WF_Node_ID (0); +setAD_WF_Process_ID (0); +setAD_Workflow_ID (0); +setProcessed (false); +setRecord_ID (0); +setWFState (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_Activity (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=644 */ +public static final int Table_ID=644; + +/** TableName=AD_WF_Activity */ +public static final String Table_Name="AD_WF_Activity"; + +protected static KeyNamePair Model = new KeyNamePair(644,"AD_WF_Activity"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_Activity[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Message. +@param AD_Message_ID System Message */ +public void setAD_Message_ID (int AD_Message_ID) +{ +if (AD_Message_ID <= 0) set_Value ("AD_Message_ID", null); + else +set_Value ("AD_Message_ID", new Integer(AD_Message_ID)); +} +/** Get Message. +@return System Message */ +public int getAD_Message_ID() +{ +Integer ii = (Integer)get_Value("AD_Message_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_User_ID AD_Reference_ID=286 */ +public static final int AD_USER_ID_AD_Reference_ID=286; +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Activity. +@param AD_WF_Activity_ID Workflow Activity */ +public void setAD_WF_Activity_ID (int AD_WF_Activity_ID) +{ +if (AD_WF_Activity_ID < 1) throw new IllegalArgumentException ("AD_WF_Activity_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Activity_ID", new Integer(AD_WF_Activity_ID)); +} +/** Get Workflow Activity. +@return Workflow Activity */ +public int getAD_WF_Activity_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node. +@param AD_WF_Node_ID Workflow Node (activity), step or process */ +public void setAD_WF_Node_ID (int AD_WF_Node_ID) +{ +if (AD_WF_Node_ID < 1) throw new IllegalArgumentException ("AD_WF_Node_ID is mandatory."); +set_Value ("AD_WF_Node_ID", new Integer(AD_WF_Node_ID)); +} +/** Get Node. +@return Workflow Node (activity), step or process */ +public int getAD_WF_Node_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_Node_ID())); +} +/** Set Workflow Process. +@param AD_WF_Process_ID Actual Workflow Process Instance */ +public void setAD_WF_Process_ID (int AD_WF_Process_ID) +{ +if (AD_WF_Process_ID < 1) throw new IllegalArgumentException ("AD_WF_Process_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Process_ID", new Integer(AD_WF_Process_ID)); +} +/** Get Workflow Process. +@return Actual Workflow Process Instance */ +public int getAD_WF_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Responsible. +@param AD_WF_Responsible_ID Responsible for Workflow Execution */ +public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID) +{ +if (AD_WF_Responsible_ID <= 0) set_Value ("AD_WF_Responsible_ID", null); + else +set_Value ("AD_WF_Responsible_ID", new Integer(AD_WF_Responsible_ID)); +} +/** Get Workflow Responsible. +@return Responsible for Workflow Execution */ +public int getAD_WF_Responsible_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Responsible_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID < 1) throw new IllegalArgumentException ("AD_Workflow_ID is mandatory."); +set_Value ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Last Alert. +@param DateLastAlert Date when last alert were sent */ +public void setDateLastAlert (Timestamp DateLastAlert) +{ +set_Value ("DateLastAlert", DateLastAlert); +} +/** Get Last Alert. +@return Date when last alert were sent */ +public Timestamp getDateLastAlert() +{ +return (Timestamp)get_Value("DateLastAlert"); +} +/** Set Dyn Priority Start. +@param DynPriorityStart Starting priority before changed dynamically */ +public void setDynPriorityStart (int DynPriorityStart) +{ +set_Value ("DynPriorityStart", new Integer(DynPriorityStart)); +} +/** Get Dyn Priority Start. +@return Starting priority before changed dynamically */ +public int getDynPriorityStart() +{ +Integer ii = (Integer)get_Value("DynPriorityStart"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set End Wait. +@param EndWaitTime End of sleep time */ +public void setEndWaitTime (Timestamp EndWaitTime) +{ +set_Value ("EndWaitTime", EndWaitTime); +} +/** Get End Wait. +@return End of sleep time */ +public Timestamp getEndWaitTime() +{ +return (Timestamp)get_Value("EndWaitTime"); +} +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (int Priority) +{ +set_Value ("Priority", new Integer(Priority)); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public int getPriority() +{ +Integer ii = (Integer)get_Value("Priority"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} + +/** WFState AD_Reference_ID=305 */ +public static final int WFSTATE_AD_Reference_ID=305; +/** Aborted = CA */ +public static final String WFSTATE_Aborted = "CA"; +/** Completed = CC */ +public static final String WFSTATE_Completed = "CC"; +/** Terminated = CT */ +public static final String WFSTATE_Terminated = "CT"; +/** Not Started = ON */ +public static final String WFSTATE_NotStarted = "ON"; +/** Running = OR */ +public static final String WFSTATE_Running = "OR"; +/** Suspended = OS */ +public static final String WFSTATE_Suspended = "OS"; +/** Set Workflow State. +@param WFState State of the execution of the workflow */ +public void setWFState (String WFState) +{ +if (WFState == null) throw new IllegalArgumentException ("WFState is mandatory"); +if (WFState.equals("CA") || WFState.equals("CC") || WFState.equals("CT") || WFState.equals("ON") || WFState.equals("OR") || WFState.equals("OS")); + else throw new IllegalArgumentException ("WFState Invalid value - " + WFState + " - Reference_ID=305 - CA - CC - CT - ON - OR - OS"); +if (WFState.length() > 2) +{ +log.warning("Length > 2 - truncated"); +WFState = WFState.substring(0,1); +} +set_Value ("WFState", WFState); +} +/** Get Workflow State. +@return State of the execution of the workflow */ +public String getWFState() +{ +return (String)get_Value("WFState"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_ActivityResult.java b/dbPort/src/org/compiere/model/X_AD_WF_ActivityResult.java new file mode 100644 index 0000000000..f4757a52d1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_ActivityResult.java @@ -0,0 +1,195 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_ActivityResult + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.687 */ +public class X_AD_WF_ActivityResult extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_ActivityResult_ID id +@param trxName transaction +*/ +public X_AD_WF_ActivityResult (Properties ctx, int AD_WF_ActivityResult_ID, String trxName) +{ +super (ctx, AD_WF_ActivityResult_ID, trxName); +/** if (AD_WF_ActivityResult_ID == 0) +{ +setAD_WF_ActivityResult_ID (0); +setAD_WF_Activity_ID (0); +setAttributeName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_ActivityResult (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=650 */ +public static final int Table_ID=650; + +/** TableName=AD_WF_ActivityResult */ +public static final String Table_Name="AD_WF_ActivityResult"; + +protected static KeyNamePair Model = new KeyNamePair(650,"AD_WF_ActivityResult"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_ActivityResult[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Workflow Activity Result. +@param AD_WF_ActivityResult_ID Result of the Workflow Process Activity */ +public void setAD_WF_ActivityResult_ID (int AD_WF_ActivityResult_ID) +{ +if (AD_WF_ActivityResult_ID < 1) throw new IllegalArgumentException ("AD_WF_ActivityResult_ID is mandatory."); +set_ValueNoCheck ("AD_WF_ActivityResult_ID", new Integer(AD_WF_ActivityResult_ID)); +} +/** Get Workflow Activity Result. +@return Result of the Workflow Process Activity */ +public int getAD_WF_ActivityResult_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_ActivityResult_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Activity. +@param AD_WF_Activity_ID Workflow Activity */ +public void setAD_WF_Activity_ID (int AD_WF_Activity_ID) +{ +if (AD_WF_Activity_ID < 1) throw new IllegalArgumentException ("AD_WF_Activity_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Activity_ID", new Integer(AD_WF_Activity_ID)); +} +/** Get Workflow Activity. +@return Workflow Activity */ +public int getAD_WF_Activity_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_Activity_ID())); +} +/** Set Attribute Name. +@param AttributeName Name of the Attribute */ +public void setAttributeName (String AttributeName) +{ +if (AttributeName == null) throw new IllegalArgumentException ("AttributeName is mandatory."); +if (AttributeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeName = AttributeName.substring(0,59); +} +set_Value ("AttributeName", AttributeName); +} +/** Get Attribute Name. +@return Name of the Attribute */ +public String getAttributeName() +{ +return (String)get_Value("AttributeName"); +} +/** Set Attribute Value. +@param AttributeValue Value of the Attribute */ +public void setAttributeValue (String AttributeValue) +{ +if (AttributeValue != null && AttributeValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +AttributeValue = AttributeValue.substring(0,1999); +} +set_Value ("AttributeValue", AttributeValue); +} +/** Get Attribute Value. +@return Value of the Attribute */ +public String getAttributeValue() +{ +return (String)get_Value("AttributeValue"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_Block.java b/dbPort/src/org/compiere/model/X_AD_WF_Block.java new file mode 100644 index 0000000000..bbcfec1487 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_Block.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_Block + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.703 */ +public class X_AD_WF_Block extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_Block_ID id +@param trxName transaction +*/ +public X_AD_WF_Block (Properties ctx, int AD_WF_Block_ID, String trxName) +{ +super (ctx, AD_WF_Block_ID, trxName); +/** if (AD_WF_Block_ID == 0) +{ +setAD_WF_Block_ID (0); +setAD_Workflow_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_Block (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=647 */ +public static final int Table_ID=647; + +/** TableName=AD_WF_Block */ +public static final String Table_Name="AD_WF_Block"; + +protected static KeyNamePair Model = new KeyNamePair(647,"AD_WF_Block"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_Block[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Workflow Block. +@param AD_WF_Block_ID Workflow Transaction Execution Block */ +public void setAD_WF_Block_ID (int AD_WF_Block_ID) +{ +if (AD_WF_Block_ID < 1) throw new IllegalArgumentException ("AD_WF_Block_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Block_ID", new Integer(AD_WF_Block_ID)); +} +/** Get Workflow Block. +@return Workflow Transaction Execution Block */ +public int getAD_WF_Block_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Block_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID < 1) throw new IllegalArgumentException ("AD_Workflow_ID is mandatory."); +set_ValueNoCheck ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_EventAudit.java b/dbPort/src/org/compiere/model/X_AD_WF_EventAudit.java new file mode 100644 index 0000000000..bf703f87aa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_EventAudit.java @@ -0,0 +1,375 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_EventAudit + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.718 */ +public class X_AD_WF_EventAudit extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_EventAudit_ID id +@param trxName transaction +*/ +public X_AD_WF_EventAudit (Properties ctx, int AD_WF_EventAudit_ID, String trxName) +{ +super (ctx, AD_WF_EventAudit_ID, trxName); +/** if (AD_WF_EventAudit_ID == 0) +{ +setAD_Table_ID (0); +setAD_WF_EventAudit_ID (0); +setAD_WF_Node_ID (0); +setAD_WF_Process_ID (0); +setAD_WF_Responsible_ID (0); +setElapsedTimeMS (Env.ZERO); +setEventType (null); +setRecord_ID (0); +setWFState (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_EventAudit (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=649 */ +public static final int Table_ID=649; + +/** TableName=AD_WF_EventAudit */ +public static final String Table_Name="AD_WF_EventAudit"; + +protected static KeyNamePair Model = new KeyNamePair(649,"AD_WF_EventAudit"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_EventAudit[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_User_ID AD_Reference_ID=110 */ +public static final int AD_USER_ID_AD_Reference_ID=110; +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Event Audit. +@param AD_WF_EventAudit_ID Workflow Process Activity Event Audit Information */ +public void setAD_WF_EventAudit_ID (int AD_WF_EventAudit_ID) +{ +if (AD_WF_EventAudit_ID < 1) throw new IllegalArgumentException ("AD_WF_EventAudit_ID is mandatory."); +set_ValueNoCheck ("AD_WF_EventAudit_ID", new Integer(AD_WF_EventAudit_ID)); +} +/** Get Workflow Event Audit. +@return Workflow Process Activity Event Audit Information */ +public int getAD_WF_EventAudit_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_EventAudit_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_EventAudit_ID())); +} +/** Set Node. +@param AD_WF_Node_ID Workflow Node (activity), step or process */ +public void setAD_WF_Node_ID (int AD_WF_Node_ID) +{ +if (AD_WF_Node_ID < 1) throw new IllegalArgumentException ("AD_WF_Node_ID is mandatory."); +set_Value ("AD_WF_Node_ID", new Integer(AD_WF_Node_ID)); +} +/** Get Node. +@return Workflow Node (activity), step or process */ +public int getAD_WF_Node_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Process. +@param AD_WF_Process_ID Actual Workflow Process Instance */ +public void setAD_WF_Process_ID (int AD_WF_Process_ID) +{ +if (AD_WF_Process_ID < 1) throw new IllegalArgumentException ("AD_WF_Process_ID is mandatory."); +set_Value ("AD_WF_Process_ID", new Integer(AD_WF_Process_ID)); +} +/** Get Workflow Process. +@return Actual Workflow Process Instance */ +public int getAD_WF_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Responsible. +@param AD_WF_Responsible_ID Responsible for Workflow Execution */ +public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID) +{ +if (AD_WF_Responsible_ID < 1) throw new IllegalArgumentException ("AD_WF_Responsible_ID is mandatory."); +set_Value ("AD_WF_Responsible_ID", new Integer(AD_WF_Responsible_ID)); +} +/** Get Workflow Responsible. +@return Responsible for Workflow Execution */ +public int getAD_WF_Responsible_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Responsible_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Name. +@param AttributeName Name of the Attribute */ +public void setAttributeName (String AttributeName) +{ +if (AttributeName != null && AttributeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeName = AttributeName.substring(0,59); +} +set_Value ("AttributeName", AttributeName); +} +/** Get Attribute Name. +@return Name of the Attribute */ +public String getAttributeName() +{ +return (String)get_Value("AttributeName"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Elapsed Time ms. +@param ElapsedTimeMS Elapsed Time in mili seconds */ +public void setElapsedTimeMS (BigDecimal ElapsedTimeMS) +{ +if (ElapsedTimeMS == null) throw new IllegalArgumentException ("ElapsedTimeMS is mandatory."); +set_Value ("ElapsedTimeMS", ElapsedTimeMS); +} +/** Get Elapsed Time ms. +@return Elapsed Time in mili seconds */ +public BigDecimal getElapsedTimeMS() +{ +BigDecimal bd = (BigDecimal)get_Value("ElapsedTimeMS"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** EventType AD_Reference_ID=306 */ +public static final int EVENTTYPE_AD_Reference_ID=306; +/** Process Created = PC */ +public static final String EVENTTYPE_ProcessCreated = "PC"; +/** Process Completed = PX */ +public static final String EVENTTYPE_ProcessCompleted = "PX"; +/** State Changed = SC */ +public static final String EVENTTYPE_StateChanged = "SC"; +/** Set Event Type. +@param EventType Type of Event */ +public void setEventType (String EventType) +{ +if (EventType == null) throw new IllegalArgumentException ("EventType is mandatory"); +if (EventType.equals("PC") || EventType.equals("PX") || EventType.equals("SC")); + else throw new IllegalArgumentException ("EventType Invalid value - " + EventType + " - Reference_ID=306 - PC - PX - SC"); +if (EventType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +EventType = EventType.substring(0,1); +} +set_Value ("EventType", EventType); +} +/** Get Event Type. +@return Type of Event */ +public String getEventType() +{ +return (String)get_Value("EventType"); +} +/** Set New Value. +@param NewValue New field value */ +public void setNewValue (String NewValue) +{ +if (NewValue != null && NewValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +NewValue = NewValue.substring(0,1999); +} +set_Value ("NewValue", NewValue); +} +/** Get New Value. +@return New field value */ +public String getNewValue() +{ +return (String)get_Value("NewValue"); +} +/** Set Old Value. +@param OldValue The old file data */ +public void setOldValue (String OldValue) +{ +if (OldValue != null && OldValue.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OldValue = OldValue.substring(0,1999); +} +set_Value ("OldValue", OldValue); +} +/** Get Old Value. +@return The old file data */ +public String getOldValue() +{ +return (String)get_Value("OldValue"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} + +/** WFState AD_Reference_ID=305 */ +public static final int WFSTATE_AD_Reference_ID=305; +/** Aborted = CA */ +public static final String WFSTATE_Aborted = "CA"; +/** Completed = CC */ +public static final String WFSTATE_Completed = "CC"; +/** Terminated = CT */ +public static final String WFSTATE_Terminated = "CT"; +/** Not Started = ON */ +public static final String WFSTATE_NotStarted = "ON"; +/** Running = OR */ +public static final String WFSTATE_Running = "OR"; +/** Suspended = OS */ +public static final String WFSTATE_Suspended = "OS"; +/** Set Workflow State. +@param WFState State of the execution of the workflow */ +public void setWFState (String WFState) +{ +if (WFState == null) throw new IllegalArgumentException ("WFState is mandatory"); +if (WFState.equals("CA") || WFState.equals("CC") || WFState.equals("CT") || WFState.equals("ON") || WFState.equals("OR") || WFState.equals("OS")); + else throw new IllegalArgumentException ("WFState Invalid value - " + WFState + " - Reference_ID=305 - CA - CC - CT - ON - OR - OS"); +if (WFState.length() > 2) +{ +log.warning("Length > 2 - truncated"); +WFState = WFState.substring(0,1); +} +set_Value ("WFState", WFState); +} +/** Get Workflow State. +@return State of the execution of the workflow */ +public String getWFState() +{ +return (String)get_Value("WFState"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_NextCondition.java b/dbPort/src/org/compiere/model/X_AD_WF_NextCondition.java new file mode 100644 index 0000000000..edb4d94086 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_NextCondition.java @@ -0,0 +1,287 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_NextCondition + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.75 */ +public class X_AD_WF_NextCondition extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_NextCondition_ID id +@param trxName transaction +*/ +public X_AD_WF_NextCondition (Properties ctx, int AD_WF_NextCondition_ID, String trxName) +{ +super (ctx, AD_WF_NextCondition_ID, trxName); +/** if (AD_WF_NextCondition_ID == 0) +{ +setAD_Column_ID (0); +setAD_WF_NextCondition_ID (0); +setAD_WF_NodeNext_ID (0); +setAndOr (null); // O +setEntityType (null); // U +setOperation (null); +setSeqNo (0); // @SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM AD_WF_NextCondition WHERE AD_WF_NodeNext_ID=@AD_WF_NodeNext_ID@ +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_NextCondition (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=706 */ +public static final int Table_ID=706; + +/** TableName=AD_WF_NextCondition */ +public static final String Table_Name="AD_WF_NextCondition"; + +protected static KeyNamePair Model = new KeyNamePair(706,"AD_WF_NextCondition"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_NextCondition[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Transition Condition. +@param AD_WF_NextCondition_ID Workflow Node Transition Condition */ +public void setAD_WF_NextCondition_ID (int AD_WF_NextCondition_ID) +{ +if (AD_WF_NextCondition_ID < 1) throw new IllegalArgumentException ("AD_WF_NextCondition_ID is mandatory."); +set_ValueNoCheck ("AD_WF_NextCondition_ID", new Integer(AD_WF_NextCondition_ID)); +} +/** Get Transition Condition. +@return Workflow Node Transition Condition */ +public int getAD_WF_NextCondition_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_NextCondition_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node Transition. +@param AD_WF_NodeNext_ID Workflow Node Transition */ +public void setAD_WF_NodeNext_ID (int AD_WF_NodeNext_ID) +{ +if (AD_WF_NodeNext_ID < 1) throw new IllegalArgumentException ("AD_WF_NodeNext_ID is mandatory."); +set_ValueNoCheck ("AD_WF_NodeNext_ID", new Integer(AD_WF_NodeNext_ID)); +} +/** Get Node Transition. +@return Workflow Node Transition */ +public int getAD_WF_NodeNext_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_NodeNext_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AndOr AD_Reference_ID=204 */ +public static final int ANDOR_AD_Reference_ID=204; +/** And = A */ +public static final String ANDOR_And = "A"; +/** Or = O */ +public static final String ANDOR_Or = "O"; +/** Set And/Or. +@param AndOr Logical operation: AND or OR */ +public void setAndOr (String AndOr) +{ +if (AndOr == null) throw new IllegalArgumentException ("AndOr is mandatory"); +if (AndOr.equals("A") || AndOr.equals("O")); + else throw new IllegalArgumentException ("AndOr Invalid value - " + AndOr + " - Reference_ID=204 - A - O"); +if (AndOr.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AndOr = AndOr.substring(0,0); +} +set_Value ("AndOr", AndOr); +} +/** Get And/Or. +@return Logical operation: AND or OR */ +public String getAndOr() +{ +return (String)get_Value("AndOr"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} + +/** Operation AD_Reference_ID=205 */ +public static final int OPERATION_AD_Reference_ID=205; +/** != = != */ +public static final String OPERATION_NotEq = "!="; +/** < = << */ +public static final String OPERATION_Le = "<<"; +/** <= = <= */ +public static final String OPERATION_LeEq = "<="; +/** = = == */ +public static final String OPERATION_Eq = "=="; +/** >= = >= */ +public static final String OPERATION_GtEq = ">="; +/** > = >> */ +public static final String OPERATION_Gt = ">>"; +/** || = AB */ +public static final String OPERATION_X = "AB"; +/** sql = SQ */ +public static final String OPERATION_Sql = "SQ"; +/** ~ = ~~ */ +public static final String OPERATION_Like = "~~"; +/** Set Operation. +@param Operation Compare Operation */ +public void setOperation (String Operation) +{ +if (Operation == null) throw new IllegalArgumentException ("Operation is mandatory"); +if (Operation.equals("!=") || Operation.equals("<<") || Operation.equals("<=") || Operation.equals("==") || Operation.equals(">=") || Operation.equals(">>") || Operation.equals("AB") || Operation.equals("SQ") || Operation.equals("~~")); + else throw new IllegalArgumentException ("Operation Invalid value - " + Operation + " - Reference_ID=205 - != - << - <= - == - >= - >> - AB - SQ - ~~"); +if (Operation.length() > 2) +{ +log.warning("Length > 2 - truncated"); +Operation = Operation.substring(0,1); +} +set_Value ("Operation", Operation); +} +/** Get Operation. +@return Compare Operation */ +public String getOperation() +{ +return (String)get_Value("Operation"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +/** Set Value To. +@param Value2 Value To */ +public void setValue2 (String Value2) +{ +if (Value2 != null && Value2.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value2 = Value2.substring(0,39); +} +set_Value ("Value2", Value2); +} +/** Get Value To. +@return Value To */ +public String getValue2() +{ +return (String)get_Value("Value2"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_Node.java b/dbPort/src/org/compiere/model/X_AD_WF_Node.java new file mode 100644 index 0000000000..400cf6df94 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_Node.java @@ -0,0 +1,894 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_Node + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.765 */ +public class X_AD_WF_Node extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_Node_ID id +@param trxName transaction +*/ +public X_AD_WF_Node (Properties ctx, int AD_WF_Node_ID, String trxName) +{ +super (ctx, AD_WF_Node_ID, trxName); +/** if (AD_WF_Node_ID == 0) +{ +setAD_WF_Node_ID (0); +setAD_Workflow_ID (0); +setAction (null); // N +setCost (Env.ZERO); +setDuration (0); +setEntityType (null); // U +setIsCentrallyMaintained (true); // Y +setJoinElement (null); // X +setLimit (0); +setName (null); +setSplitElement (null); // X +setValue (null); +setWaitingTime (0); +setXPosition (0); +setYPosition (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_Node (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=129 */ +public static final int Table_ID=129; + +/** TableName=AD_WF_Node */ +public static final String Table_Name="AD_WF_Node"; + +protected static KeyNamePair Model = new KeyNamePair(129,"AD_WF_Node"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_Node[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Special Form. +@param AD_Form_ID Special Form */ +public void setAD_Form_ID (int AD_Form_ID) +{ +if (AD_Form_ID <= 0) set_Value ("AD_Form_ID", null); + else +set_Value ("AD_Form_ID", new Integer(AD_Form_ID)); +} +/** Get Special Form. +@return Special Form */ +public int getAD_Form_ID() +{ +Integer ii = (Integer)get_Value("AD_Form_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set OS Task. +@param AD_Task_ID Operation System Task */ +public void setAD_Task_ID (int AD_Task_ID) +{ +if (AD_Task_ID <= 0) set_Value ("AD_Task_ID", null); + else +set_Value ("AD_Task_ID", new Integer(AD_Task_ID)); +} +/** Get OS Task. +@return Operation System Task */ +public int getAD_Task_ID() +{ +Integer ii = (Integer)get_Value("AD_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Block. +@param AD_WF_Block_ID Workflow Transaction Execution Block */ +public void setAD_WF_Block_ID (int AD_WF_Block_ID) +{ +if (AD_WF_Block_ID <= 0) set_Value ("AD_WF_Block_ID", null); + else +set_Value ("AD_WF_Block_ID", new Integer(AD_WF_Block_ID)); +} +/** Get Workflow Block. +@return Workflow Transaction Execution Block */ +public int getAD_WF_Block_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Block_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node. +@param AD_WF_Node_ID Workflow Node (activity), step or process */ +public void setAD_WF_Node_ID (int AD_WF_Node_ID) +{ +if (AD_WF_Node_ID < 1) throw new IllegalArgumentException ("AD_WF_Node_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Node_ID", new Integer(AD_WF_Node_ID)); +} +/** Get Node. +@return Workflow Node (activity), step or process */ +public int getAD_WF_Node_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Responsible. +@param AD_WF_Responsible_ID Responsible for Workflow Execution */ +public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID) +{ +if (AD_WF_Responsible_ID <= 0) set_Value ("AD_WF_Responsible_ID", null); + else +set_Value ("AD_WF_Responsible_ID", new Integer(AD_WF_Responsible_ID)); +} +/** Get Workflow Responsible. +@return Responsible for Workflow Execution */ +public int getAD_WF_Responsible_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Responsible_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID <= 0) set_Value ("AD_Window_ID", null); + else +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID < 1) throw new IllegalArgumentException ("AD_Workflow_ID is mandatory."); +set_ValueNoCheck ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Action AD_Reference_ID=302 */ +public static final int ACTION_AD_Reference_ID=302; +/** User Workbench = B */ +public static final String ACTION_UserWorkbench = "B"; +/** User Choice = C */ +public static final String ACTION_UserChoice = "C"; +/** Document Action = D */ +public static final String ACTION_DocumentAction = "D"; +/** Sub Workflow = F */ +public static final String ACTION_SubWorkflow = "F"; +/** EMail = M */ +public static final String ACTION_EMail = "M"; +/** Apps Process = P */ +public static final String ACTION_AppsProcess = "P"; +/** Apps Report = R */ +public static final String ACTION_AppsReport = "R"; +/** Apps Task = T */ +public static final String ACTION_AppsTask = "T"; +/** Set Variable = V */ +public static final String ACTION_SetVariable = "V"; +/** User Window = W */ +public static final String ACTION_UserWindow = "W"; +/** User Form = X */ +public static final String ACTION_UserForm = "X"; +/** Wait (Sleep) = Z */ +public static final String ACTION_WaitSleep = "Z"; +/** Set Action. +@param Action Indicates the Action to be performed */ +public void setAction (String Action) +{ +if (Action == null) throw new IllegalArgumentException ("Action is mandatory"); +if (Action.equals("B") || Action.equals("C") || Action.equals("D") || Action.equals("F") || Action.equals("M") || Action.equals("P") || Action.equals("R") || Action.equals("T") || Action.equals("V") || Action.equals("W") || Action.equals("X") || Action.equals("Z")); + else throw new IllegalArgumentException ("Action Invalid value - " + Action + " - Reference_ID=302 - B - C - D - F - M - P - R - T - V - W - X - Z"); +if (Action.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Action = Action.substring(0,0); +} +set_Value ("Action", Action); +} +/** Get Action. +@return Indicates the Action to be performed */ +public String getAction() +{ +return (String)get_Value("Action"); +} +/** Set Attribute Name. +@param AttributeName Name of the Attribute */ +public void setAttributeName (String AttributeName) +{ +if (AttributeName != null && AttributeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeName = AttributeName.substring(0,59); +} +set_Value ("AttributeName", AttributeName); +} +/** Get Attribute Name. +@return Name of the Attribute */ +public String getAttributeName() +{ +return (String)get_Value("AttributeName"); +} +/** Set Attribute Value. +@param AttributeValue Value of the Attribute */ +public void setAttributeValue (String AttributeValue) +{ +if (AttributeValue != null && AttributeValue.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeValue = AttributeValue.substring(0,59); +} +set_Value ("AttributeValue", AttributeValue); +} +/** Get Attribute Value. +@return Value of the Attribute */ +public String getAttributeValue() +{ +return (String)get_Value("AttributeValue"); +} +/** Set Cost. +@param Cost Cost information */ +public void setCost (BigDecimal Cost) +{ +if (Cost == null) throw new IllegalArgumentException ("Cost is mandatory."); +set_Value ("Cost", Cost); +} +/** Get Cost. +@return Cost information */ +public BigDecimal getCost() +{ +BigDecimal bd = (BigDecimal)get_Value("Cost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction == null || DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction != null && DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} +/** Set Duration. +@param Duration Normal Duration in Duration Unit */ +public void setDuration (int Duration) +{ +set_Value ("Duration", new Integer(Duration)); +} +/** Get Duration. +@return Normal Duration in Duration Unit */ +public int getDuration() +{ +Integer ii = (Integer)get_Value("Duration"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dynamic Priority Change. +@param DynPriorityChange Change of priority when Activity is suspended waiting for user */ +public void setDynPriorityChange (BigDecimal DynPriorityChange) +{ +set_Value ("DynPriorityChange", DynPriorityChange); +} +/** Get Dynamic Priority Change. +@return Change of priority when Activity is suspended waiting for user */ +public BigDecimal getDynPriorityChange() +{ +BigDecimal bd = (BigDecimal)get_Value("DynPriorityChange"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** DynPriorityUnit AD_Reference_ID=221 */ +public static final int DYNPRIORITYUNIT_AD_Reference_ID=221; +/** Day = D */ +public static final String DYNPRIORITYUNIT_Day = "D"; +/** Hour = H */ +public static final String DYNPRIORITYUNIT_Hour = "H"; +/** Minute = M */ +public static final String DYNPRIORITYUNIT_Minute = "M"; +/** Set Dynamic Priority Unit. +@param DynPriorityUnit Change of priority when Activity is suspended waiting for user */ +public void setDynPriorityUnit (String DynPriorityUnit) +{ +if (DynPriorityUnit == null) throw new IllegalArgumentException ("DynPriorityUnit is mandatory"); +if (DynPriorityUnit == null || DynPriorityUnit.equals("D") || DynPriorityUnit.equals("H") || DynPriorityUnit.equals("M")); + else throw new IllegalArgumentException ("DynPriorityUnit Invalid value - " + DynPriorityUnit + " - Reference_ID=221 - D - H - M"); +if (DynPriorityUnit != null && DynPriorityUnit.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DynPriorityUnit = DynPriorityUnit.substring(0,0); +} +set_Value ("DynPriorityUnit", DynPriorityUnit); +} +/** Get Dynamic Priority Unit. +@return Change of priority when Activity is suspended waiting for user */ +public String getDynPriorityUnit() +{ +return (String)get_Value("DynPriorityUnit"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} + +/** EMailRecipient AD_Reference_ID=363 */ +public static final int EMAILRECIPIENT_AD_Reference_ID=363; +/** Document Business Partner = B */ +public static final String EMAILRECIPIENT_DocumentBusinessPartner = "B"; +/** Document Owner = D */ +public static final String EMAILRECIPIENT_DocumentOwner = "D"; +/** WF Responsible = R */ +public static final String EMAILRECIPIENT_WFResponsible = "R"; +/** Set EMail Recipient. +@param EMailRecipient Recipient of the EMail */ +public void setEMailRecipient (String EMailRecipient) +{ +if (EMailRecipient == null) throw new IllegalArgumentException ("EMailRecipient is mandatory"); +if (EMailRecipient == null || EMailRecipient.equals("B") || EMailRecipient.equals("D") || EMailRecipient.equals("R")); + else throw new IllegalArgumentException ("EMailRecipient Invalid value - " + EMailRecipient + " - Reference_ID=363 - B - D - R"); +if (EMailRecipient != null && EMailRecipient.length() > 1) +{ +log.warning("Length > 1 - truncated"); +EMailRecipient = EMailRecipient.substring(0,0); +} +set_Value ("EMailRecipient", EMailRecipient); +} +/** Get EMail Recipient. +@return Recipient of the EMail */ +public String getEMailRecipient() +{ +return (String)get_Value("EMailRecipient"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} + +/** FinishMode AD_Reference_ID=303 */ +public static final int FINISHMODE_AD_Reference_ID=303; +/** Automatic = A */ +public static final String FINISHMODE_Automatic = "A"; +/** Manual = M */ +public static final String FINISHMODE_Manual = "M"; +/** Set Finish Mode. +@param FinishMode Workflow Activity Finish Mode */ +public void setFinishMode (String FinishMode) +{ +if (FinishMode == null) throw new IllegalArgumentException ("FinishMode is mandatory"); +if (FinishMode == null || FinishMode.equals("A") || FinishMode.equals("M")); + else throw new IllegalArgumentException ("FinishMode Invalid value - " + FinishMode + " - Reference_ID=303 - A - M"); +if (FinishMode != null && FinishMode.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FinishMode = FinishMode.substring(0,0); +} +set_Value ("FinishMode", FinishMode); +} +/** Get Finish Mode. +@return Workflow Activity Finish Mode */ +public String getFinishMode() +{ +return (String)get_Value("FinishMode"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Centrally maintained. +@param IsCentrallyMaintained Information maintained in System Element table */ +public void setIsCentrallyMaintained (boolean IsCentrallyMaintained) +{ +set_Value ("IsCentrallyMaintained", new Boolean(IsCentrallyMaintained)); +} +/** Get Centrally maintained. +@return Information maintained in System Element table */ +public boolean isCentrallyMaintained() +{ +Object oo = get_Value("IsCentrallyMaintained"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** JoinElement AD_Reference_ID=301 */ +public static final int JOINELEMENT_AD_Reference_ID=301; +/** AND = A */ +public static final String JOINELEMENT_AND = "A"; +/** XOR = X */ +public static final String JOINELEMENT_XOR = "X"; +/** Set Join Element. +@param JoinElement Semantics for multiple incoming Transitions */ +public void setJoinElement (String JoinElement) +{ +if (JoinElement == null) throw new IllegalArgumentException ("JoinElement is mandatory"); +if (JoinElement.equals("A") || JoinElement.equals("X")); + else throw new IllegalArgumentException ("JoinElement Invalid value - " + JoinElement + " - Reference_ID=301 - A - X"); +if (JoinElement.length() > 1) +{ +log.warning("Length > 1 - truncated"); +JoinElement = JoinElement.substring(0,0); +} +set_Value ("JoinElement", JoinElement); +} +/** Get Join Element. +@return Semantics for multiple incoming Transitions */ +public String getJoinElement() +{ +return (String)get_Value("JoinElement"); +} +/** Set Duration Limit. +@param Limit Maximum Duration in Duration Unit */ +public void setLimit (int Limit) +{ +set_Value ("Limit", new Integer(Limit)); +} +/** Get Duration Limit. +@return Maximum Duration in Duration Unit */ +public int getLimit() +{ +Integer ii = (Integer)get_Value("Limit"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (int Priority) +{ +set_Value ("Priority", new Integer(Priority)); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public int getPriority() +{ +Integer ii = (Integer)get_Value("Priority"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Mail Template. +@param R_MailText_ID Text templates for mailings */ +public void setR_MailText_ID (int R_MailText_ID) +{ +if (R_MailText_ID <= 0) set_Value ("R_MailText_ID", null); + else +set_Value ("R_MailText_ID", new Integer(R_MailText_ID)); +} +/** Get Mail Template. +@return Text templates for mailings */ +public int getR_MailText_ID() +{ +Integer ii = (Integer)get_Value("R_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SplitElement AD_Reference_ID=301 */ +public static final int SPLITELEMENT_AD_Reference_ID=301; +/** AND = A */ +public static final String SPLITELEMENT_AND = "A"; +/** XOR = X */ +public static final String SPLITELEMENT_XOR = "X"; +/** Set Split Element. +@param SplitElement Semantics for multiple outgoing Transitions */ +public void setSplitElement (String SplitElement) +{ +if (SplitElement == null) throw new IllegalArgumentException ("SplitElement is mandatory"); +if (SplitElement.equals("A") || SplitElement.equals("X")); + else throw new IllegalArgumentException ("SplitElement Invalid value - " + SplitElement + " - Reference_ID=301 - A - X"); +if (SplitElement.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SplitElement = SplitElement.substring(0,0); +} +set_Value ("SplitElement", SplitElement); +} +/** Get Split Element. +@return Semantics for multiple outgoing Transitions */ +public String getSplitElement() +{ +return (String)get_Value("SplitElement"); +} + +/** StartMode AD_Reference_ID=303 */ +public static final int STARTMODE_AD_Reference_ID=303; +/** Automatic = A */ +public static final String STARTMODE_Automatic = "A"; +/** Manual = M */ +public static final String STARTMODE_Manual = "M"; +/** Set Start Mode. +@param StartMode Workflow Activity Start Mode */ +public void setStartMode (String StartMode) +{ +if (StartMode == null) throw new IllegalArgumentException ("StartMode is mandatory"); +if (StartMode == null || StartMode.equals("A") || StartMode.equals("M")); + else throw new IllegalArgumentException ("StartMode Invalid value - " + StartMode + " - Reference_ID=303 - A - M"); +if (StartMode != null && StartMode.length() > 1) +{ +log.warning("Length > 1 - truncated"); +StartMode = StartMode.substring(0,0); +} +set_Value ("StartMode", StartMode); +} +/** Get Start Mode. +@return Workflow Activity Start Mode */ +public String getStartMode() +{ +return (String)get_Value("StartMode"); +} + +/** SubflowExecution AD_Reference_ID=307 */ +public static final int SUBFLOWEXECUTION_AD_Reference_ID=307; +/** Asynchronously = A */ +public static final String SUBFLOWEXECUTION_Asynchronously = "A"; +/** Synchronously = S */ +public static final String SUBFLOWEXECUTION_Synchronously = "S"; +/** Set Subflow Execution. +@param SubflowExecution Mode how the sub-workflow is executed */ +public void setSubflowExecution (String SubflowExecution) +{ +if (SubflowExecution == null) throw new IllegalArgumentException ("SubflowExecution is mandatory"); +if (SubflowExecution == null || SubflowExecution.equals("A") || SubflowExecution.equals("S")); + else throw new IllegalArgumentException ("SubflowExecution Invalid value - " + SubflowExecution + " - Reference_ID=307 - A - S"); +if (SubflowExecution != null && SubflowExecution.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SubflowExecution = SubflowExecution.substring(0,0); +} +set_Value ("SubflowExecution", SubflowExecution); +} +/** Get Subflow Execution. +@return Mode how the sub-workflow is executed */ +public String getSubflowExecution() +{ +return (String)get_Value("SubflowExecution"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Wait Time. +@param WaitTime Time in minutes to wait (sleep) */ +public void setWaitTime (int WaitTime) +{ +set_Value ("WaitTime", new Integer(WaitTime)); +} +/** Get Wait Time. +@return Time in minutes to wait (sleep) */ +public int getWaitTime() +{ +Integer ii = (Integer)get_Value("WaitTime"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Waiting Time. +@param WaitingTime Workflow Simulation Waiting time */ +public void setWaitingTime (int WaitingTime) +{ +set_Value ("WaitingTime", new Integer(WaitingTime)); +} +/** Get Waiting Time. +@return Workflow Simulation Waiting time */ +public int getWaitingTime() +{ +Integer ii = (Integer)get_Value("WaitingTime"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Workflow_ID AD_Reference_ID=174 */ +public static final int WORKFLOW_ID_AD_Reference_ID=174; +/** Set Workflow. +@param Workflow_ID Workflow or tasks */ +public void setWorkflow_ID (int Workflow_ID) +{ +if (Workflow_ID <= 0) set_Value ("Workflow_ID", null); + else +set_Value ("Workflow_ID", new Integer(Workflow_ID)); +} +/** Get Workflow. +@return Workflow or tasks */ +public int getWorkflow_ID() +{ +Integer ii = (Integer)get_Value("Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Working Time. +@param WorkingTime Workflow Simulation Execution Time */ +public void setWorkingTime (int WorkingTime) +{ +set_Value ("WorkingTime", new Integer(WorkingTime)); +} +/** Get Working Time. +@return Workflow Simulation Execution Time */ +public int getWorkingTime() +{ +Integer ii = (Integer)get_Value("WorkingTime"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set X Position. +@param XPosition Absolute X (horizontal) position in 1/72 of an inch */ +public void setXPosition (int XPosition) +{ +set_Value ("XPosition", new Integer(XPosition)); +} +/** Get X Position. +@return Absolute X (horizontal) position in 1/72 of an inch */ +public int getXPosition() +{ +Integer ii = (Integer)get_Value("XPosition"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Y Position. +@param YPosition Absolute Y (vertical) position in 1/72 of an inch */ +public void setYPosition (int YPosition) +{ +set_Value ("YPosition", new Integer(YPosition)); +} +/** Get Y Position. +@return Absolute Y (vertical) position in 1/72 of an inch */ +public int getYPosition() +{ +Integer ii = (Integer)get_Value("YPosition"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_NodeNext.java b/dbPort/src/org/compiere/model/X_AD_WF_NodeNext.java new file mode 100644 index 0000000000..fb5838034a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_NodeNext.java @@ -0,0 +1,237 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_NodeNext + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.921 */ +public class X_AD_WF_NodeNext extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_NodeNext_ID id +@param trxName transaction +*/ +public X_AD_WF_NodeNext (Properties ctx, int AD_WF_NodeNext_ID, String trxName) +{ +super (ctx, AD_WF_NodeNext_ID, trxName); +/** if (AD_WF_NodeNext_ID == 0) +{ +setAD_WF_Next_ID (0); +setAD_WF_NodeNext_ID (0); +setAD_WF_Node_ID (0); +setEntityType (null); // U +setIsStdUserWorkflow (false); +setSeqNo (0); // 10 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_NodeNext (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=131 */ +public static final int Table_ID=131; + +/** TableName=AD_WF_NodeNext */ +public static final String Table_Name="AD_WF_NodeNext"; + +protected static KeyNamePair Model = new KeyNamePair(131,"AD_WF_NodeNext"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_NodeNext[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_WF_Next_ID AD_Reference_ID=109 */ +public static final int AD_WF_NEXT_ID_AD_Reference_ID=109; +/** Set Next Node. +@param AD_WF_Next_ID Next Node in workflow */ +public void setAD_WF_Next_ID (int AD_WF_Next_ID) +{ +if (AD_WF_Next_ID < 1) throw new IllegalArgumentException ("AD_WF_Next_ID is mandatory."); +set_Value ("AD_WF_Next_ID", new Integer(AD_WF_Next_ID)); +} +/** Get Next Node. +@return Next Node in workflow */ +public int getAD_WF_Next_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Next_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node Transition. +@param AD_WF_NodeNext_ID Workflow Node Transition */ +public void setAD_WF_NodeNext_ID (int AD_WF_NodeNext_ID) +{ +if (AD_WF_NodeNext_ID < 1) throw new IllegalArgumentException ("AD_WF_NodeNext_ID is mandatory."); +set_ValueNoCheck ("AD_WF_NodeNext_ID", new Integer(AD_WF_NodeNext_ID)); +} +/** Get Node Transition. +@return Workflow Node Transition */ +public int getAD_WF_NodeNext_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_NodeNext_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node. +@param AD_WF_Node_ID Workflow Node (activity), step or process */ +public void setAD_WF_Node_ID (int AD_WF_Node_ID) +{ +if (AD_WF_Node_ID < 1) throw new IllegalArgumentException ("AD_WF_Node_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Node_ID", new Integer(AD_WF_Node_ID)); +} +/** Get Node. +@return Workflow Node (activity), step or process */ +public int getAD_WF_Node_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_Node_ID())); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Std User Workflow. +@param IsStdUserWorkflow Standard Manual User Approval Workflow */ +public void setIsStdUserWorkflow (boolean IsStdUserWorkflow) +{ +set_Value ("IsStdUserWorkflow", new Boolean(IsStdUserWorkflow)); +} +/** Get Std User Workflow. +@return Standard Manual User Approval Workflow */ +public boolean isStdUserWorkflow() +{ +Object oo = get_Value("IsStdUserWorkflow"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Transition Code. +@param TransitionCode Code resulting in TRUE of FALSE */ +public void setTransitionCode (String TransitionCode) +{ +if (TransitionCode != null && TransitionCode.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TransitionCode = TransitionCode.substring(0,1999); +} +set_Value ("TransitionCode", TransitionCode); +} +/** Get Transition Code. +@return Code resulting in TRUE of FALSE */ +public String getTransitionCode() +{ +return (String)get_Value("TransitionCode"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_Node_Para.java b/dbPort/src/org/compiere/model/X_AD_WF_Node_Para.java new file mode 100644 index 0000000000..7b392720b1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_Node_Para.java @@ -0,0 +1,215 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_Node_Para + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.921 */ +public class X_AD_WF_Node_Para extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_Node_Para_ID id +@param trxName transaction +*/ +public X_AD_WF_Node_Para (Properties ctx, int AD_WF_Node_Para_ID, String trxName) +{ +super (ctx, AD_WF_Node_Para_ID, trxName); +/** if (AD_WF_Node_Para_ID == 0) +{ +setAD_WF_Node_ID (0); +setAD_WF_Node_Para_ID (0); +setEntityType (null); // U +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_Node_Para (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=643 */ +public static final int Table_ID=643; + +/** TableName=AD_WF_Node_Para */ +public static final String Table_Name="AD_WF_Node_Para"; + +protected static KeyNamePair Model = new KeyNamePair(643,"AD_WF_Node_Para"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_Node_Para[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Parameter. +@param AD_Process_Para_ID Process Parameter */ +public void setAD_Process_Para_ID (int AD_Process_Para_ID) +{ +if (AD_Process_Para_ID <= 0) set_Value ("AD_Process_Para_ID", null); + else +set_Value ("AD_Process_Para_ID", new Integer(AD_Process_Para_ID)); +} +/** Get Process Parameter. +@return Process Parameter */ +public int getAD_Process_Para_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_Para_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node. +@param AD_WF_Node_ID Workflow Node (activity), step or process */ +public void setAD_WF_Node_ID (int AD_WF_Node_ID) +{ +if (AD_WF_Node_ID < 1) throw new IllegalArgumentException ("AD_WF_Node_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Node_ID", new Integer(AD_WF_Node_ID)); +} +/** Get Node. +@return Workflow Node (activity), step or process */ +public int getAD_WF_Node_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_Node_ID())); +} +/** Set Workflow Node Parameter. +@param AD_WF_Node_Para_ID Workflow Node Execution Parameter */ +public void setAD_WF_Node_Para_ID (int AD_WF_Node_Para_ID) +{ +if (AD_WF_Node_Para_ID < 1) throw new IllegalArgumentException ("AD_WF_Node_Para_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Node_Para_ID", new Integer(AD_WF_Node_Para_ID)); +} +/** Get Workflow Node Parameter. +@return Workflow Node Execution Parameter */ +public int getAD_WF_Node_Para_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_Para_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Name. +@param AttributeName Name of the Attribute */ +public void setAttributeName (String AttributeName) +{ +if (AttributeName != null && AttributeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeName = AttributeName.substring(0,59); +} +set_Value ("AttributeName", AttributeName); +} +/** Get Attribute Name. +@return Name of the Attribute */ +public String getAttributeName() +{ +return (String)get_Value("AttributeName"); +} +/** Set Attribute Value. +@param AttributeValue Value of the Attribute */ +public void setAttributeValue (String AttributeValue) +{ +if (AttributeValue != null && AttributeValue.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeValue = AttributeValue.substring(0,59); +} +set_Value ("AttributeValue", AttributeValue); +} +/** Get Attribute Value. +@return Value of the Attribute */ +public String getAttributeValue() +{ +return (String)get_Value("AttributeValue"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_Process.java b/dbPort/src/org/compiere/model/X_AD_WF_Process.java new file mode 100644 index 0000000000..1d4505f9ad --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_Process.java @@ -0,0 +1,312 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_Process + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.937 */ +public class X_AD_WF_Process extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_Process_ID id +@param trxName transaction +*/ +public X_AD_WF_Process (Properties ctx, int AD_WF_Process_ID, String trxName) +{ +super (ctx, AD_WF_Process_ID, trxName); +/** if (AD_WF_Process_ID == 0) +{ +setAD_Table_ID (0); +setAD_WF_Process_ID (0); +setAD_WF_Responsible_ID (0); +setAD_Workflow_ID (0); +setProcessed (false); +setRecord_ID (0); +setWFState (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_Process (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=645 */ +public static final int Table_ID=645; + +/** TableName=AD_WF_Process */ +public static final String Table_Name="AD_WF_Process"; + +protected static KeyNamePair Model = new KeyNamePair(645,"AD_WF_Process"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_Process[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Message. +@param AD_Message_ID System Message */ +public void setAD_Message_ID (int AD_Message_ID) +{ +if (AD_Message_ID <= 0) set_Value ("AD_Message_ID", null); + else +set_Value ("AD_Message_ID", new Integer(AD_Message_ID)); +} +/** Get Message. +@return System Message */ +public int getAD_Message_ID() +{ +Integer ii = (Integer)get_Value("AD_Message_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_User_ID AD_Reference_ID=286 */ +public static final int AD_USER_ID_AD_Reference_ID=286; +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Process. +@param AD_WF_Process_ID Actual Workflow Process Instance */ +public void setAD_WF_Process_ID (int AD_WF_Process_ID) +{ +if (AD_WF_Process_ID < 1) throw new IllegalArgumentException ("AD_WF_Process_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Process_ID", new Integer(AD_WF_Process_ID)); +} +/** Get Workflow Process. +@return Actual Workflow Process Instance */ +public int getAD_WF_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Responsible. +@param AD_WF_Responsible_ID Responsible for Workflow Execution */ +public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID) +{ +if (AD_WF_Responsible_ID < 1) throw new IllegalArgumentException ("AD_WF_Responsible_ID is mandatory."); +set_Value ("AD_WF_Responsible_ID", new Integer(AD_WF_Responsible_ID)); +} +/** Get Workflow Responsible. +@return Responsible for Workflow Execution */ +public int getAD_WF_Responsible_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Responsible_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID < 1) throw new IllegalArgumentException ("AD_Workflow_ID is mandatory."); +set_Value ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_Workflow_ID())); +} +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (int Priority) +{ +set_Value ("Priority", new Integer(Priority)); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public int getPriority() +{ +Integer ii = (Integer)get_Value("Priority"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} + +/** WFState AD_Reference_ID=305 */ +public static final int WFSTATE_AD_Reference_ID=305; +/** Aborted = CA */ +public static final String WFSTATE_Aborted = "CA"; +/** Completed = CC */ +public static final String WFSTATE_Completed = "CC"; +/** Terminated = CT */ +public static final String WFSTATE_Terminated = "CT"; +/** Not Started = ON */ +public static final String WFSTATE_NotStarted = "ON"; +/** Running = OR */ +public static final String WFSTATE_Running = "OR"; +/** Suspended = OS */ +public static final String WFSTATE_Suspended = "OS"; +/** Set Workflow State. +@param WFState State of the execution of the workflow */ +public void setWFState (String WFState) +{ +if (WFState == null) throw new IllegalArgumentException ("WFState is mandatory"); +if (WFState.equals("CA") || WFState.equals("CC") || WFState.equals("CT") || WFState.equals("ON") || WFState.equals("OR") || WFState.equals("OS")); + else throw new IllegalArgumentException ("WFState Invalid value - " + WFState + " - Reference_ID=305 - CA - CC - CT - ON - OR - OS"); +if (WFState.length() > 2) +{ +log.warning("Length > 2 - truncated"); +WFState = WFState.substring(0,1); +} +set_Value ("WFState", WFState); +} +/** Get Workflow State. +@return State of the execution of the workflow */ +public String getWFState() +{ +return (String)get_Value("WFState"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_ProcessData.java b/dbPort/src/org/compiere/model/X_AD_WF_ProcessData.java new file mode 100644 index 0000000000..403bb7a314 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_ProcessData.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_ProcessData + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.953 */ +public class X_AD_WF_ProcessData extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_ProcessData_ID id +@param trxName transaction +*/ +public X_AD_WF_ProcessData (Properties ctx, int AD_WF_ProcessData_ID, String trxName) +{ +super (ctx, AD_WF_ProcessData_ID, trxName); +/** if (AD_WF_ProcessData_ID == 0) +{ +setAD_WF_ProcessData_ID (0); +setAD_WF_Process_ID (0); +setAttributeName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_ProcessData (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=648 */ +public static final int Table_ID=648; + +/** TableName=AD_WF_ProcessData */ +public static final String Table_Name="AD_WF_ProcessData"; + +protected static KeyNamePair Model = new KeyNamePair(648,"AD_WF_ProcessData"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_ProcessData[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Workflow Process Data. +@param AD_WF_ProcessData_ID Workflow Process Context */ +public void setAD_WF_ProcessData_ID (int AD_WF_ProcessData_ID) +{ +if (AD_WF_ProcessData_ID < 1) throw new IllegalArgumentException ("AD_WF_ProcessData_ID is mandatory."); +set_ValueNoCheck ("AD_WF_ProcessData_ID", new Integer(AD_WF_ProcessData_ID)); +} +/** Get Workflow Process Data. +@return Workflow Process Context */ +public int getAD_WF_ProcessData_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_ProcessData_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Process. +@param AD_WF_Process_ID Actual Workflow Process Instance */ +public void setAD_WF_Process_ID (int AD_WF_Process_ID) +{ +if (AD_WF_Process_ID < 1) throw new IllegalArgumentException ("AD_WF_Process_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Process_ID", new Integer(AD_WF_Process_ID)); +} +/** Get Workflow Process. +@return Actual Workflow Process Instance */ +public int getAD_WF_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WF_Process_ID())); +} +/** Set Attribute Name. +@param AttributeName Name of the Attribute */ +public void setAttributeName (String AttributeName) +{ +if (AttributeName == null) throw new IllegalArgumentException ("AttributeName is mandatory."); +if (AttributeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeName = AttributeName.substring(0,59); +} +set_Value ("AttributeName", AttributeName); +} +/** Get Attribute Name. +@return Name of the Attribute */ +public String getAttributeName() +{ +return (String)get_Value("AttributeName"); +} +/** Set Attribute Value. +@param AttributeValue Value of the Attribute */ +public void setAttributeValue (String AttributeValue) +{ +if (AttributeValue != null && AttributeValue.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AttributeValue = AttributeValue.substring(0,59); +} +set_Value ("AttributeValue", AttributeValue); +} +/** Get Attribute Value. +@return Value of the Attribute */ +public String getAttributeValue() +{ +return (String)get_Value("AttributeValue"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WF_Responsible.java b/dbPort/src/org/compiere/model/X_AD_WF_Responsible.java new file mode 100644 index 0000000000..2b9748986c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WF_Responsible.java @@ -0,0 +1,235 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WF_Responsible + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.968 */ +public class X_AD_WF_Responsible extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WF_Responsible_ID id +@param trxName transaction +*/ +public X_AD_WF_Responsible (Properties ctx, int AD_WF_Responsible_ID, String trxName) +{ +super (ctx, AD_WF_Responsible_ID, trxName); +/** if (AD_WF_Responsible_ID == 0) +{ +setAD_Role_ID (0); +setAD_WF_Responsible_ID (0); +setEntityType (null); // U +setName (null); +setResponsibleType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WF_Responsible (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=646 */ +public static final int Table_ID=646; + +/** TableName=AD_WF_Responsible */ +public static final String Table_Name="AD_WF_Responsible"; + +protected static KeyNamePair Model = new KeyNamePair(646,"AD_WF_Responsible"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WF_Responsible[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_Value ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_User_ID AD_Reference_ID=286 */ +public static final int AD_USER_ID_AD_Reference_ID=286; +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Responsible. +@param AD_WF_Responsible_ID Responsible for Workflow Execution */ +public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID) +{ +if (AD_WF_Responsible_ID < 1) throw new IllegalArgumentException ("AD_WF_Responsible_ID is mandatory."); +set_ValueNoCheck ("AD_WF_Responsible_ID", new Integer(AD_WF_Responsible_ID)); +} +/** Get Workflow Responsible. +@return Responsible for Workflow Execution */ +public int getAD_WF_Responsible_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Responsible_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** ResponsibleType AD_Reference_ID=304 */ +public static final int RESPONSIBLETYPE_AD_Reference_ID=304; +/** Human = H */ +public static final String RESPONSIBLETYPE_Human = "H"; +/** Organization = O */ +public static final String RESPONSIBLETYPE_Organization = "O"; +/** Role = R */ +public static final String RESPONSIBLETYPE_Role = "R"; +/** System Resource = S */ +public static final String RESPONSIBLETYPE_SystemResource = "S"; +/** Set Responsible Type. +@param ResponsibleType Type of the Responsibility for a workflow */ +public void setResponsibleType (String ResponsibleType) +{ +if (ResponsibleType == null) throw new IllegalArgumentException ("ResponsibleType is mandatory"); +if (ResponsibleType.equals("H") || ResponsibleType.equals("O") || ResponsibleType.equals("R") || ResponsibleType.equals("S")); + else throw new IllegalArgumentException ("ResponsibleType Invalid value - " + ResponsibleType + " - Reference_ID=304 - H - O - R - S"); +if (ResponsibleType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ResponsibleType = ResponsibleType.substring(0,0); +} +set_Value ("ResponsibleType", ResponsibleType); +} +/** Get Responsible Type. +@return Type of the Responsibility for a workflow */ +public String getResponsibleType() +{ +return (String)get_Value("ResponsibleType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Window.java b/dbPort/src/org/compiere/model/X_AD_Window.java new file mode 100644 index 0000000000..7d01fe82f3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Window.java @@ -0,0 +1,352 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Window + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:54.984 */ +public class X_AD_Window extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Window_ID id +@param trxName transaction +*/ +public X_AD_Window (Properties ctx, int AD_Window_ID, String trxName) +{ +super (ctx, AD_Window_ID, trxName); +/** if (AD_Window_ID == 0) +{ +setAD_Window_ID (0); +setEntityType (null); // U +setIsBetaFunctionality (false); +setIsDefault (false); +setIsSOTrx (true); // Y +setName (null); +setWindowType (null); // M +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Window (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=105 */ +public static final int Table_ID=105; + +/** TableName=AD_Window */ +public static final String Table_Name="AD_Window"; + +protected static KeyNamePair Model = new KeyNamePair(105,"AD_Window"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Window[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Color. +@param AD_Color_ID Color for backgrounds or indicators */ +public void setAD_Color_ID (int AD_Color_ID) +{ +if (AD_Color_ID <= 0) set_Value ("AD_Color_ID", null); + else +set_Value ("AD_Color_ID", new Integer(AD_Color_ID)); +} +/** Get System Color. +@return Color for backgrounds or indicators */ +public int getAD_Color_ID() +{ +Integer ii = (Integer)get_Value("AD_Color_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID < 1) throw new IllegalArgumentException ("AD_Window_ID is mandatory."); +set_ValueNoCheck ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Beta Functionality. +@param IsBetaFunctionality This functionality is considered Beta */ +public void setIsBetaFunctionality (boolean IsBetaFunctionality) +{ +set_Value ("IsBetaFunctionality", new Boolean(IsBetaFunctionality)); +} +/** Get Beta Functionality. +@return This functionality is considered Beta */ +public boolean isBetaFunctionality() +{ +Object oo = get_Value("IsBetaFunctionality"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Window Height. +@param WinHeight Window Height */ +public void setWinHeight (int WinHeight) +{ +set_Value ("WinHeight", new Integer(WinHeight)); +} +/** Get Window Height. +@return Window Height */ +public int getWinHeight() +{ +Integer ii = (Integer)get_Value("WinHeight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window Width. +@param WinWidth Window Width */ +public void setWinWidth (int WinWidth) +{ +set_Value ("WinWidth", new Integer(WinWidth)); +} +/** Get Window Width. +@return Window Width */ +public int getWinWidth() +{ +Integer ii = (Integer)get_Value("WinWidth"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** WindowType AD_Reference_ID=108 */ +public static final int WINDOWTYPE_AD_Reference_ID=108; +/** Maintain = M */ +public static final String WINDOWTYPE_Maintain = "M"; +/** Query Only = Q */ +public static final String WINDOWTYPE_QueryOnly = "Q"; +/** Single Record = S */ +public static final String WINDOWTYPE_SingleRecord = "S"; +/** Transaction = T */ +public static final String WINDOWTYPE_Transaction = "T"; +/** Set WindowType. +@param WindowType Type or classification of a Window */ +public void setWindowType (String WindowType) +{ +if (WindowType == null) throw new IllegalArgumentException ("WindowType is mandatory"); +if (WindowType.equals("M") || WindowType.equals("Q") || WindowType.equals("S") || WindowType.equals("T")); + else throw new IllegalArgumentException ("WindowType Invalid value - " + WindowType + " - Reference_ID=108 - M - Q - S - T"); +if (WindowType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +WindowType = WindowType.substring(0,0); +} +set_Value ("WindowType", WindowType); +} +/** Get WindowType. +@return Type or classification of a Window */ +public String getWindowType() +{ +return (String)get_Value("WindowType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Window_Access.java b/dbPort/src/org/compiere/model/X_AD_Window_Access.java new file mode 100644 index 0000000000..044b53b088 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Window_Access.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Window_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.015 */ +public class X_AD_Window_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Window_Access_ID id +@param trxName transaction +*/ +public X_AD_Window_Access (Properties ctx, int AD_Window_Access_ID, String trxName) +{ +super (ctx, AD_Window_Access_ID, trxName); +/** if (AD_Window_Access_ID == 0) +{ +setAD_Role_ID (0); +setAD_Window_ID (0); +setIsReadWrite (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Window_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=201 */ +public static final int Table_ID=201; + +/** TableName=AD_Window_Access */ +public static final String Table_Name="AD_Window_Access"; + +protected static KeyNamePair Model = new KeyNamePair(201,"AD_Window_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Window_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID < 1) throw new IllegalArgumentException ("AD_Window_ID is mandatory."); +set_ValueNoCheck ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Write. +@param IsReadWrite Field is read / write */ +public void setIsReadWrite (boolean IsReadWrite) +{ +set_Value ("IsReadWrite", new Boolean(IsReadWrite)); +} +/** Get Read Write. +@return Field is read / write */ +public boolean isReadWrite() +{ +Object oo = get_Value("IsReadWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Workbench.java b/dbPort/src/org/compiere/model/X_AD_Workbench.java new file mode 100644 index 0000000000..29a5fbc83c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Workbench.java @@ -0,0 +1,232 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Workbench + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.015 */ +public class X_AD_Workbench extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Workbench_ID id +@param trxName transaction +*/ +public X_AD_Workbench (Properties ctx, int AD_Workbench_ID, String trxName) +{ +super (ctx, AD_Workbench_ID, trxName); +/** if (AD_Workbench_ID == 0) +{ +setAD_Column_ID (0); +setAD_Workbench_ID (0); +setEntityType (null); // U +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Workbench (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=468 */ +public static final int Table_ID=468; + +/** TableName=AD_Workbench */ +public static final String Table_Name="AD_Workbench"; + +protected static KeyNamePair Model = new KeyNamePair(468,"AD_Workbench"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Workbench[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set System Color. +@param AD_Color_ID Color for backgrounds or indicators */ +public void setAD_Color_ID (Object AD_Color_ID) +{ +set_Value ("AD_Color_ID", AD_Color_ID); +} +/** Get System Color. +@return Color for backgrounds or indicators */ +public Object getAD_Color_ID() +{ +return get_Value("AD_Color_ID"); +} + +/** AD_Column_ID AD_Reference_ID=244 */ +public static final int AD_COLUMN_ID_AD_Reference_ID=244; +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID < 1) throw new IllegalArgumentException ("AD_Column_ID is mandatory."); +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workbench. +@param AD_Workbench_ID Collection of windows, reports */ +public void setAD_Workbench_ID (int AD_Workbench_ID) +{ +if (AD_Workbench_ID < 1) throw new IllegalArgumentException ("AD_Workbench_ID is mandatory."); +set_ValueNoCheck ("AD_Workbench_ID", new Integer(AD_Workbench_ID)); +} +/** Get Workbench. +@return Collection of windows, reports */ +public int getAD_Workbench_ID() +{ +Integer ii = (Integer)get_Value("AD_Workbench_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WorkbenchWindow.java b/dbPort/src/org/compiere/model/X_AD_WorkbenchWindow.java new file mode 100644 index 0000000000..169a520105 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WorkbenchWindow.java @@ -0,0 +1,248 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WorkbenchWindow + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.046 */ +public class X_AD_WorkbenchWindow extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WorkbenchWindow_ID id +@param trxName transaction +*/ +public X_AD_WorkbenchWindow (Properties ctx, int AD_WorkbenchWindow_ID, String trxName) +{ +super (ctx, AD_WorkbenchWindow_ID, trxName); +/** if (AD_WorkbenchWindow_ID == 0) +{ +setAD_WorkbenchWindow_ID (0); +setAD_Workbench_ID (0); +setEntityType (null); // U +setIsPrimary (false); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WorkbenchWindow (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=469 */ +public static final int Table_ID=469; + +/** TableName=AD_WorkbenchWindow */ +public static final String Table_Name="AD_WorkbenchWindow"; + +protected static KeyNamePair Model = new KeyNamePair(469,"AD_WorkbenchWindow"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WorkbenchWindow[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Special Form. +@param AD_Form_ID Special Form */ +public void setAD_Form_ID (int AD_Form_ID) +{ +if (AD_Form_ID <= 0) set_Value ("AD_Form_ID", null); + else +set_Value ("AD_Form_ID", new Integer(AD_Form_ID)); +} +/** Get Special Form. +@return Special Form */ +public int getAD_Form_ID() +{ +Integer ii = (Integer)get_Value("AD_Form_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process. +@param AD_Process_ID Process or Report */ +public void setAD_Process_ID (int AD_Process_ID) +{ +if (AD_Process_ID <= 0) set_Value ("AD_Process_ID", null); + else +set_Value ("AD_Process_ID", new Integer(AD_Process_ID)); +} +/** Get Process. +@return Process or Report */ +public int getAD_Process_ID() +{ +Integer ii = (Integer)get_Value("AD_Process_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set OS Task. +@param AD_Task_ID Operation System Task */ +public void setAD_Task_ID (int AD_Task_ID) +{ +if (AD_Task_ID <= 0) set_Value ("AD_Task_ID", null); + else +set_Value ("AD_Task_ID", new Integer(AD_Task_ID)); +} +/** Get OS Task. +@return Operation System Task */ +public int getAD_Task_ID() +{ +Integer ii = (Integer)get_Value("AD_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Window. +@param AD_Window_ID Data entry or display window */ +public void setAD_Window_ID (int AD_Window_ID) +{ +if (AD_Window_ID <= 0) set_Value ("AD_Window_ID", null); + else +set_Value ("AD_Window_ID", new Integer(AD_Window_ID)); +} +/** Get Window. +@return Data entry or display window */ +public int getAD_Window_ID() +{ +Integer ii = (Integer)get_Value("AD_Window_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workbench Window. +@param AD_WorkbenchWindow_ID Workbench Window */ +public void setAD_WorkbenchWindow_ID (int AD_WorkbenchWindow_ID) +{ +if (AD_WorkbenchWindow_ID < 1) throw new IllegalArgumentException ("AD_WorkbenchWindow_ID is mandatory."); +set_ValueNoCheck ("AD_WorkbenchWindow_ID", new Integer(AD_WorkbenchWindow_ID)); +} +/** Get Workbench Window. +@return Workbench Window */ +public int getAD_WorkbenchWindow_ID() +{ +Integer ii = (Integer)get_Value("AD_WorkbenchWindow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_WorkbenchWindow_ID())); +} +/** Set Workbench. +@param AD_Workbench_ID Collection of windows, reports */ +public void setAD_Workbench_ID (int AD_Workbench_ID) +{ +if (AD_Workbench_ID < 1) throw new IllegalArgumentException ("AD_Workbench_ID is mandatory."); +set_ValueNoCheck ("AD_Workbench_ID", new Integer(AD_Workbench_ID)); +} +/** Get Workbench. +@return Collection of windows, reports */ +public int getAD_Workbench_ID() +{ +Integer ii = (Integer)get_Value("AD_Workbench_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Primary. +@param IsPrimary Indicates if this is the primary budget */ +public void setIsPrimary (boolean IsPrimary) +{ +set_Value ("IsPrimary", new Boolean(IsPrimary)); +} +/** Get Primary. +@return Indicates if this is the primary budget */ +public boolean isPrimary() +{ +Object oo = get_Value("IsPrimary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Workflow.java b/dbPort/src/org/compiere/model/X_AD_Workflow.java new file mode 100644 index 0000000000..92788dc148 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Workflow.java @@ -0,0 +1,619 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Workflow + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.062 */ +public class X_AD_Workflow extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Workflow_ID id +@param trxName transaction +*/ +public X_AD_Workflow (Properties ctx, int AD_Workflow_ID, String trxName) +{ +super (ctx, AD_Workflow_ID, trxName); +/** if (AD_Workflow_ID == 0) +{ +setAD_Workflow_ID (0); +setAccessLevel (null); +setAuthor (null); +setCost (0); +setDuration (0); +setEntityType (null); // U +setIsDefault (false); +setIsValid (false); +setName (null); +setPublishStatus (null); // U +setValue (null); +setVersion (0); +setWaitingTime (0); +setWorkflowType (null); // G +setWorkingTime (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Workflow (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=117 */ +public static final int Table_ID=117; + +/** TableName=AD_Workflow */ +public static final String Table_Name="AD_Workflow"; + +protected static KeyNamePair Model = new KeyNamePair(117,"AD_Workflow"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Workflow[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Node. +@param AD_WF_Node_ID Workflow Node (activity), step or process */ +public void setAD_WF_Node_ID (int AD_WF_Node_ID) +{ +if (AD_WF_Node_ID <= 0) set_Value ("AD_WF_Node_ID", null); + else +set_Value ("AD_WF_Node_ID", new Integer(AD_WF_Node_ID)); +} +/** Get Node. +@return Workflow Node (activity), step or process */ +public int getAD_WF_Node_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Node_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Responsible. +@param AD_WF_Responsible_ID Responsible for Workflow Execution */ +public void setAD_WF_Responsible_ID (int AD_WF_Responsible_ID) +{ +if (AD_WF_Responsible_ID <= 0) set_Value ("AD_WF_Responsible_ID", null); + else +set_Value ("AD_WF_Responsible_ID", new Integer(AD_WF_Responsible_ID)); +} +/** Get Workflow Responsible. +@return Responsible for Workflow Execution */ +public int getAD_WF_Responsible_ID() +{ +Integer ii = (Integer)get_Value("AD_WF_Responsible_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Processor. +@param AD_WorkflowProcessor_ID Workflow Processor Server */ +public void setAD_WorkflowProcessor_ID (int AD_WorkflowProcessor_ID) +{ +if (AD_WorkflowProcessor_ID <= 0) set_Value ("AD_WorkflowProcessor_ID", null); + else +set_Value ("AD_WorkflowProcessor_ID", new Integer(AD_WorkflowProcessor_ID)); +} +/** Get Workflow Processor. +@return Workflow Processor Server */ +public int getAD_WorkflowProcessor_ID() +{ +Integer ii = (Integer)get_Value("AD_WorkflowProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID < 1) throw new IllegalArgumentException ("AD_Workflow_ID is mandatory."); +set_ValueNoCheck ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AccessLevel AD_Reference_ID=5 */ +public static final int ACCESSLEVEL_AD_Reference_ID=5; +/** Organization = 1 */ +public static final String ACCESSLEVEL_Organization = "1"; +/** Client only = 2 */ +public static final String ACCESSLEVEL_ClientOnly = "2"; +/** Client+Organization = 3 */ +public static final String ACCESSLEVEL_ClientPlusOrganization = "3"; +/** System only = 4 */ +public static final String ACCESSLEVEL_SystemOnly = "4"; +/** System+Client = 6 */ +public static final String ACCESSLEVEL_SystemPlusClient = "6"; +/** All = 7 */ +public static final String ACCESSLEVEL_All = "7"; +/** Set Data Access Level. +@param AccessLevel Access Level required */ +public void setAccessLevel (String AccessLevel) +{ +if (AccessLevel == null) throw new IllegalArgumentException ("AccessLevel is mandatory"); +if (AccessLevel.equals("1") || AccessLevel.equals("2") || AccessLevel.equals("3") || AccessLevel.equals("4") || AccessLevel.equals("6") || AccessLevel.equals("7")); + else throw new IllegalArgumentException ("AccessLevel Invalid value - " + AccessLevel + " - Reference_ID=5 - 1 - 2 - 3 - 4 - 6 - 7"); +if (AccessLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccessLevel = AccessLevel.substring(0,0); +} +set_Value ("AccessLevel", AccessLevel); +} +/** Get Data Access Level. +@return Access Level required */ +public String getAccessLevel() +{ +return (String)get_Value("AccessLevel"); +} +/** Set Author. +@param Author Author/Creator of the Entity */ +public void setAuthor (String Author) +{ +if (Author == null) throw new IllegalArgumentException ("Author is mandatory."); +if (Author.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Author = Author.substring(0,19); +} +set_Value ("Author", Author); +} +/** Get Author. +@return Author/Creator of the Entity */ +public String getAuthor() +{ +return (String)get_Value("Author"); +} +/** Set Cost. +@param Cost Cost information */ +public void setCost (int Cost) +{ +set_Value ("Cost", new Integer(Cost)); +} +/** Get Cost. +@return Cost information */ +public int getCost() +{ +Integer ii = (Integer)get_Value("Cost"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Value Logic. +@param DocValueLogic Logic to determine Workflow Start - If true, a workflow process is started for the document */ +public void setDocValueLogic (String DocValueLogic) +{ +if (DocValueLogic != null && DocValueLogic.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DocValueLogic = DocValueLogic.substring(0,1999); +} +set_Value ("DocValueLogic", DocValueLogic); +} +/** Get Document Value Logic. +@return Logic to determine Workflow Start - If true, a workflow process is started for the document */ +public String getDocValueLogic() +{ +return (String)get_Value("DocValueLogic"); +} +/** Set Duration. +@param Duration Normal Duration in Duration Unit */ +public void setDuration (int Duration) +{ +set_Value ("Duration", new Integer(Duration)); +} +/** Get Duration. +@return Normal Duration in Duration Unit */ +public int getDuration() +{ +Integer ii = (Integer)get_Value("Duration"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** DurationUnit AD_Reference_ID=299 */ +public static final int DURATIONUNIT_AD_Reference_ID=299; +/** Day = D */ +public static final String DURATIONUNIT_Day = "D"; +/** Month = M */ +public static final String DURATIONUNIT_Month = "M"; +/** Year = Y */ +public static final String DURATIONUNIT_Year = "Y"; +/** hour = h */ +public static final String DURATIONUNIT_Hour = "h"; +/** minute = m */ +public static final String DURATIONUNIT_Minute = "m"; +/** second = s */ +public static final String DURATIONUNIT_Second = "s"; +/** Set Duration Unit. +@param DurationUnit Unit of Duration */ +public void setDurationUnit (String DurationUnit) +{ +if (DurationUnit == null) throw new IllegalArgumentException ("DurationUnit is mandatory"); +if (DurationUnit == null || DurationUnit.equals("D") || DurationUnit.equals("M") || DurationUnit.equals("Y") || DurationUnit.equals("h") || DurationUnit.equals("m") || DurationUnit.equals("s")); + else throw new IllegalArgumentException ("DurationUnit Invalid value - " + DurationUnit + " - Reference_ID=299 - D - M - Y - h - m - s"); +if (DurationUnit != null && DurationUnit.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DurationUnit = DurationUnit.substring(0,0); +} +set_Value ("DurationUnit", DurationUnit); +} +/** Get Duration Unit. +@return Unit of Duration */ +public String getDurationUnit() +{ +return (String)get_Value("DurationUnit"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Duration Limit. +@param Limit Maximum Duration in Duration Unit */ +public void setLimit (int Limit) +{ +set_Value ("Limit", new Integer(Limit)); +} +/** Get Duration Limit. +@return Maximum Duration in Duration Unit */ +public int getLimit() +{ +Integer ii = (Integer)get_Value("Limit"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (int Priority) +{ +set_Value ("Priority", new Integer(Priority)); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public int getPriority() +{ +Integer ii = (Integer)get_Value("Priority"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PublishStatus AD_Reference_ID=310 */ +public static final int PUBLISHSTATUS_AD_Reference_ID=310; +/** Released = R */ +public static final String PUBLISHSTATUS_Released = "R"; +/** Test = T */ +public static final String PUBLISHSTATUS_Test = "T"; +/** Under Revision = U */ +public static final String PUBLISHSTATUS_UnderRevision = "U"; +/** Void = V */ +public static final String PUBLISHSTATUS_Void = "V"; +/** Set Publication Status. +@param PublishStatus Status of Publication */ +public void setPublishStatus (String PublishStatus) +{ +if (PublishStatus == null) throw new IllegalArgumentException ("PublishStatus is mandatory"); +if (PublishStatus.equals("R") || PublishStatus.equals("T") || PublishStatus.equals("U") || PublishStatus.equals("V")); + else throw new IllegalArgumentException ("PublishStatus Invalid value - " + PublishStatus + " - Reference_ID=310 - R - T - U - V"); +if (PublishStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PublishStatus = PublishStatus.substring(0,0); +} +set_Value ("PublishStatus", PublishStatus); +} +/** Get Publication Status. +@return Status of Publication */ +public String getPublishStatus() +{ +return (String)get_Value("PublishStatus"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +/** Set Validate Workflow. +@param ValidateWorkflow Validate Workflow */ +public void setValidateWorkflow (String ValidateWorkflow) +{ +if (ValidateWorkflow != null && ValidateWorkflow.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ValidateWorkflow = ValidateWorkflow.substring(0,0); +} +set_Value ("ValidateWorkflow", ValidateWorkflow); +} +/** Get Validate Workflow. +@return Validate Workflow */ +public String getValidateWorkflow() +{ +return (String)get_Value("ValidateWorkflow"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (int Version) +{ +set_Value ("Version", new Integer(Version)); +} +/** Get Version. +@return Version of the table definition */ +public int getVersion() +{ +Integer ii = (Integer)get_Value("Version"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Waiting Time. +@param WaitingTime Workflow Simulation Waiting time */ +public void setWaitingTime (int WaitingTime) +{ +set_Value ("WaitingTime", new Integer(WaitingTime)); +} +/** Get Waiting Time. +@return Workflow Simulation Waiting time */ +public int getWaitingTime() +{ +Integer ii = (Integer)get_Value("WaitingTime"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** WorkflowType AD_Reference_ID=328 */ +public static final int WORKFLOWTYPE_AD_Reference_ID=328; +/** General = G */ +public static final String WORKFLOWTYPE_General = "G"; +/** Document Process = P */ +public static final String WORKFLOWTYPE_DocumentProcess = "P"; +/** Document Value = V */ +public static final String WORKFLOWTYPE_DocumentValue = "V"; +/** Set Workflow Type. +@param WorkflowType Type of Worflow */ +public void setWorkflowType (String WorkflowType) +{ +if (WorkflowType == null) throw new IllegalArgumentException ("WorkflowType is mandatory"); +if (WorkflowType.equals("G") || WorkflowType.equals("P") || WorkflowType.equals("V")); + else throw new IllegalArgumentException ("WorkflowType Invalid value - " + WorkflowType + " - Reference_ID=328 - G - P - V"); +if (WorkflowType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +WorkflowType = WorkflowType.substring(0,0); +} +set_Value ("WorkflowType", WorkflowType); +} +/** Get Workflow Type. +@return Type of Worflow */ +public String getWorkflowType() +{ +return (String)get_Value("WorkflowType"); +} +/** Set Working Time. +@param WorkingTime Workflow Simulation Execution Time */ +public void setWorkingTime (int WorkingTime) +{ +set_Value ("WorkingTime", new Integer(WorkingTime)); +} +/** Get Working Time. +@return Workflow Simulation Execution Time */ +public int getWorkingTime() +{ +Integer ii = (Integer)get_Value("WorkingTime"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WorkflowProcessor.java b/dbPort/src/org/compiere/model/X_AD_WorkflowProcessor.java new file mode 100644 index 0000000000..2ee8271652 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WorkflowProcessor.java @@ -0,0 +1,308 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WorkflowProcessor + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.109 */ +public class X_AD_WorkflowProcessor extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WorkflowProcessor_ID id +@param trxName transaction +*/ +public X_AD_WorkflowProcessor (Properties ctx, int AD_WorkflowProcessor_ID, String trxName) +{ +super (ctx, AD_WorkflowProcessor_ID, trxName); +/** if (AD_WorkflowProcessor_ID == 0) +{ +setAD_WorkflowProcessor_ID (0); +setFrequency (0); +setFrequencyType (null); +setKeepLogDays (0); // 7 +setName (null); +setSupervisor_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WorkflowProcessor (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=697 */ +public static final int Table_ID=697; + +/** TableName=AD_WorkflowProcessor */ +public static final String Table_Name="AD_WorkflowProcessor"; + +protected static KeyNamePair Model = new KeyNamePair(697,"AD_WorkflowProcessor"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WorkflowProcessor[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Workflow Processor. +@param AD_WorkflowProcessor_ID Workflow Processor Server */ +public void setAD_WorkflowProcessor_ID (int AD_WorkflowProcessor_ID) +{ +if (AD_WorkflowProcessor_ID < 1) throw new IllegalArgumentException ("AD_WorkflowProcessor_ID is mandatory."); +set_ValueNoCheck ("AD_WorkflowProcessor_ID", new Integer(AD_WorkflowProcessor_ID)); +} +/** Get Workflow Processor. +@return Workflow Processor Server */ +public int getAD_WorkflowProcessor_ID() +{ +Integer ii = (Integer)get_Value("AD_WorkflowProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alert over Priority. +@param AlertOverPriority Send alert email when over priority */ +public void setAlertOverPriority (int AlertOverPriority) +{ +set_Value ("AlertOverPriority", new Integer(AlertOverPriority)); +} +/** Get Alert over Priority. +@return Send alert email when over priority */ +public int getAlertOverPriority() +{ +Integer ii = (Integer)get_Value("AlertOverPriority"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +set_Value ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=221 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=221; +/** Day = D */ +public static final String FREQUENCYTYPE_Day = "D"; +/** Hour = H */ +public static final String FREQUENCYTYPE_Hour = "H"; +/** Minute = M */ +public static final String FREQUENCYTYPE_Minute = "M"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("H") || FrequencyType.equals("M")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=221 - D - H - M"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Inactivity Alert Days. +@param InactivityAlertDays Send Alert when there is no activity after days (0= no alert) */ +public void setInactivityAlertDays (int InactivityAlertDays) +{ +set_Value ("InactivityAlertDays", new Integer(InactivityAlertDays)); +} +/** Get Inactivity Alert Days. +@return Send Alert when there is no activity after days (0= no alert) */ +public int getInactivityAlertDays() +{ +Integer ii = (Integer)get_Value("InactivityAlertDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Days to keep Log. +@param KeepLogDays Number of days to keep the log entries */ +public void setKeepLogDays (int KeepLogDays) +{ +set_Value ("KeepLogDays", new Integer(KeepLogDays)); +} +/** Get Days to keep Log. +@return Number of days to keep the log entries */ +public int getKeepLogDays() +{ +Integer ii = (Integer)get_Value("KeepLogDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reminder Days. +@param RemindDays Days between sending Reminder Emails for a due or inactive Document */ +public void setRemindDays (int RemindDays) +{ +set_Value ("RemindDays", new Integer(RemindDays)); +} +/** Get Reminder Days. +@return Days between sending Reminder Emails for a due or inactive Document */ +public int getRemindDays() +{ +Integer ii = (Integer)get_Value("RemindDays"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Supervisor_ID AD_Reference_ID=316 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=316; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID < 1) throw new IllegalArgumentException ("Supervisor_ID is mandatory."); +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_WorkflowProcessorLog.java b/dbPort/src/org/compiere/model/X_AD_WorkflowProcessorLog.java new file mode 100644 index 0000000000..b21dd82d68 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_WorkflowProcessorLog.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_WorkflowProcessorLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.125 */ +public class X_AD_WorkflowProcessorLog extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_WorkflowProcessorLog_ID id +@param trxName transaction +*/ +public X_AD_WorkflowProcessorLog (Properties ctx, int AD_WorkflowProcessorLog_ID, String trxName) +{ +super (ctx, AD_WorkflowProcessorLog_ID, trxName); +/** if (AD_WorkflowProcessorLog_ID == 0) +{ +setAD_WorkflowProcessorLog_ID (0); +setAD_WorkflowProcessor_ID (0); +setIsError (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_WorkflowProcessorLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=696 */ +public static final int Table_ID=696; + +/** TableName=AD_WorkflowProcessorLog */ +public static final String Table_Name="AD_WorkflowProcessorLog"; + +protected static KeyNamePair Model = new KeyNamePair(696,"AD_WorkflowProcessorLog"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_WorkflowProcessorLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Workflow Processorl Log. +@param AD_WorkflowProcessorLog_ID Result of the execution of the Workflow Processor */ +public void setAD_WorkflowProcessorLog_ID (int AD_WorkflowProcessorLog_ID) +{ +if (AD_WorkflowProcessorLog_ID < 1) throw new IllegalArgumentException ("AD_WorkflowProcessorLog_ID is mandatory."); +set_ValueNoCheck ("AD_WorkflowProcessorLog_ID", new Integer(AD_WorkflowProcessorLog_ID)); +} +/** Get Workflow Processorl Log. +@return Result of the execution of the Workflow Processor */ +public int getAD_WorkflowProcessorLog_ID() +{ +Integer ii = (Integer)get_Value("AD_WorkflowProcessorLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow Processor. +@param AD_WorkflowProcessor_ID Workflow Processor Server */ +public void setAD_WorkflowProcessor_ID (int AD_WorkflowProcessor_ID) +{ +if (AD_WorkflowProcessor_ID < 1) throw new IllegalArgumentException ("AD_WorkflowProcessor_ID is mandatory."); +set_ValueNoCheck ("AD_WorkflowProcessor_ID", new Integer(AD_WorkflowProcessor_ID)); +} +/** Get Workflow Processor. +@return Workflow Processor Server */ +public int getAD_WorkflowProcessor_ID() +{ +Integer ii = (Integer)get_Value("AD_WorkflowProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Error. +@param IsError An Error occured in the execution */ +public void setIsError (boolean IsError) +{ +set_Value ("IsError", new Boolean(IsError)); +} +/** Get Error. +@return An Error occured in the execution */ +public boolean isError() +{ +Object oo = get_Value("IsError"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_AD_Workflow_Access.java b/dbPort/src/org/compiere/model/X_AD_Workflow_Access.java new file mode 100644 index 0000000000..7861d03c2d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_AD_Workflow_Access.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for AD_Workflow_Access + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.187 */ +public class X_AD_Workflow_Access extends PO +{ +/** Standard Constructor +@param ctx context +@param AD_Workflow_Access_ID id +@param trxName transaction +*/ +public X_AD_Workflow_Access (Properties ctx, int AD_Workflow_Access_ID, String trxName) +{ +super (ctx, AD_Workflow_Access_ID, trxName); +/** if (AD_Workflow_Access_ID == 0) +{ +setAD_Role_ID (0); +setAD_Workflow_ID (0); +setIsReadWrite (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_AD_Workflow_Access (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=202 */ +public static final int Table_ID=202; + +/** TableName=AD_Workflow_Access */ +public static final String Table_Name="AD_Workflow_Access"; + +protected static KeyNamePair Model = new KeyNamePair(202,"AD_Workflow_Access"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_AD_Workflow_Access[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Workflow. +@param AD_Workflow_ID Workflow or combination of tasks */ +public void setAD_Workflow_ID (int AD_Workflow_ID) +{ +if (AD_Workflow_ID < 1) throw new IllegalArgumentException ("AD_Workflow_ID is mandatory."); +set_ValueNoCheck ("AD_Workflow_ID", new Integer(AD_Workflow_ID)); +} +/** Get Workflow. +@return Workflow or combination of tasks */ +public int getAD_Workflow_ID() +{ +Integer ii = (Integer)get_Value("AD_Workflow_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Read Write. +@param IsReadWrite Field is read / write */ +public void setIsReadWrite (boolean IsReadWrite) +{ +set_Value ("IsReadWrite", new Boolean(IsReadWrite)); +} +/** Get Read Write. +@return Field is read / write */ +public boolean isReadWrite() +{ +Object oo = get_Value("IsReadWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_A_Asset.java b/dbPort/src/org/compiere/model/X_A_Asset.java new file mode 100644 index 0000000000..f5aab4eb4c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_Asset.java @@ -0,0 +1,741 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_Asset + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.187 */ +public class X_A_Asset extends PO +{ +/** Standard Constructor +@param ctx context +@param A_Asset_ID id +@param trxName transaction +*/ +public X_A_Asset (Properties ctx, int A_Asset_ID, String trxName) +{ +super (ctx, A_Asset_ID, trxName); +/** if (A_Asset_ID == 0) +{ +setA_Asset_Group_ID (0); +setA_Asset_ID (0); +setIsDepreciated (false); +setIsDisposed (false); +setIsFullyDepreciated (false); // N +setIsInPosession (false); +setIsOwned (false); +setM_AttributeSetInstance_ID (0); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_Asset (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=539 */ +public static final int Table_ID=539; + +/** TableName=A_Asset */ +public static final String Table_Name="A_Asset"; + +protected static KeyNamePair Model = new KeyNamePair(539,"A_Asset"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_Asset[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset Group. +@param A_Asset_Group_ID Group of Assets */ +public void setA_Asset_Group_ID (int A_Asset_Group_ID) +{ +if (A_Asset_Group_ID < 1) throw new IllegalArgumentException ("A_Asset_Group_ID is mandatory."); +set_Value ("A_Asset_Group_ID", new Integer(A_Asset_Group_ID)); +} +/** Get Asset Group. +@return Group of Assets */ +public int getA_Asset_Group_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID < 1) throw new IllegalArgumentException ("A_Asset_ID is mandatory."); +set_ValueNoCheck ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset Depreciation Date. +@param AssetDepreciationDate Date of last depreciation */ +public void setAssetDepreciationDate (Timestamp AssetDepreciationDate) +{ +set_Value ("AssetDepreciationDate", AssetDepreciationDate); +} +/** Get Asset Depreciation Date. +@return Date of last depreciation */ +public Timestamp getAssetDepreciationDate() +{ +return (Timestamp)get_Value("AssetDepreciationDate"); +} +/** Set Asset Disposal Date. +@param AssetDisposalDate Date when the asset is/was disposed */ +public void setAssetDisposalDate (Timestamp AssetDisposalDate) +{ +set_Value ("AssetDisposalDate", AssetDisposalDate); +} +/** Get Asset Disposal Date. +@return Date when the asset is/was disposed */ +public Timestamp getAssetDisposalDate() +{ +return (Timestamp)get_Value("AssetDisposalDate"); +} +/** Set In Service Date. +@param AssetServiceDate Date when Asset was put into service */ +public void setAssetServiceDate (Timestamp AssetServiceDate) +{ +set_Value ("AssetServiceDate", AssetServiceDate); +} +/** Get In Service Date. +@return Date when Asset was put into service */ +public Timestamp getAssetServiceDate() +{ +return (Timestamp)get_Value("AssetServiceDate"); +} + +/** C_BPartnerSR_ID AD_Reference_ID=353 */ +public static final int C_BPARTNERSR_ID_AD_Reference_ID=353; +/** Set BPartner (Agent). +@param C_BPartnerSR_ID Business Partner (Agent or Sales Rep) */ +public void setC_BPartnerSR_ID (int C_BPartnerSR_ID) +{ +if (C_BPartnerSR_ID <= 0) set_Value ("C_BPartnerSR_ID", null); + else +set_Value ("C_BPartnerSR_ID", new Integer(C_BPartnerSR_ID)); +} +/** Get BPartner (Agent). +@return Business Partner (Agent or Sales Rep) */ +public int getC_BPartnerSR_ID() +{ +Integer ii = (Integer)get_Value("C_BPartnerSR_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Guarantee Date. +@param GuaranteeDate Date when guarantee expires */ +public void setGuaranteeDate (Timestamp GuaranteeDate) +{ +set_Value ("GuaranteeDate", GuaranteeDate); +} +/** Get Guarantee Date. +@return Date when guarantee expires */ +public Timestamp getGuaranteeDate() +{ +return (Timestamp)get_Value("GuaranteeDate"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Depreciate. +@param IsDepreciated The asset will be depreciated */ +public void setIsDepreciated (boolean IsDepreciated) +{ +set_Value ("IsDepreciated", new Boolean(IsDepreciated)); +} +/** Get Depreciate. +@return The asset will be depreciated */ +public boolean isDepreciated() +{ +Object oo = get_Value("IsDepreciated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Disposed. +@param IsDisposed The asset is disposed */ +public void setIsDisposed (boolean IsDisposed) +{ +set_Value ("IsDisposed", new Boolean(IsDisposed)); +} +/** Get Disposed. +@return The asset is disposed */ +public boolean isDisposed() +{ +Object oo = get_Value("IsDisposed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Fully depreciated. +@param IsFullyDepreciated The asset is fully depreciated */ +public void setIsFullyDepreciated (boolean IsFullyDepreciated) +{ +set_ValueNoCheck ("IsFullyDepreciated", new Boolean(IsFullyDepreciated)); +} +/** Get Fully depreciated. +@return The asset is fully depreciated */ +public boolean isFullyDepreciated() +{ +Object oo = get_Value("IsFullyDepreciated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Possession. +@param IsInPosession The asset is in the possession of the organization */ +public void setIsInPosession (boolean IsInPosession) +{ +set_Value ("IsInPosession", new Boolean(IsInPosession)); +} +/** Get In Possession. +@return The asset is in the possession of the organization */ +public boolean isInPosession() +{ +Object oo = get_Value("IsInPosession"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Owned. +@param IsOwned The asset is owned by the organization */ +public void setIsOwned (boolean IsOwned) +{ +set_Value ("IsOwned", new Boolean(IsOwned)); +} +/** Get Owned. +@return The asset is owned by the organization */ +public boolean isOwned() +{ +Object oo = get_Value("IsOwned"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Last Maintenance. +@param LastMaintenanceDate Last Maintenance Date */ +public void setLastMaintenanceDate (Timestamp LastMaintenanceDate) +{ +set_Value ("LastMaintenanceDate", LastMaintenanceDate); +} +/** Get Last Maintenance. +@return Last Maintenance Date */ +public Timestamp getLastMaintenanceDate() +{ +return (Timestamp)get_Value("LastMaintenanceDate"); +} +/** Set Last Note. +@param LastMaintenanceNote Last Maintenance Note */ +public void setLastMaintenanceNote (String LastMaintenanceNote) +{ +if (LastMaintenanceNote != null && LastMaintenanceNote.length() > 60) +{ +log.warning("Length > 60 - truncated"); +LastMaintenanceNote = LastMaintenanceNote.substring(0,59); +} +set_Value ("LastMaintenanceNote", LastMaintenanceNote); +} +/** Get Last Note. +@return Last Maintenance Note */ +public String getLastMaintenanceNote() +{ +return (String)get_Value("LastMaintenanceNote"); +} +/** Set Last Unit. +@param LastMaintenanceUnit Last Maintenance Unit */ +public void setLastMaintenanceUnit (int LastMaintenanceUnit) +{ +set_Value ("LastMaintenanceUnit", new Integer(LastMaintenanceUnit)); +} +/** Get Last Unit. +@return Last Maintenance Unit */ +public int getLastMaintenanceUnit() +{ +Integer ii = (Integer)get_Value("LastMaintenanceUnit"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Lease Termination. +@param LeaseTerminationDate Lease Termination Date */ +public void setLeaseTerminationDate (Timestamp LeaseTerminationDate) +{ +set_Value ("LeaseTerminationDate", LeaseTerminationDate); +} +/** Get Lease Termination. +@return Lease Termination Date */ +public Timestamp getLeaseTerminationDate() +{ +return (Timestamp)get_Value("LeaseTerminationDate"); +} + +/** Lease_BPartner_ID AD_Reference_ID=192 */ +public static final int LEASE_BPARTNER_ID_AD_Reference_ID=192; +/** Set Lessor. +@param Lease_BPartner_ID The Business Partner who rents or leases */ +public void setLease_BPartner_ID (int Lease_BPartner_ID) +{ +if (Lease_BPartner_ID <= 0) set_Value ("Lease_BPartner_ID", null); + else +set_Value ("Lease_BPartner_ID", new Integer(Lease_BPartner_ID)); +} +/** Get Lessor. +@return The Business Partner who rents or leases */ +public int getLease_BPartner_ID() +{ +Integer ii = (Integer)get_Value("Lease_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Life use. +@param LifeUseUnits Units of use until the asset is not usable anymore */ +public void setLifeUseUnits (int LifeUseUnits) +{ +set_Value ("LifeUseUnits", new Integer(LifeUseUnits)); +} +/** Get Life use. +@return Units of use until the asset is not usable anymore */ +public int getLifeUseUnits() +{ +Integer ii = (Integer)get_Value("LifeUseUnits"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Location comment. +@param LocationComment Additional comments or remarks concerning the location */ +public void setLocationComment (String LocationComment) +{ +if (LocationComment != null && LocationComment.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LocationComment = LocationComment.substring(0,254); +} +set_Value ("LocationComment", LocationComment); +} +/** Get Location comment. +@return Additional comments or remarks concerning the location */ +public String getLocationComment() +{ +return (String)get_Value("LocationComment"); +} +/** Set Lot No. +@param Lot Lot number (alphanumeric) */ +public void setLot (String Lot) +{ +if (Lot != null && Lot.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Lot = Lot.substring(0,254); +} +set_Value ("Lot", Lot); +} +/** Get Lot No. +@return Lot number (alphanumeric) */ +public String getLot() +{ +return (String)get_Value("Lot"); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_Value ("M_InOutLine_ID", null); + else +set_Value ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID <= 0) set_Value ("M_Locator_ID", null); + else +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_ValueNoCheck ("M_Product_ID", null); + else +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Next Maintenence. +@param NextMaintenenceDate Next Maintenence Date */ +public void setNextMaintenenceDate (Timestamp NextMaintenenceDate) +{ +set_Value ("NextMaintenenceDate", NextMaintenenceDate); +} +/** Get Next Maintenence. +@return Next Maintenence Date */ +public Timestamp getNextMaintenenceDate() +{ +return (Timestamp)get_Value("NextMaintenenceDate"); +} +/** Set Next Unit. +@param NextMaintenenceUnit Next Maintenence Unit */ +public void setNextMaintenenceUnit (int NextMaintenenceUnit) +{ +set_Value ("NextMaintenenceUnit", new Integer(NextMaintenenceUnit)); +} +/** Get Next Unit. +@return Next Maintenence Unit */ +public int getNextMaintenenceUnit() +{ +Integer ii = (Integer)get_Value("NextMaintenenceUnit"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Serial No. +@param SerNo Product Serial Number */ +public void setSerNo (String SerNo) +{ +if (SerNo != null && SerNo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +SerNo = SerNo.substring(0,254); +} +set_Value ("SerNo", SerNo); +} +/** Get Serial No. +@return Product Serial Number */ +public String getSerNo() +{ +return (String)get_Value("SerNo"); +} +/** Set Usable Life - Months. +@param UseLifeMonths Months of the usable life of the asset */ +public void setUseLifeMonths (int UseLifeMonths) +{ +set_Value ("UseLifeMonths", new Integer(UseLifeMonths)); +} +/** Get Usable Life - Months. +@return Months of the usable life of the asset */ +public int getUseLifeMonths() +{ +Integer ii = (Integer)get_Value("UseLifeMonths"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Usable Life - Years. +@param UseLifeYears Years of the usable life of the asset */ +public void setUseLifeYears (int UseLifeYears) +{ +set_Value ("UseLifeYears", new Integer(UseLifeYears)); +} +/** Get Usable Life - Years. +@return Years of the usable life of the asset */ +public int getUseLifeYears() +{ +Integer ii = (Integer)get_Value("UseLifeYears"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Use units. +@param UseUnits Currently used units of the assets */ +public void setUseUnits (int UseUnits) +{ +set_ValueNoCheck ("UseUnits", new Integer(UseUnits)); +} +/** Get Use units. +@return Currently used units of the assets */ +public int getUseUnits() +{ +Integer ii = (Integer)get_Value("UseUnits"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Version No. +@param VersionNo Version Number */ +public void setVersionNo (String VersionNo) +{ +if (VersionNo != null && VersionNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +VersionNo = VersionNo.substring(0,19); +} +set_Value ("VersionNo", VersionNo); +} +/** Get Version No. +@return Version Number */ +public String getVersionNo() +{ +return (String)get_Value("VersionNo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_Asset_Delivery.java b/dbPort/src/org/compiere/model/X_A_Asset_Delivery.java new file mode 100644 index 0000000000..f0406ed596 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_Asset_Delivery.java @@ -0,0 +1,374 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_Asset_Delivery + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.25 */ +public class X_A_Asset_Delivery extends PO +{ +/** Standard Constructor +@param ctx context +@param A_Asset_Delivery_ID id +@param trxName transaction +*/ +public X_A_Asset_Delivery (Properties ctx, int A_Asset_Delivery_ID, String trxName) +{ +super (ctx, A_Asset_Delivery_ID, trxName); +/** if (A_Asset_Delivery_ID == 0) +{ +setA_Asset_Delivery_ID (0); +setA_Asset_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_Asset_Delivery (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=541 */ +public static final int Table_ID=541; + +/** TableName=A_Asset_Delivery */ +public static final String Table_Name="A_Asset_Delivery"; + +protected static KeyNamePair Model = new KeyNamePair(541,"A_Asset_Delivery"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_Asset_Delivery[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_ValueNoCheck ("AD_User_ID", null); + else +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset Delivery. +@param A_Asset_Delivery_ID Delivery of Asset */ +public void setA_Asset_Delivery_ID (int A_Asset_Delivery_ID) +{ +if (A_Asset_Delivery_ID < 1) throw new IllegalArgumentException ("A_Asset_Delivery_ID is mandatory."); +set_ValueNoCheck ("A_Asset_Delivery_ID", new Integer(A_Asset_Delivery_ID)); +} +/** Get Asset Delivery. +@return Delivery of Asset */ +public int getA_Asset_Delivery_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_Delivery_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID < 1) throw new IllegalArgumentException ("A_Asset_ID is mandatory."); +set_ValueNoCheck ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Delivery Confirmation. +@param DeliveryConfirmation EMail Delivery confirmation */ +public void setDeliveryConfirmation (String DeliveryConfirmation) +{ +if (DeliveryConfirmation != null && DeliveryConfirmation.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DeliveryConfirmation = DeliveryConfirmation.substring(0,119); +} +set_Value ("DeliveryConfirmation", DeliveryConfirmation); +} +/** Get Delivery Confirmation. +@return EMail Delivery confirmation */ +public String getDeliveryConfirmation() +{ +return (String)get_Value("DeliveryConfirmation"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_ValueNoCheck ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Lot No. +@param Lot Lot number (alphanumeric) */ +public void setLot (String Lot) +{ +if (Lot != null && Lot.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Lot = Lot.substring(0,39); +} +set_ValueNoCheck ("Lot", Lot); +} +/** Get Lot No. +@return Lot number (alphanumeric) */ +public String getLot() +{ +return (String)get_Value("Lot"); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_ValueNoCheck ("M_InOutLine_ID", null); + else +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Download. +@param M_ProductDownload_ID Product downloads */ +public void setM_ProductDownload_ID (int M_ProductDownload_ID) +{ +if (M_ProductDownload_ID <= 0) set_Value ("M_ProductDownload_ID", null); + else +set_Value ("M_ProductDownload_ID", new Integer(M_ProductDownload_ID)); +} +/** Get Product Download. +@return Product downloads */ +public int getM_ProductDownload_ID() +{ +Integer ii = (Integer)get_Value("M_ProductDownload_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Message ID. +@param MessageID EMail Message ID */ +public void setMessageID (String MessageID) +{ +if (MessageID != null && MessageID.length() > 120) +{ +log.warning("Length > 120 - truncated"); +MessageID = MessageID.substring(0,119); +} +set_ValueNoCheck ("MessageID", MessageID); +} +/** Get Message ID. +@return EMail Message ID */ +public String getMessageID() +{ +return (String)get_Value("MessageID"); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_ValueNoCheck ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getMovementDate())); +} +/** Set Referrer. +@param Referrer Referring web address */ +public void setReferrer (String Referrer) +{ +if (Referrer != null && Referrer.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Referrer = Referrer.substring(0,254); +} +set_ValueNoCheck ("Referrer", Referrer); +} +/** Get Referrer. +@return Referring web address */ +public String getReferrer() +{ +return (String)get_Value("Referrer"); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_ValueNoCheck ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Host = Remote_Host.substring(0,59); +} +set_ValueNoCheck ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Serial No. +@param SerNo Product Serial Number */ +public void setSerNo (String SerNo) +{ +if (SerNo != null && SerNo.length() > 40) +{ +log.warning("Length > 40 - truncated"); +SerNo = SerNo.substring(0,39); +} +set_ValueNoCheck ("SerNo", SerNo); +} +/** Get Serial No. +@return Product Serial Number */ +public String getSerNo() +{ +return (String)get_Value("SerNo"); +} +/** Set URL. +@param URL Full URL address - e.g. http://www.adempiere.org */ +public void setURL (String URL) +{ +if (URL != null && URL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +URL = URL.substring(0,119); +} +set_ValueNoCheck ("URL", URL); +} +/** Get URL. +@return Full URL address - e.g. http://www.adempiere.org */ +public String getURL() +{ +return (String)get_Value("URL"); +} +/** Set Version No. +@param VersionNo Version Number */ +public void setVersionNo (String VersionNo) +{ +if (VersionNo != null && VersionNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +VersionNo = VersionNo.substring(0,19); +} +set_ValueNoCheck ("VersionNo", VersionNo); +} +/** Get Version No. +@return Version Number */ +public String getVersionNo() +{ +return (String)get_Value("VersionNo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_Asset_Group.java b/dbPort/src/org/compiere/model/X_A_Asset_Group.java new file mode 100644 index 0000000000..5bdc38873b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_Asset_Group.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_Asset_Group + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.265 */ +public class X_A_Asset_Group extends PO +{ +/** Standard Constructor +@param ctx context +@param A_Asset_Group_ID id +@param trxName transaction +*/ +public X_A_Asset_Group (Properties ctx, int A_Asset_Group_ID, String trxName) +{ +super (ctx, A_Asset_Group_ID, trxName); +/** if (A_Asset_Group_ID == 0) +{ +setA_Asset_Group_ID (0); +setIsCreateAsActive (true); // Y +setIsDepreciated (false); +setIsOneAssetPerUOM (false); +setIsOwned (false); +setIsTrackIssues (false); // N +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_Asset_Group (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=542 */ +public static final int Table_ID=542; + +/** TableName=A_Asset_Group */ +public static final String Table_Name="A_Asset_Group"; + +protected static KeyNamePair Model = new KeyNamePair(542,"A_Asset_Group"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_Asset_Group[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Asset Group. +@param A_Asset_Group_ID Group of Assets */ +public void setA_Asset_Group_ID (int A_Asset_Group_ID) +{ +if (A_Asset_Group_ID < 1) throw new IllegalArgumentException ("A_Asset_Group_ID is mandatory."); +set_ValueNoCheck ("A_Asset_Group_ID", new Integer(A_Asset_Group_ID)); +} +/** Get Asset Group. +@return Group of Assets */ +public int getA_Asset_Group_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Create As Active. +@param IsCreateAsActive Create Asset and activate it */ +public void setIsCreateAsActive (boolean IsCreateAsActive) +{ +set_Value ("IsCreateAsActive", new Boolean(IsCreateAsActive)); +} +/** Get Create As Active. +@return Create Asset and activate it */ +public boolean isCreateAsActive() +{ +Object oo = get_Value("IsCreateAsActive"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Depreciate. +@param IsDepreciated The asset will be depreciated */ +public void setIsDepreciated (boolean IsDepreciated) +{ +set_Value ("IsDepreciated", new Boolean(IsDepreciated)); +} +/** Get Depreciate. +@return The asset will be depreciated */ +public boolean isDepreciated() +{ +Object oo = get_Value("IsDepreciated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set One Asset Per UOM. +@param IsOneAssetPerUOM Create one asset per UOM */ +public void setIsOneAssetPerUOM (boolean IsOneAssetPerUOM) +{ +set_Value ("IsOneAssetPerUOM", new Boolean(IsOneAssetPerUOM)); +} +/** Get One Asset Per UOM. +@return Create one asset per UOM */ +public boolean isOneAssetPerUOM() +{ +Object oo = get_Value("IsOneAssetPerUOM"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Owned. +@param IsOwned The asset is owned by the organization */ +public void setIsOwned (boolean IsOwned) +{ +set_Value ("IsOwned", new Boolean(IsOwned)); +} +/** Get Owned. +@return The asset is owned by the organization */ +public boolean isOwned() +{ +Object oo = get_Value("IsOwned"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Track Issues. +@param IsTrackIssues Enable tracking issues for this asset */ +public void setIsTrackIssues (boolean IsTrackIssues) +{ +set_Value ("IsTrackIssues", new Boolean(IsTrackIssues)); +} +/** Get Track Issues. +@return Enable tracking issues for this asset */ +public boolean isTrackIssues() +{ +Object oo = get_Value("IsTrackIssues"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_Asset_Retirement.java b/dbPort/src/org/compiere/model/X_A_Asset_Retirement.java new file mode 100644 index 0000000000..0de258d88d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_Asset_Retirement.java @@ -0,0 +1,173 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_Asset_Retirement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.281 */ +public class X_A_Asset_Retirement extends PO +{ +/** Standard Constructor +@param ctx context +@param A_Asset_Retirement_ID id +@param trxName transaction +*/ +public X_A_Asset_Retirement (Properties ctx, int A_Asset_Retirement_ID, String trxName) +{ +super (ctx, A_Asset_Retirement_ID, trxName); +/** if (A_Asset_Retirement_ID == 0) +{ +setA_Asset_ID (0); +setA_Asset_Retirement_ID (0); +setAssetMarketValueAmt (Env.ZERO); +setAssetValueAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_Asset_Retirement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=540 */ +public static final int Table_ID=540; + +/** TableName=A_Asset_Retirement */ +public static final String Table_Name="A_Asset_Retirement"; + +protected static KeyNamePair Model = new KeyNamePair(540,"A_Asset_Retirement"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_Asset_Retirement[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID < 1) throw new IllegalArgumentException ("A_Asset_ID is mandatory."); +set_ValueNoCheck ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset Retirement. +@param A_Asset_Retirement_ID Internally used asset is not longer used. */ +public void setA_Asset_Retirement_ID (int A_Asset_Retirement_ID) +{ +if (A_Asset_Retirement_ID < 1) throw new IllegalArgumentException ("A_Asset_Retirement_ID is mandatory."); +set_ValueNoCheck ("A_Asset_Retirement_ID", new Integer(A_Asset_Retirement_ID)); +} +/** Get Asset Retirement. +@return Internally used asset is not longer used. */ +public int getA_Asset_Retirement_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_Retirement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getA_Asset_Retirement_ID())); +} +/** Set Market value Amount. +@param AssetMarketValueAmt Market value of the asset */ +public void setAssetMarketValueAmt (BigDecimal AssetMarketValueAmt) +{ +if (AssetMarketValueAmt == null) throw new IllegalArgumentException ("AssetMarketValueAmt is mandatory."); +set_Value ("AssetMarketValueAmt", AssetMarketValueAmt); +} +/** Get Market value Amount. +@return Market value of the asset */ +public BigDecimal getAssetMarketValueAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("AssetMarketValueAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Asset value. +@param AssetValueAmt Book Value of the asset */ +public void setAssetValueAmt (BigDecimal AssetValueAmt) +{ +if (AssetValueAmt == null) throw new IllegalArgumentException ("AssetValueAmt is mandatory."); +set_Value ("AssetValueAmt", AssetValueAmt); +} +/** Get Asset value. +@return Book Value of the asset */ +public BigDecimal getAssetValueAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("AssetValueAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_Value ("C_InvoiceLine_ID", null); + else +set_Value ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_Registration.java b/dbPort/src/org/compiere/model/X_A_Registration.java new file mode 100644 index 0000000000..3d230ee301 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_Registration.java @@ -0,0 +1,366 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_Registration + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.296 */ +public class X_A_Registration extends PO +{ +/** Standard Constructor +@param ctx context +@param A_Registration_ID id +@param trxName transaction +*/ +public X_A_Registration (Properties ctx, int A_Registration_ID, String trxName) +{ +super (ctx, A_Registration_ID, trxName); +/** if (A_Registration_ID == 0) +{ +setA_Registration_ID (0); +setAssetServiceDate (new Timestamp(System.currentTimeMillis())); +setIsAllowPublish (false); +setIsInProduction (false); +setIsRegistered (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_Registration (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=651 */ +public static final int Table_ID=651; + +/** TableName=A_Registration */ +public static final String Table_Name="A_Registration"; + +protected static KeyNamePair Model = new KeyNamePair(651,"A_Registration"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_Registration[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Registration. +@param A_Registration_ID User Asset Registration */ +public void setA_Registration_ID (int A_Registration_ID) +{ +if (A_Registration_ID < 1) throw new IllegalArgumentException ("A_Registration_ID is mandatory."); +set_ValueNoCheck ("A_Registration_ID", new Integer(A_Registration_ID)); +} +/** Get Registration. +@return User Asset Registration */ +public int getA_Registration_ID() +{ +Integer ii = (Integer)get_Value("A_Registration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set In Service Date. +@param AssetServiceDate Date when Asset was put into service */ +public void setAssetServiceDate (Timestamp AssetServiceDate) +{ +if (AssetServiceDate == null) throw new IllegalArgumentException ("AssetServiceDate is mandatory."); +set_ValueNoCheck ("AssetServiceDate", AssetServiceDate); +} +/** Get In Service Date. +@return Date when Asset was put into service */ +public Timestamp getAssetServiceDate() +{ +return (Timestamp)get_Value("AssetServiceDate"); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Allowed to be Published. +@param IsAllowPublish You allow to publish the information, not just statistical summary info */ +public void setIsAllowPublish (boolean IsAllowPublish) +{ +set_Value ("IsAllowPublish", new Boolean(IsAllowPublish)); +} +/** Get Allowed to be Published. +@return You allow to publish the information, not just statistical summary info */ +public boolean isAllowPublish() +{ +Object oo = get_Value("IsAllowPublish"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Production. +@param IsInProduction The system is in production */ +public void setIsInProduction (boolean IsInProduction) +{ +set_Value ("IsInProduction", new Boolean(IsInProduction)); +} +/** Get In Production. +@return The system is in production */ +public boolean isInProduction() +{ +Object oo = get_Value("IsInProduction"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Registered. +@param IsRegistered The application is registered. */ +public void setIsRegistered (boolean IsRegistered) +{ +set_Value ("IsRegistered", new Boolean(IsRegistered)); +} +/** Get Registered. +@return The application is registered. */ +public boolean isRegistered() +{ +Object oo = get_Value("IsRegistered"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Note = Note.substring(0,1999); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_Value ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_Value ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_RegistrationAttribute.java b/dbPort/src/org/compiere/model/X_A_RegistrationAttribute.java new file mode 100644 index 0000000000..7d85a30365 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_RegistrationAttribute.java @@ -0,0 +1,236 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_RegistrationAttribute + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.312 */ +public class X_A_RegistrationAttribute extends PO +{ +/** Standard Constructor +@param ctx context +@param A_RegistrationAttribute_ID id +@param trxName transaction +*/ +public X_A_RegistrationAttribute (Properties ctx, int A_RegistrationAttribute_ID, String trxName) +{ +super (ctx, A_RegistrationAttribute_ID, trxName); +/** if (A_RegistrationAttribute_ID == 0) +{ +setAD_Reference_ID (0); +setA_RegistrationAttribute_ID (0); +setIsSelfService (true); // Y +setName (null); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_RegistrationAttribute (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=652 */ +public static final int Table_ID=652; + +/** TableName=A_RegistrationAttribute */ +public static final String Table_Name="A_RegistrationAttribute"; + +protected static KeyNamePair Model = new KeyNamePair(652,"A_RegistrationAttribute"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_RegistrationAttribute[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Reference_ID AD_Reference_ID=1 */ +public static final int AD_REFERENCE_ID_AD_Reference_ID=1; +/** Set Reference. +@param AD_Reference_ID System Reference and Validation */ +public void setAD_Reference_ID (int AD_Reference_ID) +{ +if (AD_Reference_ID < 1) throw new IllegalArgumentException ("AD_Reference_ID is mandatory."); +set_Value ("AD_Reference_ID", new Integer(AD_Reference_ID)); +} +/** Get Reference. +@return System Reference and Validation */ +public int getAD_Reference_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Reference_Value_ID AD_Reference_ID=4 */ +public static final int AD_REFERENCE_VALUE_ID_AD_Reference_ID=4; +/** Set Reference Key. +@param AD_Reference_Value_ID Required to specify, if data type is Table or List */ +public void setAD_Reference_Value_ID (int AD_Reference_Value_ID) +{ +if (AD_Reference_Value_ID <= 0) set_Value ("AD_Reference_Value_ID", null); + else +set_Value ("AD_Reference_Value_ID", new Integer(AD_Reference_Value_ID)); +} +/** Get Reference Key. +@return Required to specify, if data type is Table or List */ +public int getAD_Reference_Value_ID() +{ +Integer ii = (Integer)get_Value("AD_Reference_Value_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Registration Attribute. +@param A_RegistrationAttribute_ID Asset Registration Attribute */ +public void setA_RegistrationAttribute_ID (int A_RegistrationAttribute_ID) +{ +if (A_RegistrationAttribute_ID < 1) throw new IllegalArgumentException ("A_RegistrationAttribute_ID is mandatory."); +set_ValueNoCheck ("A_RegistrationAttribute_ID", new Integer(A_RegistrationAttribute_ID)); +} +/** Get Registration Attribute. +@return Asset Registration Attribute */ +public int getA_RegistrationAttribute_ID() +{ +Integer ii = (Integer)get_Value("A_RegistrationAttribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set DB Column Name. +@param ColumnName Name of the column in the database */ +public void setColumnName (String ColumnName) +{ +if (ColumnName != null && ColumnName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ColumnName = ColumnName.substring(0,39); +} +set_Value ("ColumnName", ColumnName); +} +/** Get DB Column Name. +@return Name of the column in the database */ +public String getColumnName() +{ +return (String)get_Value("ColumnName"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_RegistrationProduct.java b/dbPort/src/org/compiere/model/X_A_RegistrationProduct.java new file mode 100644 index 0000000000..2f0451610e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_RegistrationProduct.java @@ -0,0 +1,136 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_RegistrationProduct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.328 */ +public class X_A_RegistrationProduct extends PO +{ +/** Standard Constructor +@param ctx context +@param A_RegistrationProduct_ID id +@param trxName transaction +*/ +public X_A_RegistrationProduct (Properties ctx, int A_RegistrationProduct_ID, String trxName) +{ +super (ctx, A_RegistrationProduct_ID, trxName); +/** if (A_RegistrationProduct_ID == 0) +{ +setA_RegistrationAttribute_ID (0); +setM_Product_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_RegistrationProduct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=715 */ +public static final int Table_ID=715; + +/** TableName=A_RegistrationProduct */ +public static final String Table_Name="A_RegistrationProduct"; + +protected static KeyNamePair Model = new KeyNamePair(715,"A_RegistrationProduct"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_RegistrationProduct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Registration Attribute. +@param A_RegistrationAttribute_ID Asset Registration Attribute */ +public void setA_RegistrationAttribute_ID (int A_RegistrationAttribute_ID) +{ +if (A_RegistrationAttribute_ID < 1) throw new IllegalArgumentException ("A_RegistrationAttribute_ID is mandatory."); +set_ValueNoCheck ("A_RegistrationAttribute_ID", new Integer(A_RegistrationAttribute_ID)); +} +/** Get Registration Attribute. +@return Asset Registration Attribute */ +public int getA_RegistrationAttribute_ID() +{ +Integer ii = (Integer)get_Value("A_RegistrationAttribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_A_RegistrationValue.java b/dbPort/src/org/compiere/model/X_A_RegistrationValue.java new file mode 100644 index 0000000000..c561d39600 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_A_RegistrationValue.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for A_RegistrationValue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.343 */ +public class X_A_RegistrationValue extends PO +{ +/** Standard Constructor +@param ctx context +@param A_RegistrationValue_ID id +@param trxName transaction +*/ +public X_A_RegistrationValue (Properties ctx, int A_RegistrationValue_ID, String trxName) +{ +super (ctx, A_RegistrationValue_ID, trxName); +/** if (A_RegistrationValue_ID == 0) +{ +setA_RegistrationAttribute_ID (0); +setA_Registration_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_A_RegistrationValue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=653 */ +public static final int Table_ID=653; + +/** TableName=A_RegistrationValue */ +public static final String Table_Name="A_RegistrationValue"; + +protected static KeyNamePair Model = new KeyNamePair(653,"A_RegistrationValue"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_A_RegistrationValue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Registration Attribute. +@param A_RegistrationAttribute_ID Asset Registration Attribute */ +public void setA_RegistrationAttribute_ID (int A_RegistrationAttribute_ID) +{ +if (A_RegistrationAttribute_ID < 1) throw new IllegalArgumentException ("A_RegistrationAttribute_ID is mandatory."); +set_ValueNoCheck ("A_RegistrationAttribute_ID", new Integer(A_RegistrationAttribute_ID)); +} +/** Get Registration Attribute. +@return Asset Registration Attribute */ +public int getA_RegistrationAttribute_ID() +{ +Integer ii = (Integer)get_Value("A_RegistrationAttribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getA_RegistrationAttribute_ID())); +} +/** Set Registration. +@param A_Registration_ID User Asset Registration */ +public void setA_Registration_ID (int A_Registration_ID) +{ +if (A_Registration_ID < 1) throw new IllegalArgumentException ("A_Registration_ID is mandatory."); +set_ValueNoCheck ("A_Registration_ID", new Integer(A_Registration_ID)); +} +/** Get Registration. +@return User Asset Registration */ +public int getA_Registration_ID() +{ +Integer ii = (Integer)get_Value("A_Registration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_Bid.java b/dbPort/src/org/compiere/model/X_B_Bid.java new file mode 100644 index 0000000000..0215c0e9fe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_Bid.java @@ -0,0 +1,229 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_Bid + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.359 */ +public class X_B_Bid extends PO +{ +/** Standard Constructor +@param ctx context +@param B_Bid_ID id +@param trxName transaction +*/ +public X_B_Bid (Properties ctx, int B_Bid_ID, String trxName) +{ +super (ctx, B_Bid_ID, trxName); +/** if (B_Bid_ID == 0) +{ +setAD_User_ID (0); +setB_Bid_ID (0); +setB_BuyerFunds_ID (0); +setB_Topic_ID (0); +setIsWillingToCommit (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_Bid (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=686 */ +public static final int Table_ID=686; + +/** TableName=B_Bid */ +public static final String Table_Name="B_Bid"; + +protected static KeyNamePair Model = new KeyNamePair(686,"B_Bid"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_Bid[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bid. +@param B_Bid_ID Bid for a Topic */ +public void setB_Bid_ID (int B_Bid_ID) +{ +if (B_Bid_ID < 1) throw new IllegalArgumentException ("B_Bid_ID is mandatory."); +set_ValueNoCheck ("B_Bid_ID", new Integer(B_Bid_ID)); +} +/** Get Bid. +@return Bid for a Topic */ +public int getB_Bid_ID() +{ +Integer ii = (Integer)get_Value("B_Bid_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Buyer Funds. +@param B_BuyerFunds_ID Buyer Funds for Bids on Topics */ +public void setB_BuyerFunds_ID (int B_BuyerFunds_ID) +{ +if (B_BuyerFunds_ID < 1) throw new IllegalArgumentException ("B_BuyerFunds_ID is mandatory."); +set_Value ("B_BuyerFunds_ID", new Integer(B_BuyerFunds_ID)); +} +/** Get Buyer Funds. +@return Buyer Funds for Bids on Topics */ +public int getB_BuyerFunds_ID() +{ +Integer ii = (Integer)get_Value("B_BuyerFunds_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Topic. +@param B_Topic_ID Auction Topic */ +public void setB_Topic_ID (int B_Topic_ID) +{ +if (B_Topic_ID < 1) throw new IllegalArgumentException ("B_Topic_ID is mandatory."); +set_Value ("B_Topic_ID", new Integer(B_Topic_ID)); +} +/** Get Topic. +@return Auction Topic */ +public int getB_Topic_ID() +{ +Integer ii = (Integer)get_Value("B_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Willing to commit. +@param IsWillingToCommit Willing to commit */ +public void setIsWillingToCommit (boolean IsWillingToCommit) +{ +set_Value ("IsWillingToCommit", new Boolean(IsWillingToCommit)); +} +/** Get Willing to commit. +@return Willing to commit */ +public boolean isWillingToCommit() +{ +Object oo = get_Value("IsWillingToCommit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Private Note. +@param PrivateNote Private Note - not visible to the other parties */ +public void setPrivateNote (String PrivateNote) +{ +if (PrivateNote != null && PrivateNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +PrivateNote = PrivateNote.substring(0,1999); +} +set_Value ("PrivateNote", PrivateNote); +} +/** Get Private Note. +@return Private Note - not visible to the other parties */ +public String getPrivateNote() +{ +return (String)get_Value("PrivateNote"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_BidComment.java b/dbPort/src/org/compiere/model/X_B_BidComment.java new file mode 100644 index 0000000000..ac485f1a04 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_BidComment.java @@ -0,0 +1,154 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_BidComment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.375 */ +public class X_B_BidComment extends PO +{ +/** Standard Constructor +@param ctx context +@param B_BidComment_ID id +@param trxName transaction +*/ +public X_B_BidComment (Properties ctx, int B_BidComment_ID, String trxName) +{ +super (ctx, B_BidComment_ID, trxName); +/** if (B_BidComment_ID == 0) +{ +setAD_User_ID (0); +setB_BidComment_ID (0); +setB_Topic_ID (0); +setTextMsg (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_BidComment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=685 */ +public static final int Table_ID=685; + +/** TableName=B_BidComment */ +public static final String Table_Name="B_BidComment"; + +protected static KeyNamePair Model = new KeyNamePair(685,"B_BidComment"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_BidComment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bid Comment. +@param B_BidComment_ID Make a comment to a Bid Topic */ +public void setB_BidComment_ID (int B_BidComment_ID) +{ +if (B_BidComment_ID < 1) throw new IllegalArgumentException ("B_BidComment_ID is mandatory."); +set_ValueNoCheck ("B_BidComment_ID", new Integer(B_BidComment_ID)); +} +/** Get Bid Comment. +@return Make a comment to a Bid Topic */ +public int getB_BidComment_ID() +{ +Integer ii = (Integer)get_Value("B_BidComment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Topic. +@param B_Topic_ID Auction Topic */ +public void setB_Topic_ID (int B_Topic_ID) +{ +if (B_Topic_ID < 1) throw new IllegalArgumentException ("B_Topic_ID is mandatory."); +set_Value ("B_Topic_ID", new Integer(B_Topic_ID)); +} +/** Get Topic. +@return Auction Topic */ +public int getB_Topic_ID() +{ +Integer ii = (Integer)get_Value("B_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg == null) throw new IllegalArgumentException ("TextMsg is mandatory."); +if (TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_Buyer.java b/dbPort/src/org/compiere/model/X_B_Buyer.java new file mode 100644 index 0000000000..0a0f52b9de --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_Buyer.java @@ -0,0 +1,159 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_Buyer + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.39 */ +public class X_B_Buyer extends PO +{ +/** Standard Constructor +@param ctx context +@param B_Buyer_ID id +@param trxName transaction +*/ +public X_B_Buyer (Properties ctx, int B_Buyer_ID, String trxName) +{ +super (ctx, B_Buyer_ID, trxName); +/** if (B_Buyer_ID == 0) +{ +setAD_User_ID (0); +setName (null); +setValidTo (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_Buyer (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=684 */ +public static final int Table_ID=684; + +/** TableName=B_Buyer */ +public static final String Table_Name="B_Buyer"; + +protected static KeyNamePair Model = new KeyNamePair(684,"B_Buyer"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_Buyer[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +if (ValidTo == null) throw new IllegalArgumentException ("ValidTo is mandatory."); +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_BuyerFunds.java b/dbPort/src/org/compiere/model/X_B_BuyerFunds.java new file mode 100644 index 0000000000..1488fbef36 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_BuyerFunds.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_BuyerFunds + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.39 */ +public class X_B_BuyerFunds extends PO +{ +/** Standard Constructor +@param ctx context +@param B_BuyerFunds_ID id +@param trxName transaction +*/ +public X_B_BuyerFunds (Properties ctx, int B_BuyerFunds_ID, String trxName) +{ +super (ctx, B_BuyerFunds_ID, trxName); +/** if (B_BuyerFunds_ID == 0) +{ +setAD_User_ID (0); +setB_BuyerFunds_ID (0); +setCommittedAmt (Env.ZERO); +setNonCommittedAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_BuyerFunds (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=683 */ +public static final int Table_ID=683; + +/** TableName=B_BuyerFunds */ +public static final String Table_Name="B_BuyerFunds"; + +protected static KeyNamePair Model = new KeyNamePair(683,"B_BuyerFunds"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_BuyerFunds[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +/** Set Buyer Funds. +@param B_BuyerFunds_ID Buyer Funds for Bids on Topics */ +public void setB_BuyerFunds_ID (int B_BuyerFunds_ID) +{ +if (B_BuyerFunds_ID < 1) throw new IllegalArgumentException ("B_BuyerFunds_ID is mandatory."); +set_ValueNoCheck ("B_BuyerFunds_ID", new Integer(B_BuyerFunds_ID)); +} +/** Get Buyer Funds. +@return Buyer Funds for Bids on Topics */ +public int getB_BuyerFunds_ID() +{ +Integer ii = (Integer)get_Value("B_BuyerFunds_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_ValueNoCheck ("C_Payment_ID", null); + else +set_ValueNoCheck ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Committed Amount. +@param CommittedAmt The (legal) commitment amount */ +public void setCommittedAmt (BigDecimal CommittedAmt) +{ +if (CommittedAmt == null) throw new IllegalArgumentException ("CommittedAmt is mandatory."); +set_Value ("CommittedAmt", CommittedAmt); +} +/** Get Committed Amount. +@return The (legal) commitment amount */ +public BigDecimal getCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Not Committed Aount. +@param NonCommittedAmt Amount not committed yet */ +public void setNonCommittedAmt (BigDecimal NonCommittedAmt) +{ +if (NonCommittedAmt == null) throw new IllegalArgumentException ("NonCommittedAmt is mandatory."); +set_Value ("NonCommittedAmt", NonCommittedAmt); +} +/** Get Not Committed Aount. +@return Amount not committed yet */ +public BigDecimal getNonCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("NonCommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_B_Offer.java b/dbPort/src/org/compiere/model/X_B_Offer.java new file mode 100644 index 0000000000..266e63c349 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_Offer.java @@ -0,0 +1,229 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_Offer + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.406 */ +public class X_B_Offer extends PO +{ +/** Standard Constructor +@param ctx context +@param B_Offer_ID id +@param trxName transaction +*/ +public X_B_Offer (Properties ctx, int B_Offer_ID, String trxName) +{ +super (ctx, B_Offer_ID, trxName); +/** if (B_Offer_ID == 0) +{ +setAD_User_ID (0); +setB_Offer_ID (0); +setB_SellerFunds_ID (0); +setB_Topic_ID (0); +setIsWillingToCommit (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_Offer (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=682 */ +public static final int Table_ID=682; + +/** TableName=B_Offer */ +public static final String Table_Name="B_Offer"; + +protected static KeyNamePair Model = new KeyNamePair(682,"B_Offer"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_Offer[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Offer. +@param B_Offer_ID Offer for a Topic */ +public void setB_Offer_ID (int B_Offer_ID) +{ +if (B_Offer_ID < 1) throw new IllegalArgumentException ("B_Offer_ID is mandatory."); +set_ValueNoCheck ("B_Offer_ID", new Integer(B_Offer_ID)); +} +/** Get Offer. +@return Offer for a Topic */ +public int getB_Offer_ID() +{ +Integer ii = (Integer)get_Value("B_Offer_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Seller Funds. +@param B_SellerFunds_ID Seller Funds from Offers on Topics */ +public void setB_SellerFunds_ID (int B_SellerFunds_ID) +{ +if (B_SellerFunds_ID < 1) throw new IllegalArgumentException ("B_SellerFunds_ID is mandatory."); +set_Value ("B_SellerFunds_ID", new Integer(B_SellerFunds_ID)); +} +/** Get Seller Funds. +@return Seller Funds from Offers on Topics */ +public int getB_SellerFunds_ID() +{ +Integer ii = (Integer)get_Value("B_SellerFunds_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Topic. +@param B_Topic_ID Auction Topic */ +public void setB_Topic_ID (int B_Topic_ID) +{ +if (B_Topic_ID < 1) throw new IllegalArgumentException ("B_Topic_ID is mandatory."); +set_Value ("B_Topic_ID", new Integer(B_Topic_ID)); +} +/** Get Topic. +@return Auction Topic */ +public int getB_Topic_ID() +{ +Integer ii = (Integer)get_Value("B_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Willing to commit. +@param IsWillingToCommit Willing to commit */ +public void setIsWillingToCommit (boolean IsWillingToCommit) +{ +set_Value ("IsWillingToCommit", new Boolean(IsWillingToCommit)); +} +/** Get Willing to commit. +@return Willing to commit */ +public boolean isWillingToCommit() +{ +Object oo = get_Value("IsWillingToCommit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Private Note. +@param PrivateNote Private Note - not visible to the other parties */ +public void setPrivateNote (String PrivateNote) +{ +if (PrivateNote != null && PrivateNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +PrivateNote = PrivateNote.substring(0,1999); +} +set_Value ("PrivateNote", PrivateNote); +} +/** Get Private Note. +@return Private Note - not visible to the other parties */ +public String getPrivateNote() +{ +return (String)get_Value("PrivateNote"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_Seller.java b/dbPort/src/org/compiere/model/X_B_Seller.java new file mode 100644 index 0000000000..a2420d933a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_Seller.java @@ -0,0 +1,178 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_Seller + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.421 */ +public class X_B_Seller extends PO +{ +/** Standard Constructor +@param ctx context +@param B_Seller_ID id +@param trxName transaction +*/ +public X_B_Seller (Properties ctx, int B_Seller_ID, String trxName) +{ +super (ctx, B_Seller_ID, trxName); +/** if (B_Seller_ID == 0) +{ +setAD_User_ID (0); +setIsInternal (false); +setName (null); +setValidTo (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_Seller (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=681 */ +public static final int Table_ID=681; + +/** TableName=B_Seller */ +public static final String Table_Name="B_Seller"; + +protected static KeyNamePair Model = new KeyNamePair(681,"B_Seller"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_Seller[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Internal. +@param IsInternal Internal Organization */ +public void setIsInternal (boolean IsInternal) +{ +set_Value ("IsInternal", new Boolean(IsInternal)); +} +/** Get Internal. +@return Internal Organization */ +public boolean isInternal() +{ +Object oo = get_Value("IsInternal"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +if (ValidTo == null) throw new IllegalArgumentException ("ValidTo is mandatory."); +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_SellerFunds.java b/dbPort/src/org/compiere/model/X_B_SellerFunds.java new file mode 100644 index 0000000000..c11e48267d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_SellerFunds.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_SellerFunds + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.437 */ +public class X_B_SellerFunds extends PO +{ +/** Standard Constructor +@param ctx context +@param B_SellerFunds_ID id +@param trxName transaction +*/ +public X_B_SellerFunds (Properties ctx, int B_SellerFunds_ID, String trxName) +{ +super (ctx, B_SellerFunds_ID, trxName); +/** if (B_SellerFunds_ID == 0) +{ +setAD_User_ID (0); +setB_SellerFunds_ID (0); +setCommittedAmt (Env.ZERO); +setNonCommittedAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_SellerFunds (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=680 */ +public static final int Table_ID=680; + +/** TableName=B_SellerFunds */ +public static final String Table_Name="B_SellerFunds"; + +protected static KeyNamePair Model = new KeyNamePair(680,"B_SellerFunds"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_SellerFunds[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +/** Set Seller Funds. +@param B_SellerFunds_ID Seller Funds from Offers on Topics */ +public void setB_SellerFunds_ID (int B_SellerFunds_ID) +{ +if (B_SellerFunds_ID < 1) throw new IllegalArgumentException ("B_SellerFunds_ID is mandatory."); +set_ValueNoCheck ("B_SellerFunds_ID", new Integer(B_SellerFunds_ID)); +} +/** Get Seller Funds. +@return Seller Funds from Offers on Topics */ +public int getB_SellerFunds_ID() +{ +Integer ii = (Integer)get_Value("B_SellerFunds_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Committed Amount. +@param CommittedAmt The (legal) commitment amount */ +public void setCommittedAmt (BigDecimal CommittedAmt) +{ +if (CommittedAmt == null) throw new IllegalArgumentException ("CommittedAmt is mandatory."); +set_Value ("CommittedAmt", CommittedAmt); +} +/** Get Committed Amount. +@return The (legal) commitment amount */ +public BigDecimal getCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Not Committed Aount. +@param NonCommittedAmt Amount not committed yet */ +public void setNonCommittedAmt (BigDecimal NonCommittedAmt) +{ +if (NonCommittedAmt == null) throw new IllegalArgumentException ("NonCommittedAmt is mandatory."); +set_Value ("NonCommittedAmt", NonCommittedAmt); +} +/** Get Not Committed Aount. +@return Amount not committed yet */ +public BigDecimal getNonCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("NonCommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_B_Topic.java b/dbPort/src/org/compiere/model/X_B_Topic.java new file mode 100644 index 0000000000..09bd5035d5 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_Topic.java @@ -0,0 +1,338 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_Topic + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.437 */ +public class X_B_Topic extends PO +{ +/** Standard Constructor +@param ctx context +@param B_Topic_ID id +@param trxName transaction +*/ +public X_B_Topic (Properties ctx, int B_Topic_ID, String trxName) +{ +super (ctx, B_Topic_ID, trxName); +/** if (B_Topic_ID == 0) +{ +setB_TopicCategory_ID (0); +setB_TopicType_ID (0); +setB_Topic_ID (0); +setDecisionDate (new Timestamp(System.currentTimeMillis())); +setDocumentNo (null); +setIsPublished (false); +setName (null); +setProcessed (false); +setTopicAction (null); +setTopicStatus (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_Topic (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=679 */ +public static final int Table_ID=679; + +/** TableName=B_Topic */ +public static final String Table_Name="B_Topic"; + +protected static KeyNamePair Model = new KeyNamePair(679,"B_Topic"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_Topic[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Topic Category. +@param B_TopicCategory_ID Auction Topic Category */ +public void setB_TopicCategory_ID (int B_TopicCategory_ID) +{ +if (B_TopicCategory_ID < 1) throw new IllegalArgumentException ("B_TopicCategory_ID is mandatory."); +set_ValueNoCheck ("B_TopicCategory_ID", new Integer(B_TopicCategory_ID)); +} +/** Get Topic Category. +@return Auction Topic Category */ +public int getB_TopicCategory_ID() +{ +Integer ii = (Integer)get_Value("B_TopicCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Topic Type. +@param B_TopicType_ID Auction Topic Type */ +public void setB_TopicType_ID (int B_TopicType_ID) +{ +if (B_TopicType_ID < 1) throw new IllegalArgumentException ("B_TopicType_ID is mandatory."); +set_ValueNoCheck ("B_TopicType_ID", new Integer(B_TopicType_ID)); +} +/** Get Topic Type. +@return Auction Topic Type */ +public int getB_TopicType_ID() +{ +Integer ii = (Integer)get_Value("B_TopicType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Topic. +@param B_Topic_ID Auction Topic */ +public void setB_Topic_ID (int B_Topic_ID) +{ +if (B_Topic_ID < 1) throw new IllegalArgumentException ("B_Topic_ID is mandatory."); +set_ValueNoCheck ("B_Topic_ID", new Integer(B_Topic_ID)); +} +/** Get Topic. +@return Auction Topic */ +public int getB_Topic_ID() +{ +Integer ii = (Integer)get_Value("B_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Decision date. +@param DecisionDate Decision date */ +public void setDecisionDate (Timestamp DecisionDate) +{ +if (DecisionDate == null) throw new IllegalArgumentException ("DecisionDate is mandatory."); +set_Value ("DecisionDate", DecisionDate); +} +/** Get Decision date. +@return Decision date */ +public Timestamp getDecisionDate() +{ +return (Timestamp)get_Value("DecisionDate"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set Published. +@param IsPublished The Topic is published and can be viewed */ +public void setIsPublished (boolean IsPublished) +{ +set_Value ("IsPublished", new Boolean(IsPublished)); +} +/** Get Published. +@return The Topic is published and can be viewed */ +public boolean isPublished() +{ +Object oo = get_Value("IsPublished"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Details. +@param TextDetails Details */ +public void setTextDetails (String TextDetails) +{ +if (TextDetails != null && TextDetails.length() > 4000) +{ +log.warning("Length > 4000 - truncated"); +TextDetails = TextDetails.substring(0,3999); +} +set_Value ("TextDetails", TextDetails); +} +/** Get Details. +@return Details */ +public String getTextDetails() +{ +return (String)get_Value("TextDetails"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +/** Set Topic Action. +@param TopicAction Topic Action */ +public void setTopicAction (String TopicAction) +{ +if (TopicAction == null) throw new IllegalArgumentException ("TopicAction is mandatory."); +if (TopicAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +TopicAction = TopicAction.substring(0,1); +} +set_Value ("TopicAction", TopicAction); +} +/** Get Topic Action. +@return Topic Action */ +public String getTopicAction() +{ +return (String)get_Value("TopicAction"); +} +/** Set Topic Status. +@param TopicStatus Topic Status */ +public void setTopicStatus (String TopicStatus) +{ +if (TopicStatus == null) throw new IllegalArgumentException ("TopicStatus is mandatory."); +if (TopicStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +TopicStatus = TopicStatus.substring(0,1); +} +set_Value ("TopicStatus", TopicStatus); +} +/** Get Topic Status. +@return Topic Status */ +public String getTopicStatus() +{ +return (String)get_Value("TopicStatus"); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_TopicCategory.java b/dbPort/src/org/compiere/model/X_B_TopicCategory.java new file mode 100644 index 0000000000..f118954a01 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_TopicCategory.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_TopicCategory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.468 */ +public class X_B_TopicCategory extends PO +{ +/** Standard Constructor +@param ctx context +@param B_TopicCategory_ID id +@param trxName transaction +*/ +public X_B_TopicCategory (Properties ctx, int B_TopicCategory_ID, String trxName) +{ +super (ctx, B_TopicCategory_ID, trxName); +/** if (B_TopicCategory_ID == 0) +{ +setB_TopicCategory_ID (0); +setB_TopicType_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_TopicCategory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=691 */ +public static final int Table_ID=691; + +/** TableName=B_TopicCategory */ +public static final String Table_Name="B_TopicCategory"; + +protected static KeyNamePair Model = new KeyNamePair(691,"B_TopicCategory"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_TopicCategory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Topic Category. +@param B_TopicCategory_ID Auction Topic Category */ +public void setB_TopicCategory_ID (int B_TopicCategory_ID) +{ +if (B_TopicCategory_ID < 1) throw new IllegalArgumentException ("B_TopicCategory_ID is mandatory."); +set_ValueNoCheck ("B_TopicCategory_ID", new Integer(B_TopicCategory_ID)); +} +/** Get Topic Category. +@return Auction Topic Category */ +public int getB_TopicCategory_ID() +{ +Integer ii = (Integer)get_Value("B_TopicCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Topic Type. +@param B_TopicType_ID Auction Topic Type */ +public void setB_TopicType_ID (int B_TopicType_ID) +{ +if (B_TopicType_ID < 1) throw new IllegalArgumentException ("B_TopicType_ID is mandatory."); +set_ValueNoCheck ("B_TopicType_ID", new Integer(B_TopicType_ID)); +} +/** Get Topic Type. +@return Auction Topic Type */ +public int getB_TopicType_ID() +{ +Integer ii = (Integer)get_Value("B_TopicType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_B_TopicType.java b/dbPort/src/org/compiere/model/X_B_TopicType.java new file mode 100644 index 0000000000..e5bcd8f3a2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_B_TopicType.java @@ -0,0 +1,232 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for B_TopicType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.484 */ +public class X_B_TopicType extends PO +{ +/** Standard Constructor +@param ctx context +@param B_TopicType_ID id +@param trxName transaction +*/ +public X_B_TopicType (Properties ctx, int B_TopicType_ID, String trxName) +{ +super (ctx, B_TopicType_ID, trxName); +/** if (B_TopicType_ID == 0) +{ +setAuctionType (null); +setB_TopicType_ID (0); +setM_PriceList_ID (0); +setM_ProductMember_ID (0); +setM_Product_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_B_TopicType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=690 */ +public static final int Table_ID=690; + +/** TableName=B_TopicType */ +public static final String Table_Name="B_TopicType"; + +protected static KeyNamePair Model = new KeyNamePair(690,"B_TopicType"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_B_TopicType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Auction Type. +@param AuctionType Auction Type */ +public void setAuctionType (String AuctionType) +{ +if (AuctionType == null) throw new IllegalArgumentException ("AuctionType is mandatory."); +if (AuctionType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AuctionType = AuctionType.substring(0,0); +} +set_Value ("AuctionType", AuctionType); +} +/** Get Auction Type. +@return Auction Type */ +public String getAuctionType() +{ +return (String)get_Value("AuctionType"); +} +/** Set Topic Type. +@param B_TopicType_ID Auction Topic Type */ +public void setB_TopicType_ID (int B_TopicType_ID) +{ +if (B_TopicType_ID < 1) throw new IllegalArgumentException ("B_TopicType_ID is mandatory."); +set_ValueNoCheck ("B_TopicType_ID", new Integer(B_TopicType_ID)); +} +/** Get Topic Type. +@return Auction Topic Type */ +public int getB_TopicType_ID() +{ +Integer ii = (Integer)get_Value("B_TopicType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_ProductMember_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTMEMBER_ID_AD_Reference_ID=162; +/** Set Membership. +@param M_ProductMember_ID Product used to deternine the price of the membership for the topic type */ +public void setM_ProductMember_ID (int M_ProductMember_ID) +{ +if (M_ProductMember_ID < 1) throw new IllegalArgumentException ("M_ProductMember_ID is mandatory."); +set_Value ("M_ProductMember_ID", new Integer(M_ProductMember_ID)); +} +/** Get Membership. +@return Product used to deternine the price of the membership for the topic type */ +public int getM_ProductMember_ID() +{ +Integer ii = (Integer)get_Value("M_ProductMember_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessContainer.java b/dbPort/src/org/compiere/model/X_CM_AccessContainer.java new file mode 100644 index 0000000000..28a0b1a26e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessContainer.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessContainer + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.5 */ +public class X_CM_AccessContainer extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessContainer_ID id +@param trxName transaction +*/ +public X_CM_AccessContainer (Properties ctx, int CM_AccessContainer_ID, String trxName) +{ +super (ctx, CM_AccessContainer_ID, trxName); +/** if (CM_AccessContainer_ID == 0) +{ +setCM_AccessProfile_ID (0); +setCM_Container_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessContainer (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=888 */ +public static final int Table_ID=888; + +/** TableName=CM_AccessContainer */ +public static final String Table_Name="CM_AccessContainer"; + +protected static KeyNamePair Model = new KeyNamePair(888,"CM_AccessContainer"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessContainer[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID < 1) throw new IllegalArgumentException ("CM_Container_ID is mandatory."); +set_ValueNoCheck ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessListBPGroup.java b/dbPort/src/org/compiere/model/X_CM_AccessListBPGroup.java new file mode 100644 index 0000000000..c924206d0c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessListBPGroup.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessListBPGroup + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.515 */ +public class X_CM_AccessListBPGroup extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessListBPGroup_ID id +@param trxName transaction +*/ +public X_CM_AccessListBPGroup (Properties ctx, int CM_AccessListBPGroup_ID, String trxName) +{ +super (ctx, CM_AccessListBPGroup_ID, trxName); +/** if (CM_AccessListBPGroup_ID == 0) +{ +setCM_AccessProfile_ID (0); +setC_BP_Group_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessListBPGroup (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=886 */ +public static final int Table_ID=886; + +/** TableName=CM_AccessListBPGroup */ +public static final String Table_Name="CM_AccessListBPGroup"; + +protected static KeyNamePair Model = new KeyNamePair(886,"CM_AccessListBPGroup"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessListBPGroup[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID < 1) throw new IllegalArgumentException ("C_BP_Group_ID is mandatory."); +set_ValueNoCheck ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessListRole.java b/dbPort/src/org/compiere/model/X_CM_AccessListRole.java new file mode 100644 index 0000000000..3f06a00105 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessListRole.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessListRole + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.531 */ +public class X_CM_AccessListRole extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessListRole_ID id +@param trxName transaction +*/ +public X_CM_AccessListRole (Properties ctx, int CM_AccessListRole_ID, String trxName) +{ +super (ctx, CM_AccessListRole_ID, trxName); +/** if (CM_AccessListRole_ID == 0) +{ +setAD_Role_ID (0); +setCM_AccessProfile_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessListRole (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=887 */ +public static final int Table_ID=887; + +/** TableName=CM_AccessListRole */ +public static final String Table_Name="CM_AccessListRole"; + +protected static KeyNamePair Model = new KeyNamePair(887,"CM_AccessListRole"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessListRole[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID < 0) throw new IllegalArgumentException ("AD_Role_ID is mandatory."); +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessMedia.java b/dbPort/src/org/compiere/model/X_CM_AccessMedia.java new file mode 100644 index 0000000000..dca6182170 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessMedia.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessMedia + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.531 */ +public class X_CM_AccessMedia extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessMedia_ID id +@param trxName transaction +*/ +public X_CM_AccessMedia (Properties ctx, int CM_AccessMedia_ID, String trxName) +{ +super (ctx, CM_AccessMedia_ID, trxName); +/** if (CM_AccessMedia_ID == 0) +{ +setCM_AccessProfile_ID (0); +setCM_Media_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessMedia (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=890 */ +public static final int Table_ID=890; + +/** TableName=CM_AccessMedia */ +public static final String Table_Name="CM_AccessMedia"; + +protected static KeyNamePair Model = new KeyNamePair(890,"CM_AccessMedia"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessMedia[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Media Item. +@param CM_Media_ID Contains media content like images, flash movies etc. */ +public void setCM_Media_ID (int CM_Media_ID) +{ +if (CM_Media_ID < 1) throw new IllegalArgumentException ("CM_Media_ID is mandatory."); +set_ValueNoCheck ("CM_Media_ID", new Integer(CM_Media_ID)); +} +/** Get Media Item. +@return Contains media content like images, flash movies etc. */ +public int getCM_Media_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessNewsChannel.java b/dbPort/src/org/compiere/model/X_CM_AccessNewsChannel.java new file mode 100644 index 0000000000..090a68912e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessNewsChannel.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessNewsChannel + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.546 */ +public class X_CM_AccessNewsChannel extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessNewsChannel_ID id +@param trxName transaction +*/ +public X_CM_AccessNewsChannel (Properties ctx, int CM_AccessNewsChannel_ID, String trxName) +{ +super (ctx, CM_AccessNewsChannel_ID, trxName); +/** if (CM_AccessNewsChannel_ID == 0) +{ +setCM_AccessProfile_ID (0); +setCM_NewsChannel_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessNewsChannel (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=891 */ +public static final int Table_ID=891; + +/** TableName=CM_AccessNewsChannel */ +public static final String Table_Name="CM_AccessNewsChannel"; + +protected static KeyNamePair Model = new KeyNamePair(891,"CM_AccessNewsChannel"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessNewsChannel[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set News Channel. +@param CM_NewsChannel_ID News channel for rss feed */ +public void setCM_NewsChannel_ID (int CM_NewsChannel_ID) +{ +if (CM_NewsChannel_ID < 1) throw new IllegalArgumentException ("CM_NewsChannel_ID is mandatory."); +set_ValueNoCheck ("CM_NewsChannel_ID", new Integer(CM_NewsChannel_ID)); +} +/** Get News Channel. +@return News channel for rss feed */ +public int getCM_NewsChannel_ID() +{ +Integer ii = (Integer)get_Value("CM_NewsChannel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessProfile.java b/dbPort/src/org/compiere/model/X_CM_AccessProfile.java new file mode 100644 index 0000000000..2673b3a97a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessProfile.java @@ -0,0 +1,181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessProfile + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.546 */ +public class X_CM_AccessProfile extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessProfile_ID id +@param trxName transaction +*/ +public X_CM_AccessProfile (Properties ctx, int CM_AccessProfile_ID, String trxName) +{ +super (ctx, CM_AccessProfile_ID, trxName); +/** if (CM_AccessProfile_ID == 0) +{ +setCM_AccessProfile_ID (0); +setIsExclude (true); // Y +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessProfile (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=885 */ +public static final int Table_ID=885; + +/** TableName=CM_AccessProfile */ +public static final String Table_Name="CM_AccessProfile"; + +protected static KeyNamePair Model = new KeyNamePair(885,"CM_AccessProfile"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessProfile[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Exclude. +@param IsExclude Exclude access to the data - if not selected Include access to the data */ +public void setIsExclude (boolean IsExclude) +{ +set_Value ("IsExclude", new Boolean(IsExclude)); +} +/** Get Exclude. +@return Exclude access to the data - if not selected Include access to the data */ +public boolean isExclude() +{ +Object oo = get_Value("IsExclude"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_AccessStage.java b/dbPort/src/org/compiere/model/X_CM_AccessStage.java new file mode 100644 index 0000000000..cf5856f7d6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_AccessStage.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_AccessStage + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.562 */ +public class X_CM_AccessStage extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_AccessStage_ID id +@param trxName transaction +*/ +public X_CM_AccessStage (Properties ctx, int CM_AccessStage_ID, String trxName) +{ +super (ctx, CM_AccessStage_ID, trxName); +/** if (CM_AccessStage_ID == 0) +{ +setCM_AccessProfile_ID (0); +setCM_CStage_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_AccessStage (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=889 */ +public static final int Table_ID=889; + +/** TableName=CM_AccessStage */ +public static final String Table_Name="CM_AccessStage"; + +protected static KeyNamePair Model = new KeyNamePair(889,"CM_AccessStage"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_AccessStage[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Access Profile. +@param CM_AccessProfile_ID Web Access Profile */ +public void setCM_AccessProfile_ID (int CM_AccessProfile_ID) +{ +if (CM_AccessProfile_ID < 1) throw new IllegalArgumentException ("CM_AccessProfile_ID is mandatory."); +set_ValueNoCheck ("CM_AccessProfile_ID", new Integer(CM_AccessProfile_ID)); +} +/** Get Web Access Profile. +@return Web Access Profile */ +public int getCM_AccessProfile_ID() +{ +Integer ii = (Integer)get_Value("CM_AccessProfile_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container Stage. +@param CM_CStage_ID Web Container Stage contains the staging content like images, text etc. */ +public void setCM_CStage_ID (int CM_CStage_ID) +{ +if (CM_CStage_ID < 1) throw new IllegalArgumentException ("CM_CStage_ID is mandatory."); +set_ValueNoCheck ("CM_CStage_ID", new Integer(CM_CStage_ID)); +} +/** Get Web Container Stage. +@return Web Container Stage contains the staging content like images, text etc. */ +public int getCM_CStage_ID() +{ +Integer ii = (Integer)get_Value("CM_CStage_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Ad.java b/dbPort/src/org/compiere/model/X_CM_Ad.java new file mode 100644 index 0000000000..0baf244d0f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Ad.java @@ -0,0 +1,386 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Ad + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.593 */ +public class X_CM_Ad extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Ad_ID id +@param trxName transaction +*/ +public X_CM_Ad (Properties ctx, int CM_Ad_ID, String trxName) +{ +super (ctx, CM_Ad_ID, trxName); +/** if (CM_Ad_ID == 0) +{ +setActualClick (0); +setActualImpression (0); +setCM_Ad_Cat_ID (0); +setCM_Ad_ID (0); +setCM_Media_ID (0); +setIsAdFlag (false); +setIsLogged (false); +setMaxClick (0); +setMaxImpression (0); +setName (null); +setStartDate (new Timestamp(System.currentTimeMillis())); +setStartImpression (0); +setTarget_Frame (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Ad (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=858 */ +public static final int Table_ID=858; + +/** TableName=CM_Ad */ +public static final String Table_Name="CM_Ad"; + +protected static KeyNamePair Model = new KeyNamePair(858,"CM_Ad"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Ad[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Actual Click Count. +@param ActualClick How many clicks have been counted */ +public void setActualClick (int ActualClick) +{ +set_Value ("ActualClick", new Integer(ActualClick)); +} +/** Get Actual Click Count. +@return How many clicks have been counted */ +public int getActualClick() +{ +Integer ii = (Integer)get_Value("ActualClick"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Actual Impression Count. +@param ActualImpression How many impressions have been counted */ +public void setActualImpression (int ActualImpression) +{ +set_Value ("ActualImpression", new Integer(ActualImpression)); +} +/** Get Actual Impression Count. +@return How many impressions have been counted */ +public int getActualImpression() +{ +Integer ii = (Integer)get_Value("ActualImpression"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Advertisement Category. +@param CM_Ad_Cat_ID Advertisement Category like Banner Homepage */ +public void setCM_Ad_Cat_ID (int CM_Ad_Cat_ID) +{ +if (CM_Ad_Cat_ID < 1) throw new IllegalArgumentException ("CM_Ad_Cat_ID is mandatory."); +set_ValueNoCheck ("CM_Ad_Cat_ID", new Integer(CM_Ad_Cat_ID)); +} +/** Get Advertisement Category. +@return Advertisement Category like Banner Homepage */ +public int getCM_Ad_Cat_ID() +{ +Integer ii = (Integer)get_Value("CM_Ad_Cat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Advertisement. +@param CM_Ad_ID An Advertisement is something like a banner */ +public void setCM_Ad_ID (int CM_Ad_ID) +{ +if (CM_Ad_ID < 1) throw new IllegalArgumentException ("CM_Ad_ID is mandatory."); +set_ValueNoCheck ("CM_Ad_ID", new Integer(CM_Ad_ID)); +} +/** Get Advertisement. +@return An Advertisement is something like a banner */ +public int getCM_Ad_ID() +{ +Integer ii = (Integer)get_Value("CM_Ad_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Media Item. +@param CM_Media_ID Contains media content like images, flash movies etc. */ +public void setCM_Media_ID (int CM_Media_ID) +{ +if (CM_Media_ID < 1) throw new IllegalArgumentException ("CM_Media_ID is mandatory."); +set_Value ("CM_Media_ID", new Integer(CM_Media_ID)); +} +/** Get Media Item. +@return Contains media content like images, flash movies etc. */ +public int getCM_Media_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Content HTML. +@param ContentHTML Contains the content itself */ +public void setContentHTML (String ContentHTML) +{ +if (ContentHTML != null && ContentHTML.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ContentHTML = ContentHTML.substring(0,1999); +} +set_Value ("ContentHTML", ContentHTML); +} +/** Get Content HTML. +@return Contains the content itself */ +public String getContentHTML() +{ +return (String)get_Value("ContentHTML"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set End Date. +@param EndDate Last effective date (inclusive) */ +public void setEndDate (Timestamp EndDate) +{ +set_Value ("EndDate", EndDate); +} +/** Get End Date. +@return Last effective date (inclusive) */ +public Timestamp getEndDate() +{ +return (Timestamp)get_Value("EndDate"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Special AD Flag. +@param IsAdFlag Do we need to specially mention this ad? */ +public void setIsAdFlag (boolean IsAdFlag) +{ +set_Value ("IsAdFlag", new Boolean(IsAdFlag)); +} +/** Get Special AD Flag. +@return Do we need to specially mention this ad? */ +public boolean isAdFlag() +{ +Object oo = get_Value("IsAdFlag"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Logging. +@param IsLogged Do we need to log the banner impressions and clicks? (needs much performance) */ +public void setIsLogged (boolean IsLogged) +{ +set_Value ("IsLogged", new Boolean(IsLogged)); +} +/** Get Logging. +@return Do we need to log the banner impressions and clicks? (needs much performance) */ +public boolean isLogged() +{ +Object oo = get_Value("IsLogged"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Max Click Count. +@param MaxClick Maximum Click Count until banner is deactivated */ +public void setMaxClick (int MaxClick) +{ +set_Value ("MaxClick", new Integer(MaxClick)); +} +/** Get Max Click Count. +@return Maximum Click Count until banner is deactivated */ +public int getMaxClick() +{ +Integer ii = (Integer)get_Value("MaxClick"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Max Impression Count. +@param MaxImpression Maximum Impression Count until banner is deactivated */ +public void setMaxImpression (int MaxImpression) +{ +set_Value ("MaxImpression", new Integer(MaxImpression)); +} +/** Get Max Impression Count. +@return Maximum Impression Count until banner is deactivated */ +public int getMaxImpression() +{ +Integer ii = (Integer)get_Value("MaxImpression"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +if (StartDate == null) throw new IllegalArgumentException ("StartDate is mandatory."); +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +/** Set Start Count Impression. +@param StartImpression For rotation we need a start count */ +public void setStartImpression (int StartImpression) +{ +set_Value ("StartImpression", new Integer(StartImpression)); +} +/** Get Start Count Impression. +@return For rotation we need a start count */ +public int getStartImpression() +{ +Integer ii = (Integer)get_Value("StartImpression"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Target URL. +@param TargetURL URL for the Target */ +public void setTargetURL (String TargetURL) +{ +if (TargetURL != null && TargetURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +TargetURL = TargetURL.substring(0,119); +} +set_Value ("TargetURL", TargetURL); +} +/** Get Target URL. +@return URL for the Target */ +public String getTargetURL() +{ +return (String)get_Value("TargetURL"); +} +/** Set Target Frame. +@param Target_Frame Which target should be used if user clicks? */ +public void setTarget_Frame (String Target_Frame) +{ +if (Target_Frame == null) throw new IllegalArgumentException ("Target_Frame is mandatory."); +if (Target_Frame.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Target_Frame = Target_Frame.substring(0,19); +} +set_Value ("Target_Frame", Target_Frame); +} +/** Get Target Frame. +@return Which target should be used if user clicks? */ +public String getTarget_Frame() +{ +return (String)get_Value("Target_Frame"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Ad_Cat.java b/dbPort/src/org/compiere/model/X_CM_Ad_Cat.java new file mode 100644 index 0000000000..83911b9d30 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Ad_Cat.java @@ -0,0 +1,178 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Ad_Cat + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.625 */ +public class X_CM_Ad_Cat extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Ad_Cat_ID id +@param trxName transaction +*/ +public X_CM_Ad_Cat (Properties ctx, int CM_Ad_Cat_ID, String trxName) +{ +super (ctx, CM_Ad_Cat_ID, trxName); +/** if (CM_Ad_Cat_ID == 0) +{ +setCM_Ad_Cat_ID (0); +setCM_WebProject_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Ad_Cat (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=856 */ +public static final int Table_ID=856; + +/** TableName=CM_Ad_Cat */ +public static final String Table_Name="CM_Ad_Cat"; + +protected static KeyNamePair Model = new KeyNamePair(856,"CM_Ad_Cat"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Ad_Cat[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Advertisement Category. +@param CM_Ad_Cat_ID Advertisement Category like Banner Homepage */ +public void setCM_Ad_Cat_ID (int CM_Ad_Cat_ID) +{ +if (CM_Ad_Cat_ID < 1) throw new IllegalArgumentException ("CM_Ad_Cat_ID is mandatory."); +set_ValueNoCheck ("CM_Ad_Cat_ID", new Integer(CM_Ad_Cat_ID)); +} +/** Get Advertisement Category. +@return Advertisement Category like Banner Homepage */ +public int getCM_Ad_Cat_ID() +{ +Integer ii = (Integer)get_Value("CM_Ad_Cat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_Value ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_BroadcastServer.java b/dbPort/src/org/compiere/model/X_CM_BroadcastServer.java new file mode 100644 index 0000000000..bbe8fb8440 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_BroadcastServer.java @@ -0,0 +1,209 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_BroadcastServer + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.64 */ +public class X_CM_BroadcastServer extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_BroadcastServer_ID id +@param trxName transaction +*/ +public X_CM_BroadcastServer (Properties ctx, int CM_BroadcastServer_ID, String trxName) +{ +super (ctx, CM_BroadcastServer_ID, trxName); +/** if (CM_BroadcastServer_ID == 0) +{ +setCM_BroadcastServer_ID (0); +setIP_Address (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_BroadcastServer (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=893 */ +public static final int Table_ID=893; + +/** TableName=CM_BroadcastServer */ +public static final String Table_Name="CM_BroadcastServer"; + +protected static KeyNamePair Model = new KeyNamePair(893,"CM_BroadcastServer"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_BroadcastServer[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Broadcast Server. +@param CM_BroadcastServer_ID Web Broadcast Server */ +public void setCM_BroadcastServer_ID (int CM_BroadcastServer_ID) +{ +if (CM_BroadcastServer_ID < 1) throw new IllegalArgumentException ("CM_BroadcastServer_ID is mandatory."); +set_ValueNoCheck ("CM_BroadcastServer_ID", new Integer(CM_BroadcastServer_ID)); +} +/** Get Broadcast Server. +@return Web Broadcast Server */ +public int getCM_BroadcastServer_ID() +{ +Integer ii = (Integer)get_Value("CM_BroadcastServer_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID <= 0) set_Value ("CM_WebProject_ID", null); + else +set_Value ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set IP Address. +@param IP_Address Defines the IP address to transfer data to */ +public void setIP_Address (String IP_Address) +{ +if (IP_Address == null) throw new IllegalArgumentException ("IP_Address is mandatory."); +if (IP_Address.length() > 20) +{ +log.warning("Length > 20 - truncated"); +IP_Address = IP_Address.substring(0,19); +} +set_Value ("IP_Address", IP_Address); +} +/** Get IP Address. +@return Defines the IP address to transfer data to */ +public String getIP_Address() +{ +return (String)get_Value("IP_Address"); +} +/** Set Last Synchronized. +@param LastSynchronized Date when last synchronized */ +public void setLastSynchronized (Timestamp LastSynchronized) +{ +set_Value ("LastSynchronized", LastSynchronized); +} +/** Get Last Synchronized. +@return Date when last synchronized */ +public Timestamp getLastSynchronized() +{ +return (Timestamp)get_Value("LastSynchronized"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_CStage.java b/dbPort/src/org/compiere/model/X_CM_CStage.java new file mode 100644 index 0000000000..a21b1ffc14 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_CStage.java @@ -0,0 +1,618 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_CStage + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.656 */ +public class X_CM_CStage extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_CStage_ID id +@param trxName transaction +*/ +public X_CM_CStage (Properties ctx, int CM_CStage_ID, String trxName) +{ +super (ctx, CM_CStage_ID, trxName); +/** if (CM_CStage_ID == 0) +{ +setCM_CStage_ID (0); +setCM_WebProject_ID (0); +setContainerType (null); // D +setIsIndexed (true); // Y +setIsModified (false); +setIsSecure (false); +setIsSummary (false); +setMeta_Description (null); +setMeta_Keywords (null); +setName (null); +setNotice (null); +setPriority (0); +setRelativeURL (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_CStage (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=866 */ +public static final int Table_ID=866; + +/** TableName=CM_CStage */ +public static final String Table_Name="CM_CStage"; + +protected static KeyNamePair Model = new KeyNamePair(866,"CM_CStage"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_CStage[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** CM_CStageLink_ID AD_Reference_ID=387 */ +public static final int CM_CSTAGELINK_ID_AD_Reference_ID=387; +/** Set Container Link. +@param CM_CStageLink_ID Stage Link to another Container in the Web Project */ +public void setCM_CStageLink_ID (int CM_CStageLink_ID) +{ +if (CM_CStageLink_ID <= 0) set_Value ("CM_CStageLink_ID", null); + else +set_Value ("CM_CStageLink_ID", new Integer(CM_CStageLink_ID)); +} +/** Get Container Link. +@return Stage Link to another Container in the Web Project */ +public int getCM_CStageLink_ID() +{ +Integer ii = (Integer)get_Value("CM_CStageLink_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container Stage. +@param CM_CStage_ID Web Container Stage contains the staging content like images, text etc. */ +public void setCM_CStage_ID (int CM_CStage_ID) +{ +if (CM_CStage_ID < 1) throw new IllegalArgumentException ("CM_CStage_ID is mandatory."); +set_ValueNoCheck ("CM_CStage_ID", new Integer(CM_CStage_ID)); +} +/** Get Web Container Stage. +@return Web Container Stage contains the staging content like images, text etc. */ +public int getCM_CStage_ID() +{ +Integer ii = (Integer)get_Value("CM_CStage_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template. +@param CM_Template_ID Template defines how content is displayed */ +public void setCM_Template_ID (int CM_Template_ID) +{ +if (CM_Template_ID <= 0) set_Value ("CM_Template_ID", null); + else +set_Value ("CM_Template_ID", new Integer(CM_Template_ID)); +} +/** Get Template. +@return Template defines how content is displayed */ +public int getCM_Template_ID() +{ +Integer ii = (Integer)get_Value("CM_Template_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set External Link (URL). +@param ContainerLinkURL External Link (IRL) for the Container */ +public void setContainerLinkURL (String ContainerLinkURL) +{ +if (ContainerLinkURL != null && ContainerLinkURL.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ContainerLinkURL = ContainerLinkURL.substring(0,59); +} +set_Value ("ContainerLinkURL", ContainerLinkURL); +} +/** Get External Link (URL). +@return External Link (IRL) for the Container */ +public String getContainerLinkURL() +{ +return (String)get_Value("ContainerLinkURL"); +} + +/** ContainerType AD_Reference_ID=385 */ +public static final int CONTAINERTYPE_AD_Reference_ID=385; +/** Document = D */ +public static final String CONTAINERTYPE_Document = "D"; +/** Internal Link = L */ +public static final String CONTAINERTYPE_InternalLink = "L"; +/** External URL = U */ +public static final String CONTAINERTYPE_ExternalURL = "U"; +/** Set Web Container Type. +@param ContainerType Web Container Type */ +public void setContainerType (String ContainerType) +{ +if (ContainerType == null) throw new IllegalArgumentException ("ContainerType is mandatory"); +if (ContainerType.equals("D") || ContainerType.equals("L") || ContainerType.equals("U")); + else throw new IllegalArgumentException ("ContainerType Invalid value - " + ContainerType + " - Reference_ID=385 - D - L - U"); +if (ContainerType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ContainerType = ContainerType.substring(0,0); +} +set_Value ("ContainerType", ContainerType); +} +/** Get Web Container Type. +@return Web Container Type */ +public String getContainerType() +{ +return (String)get_Value("ContainerType"); +} +/** Set ContainerXML. +@param ContainerXML Autogenerated Containerdefinition as XML Code */ +public void setContainerXML (String ContainerXML) +{ +if (ContainerXML != null && ContainerXML.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ContainerXML = ContainerXML.substring(0,1999); +} +set_ValueNoCheck ("ContainerXML", ContainerXML); +} +/** Get ContainerXML. +@return Autogenerated Containerdefinition as XML Code */ +public String getContainerXML() +{ +return (String)get_Value("ContainerXML"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Description = Description.substring(0,1999); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Indexed. +@param IsIndexed Index the document for the internal search engine */ +public void setIsIndexed (boolean IsIndexed) +{ +set_Value ("IsIndexed", new Boolean(IsIndexed)); +} +/** Get Indexed. +@return Index the document for the internal search engine */ +public boolean isIndexed() +{ +Object oo = get_Value("IsIndexed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Modified. +@param IsModified The record is modified */ +public void setIsModified (boolean IsModified) +{ +set_ValueNoCheck ("IsModified", new Boolean(IsModified)); +} +/** Get Modified. +@return The record is modified */ +public boolean isModified() +{ +Object oo = get_Value("IsModified"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Secure content. +@param IsSecure Defines whether content needs to get encrypted */ +public void setIsSecure (boolean IsSecure) +{ +set_Value ("IsSecure", new Boolean(IsSecure)); +} +/** Get Secure content. +@return Defines whether content needs to get encrypted */ +public boolean isSecure() +{ +Object oo = get_Value("IsSecure"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_ValueNoCheck ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Meta Author. +@param Meta_Author Author of the content */ +public void setMeta_Author (String Meta_Author) +{ +if (Meta_Author != null && Meta_Author.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Author = Meta_Author.substring(0,1999); +} +set_Value ("Meta_Author", Meta_Author); +} +/** Get Meta Author. +@return Author of the content */ +public String getMeta_Author() +{ +return (String)get_Value("Meta_Author"); +} +/** Set Meta Content Type. +@param Meta_Content Defines the type of content i.e. "text/html; + charset=UTF-8" */ +public void setMeta_Content (String Meta_Content) +{ +if (Meta_Content != null && Meta_Content.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Content = Meta_Content.substring(0,1999); +} +set_Value ("Meta_Content", Meta_Content); +} +/** Get Meta Content Type. +@return Defines the type of content i.e. "text/html; + charset=UTF-8" */ +public String getMeta_Content() +{ +return (String)get_Value("Meta_Content"); +} +/** Set Meta Copyright. +@param Meta_Copyright Contains Copyright information for the content */ +public void setMeta_Copyright (String Meta_Copyright) +{ +if (Meta_Copyright != null && Meta_Copyright.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Copyright = Meta_Copyright.substring(0,1999); +} +set_Value ("Meta_Copyright", Meta_Copyright); +} +/** Get Meta Copyright. +@return Contains Copyright information for the content */ +public String getMeta_Copyright() +{ +return (String)get_Value("Meta_Copyright"); +} +/** Set Meta Description. +@param Meta_Description Meta info describing the contents of the page */ +public void setMeta_Description (String Meta_Description) +{ +if (Meta_Description == null) throw new IllegalArgumentException ("Meta_Description is mandatory."); +if (Meta_Description.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Description = Meta_Description.substring(0,1999); +} +set_Value ("Meta_Description", Meta_Description); +} +/** Get Meta Description. +@return Meta info describing the contents of the page */ +public String getMeta_Description() +{ +return (String)get_Value("Meta_Description"); +} +/** Set Meta Keywords. +@param Meta_Keywords Contains the keywords for the content */ +public void setMeta_Keywords (String Meta_Keywords) +{ +if (Meta_Keywords == null) throw new IllegalArgumentException ("Meta_Keywords is mandatory."); +if (Meta_Keywords.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Keywords = Meta_Keywords.substring(0,1999); +} +set_Value ("Meta_Keywords", Meta_Keywords); +} +/** Get Meta Keywords. +@return Contains the keywords for the content */ +public String getMeta_Keywords() +{ +return (String)get_Value("Meta_Keywords"); +} +/** Set Meta Language. +@param Meta_Language Language HTML Meta Tag */ +public void setMeta_Language (String Meta_Language) +{ +if (Meta_Language != null && Meta_Language.length() > 2) +{ +log.warning("Length > 2 - truncated"); +Meta_Language = Meta_Language.substring(0,1); +} +set_Value ("Meta_Language", Meta_Language); +} +/** Get Meta Language. +@return Language HTML Meta Tag */ +public String getMeta_Language() +{ +return (String)get_Value("Meta_Language"); +} +/** Set Meta Publisher. +@param Meta_Publisher Meta Publisher defines the publisher of the content */ +public void setMeta_Publisher (String Meta_Publisher) +{ +if (Meta_Publisher != null && Meta_Publisher.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Publisher = Meta_Publisher.substring(0,1999); +} +set_Value ("Meta_Publisher", Meta_Publisher); +} +/** Get Meta Publisher. +@return Meta Publisher defines the publisher of the content */ +public String getMeta_Publisher() +{ +return (String)get_Value("Meta_Publisher"); +} +/** Set Meta RobotsTag. +@param Meta_RobotsTag RobotsTag defines how search robots should handle this content */ +public void setMeta_RobotsTag (String Meta_RobotsTag) +{ +if (Meta_RobotsTag != null && Meta_RobotsTag.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_RobotsTag = Meta_RobotsTag.substring(0,1999); +} +set_Value ("Meta_RobotsTag", Meta_RobotsTag); +} +/** Get Meta RobotsTag. +@return RobotsTag defines how search robots should handle this content */ +public String getMeta_RobotsTag() +{ +return (String)get_Value("Meta_RobotsTag"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Notice. +@param Notice Contains last write notice */ +public void setNotice (String Notice) +{ +if (Notice == null) throw new IllegalArgumentException ("Notice is mandatory."); +if (Notice.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Notice = Notice.substring(0,1999); +} +set_Value ("Notice", Notice); +} +/** Get Notice. +@return Contains last write notice */ +public String getNotice() +{ +return (String)get_Value("Notice"); +} +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (int Priority) +{ +set_Value ("Priority", new Integer(Priority)); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public int getPriority() +{ +Integer ii = (Integer)get_Value("Priority"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Relative URL. +@param RelativeURL Contains the relative URL for the container */ +public void setRelativeURL (String RelativeURL) +{ +if (RelativeURL == null) throw new IllegalArgumentException ("RelativeURL is mandatory."); +if (RelativeURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +RelativeURL = RelativeURL.substring(0,119); +} +set_Value ("RelativeURL", RelativeURL); +} +/** Get Relative URL. +@return Contains the relative URL for the container */ +public String getRelativeURL() +{ +return (String)get_Value("RelativeURL"); +} +/** Set StructureXML. +@param StructureXML Autogenerated Containerdefinition as XML Code */ +public void setStructureXML (String StructureXML) +{ +if (StructureXML != null && StructureXML.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +StructureXML = StructureXML.substring(0,1999); +} +set_Value ("StructureXML", StructureXML); +} +/** Get StructureXML. +@return Autogenerated Containerdefinition as XML Code */ +public String getStructureXML() +{ +return (String)get_Value("StructureXML"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title != null && Title.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Title = Title.substring(0,59); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_CStageTTable.java b/dbPort/src/org/compiere/model/X_CM_CStageTTable.java new file mode 100644 index 0000000000..edefb4addc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_CStageTTable.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_CStageTTable + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.687 */ +public class X_CM_CStageTTable extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_CStageTTable_ID id +@param trxName transaction +*/ +public X_CM_CStageTTable (Properties ctx, int CM_CStageTTable_ID, String trxName) +{ +super (ctx, CM_CStageTTable_ID, trxName); +/** if (CM_CStageTTable_ID == 0) +{ +setCM_CStageTTable_ID (0); +setCM_CStage_ID (0); +setCM_TemplateTable_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_CStageTTable (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=881 */ +public static final int Table_ID=881; + +/** TableName=CM_CStageTTable */ +public static final String Table_Name="CM_CStageTTable"; + +protected static KeyNamePair Model = new KeyNamePair(881,"CM_CStageTTable"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_CStageTTable[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Stage T.Table. +@param CM_CStageTTable_ID Containet Stage Template Table */ +public void setCM_CStageTTable_ID (int CM_CStageTTable_ID) +{ +if (CM_CStageTTable_ID < 1) throw new IllegalArgumentException ("CM_CStageTTable_ID is mandatory."); +set_ValueNoCheck ("CM_CStageTTable_ID", new Integer(CM_CStageTTable_ID)); +} +/** Get Stage T.Table. +@return Containet Stage Template Table */ +public int getCM_CStageTTable_ID() +{ +Integer ii = (Integer)get_Value("CM_CStageTTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container Stage. +@param CM_CStage_ID Web Container Stage contains the staging content like images, text etc. */ +public void setCM_CStage_ID (int CM_CStage_ID) +{ +if (CM_CStage_ID < 1) throw new IllegalArgumentException ("CM_CStage_ID is mandatory."); +set_ValueNoCheck ("CM_CStage_ID", new Integer(CM_CStage_ID)); +} +/** Get Web Container Stage. +@return Web Container Stage contains the staging content like images, text etc. */ +public int getCM_CStage_ID() +{ +Integer ii = (Integer)get_Value("CM_CStage_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template Table. +@param CM_TemplateTable_ID CM Template Table Link */ +public void setCM_TemplateTable_ID (int CM_TemplateTable_ID) +{ +if (CM_TemplateTable_ID < 1) throw new IllegalArgumentException ("CM_TemplateTable_ID is mandatory."); +set_ValueNoCheck ("CM_TemplateTable_ID", new Integer(CM_TemplateTable_ID)); +} +/** Get Template Table. +@return CM Template Table Link */ +public int getCM_TemplateTable_ID() +{ +Integer ii = (Integer)get_Value("CM_TemplateTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Other SQL Clause. +@param OtherClause Other SQL Clause */ +public void setOtherClause (String OtherClause) +{ +if (OtherClause != null && OtherClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OtherClause = OtherClause.substring(0,1999); +} +set_Value ("OtherClause", OtherClause); +} +/** Get Other SQL Clause. +@return Other SQL Clause */ +public String getOtherClause() +{ +return (String)get_Value("OtherClause"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_ValueNoCheck ("Record_ID", null); + else +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_CStage_Element.java b/dbPort/src/org/compiere/model/X_CM_CStage_Element.java new file mode 100644 index 0000000000..55671e1d50 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_CStage_Element.java @@ -0,0 +1,208 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_CStage_Element + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.703 */ +public class X_CM_CStage_Element extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_CStage_Element_ID id +@param trxName transaction +*/ +public X_CM_CStage_Element (Properties ctx, int CM_CStage_Element_ID, String trxName) +{ +super (ctx, CM_CStage_Element_ID, trxName); +/** if (CM_CStage_Element_ID == 0) +{ +setCM_CStage_Element_ID (0); +setCM_CStage_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_CStage_Element (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=867 */ +public static final int Table_ID=867; + +/** TableName=CM_CStage_Element */ +public static final String Table_Name="CM_CStage_Element"; + +protected static KeyNamePair Model = new KeyNamePair(867,"CM_CStage_Element"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_CStage_Element[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Container Stage Element. +@param CM_CStage_Element_ID Container element i.e. Headline, Content, Footer etc. */ +public void setCM_CStage_Element_ID (int CM_CStage_Element_ID) +{ +if (CM_CStage_Element_ID < 1) throw new IllegalArgumentException ("CM_CStage_Element_ID is mandatory."); +set_ValueNoCheck ("CM_CStage_Element_ID", new Integer(CM_CStage_Element_ID)); +} +/** Get Container Stage Element. +@return Container element i.e. Headline, Content, Footer etc. */ +public int getCM_CStage_Element_ID() +{ +Integer ii = (Integer)get_Value("CM_CStage_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container Stage. +@param CM_CStage_ID Web Container Stage contains the staging content like images, text etc. */ +public void setCM_CStage_ID (int CM_CStage_ID) +{ +if (CM_CStage_ID < 1) throw new IllegalArgumentException ("CM_CStage_ID is mandatory."); +set_ValueNoCheck ("CM_CStage_ID", new Integer(CM_CStage_ID)); +} +/** Get Web Container Stage. +@return Web Container Stage contains the staging content like images, text etc. */ +public int getCM_CStage_ID() +{ +Integer ii = (Integer)get_Value("CM_CStage_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Content HTML. +@param ContentHTML Contains the content itself */ +public void setContentHTML (String ContentHTML) +{ +set_Value ("ContentHTML", ContentHTML); +} +/** Get Content HTML. +@return Contains the content itself */ +public String getContentHTML() +{ +return (String)get_Value("ContentHTML"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Chat.java b/dbPort/src/org/compiere/model/X_CM_Chat.java new file mode 100644 index 0000000000..7aec19c240 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Chat.java @@ -0,0 +1,208 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Chat + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.718 */ +public class X_CM_Chat extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Chat_ID id +@param trxName transaction +*/ +public X_CM_Chat (Properties ctx, int CM_Chat_ID, String trxName) +{ +super (ctx, CM_Chat_ID, trxName); +/** if (CM_Chat_ID == 0) +{ +setAD_Table_ID (0); +setCM_Chat_ID (0); +setConfidentialType (null); +setDescription (null); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Chat (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=876 */ +public static final int Table_ID=876; + +/** TableName=CM_Chat */ +public static final String Table_Name="CM_Chat"; + +protected static KeyNamePair Model = new KeyNamePair(876,"CM_Chat"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Chat[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chat Type. +@param CM_ChatType_ID Type of discussion / chat */ +public void setCM_ChatType_ID (int CM_ChatType_ID) +{ +if (CM_ChatType_ID <= 0) set_Value ("CM_ChatType_ID", null); + else +set_Value ("CM_ChatType_ID", new Integer(CM_ChatType_ID)); +} +/** Get Chat Type. +@return Type of discussion / chat */ +public int getCM_ChatType_ID() +{ +Integer ii = (Integer)get_Value("CM_ChatType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chat. +@param CM_Chat_ID Chat or discussion thread */ +public void setCM_Chat_ID (int CM_Chat_ID) +{ +if (CM_Chat_ID < 1) throw new IllegalArgumentException ("CM_Chat_ID is mandatory."); +set_ValueNoCheck ("CM_Chat_ID", new Integer(CM_Chat_ID)); +} +/** Get Chat. +@return Chat or discussion thread */ +public int getCM_Chat_ID() +{ +Integer ii = (Integer)get_Value("CM_Chat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ConfidentialType AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPE_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPE_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPE_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPE_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPE_PrivateInformation = "P"; +/** Set Confidentiality. +@param ConfidentialType Type of Confidentiality */ +public void setConfidentialType (String ConfidentialType) +{ +if (ConfidentialType == null) throw new IllegalArgumentException ("ConfidentialType is mandatory"); +if (ConfidentialType.equals("A") || ConfidentialType.equals("C") || ConfidentialType.equals("I") || ConfidentialType.equals("P")); + else throw new IllegalArgumentException ("ConfidentialType Invalid value - " + ConfidentialType + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialType = ConfidentialType.substring(0,0); +} +set_Value ("ConfidentialType", ConfidentialType); +} +/** Get Confidentiality. +@return Type of Confidentiality */ +public String getConfidentialType() +{ +return (String)get_Value("ConfidentialType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description == null) throw new IllegalArgumentException ("Description is mandatory."); +if (Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDescription()); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_ChatEntry.java b/dbPort/src/org/compiere/model/X_CM_ChatEntry.java new file mode 100644 index 0000000000..f2d1ada91e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_ChatEntry.java @@ -0,0 +1,171 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_ChatEntry + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.734 */ +public class X_CM_ChatEntry extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_ChatEntry_ID id +@param trxName transaction +*/ +public X_CM_ChatEntry (Properties ctx, int CM_ChatEntry_ID, String trxName) +{ +super (ctx, CM_ChatEntry_ID, trxName); +/** if (CM_ChatEntry_ID == 0) +{ +setCM_ChatEntry_ID (0); +setCM_Chat_ID (0); +setCharacterData (null); +setConfidentialType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_ChatEntry (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=877 */ +public static final int Table_ID=877; + +/** TableName=CM_ChatEntry */ +public static final String Table_Name="CM_ChatEntry"; + +protected static KeyNamePair Model = new KeyNamePair(877,"CM_ChatEntry"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_ChatEntry[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Chat Entry. +@param CM_ChatEntry_ID Individual Chat / Discussion Entry */ +public void setCM_ChatEntry_ID (int CM_ChatEntry_ID) +{ +if (CM_ChatEntry_ID < 1) throw new IllegalArgumentException ("CM_ChatEntry_ID is mandatory."); +set_ValueNoCheck ("CM_ChatEntry_ID", new Integer(CM_ChatEntry_ID)); +} +/** Get Chat Entry. +@return Individual Chat / Discussion Entry */ +public int getCM_ChatEntry_ID() +{ +Integer ii = (Integer)get_Value("CM_ChatEntry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getCM_ChatEntry_ID())); +} +/** Set Chat. +@param CM_Chat_ID Chat or discussion thread */ +public void setCM_Chat_ID (int CM_Chat_ID) +{ +if (CM_Chat_ID < 1) throw new IllegalArgumentException ("CM_Chat_ID is mandatory."); +set_ValueNoCheck ("CM_Chat_ID", new Integer(CM_Chat_ID)); +} +/** Get Chat. +@return Chat or discussion thread */ +public int getCM_Chat_ID() +{ +Integer ii = (Integer)get_Value("CM_Chat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Character Data. +@param CharacterData Long Character Field */ +public void setCharacterData (String CharacterData) +{ +if (CharacterData == null) throw new IllegalArgumentException ("CharacterData is mandatory."); +set_ValueNoCheck ("CharacterData", CharacterData); +} +/** Get Character Data. +@return Long Character Field */ +public String getCharacterData() +{ +return (String)get_Value("CharacterData"); +} + +/** ConfidentialType AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPE_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPE_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPE_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPE_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPE_PrivateInformation = "P"; +/** Set Confidentiality. +@param ConfidentialType Type of Confidentiality */ +public void setConfidentialType (String ConfidentialType) +{ +if (ConfidentialType == null) throw new IllegalArgumentException ("ConfidentialType is mandatory"); +if (ConfidentialType.equals("A") || ConfidentialType.equals("C") || ConfidentialType.equals("I") || ConfidentialType.equals("P")); + else throw new IllegalArgumentException ("ConfidentialType Invalid value - " + ConfidentialType + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialType = ConfidentialType.substring(0,0); +} +set_Value ("ConfidentialType", ConfidentialType); +} +/** Get Confidentiality. +@return Type of Confidentiality */ +public String getConfidentialType() +{ +return (String)get_Value("ConfidentialType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_ChatType.java b/dbPort/src/org/compiere/model/X_CM_ChatType.java new file mode 100644 index 0000000000..74c073cbfb --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_ChatType.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_ChatType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.734 */ +public class X_CM_ChatType extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_ChatType_ID id +@param trxName transaction +*/ +public X_CM_ChatType (Properties ctx, int CM_ChatType_ID, String trxName) +{ +super (ctx, CM_ChatType_ID, trxName); +/** if (CM_ChatType_ID == 0) +{ +setAD_Table_ID (0); +setCM_ChatType_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_ChatType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=874 */ +public static final int Table_ID=874; + +/** TableName=CM_ChatType */ +public static final String Table_Name="CM_ChatType"; + +protected static KeyNamePair Model = new KeyNamePair(874,"CM_ChatType"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_ChatType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chat Type. +@param CM_ChatType_ID Type of discussion / chat */ +public void setCM_ChatType_ID (int CM_ChatType_ID) +{ +if (CM_ChatType_ID < 1) throw new IllegalArgumentException ("CM_ChatType_ID is mandatory."); +set_ValueNoCheck ("CM_ChatType_ID", new Integer(CM_ChatType_ID)); +} +/** Get Chat Type. +@return Type of discussion / chat */ +public int getCM_ChatType_ID() +{ +Integer ii = (Integer)get_Value("CM_ChatType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_ChatTypeUpdate.java b/dbPort/src/org/compiere/model/X_CM_ChatTypeUpdate.java new file mode 100644 index 0000000000..62f910bd85 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_ChatTypeUpdate.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_ChatTypeUpdate + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.765 */ +public class X_CM_ChatTypeUpdate extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_ChatTypeUpdate_ID id +@param trxName transaction +*/ +public X_CM_ChatTypeUpdate (Properties ctx, int CM_ChatTypeUpdate_ID, String trxName) +{ +super (ctx, CM_ChatTypeUpdate_ID, trxName); +/** if (CM_ChatTypeUpdate_ID == 0) +{ +setAD_User_ID (0); +setCM_ChatType_ID (0); +setIsSelfService (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_ChatTypeUpdate (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=875 */ +public static final int Table_ID=875; + +/** TableName=CM_ChatTypeUpdate */ +public static final String Table_Name="CM_ChatTypeUpdate"; + +protected static KeyNamePair Model = new KeyNamePair(875,"CM_ChatTypeUpdate"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_ChatTypeUpdate[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chat Type. +@param CM_ChatType_ID Type of discussion / chat */ +public void setCM_ChatType_ID (int CM_ChatType_ID) +{ +if (CM_ChatType_ID < 1) throw new IllegalArgumentException ("CM_ChatType_ID is mandatory."); +set_ValueNoCheck ("CM_ChatType_ID", new Integer(CM_ChatType_ID)); +} +/** Get Chat Type. +@return Type of discussion / chat */ +public int getCM_ChatType_ID() +{ +Integer ii = (Integer)get_Value("CM_ChatType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_ChatUpdate.java b/dbPort/src/org/compiere/model/X_CM_ChatUpdate.java new file mode 100644 index 0000000000..fe9d54c45f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_ChatUpdate.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_ChatUpdate + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.781 */ +public class X_CM_ChatUpdate extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_ChatUpdate_ID id +@param trxName transaction +*/ +public X_CM_ChatUpdate (Properties ctx, int CM_ChatUpdate_ID, String trxName) +{ +super (ctx, CM_ChatUpdate_ID, trxName); +/** if (CM_ChatUpdate_ID == 0) +{ +setAD_User_ID (0); +setCM_Chat_ID (0); +setIsSelfService (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_ChatUpdate (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=878 */ +public static final int Table_ID=878; + +/** TableName=CM_ChatUpdate */ +public static final String Table_Name="CM_ChatUpdate"; + +protected static KeyNamePair Model = new KeyNamePair(878,"CM_ChatUpdate"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_ChatUpdate[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chat. +@param CM_Chat_ID Chat or discussion thread */ +public void setCM_Chat_ID (int CM_Chat_ID) +{ +if (CM_Chat_ID < 1) throw new IllegalArgumentException ("CM_Chat_ID is mandatory."); +set_ValueNoCheck ("CM_Chat_ID", new Integer(CM_Chat_ID)); +} +/** Get Chat. +@return Chat or discussion thread */ +public int getCM_Chat_ID() +{ +Integer ii = (Integer)get_Value("CM_Chat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Container.java b/dbPort/src/org/compiere/model/X_CM_Container.java new file mode 100644 index 0000000000..d551dcfb10 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Container.java @@ -0,0 +1,579 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Container + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.796 */ +public class X_CM_Container extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Container_ID id +@param trxName transaction +*/ +public X_CM_Container (Properties ctx, int CM_Container_ID, String trxName) +{ +super (ctx, CM_Container_ID, trxName); +/** if (CM_Container_ID == 0) +{ +setCM_Container_ID (0); +setCM_Template_ID (0); +setCM_WebProject_ID (0); +setContainerType (null); // D +setIsIndexed (false); +setIsSecure (false); +setIsSummary (false); +setMeta_Description (null); +setMeta_Keywords (null); +setName (null); +setNotice (null); +setPriority (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Container (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=855 */ +public static final int Table_ID=855; + +/** TableName=CM_Container */ +public static final String Table_Name="CM_Container"; + +protected static KeyNamePair Model = new KeyNamePair(855,"CM_Container"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Container[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** CM_ContainerLink_ID AD_Reference_ID=386 */ +public static final int CM_CONTAINERLINK_ID_AD_Reference_ID=386; +/** Set Container Link. +@param CM_ContainerLink_ID Link to another Container in the Web Project */ +public void setCM_ContainerLink_ID (int CM_ContainerLink_ID) +{ +if (CM_ContainerLink_ID <= 0) set_Value ("CM_ContainerLink_ID", null); + else +set_Value ("CM_ContainerLink_ID", new Integer(CM_ContainerLink_ID)); +} +/** Get Container Link. +@return Link to another Container in the Web Project */ +public int getCM_ContainerLink_ID() +{ +Integer ii = (Integer)get_Value("CM_ContainerLink_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID < 1) throw new IllegalArgumentException ("CM_Container_ID is mandatory."); +set_ValueNoCheck ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template. +@param CM_Template_ID Template defines how content is displayed */ +public void setCM_Template_ID (int CM_Template_ID) +{ +if (CM_Template_ID < 1) throw new IllegalArgumentException ("CM_Template_ID is mandatory."); +set_ValueNoCheck ("CM_Template_ID", new Integer(CM_Template_ID)); +} +/** Get Template. +@return Template defines how content is displayed */ +public int getCM_Template_ID() +{ +Integer ii = (Integer)get_Value("CM_Template_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set External Link (URL). +@param ContainerLinkURL External Link (IRL) for the Container */ +public void setContainerLinkURL (String ContainerLinkURL) +{ +if (ContainerLinkURL != null && ContainerLinkURL.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ContainerLinkURL = ContainerLinkURL.substring(0,59); +} +set_Value ("ContainerLinkURL", ContainerLinkURL); +} +/** Get External Link (URL). +@return External Link (IRL) for the Container */ +public String getContainerLinkURL() +{ +return (String)get_Value("ContainerLinkURL"); +} + +/** ContainerType AD_Reference_ID=385 */ +public static final int CONTAINERTYPE_AD_Reference_ID=385; +/** Document = D */ +public static final String CONTAINERTYPE_Document = "D"; +/** Internal Link = L */ +public static final String CONTAINERTYPE_InternalLink = "L"; +/** External URL = U */ +public static final String CONTAINERTYPE_ExternalURL = "U"; +/** Set Web Container Type. +@param ContainerType Web Container Type */ +public void setContainerType (String ContainerType) +{ +if (ContainerType == null) throw new IllegalArgumentException ("ContainerType is mandatory"); +if (ContainerType.equals("D") || ContainerType.equals("L") || ContainerType.equals("U")); + else throw new IllegalArgumentException ("ContainerType Invalid value - " + ContainerType + " - Reference_ID=385 - D - L - U"); +if (ContainerType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ContainerType = ContainerType.substring(0,0); +} +set_Value ("ContainerType", ContainerType); +} +/** Get Web Container Type. +@return Web Container Type */ +public String getContainerType() +{ +return (String)get_Value("ContainerType"); +} +/** Set ContainerXML. +@param ContainerXML Autogenerated Containerdefinition as XML Code */ +public void setContainerXML (String ContainerXML) +{ +if (ContainerXML != null && ContainerXML.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ContainerXML = ContainerXML.substring(0,1999); +} +set_ValueNoCheck ("ContainerXML", ContainerXML); +} +/** Get ContainerXML. +@return Autogenerated Containerdefinition as XML Code */ +public String getContainerXML() +{ +return (String)get_Value("ContainerXML"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Description = Description.substring(0,1999); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Indexed. +@param IsIndexed Index the document for the internal search engine */ +public void setIsIndexed (boolean IsIndexed) +{ +set_Value ("IsIndexed", new Boolean(IsIndexed)); +} +/** Get Indexed. +@return Index the document for the internal search engine */ +public boolean isIndexed() +{ +Object oo = get_Value("IsIndexed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Secure content. +@param IsSecure Defines whether content needs to get encrypted */ +public void setIsSecure (boolean IsSecure) +{ +set_Value ("IsSecure", new Boolean(IsSecure)); +} +/** Get Secure content. +@return Defines whether content needs to get encrypted */ +public boolean isSecure() +{ +Object oo = get_Value("IsSecure"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_ValueNoCheck ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Meta Author. +@param Meta_Author Author of the content */ +public void setMeta_Author (String Meta_Author) +{ +if (Meta_Author != null && Meta_Author.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Author = Meta_Author.substring(0,1999); +} +set_Value ("Meta_Author", Meta_Author); +} +/** Get Meta Author. +@return Author of the content */ +public String getMeta_Author() +{ +return (String)get_Value("Meta_Author"); +} +/** Set Meta Content Type. +@param Meta_Content Defines the type of content i.e. "text/html; + charset=UTF-8" */ +public void setMeta_Content (String Meta_Content) +{ +if (Meta_Content != null && Meta_Content.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Content = Meta_Content.substring(0,1999); +} +set_Value ("Meta_Content", Meta_Content); +} +/** Get Meta Content Type. +@return Defines the type of content i.e. "text/html; + charset=UTF-8" */ +public String getMeta_Content() +{ +return (String)get_Value("Meta_Content"); +} +/** Set Meta Copyright. +@param Meta_Copyright Contains Copyright information for the content */ +public void setMeta_Copyright (String Meta_Copyright) +{ +if (Meta_Copyright != null && Meta_Copyright.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Copyright = Meta_Copyright.substring(0,1999); +} +set_Value ("Meta_Copyright", Meta_Copyright); +} +/** Get Meta Copyright. +@return Contains Copyright information for the content */ +public String getMeta_Copyright() +{ +return (String)get_Value("Meta_Copyright"); +} +/** Set Meta Description. +@param Meta_Description Meta info describing the contents of the page */ +public void setMeta_Description (String Meta_Description) +{ +if (Meta_Description == null) throw new IllegalArgumentException ("Meta_Description is mandatory."); +if (Meta_Description.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Description = Meta_Description.substring(0,1999); +} +set_Value ("Meta_Description", Meta_Description); +} +/** Get Meta Description. +@return Meta info describing the contents of the page */ +public String getMeta_Description() +{ +return (String)get_Value("Meta_Description"); +} +/** Set Meta Keywords. +@param Meta_Keywords Contains the keywords for the content */ +public void setMeta_Keywords (String Meta_Keywords) +{ +if (Meta_Keywords == null) throw new IllegalArgumentException ("Meta_Keywords is mandatory."); +if (Meta_Keywords.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Keywords = Meta_Keywords.substring(0,1999); +} +set_Value ("Meta_Keywords", Meta_Keywords); +} +/** Get Meta Keywords. +@return Contains the keywords for the content */ +public String getMeta_Keywords() +{ +return (String)get_Value("Meta_Keywords"); +} +/** Set Meta Language. +@param Meta_Language Language HTML Meta Tag */ +public void setMeta_Language (String Meta_Language) +{ +if (Meta_Language != null && Meta_Language.length() > 2) +{ +log.warning("Length > 2 - truncated"); +Meta_Language = Meta_Language.substring(0,1); +} +set_Value ("Meta_Language", Meta_Language); +} +/** Get Meta Language. +@return Language HTML Meta Tag */ +public String getMeta_Language() +{ +return (String)get_Value("Meta_Language"); +} +/** Set Meta Publisher. +@param Meta_Publisher Meta Publisher defines the publisher of the content */ +public void setMeta_Publisher (String Meta_Publisher) +{ +if (Meta_Publisher != null && Meta_Publisher.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Publisher = Meta_Publisher.substring(0,1999); +} +set_Value ("Meta_Publisher", Meta_Publisher); +} +/** Get Meta Publisher. +@return Meta Publisher defines the publisher of the content */ +public String getMeta_Publisher() +{ +return (String)get_Value("Meta_Publisher"); +} +/** Set Meta RobotsTag. +@param Meta_RobotsTag RobotsTag defines how search robots should handle this content */ +public void setMeta_RobotsTag (String Meta_RobotsTag) +{ +if (Meta_RobotsTag != null && Meta_RobotsTag.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_RobotsTag = Meta_RobotsTag.substring(0,1999); +} +set_Value ("Meta_RobotsTag", Meta_RobotsTag); +} +/** Get Meta RobotsTag. +@return RobotsTag defines how search robots should handle this content */ +public String getMeta_RobotsTag() +{ +return (String)get_Value("Meta_RobotsTag"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Notice. +@param Notice Contains last write notice */ +public void setNotice (String Notice) +{ +if (Notice == null) throw new IllegalArgumentException ("Notice is mandatory."); +if (Notice.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Notice = Notice.substring(0,1999); +} +set_Value ("Notice", Notice); +} +/** Get Notice. +@return Contains last write notice */ +public String getNotice() +{ +return (String)get_Value("Notice"); +} +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (int Priority) +{ +set_Value ("Priority", new Integer(Priority)); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public int getPriority() +{ +Integer ii = (Integer)get_Value("Priority"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Relative URL. +@param RelativeURL Contains the relative URL for the container */ +public void setRelativeURL (String RelativeURL) +{ +if (RelativeURL != null && RelativeURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +RelativeURL = RelativeURL.substring(0,119); +} +set_Value ("RelativeURL", RelativeURL); +} +/** Get Relative URL. +@return Contains the relative URL for the container */ +public String getRelativeURL() +{ +return (String)get_Value("RelativeURL"); +} +/** Set StructureXML. +@param StructureXML Autogenerated Containerdefinition as XML Code */ +public void setStructureXML (String StructureXML) +{ +if (StructureXML != null && StructureXML.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +StructureXML = StructureXML.substring(0,1999); +} +set_Value ("StructureXML", StructureXML); +} +/** Get StructureXML. +@return Autogenerated Containerdefinition as XML Code */ +public String getStructureXML() +{ +return (String)get_Value("StructureXML"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title != null && Title.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Title = Title.substring(0,59); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_ContainerTTable.java b/dbPort/src/org/compiere/model/X_CM_ContainerTTable.java new file mode 100644 index 0000000000..24e41a7939 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_ContainerTTable.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_ContainerTTable + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.828 */ +public class X_CM_ContainerTTable extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_ContainerTTable_ID id +@param trxName transaction +*/ +public X_CM_ContainerTTable (Properties ctx, int CM_ContainerTTable_ID, String trxName) +{ +super (ctx, CM_ContainerTTable_ID, trxName); +/** if (CM_ContainerTTable_ID == 0) +{ +setCM_ContainerTTable_ID (0); +setCM_Container_ID (0); +setCM_TemplateTable_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_ContainerTTable (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=880 */ +public static final int Table_ID=880; + +/** TableName=CM_ContainerTTable */ +public static final String Table_Name="CM_ContainerTTable"; + +protected static KeyNamePair Model = new KeyNamePair(880,"CM_ContainerTTable"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_ContainerTTable[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Container T.Table. +@param CM_ContainerTTable_ID Container Template Table */ +public void setCM_ContainerTTable_ID (int CM_ContainerTTable_ID) +{ +if (CM_ContainerTTable_ID < 1) throw new IllegalArgumentException ("CM_ContainerTTable_ID is mandatory."); +set_ValueNoCheck ("CM_ContainerTTable_ID", new Integer(CM_ContainerTTable_ID)); +} +/** Get Container T.Table. +@return Container Template Table */ +public int getCM_ContainerTTable_ID() +{ +Integer ii = (Integer)get_Value("CM_ContainerTTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID < 1) throw new IllegalArgumentException ("CM_Container_ID is mandatory."); +set_ValueNoCheck ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template Table. +@param CM_TemplateTable_ID CM Template Table Link */ +public void setCM_TemplateTable_ID (int CM_TemplateTable_ID) +{ +if (CM_TemplateTable_ID < 1) throw new IllegalArgumentException ("CM_TemplateTable_ID is mandatory."); +set_ValueNoCheck ("CM_TemplateTable_ID", new Integer(CM_TemplateTable_ID)); +} +/** Get Template Table. +@return CM Template Table Link */ +public int getCM_TemplateTable_ID() +{ +Integer ii = (Integer)get_Value("CM_TemplateTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Other SQL Clause. +@param OtherClause Other SQL Clause */ +public void setOtherClause (String OtherClause) +{ +if (OtherClause != null && OtherClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OtherClause = OtherClause.substring(0,1999); +} +set_Value ("OtherClause", OtherClause); +} +/** Get Other SQL Clause. +@return Other SQL Clause */ +public String getOtherClause() +{ +return (String)get_Value("OtherClause"); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_ValueNoCheck ("Record_ID", null); + else +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Container_Element.java b/dbPort/src/org/compiere/model/X_CM_Container_Element.java new file mode 100644 index 0000000000..8f8a4d524d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Container_Element.java @@ -0,0 +1,208 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Container_Element + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.843 */ +public class X_CM_Container_Element extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Container_Element_ID id +@param trxName transaction +*/ +public X_CM_Container_Element (Properties ctx, int CM_Container_Element_ID, String trxName) +{ +super (ctx, CM_Container_Element_ID, trxName); +/** if (CM_Container_Element_ID == 0) +{ +setCM_Container_Element_ID (0); +setCM_Container_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Container_Element (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=860 */ +public static final int Table_ID=860; + +/** TableName=CM_Container_Element */ +public static final String Table_Name="CM_Container_Element"; + +protected static KeyNamePair Model = new KeyNamePair(860,"CM_Container_Element"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Container_Element[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Container Element. +@param CM_Container_Element_ID Container element i.e. Headline, Content, Footer etc. */ +public void setCM_Container_Element_ID (int CM_Container_Element_ID) +{ +if (CM_Container_Element_ID < 1) throw new IllegalArgumentException ("CM_Container_Element_ID is mandatory."); +set_ValueNoCheck ("CM_Container_Element_ID", new Integer(CM_Container_Element_ID)); +} +/** Get Container Element. +@return Container element i.e. Headline, Content, Footer etc. */ +public int getCM_Container_Element_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID < 1) throw new IllegalArgumentException ("CM_Container_ID is mandatory."); +set_ValueNoCheck ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Content HTML. +@param ContentHTML Contains the content itself */ +public void setContentHTML (String ContentHTML) +{ +set_Value ("ContentHTML", ContentHTML); +} +/** Get Content HTML. +@return Contains the content itself */ +public String getContentHTML() +{ +return (String)get_Value("ContentHTML"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Container_Index.java b/dbPort/src/org/compiere/model/X_CM_Container_Index.java new file mode 100644 index 0000000000..f5aad7ec5a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Container_Index.java @@ -0,0 +1,133 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Container_Index + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-06-17 17:51:37.297 */ +public class X_CM_Container_Index extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Container_Index_ID id +@param trxName transaction +*/ +public X_CM_Container_Index (Properties ctx, int CM_Container_Index_ID, String trxName) +{ +super (ctx, CM_Container_Index_ID, trxName); +/** if (CM_Container_Index_ID == 0) +{ +setCM_CONTAINER_INDEX_ID (0); +setCM_Container_Element_ID (0); +setKeyword (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Container_Index (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=862 */ +public static final int Table_ID=862; + +/** TableName=CM_Container_Index */ +public static final String Table_Name="CM_Container_Index"; + +protected static KeyNamePair Model = new KeyNamePair(862,"CM_Container_Index"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Container_Index[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Container Keyword Index. +@param CM_CONTAINER_INDEX_ID Container keyword index contains the content in keywords */ +public void setCM_CONTAINER_INDEX_ID (int CM_CONTAINER_INDEX_ID) +{ +if (CM_CONTAINER_INDEX_ID < 1) throw new IllegalArgumentException ("CM_CONTAINER_INDEX_ID is mandatory."); +set_ValueNoCheck ("CM_CONTAINER_INDEX_ID", new Integer(CM_CONTAINER_INDEX_ID)); +} +/** Get Container Keyword Index. +@return Container keyword index contains the content in keywords */ +public int getCM_CONTAINER_INDEX_ID() +{ +Integer ii = (Integer)get_Value("CM_CONTAINER_INDEX_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Container Element. +@param CM_Container_Element_ID Container element i.e. Headline, Content, Footer etc. */ +public void setCM_Container_Element_ID (int CM_Container_Element_ID) +{ +if (CM_Container_Element_ID < 1) throw new IllegalArgumentException ("CM_Container_Element_ID is mandatory."); +set_Value ("CM_Container_Element_ID", new Integer(CM_Container_Element_ID)); +} +/** Get Container Element. +@return Container element i.e. Headline, Content, Footer etc. */ +public int getCM_Container_Element_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Keyword. +@param Keyword Case insensitive keyword */ +public void setKeyword (String Keyword) +{ +if (Keyword == null) throw new IllegalArgumentException ("Keyword is mandatory."); +if (Keyword.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Keyword = Keyword.substring(0,254); +} +set_Value ("Keyword", Keyword); +} +/** Get Keyword. +@return Case insensitive keyword */ +public String getKeyword() +{ +return (String)get_Value("Keyword"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Container_ToDo.java b/dbPort/src/org/compiere/model/X_CM_Container_ToDo.java new file mode 100644 index 0000000000..0972cdb391 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Container_ToDo.java @@ -0,0 +1,244 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Container_ToDo + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-06-17 17:51:37.297 */ +public class X_CM_Container_ToDo extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Container_ToDo_ID id +@param trxName transaction +*/ +public X_CM_Container_ToDo (Properties ctx, int CM_Container_ToDo_ID, String trxName) +{ +super (ctx, CM_Container_ToDo_ID, trxName); +/** if (CM_Container_ToDo_ID == 0) +{ +setAD_User_ID (0); +setCM_Container_ID (0); +setCM_Container_ToDo_ID (0); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Container_ToDo (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=863 */ +public static final int Table_ID=863; + +/** TableName=CM_Container_ToDo */ +public static final String Table_Name="CM_Container_ToDo"; + +protected static KeyNamePair Model = new KeyNamePair(863,"CM_Container_ToDo"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Container_ToDo[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID < 1) throw new IllegalArgumentException ("CM_Container_ID is mandatory."); +set_Value ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Container ToDo. +@param CM_Container_ToDo_ID Contains internal workflow strcuture */ +public void setCM_Container_ToDo_ID (int CM_Container_ToDo_ID) +{ +if (CM_Container_ToDo_ID < 1) throw new IllegalArgumentException ("CM_Container_ToDo_ID is mandatory."); +set_ValueNoCheck ("CM_Container_ToDo_ID", new Integer(CM_Container_ToDo_ID)); +} +/** Get Container ToDo. +@return Contains internal workflow strcuture */ +public int getCM_Container_ToDo_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ToDo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set HistoryInfo. +@param HistoryInfo Info on the history */ +public void setHistoryInfo (String HistoryInfo) +{ +if (HistoryInfo != null && HistoryInfo.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +HistoryInfo = HistoryInfo.substring(0,1999); +} +set_Value ("HistoryInfo", HistoryInfo); +} +/** Get HistoryInfo. +@return Info on the history */ +public String getHistoryInfo() +{ +return (String)get_Value("HistoryInfo"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Next_User_ID AD_Reference_ID=110 */ +public static final int NEXT_USER_ID_AD_Reference_ID=110; +/** Set Next User. +@param Next_User_ID Info who should handle this case next */ +public void setNext_User_ID (int Next_User_ID) +{ +if (Next_User_ID <= 0) set_Value ("Next_User_ID", null); + else +set_Value ("Next_User_ID", new Integer(Next_User_ID)); +} +/** Get Next User. +@return Info who should handle this case next */ +public int getNext_User_ID() +{ +Integer ii = (Integer)get_Value("Next_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Container_URL.java b/dbPort/src/org/compiere/model/X_CM_Container_URL.java new file mode 100644 index 0000000000..342490c9bb --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Container_URL.java @@ -0,0 +1,171 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Container_URL + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.859 */ +public class X_CM_Container_URL extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Container_URL_ID id +@param trxName transaction +*/ +public X_CM_Container_URL (Properties ctx, int CM_Container_URL_ID, String trxName) +{ +super (ctx, CM_Container_URL_ID, trxName); +/** if (CM_Container_URL_ID == 0) +{ +setCM_Container_ID (0); +setCM_Container_URL_ID (0); +setChecked (new Timestamp(System.currentTimeMillis())); +setLast_Result (null); +setStatus (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Container_URL (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=865 */ +public static final int Table_ID=865; + +/** TableName=CM_Container_URL */ +public static final String Table_Name="CM_Container_URL"; + +protected static KeyNamePair Model = new KeyNamePair(865,"CM_Container_URL"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Container_URL[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID < 1) throw new IllegalArgumentException ("CM_Container_ID is mandatory."); +set_Value ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Container URL. +@param CM_Container_URL_ID Contains info on used URLs */ +public void setCM_Container_URL_ID (int CM_Container_URL_ID) +{ +if (CM_Container_URL_ID < 1) throw new IllegalArgumentException ("CM_Container_URL_ID is mandatory."); +set_ValueNoCheck ("CM_Container_URL_ID", new Integer(CM_Container_URL_ID)); +} +/** Get Container URL. +@return Contains info on used URLs */ +public int getCM_Container_URL_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_URL_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Last Checked. +@param Checked Info when we did the last check */ +public void setChecked (Timestamp Checked) +{ +if (Checked == null) throw new IllegalArgumentException ("Checked is mandatory."); +set_Value ("Checked", Checked); +} +/** Get Last Checked. +@return Info when we did the last check */ +public Timestamp getChecked() +{ +return (Timestamp)get_Value("Checked"); +} +/** Set Last Result. +@param Last_Result Contains data on the last check result */ +public void setLast_Result (String Last_Result) +{ +if (Last_Result == null) throw new IllegalArgumentException ("Last_Result is mandatory."); +if (Last_Result.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Last_Result = Last_Result.substring(0,1999); +} +set_Value ("Last_Result", Last_Result); +} +/** Get Last Result. +@return Contains data on the last check result */ +public String getLast_Result() +{ +return (String)get_Value("Last_Result"); +} +/** Set Status. +@param Status Status of the currently running check */ +public void setStatus (String Status) +{ +if (Status == null) throw new IllegalArgumentException ("Status is mandatory."); +if (Status.length() > 2) +{ +log.warning("Length > 2 - truncated"); +Status = Status.substring(0,1); +} +set_Value ("Status", Status); +} +/** Get Status. +@return Status of the currently running check */ +public String getStatus() +{ +return (String)get_Value("Status"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Media.java b/dbPort/src/org/compiere/model/X_CM_Media.java new file mode 100644 index 0000000000..e812145c4b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Media.java @@ -0,0 +1,277 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Media + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.859 */ +public class X_CM_Media extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Media_ID id +@param trxName transaction +*/ +public X_CM_Media (Properties ctx, int CM_Media_ID, String trxName) +{ +super (ctx, CM_Media_ID, trxName); +/** if (CM_Media_ID == 0) +{ +setCM_Media_ID (0); +setCM_WebProject_ID (0); +setIsSummary (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Media (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=857 */ +public static final int Table_ID=857; + +/** TableName=CM_Media */ +public static final String Table_Name="CM_Media"; + +protected static KeyNamePair Model = new KeyNamePair(857,"CM_Media"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Media[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Image. +@param AD_Image_ID Image or Icon */ +public void setAD_Image_ID (int AD_Image_ID) +{ +if (AD_Image_ID <= 0) set_Value ("AD_Image_ID", null); + else +set_Value ("AD_Image_ID", new Integer(AD_Image_ID)); +} +/** Get Image. +@return Image or Icon */ +public int getAD_Image_ID() +{ +Integer ii = (Integer)get_Value("AD_Image_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Media Item. +@param CM_Media_ID Contains media content like images, flash movies etc. */ +public void setCM_Media_ID (int CM_Media_ID) +{ +if (CM_Media_ID < 1) throw new IllegalArgumentException ("CM_Media_ID is mandatory."); +set_ValueNoCheck ("CM_Media_ID", new Integer(CM_Media_ID)); +} +/** Get Media Item. +@return Contains media content like images, flash movies etc. */ +public int getCM_Media_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Content. +@param ContentText Content */ +public void setContentText (String ContentText) +{ +set_Value ("ContentText", ContentText); +} +/** Get Content. +@return Content */ +public String getContentText() +{ +return (String)get_Value("ContentText"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Direct Deploy. +@param DirectDeploy Direct Deploy */ +public void setDirectDeploy (String DirectDeploy) +{ +if (DirectDeploy != null && DirectDeploy.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DirectDeploy = DirectDeploy.substring(0,0); +} +set_Value ("DirectDeploy", DirectDeploy); +} +/** Get Direct Deploy. +@return Direct Deploy */ +public String getDirectDeploy() +{ +return (String)get_Value("DirectDeploy"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** MediaType AD_Reference_ID=388 */ +public static final int MEDIATYPE_AD_Reference_ID=388; +/** text/css = CSS */ +public static final String MEDIATYPE_TextCss = "CSS"; +/** image/gif = GIF */ +public static final String MEDIATYPE_ImageGif = "GIF"; +/** image/jpeg = JPG */ +public static final String MEDIATYPE_ImageJpeg = "JPG"; +/** text/js = JS */ +public static final String MEDIATYPE_TextJs = "JS"; +/** application/pdf = PDF */ +public static final String MEDIATYPE_ApplicationPdf = "PDF"; +/** image/png = PNG */ +public static final String MEDIATYPE_ImagePng = "PNG"; +/** Set Media Type. +@param MediaType Defines the media type for the browser */ +public void setMediaType (String MediaType) +{ +if (MediaType == null) throw new IllegalArgumentException ("MediaType is mandatory"); +if (MediaType == null || MediaType.equals("CSS") || MediaType.equals("GIF") || MediaType.equals("JPG") || MediaType.equals("JS") || MediaType.equals("PDF") || MediaType.equals("PNG")); + else throw new IllegalArgumentException ("MediaType Invalid value - " + MediaType + " - Reference_ID=388 - CSS - GIF - JPG - JS - PDF - PNG"); +if (MediaType != null && MediaType.length() > 3) +{ +log.warning("Length > 3 - truncated"); +MediaType = MediaType.substring(0,2); +} +set_Value ("MediaType", MediaType); +} +/** Get Media Type. +@return Defines the media type for the browser */ +public String getMediaType() +{ +return (String)get_Value("MediaType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_MediaDeploy.java b/dbPort/src/org/compiere/model/X_CM_MediaDeploy.java new file mode 100644 index 0000000000..df5135fadd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_MediaDeploy.java @@ -0,0 +1,183 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_MediaDeploy + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.875 */ +public class X_CM_MediaDeploy extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_MediaDeploy_ID id +@param trxName transaction +*/ +public X_CM_MediaDeploy (Properties ctx, int CM_MediaDeploy_ID, String trxName) +{ +super (ctx, CM_MediaDeploy_ID, trxName); +/** if (CM_MediaDeploy_ID == 0) +{ +setCM_MediaDeploy_ID (0); +setCM_Media_ID (0); +setCM_Media_Server_ID (0); +setIsDeployed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_MediaDeploy (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=892 */ +public static final int Table_ID=892; + +/** TableName=CM_MediaDeploy */ +public static final String Table_Name="CM_MediaDeploy"; + +protected static KeyNamePair Model = new KeyNamePair(892,"CM_MediaDeploy"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_MediaDeploy[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Media Deploy. +@param CM_MediaDeploy_ID Media Deployment Log */ +public void setCM_MediaDeploy_ID (int CM_MediaDeploy_ID) +{ +if (CM_MediaDeploy_ID < 1) throw new IllegalArgumentException ("CM_MediaDeploy_ID is mandatory."); +set_ValueNoCheck ("CM_MediaDeploy_ID", new Integer(CM_MediaDeploy_ID)); +} +/** Get Media Deploy. +@return Media Deployment Log */ +public int getCM_MediaDeploy_ID() +{ +Integer ii = (Integer)get_Value("CM_MediaDeploy_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Media Item. +@param CM_Media_ID Contains media content like images, flash movies etc. */ +public void setCM_Media_ID (int CM_Media_ID) +{ +if (CM_Media_ID < 1) throw new IllegalArgumentException ("CM_Media_ID is mandatory."); +set_ValueNoCheck ("CM_Media_ID", new Integer(CM_Media_ID)); +} +/** Get Media Item. +@return Contains media content like images, flash movies etc. */ +public int getCM_Media_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Media Server. +@param CM_Media_Server_ID Media Server list to which content should get transfered */ +public void setCM_Media_Server_ID (int CM_Media_Server_ID) +{ +if (CM_Media_Server_ID < 1) throw new IllegalArgumentException ("CM_Media_Server_ID is mandatory."); +set_ValueNoCheck ("CM_Media_Server_ID", new Integer(CM_Media_Server_ID)); +} +/** Get Media Server. +@return Media Server list to which content should get transfered */ +public int getCM_Media_Server_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_Server_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Deployed. +@param IsDeployed Entity is deployed */ +public void setIsDeployed (boolean IsDeployed) +{ +set_Value ("IsDeployed", new Boolean(IsDeployed)); +} +/** Get Deployed. +@return Entity is deployed */ +public boolean isDeployed() +{ +Object oo = get_Value("IsDeployed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Last Synchronized. +@param LastSynchronized Date when last synchronized */ +public void setLastSynchronized (Timestamp LastSynchronized) +{ +set_Value ("LastSynchronized", LastSynchronized); +} +/** Get Last Synchronized. +@return Date when last synchronized */ +public Timestamp getLastSynchronized() +{ +return (Timestamp)get_Value("LastSynchronized"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Media_Server.java b/dbPort/src/org/compiere/model/X_CM_Media_Server.java new file mode 100644 index 0000000000..4ef567c909 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Media_Server.java @@ -0,0 +1,282 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Media_Server + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.89 */ +public class X_CM_Media_Server extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Media_Server_ID id +@param trxName transaction +*/ +public X_CM_Media_Server (Properties ctx, int CM_Media_Server_ID, String trxName) +{ +super (ctx, CM_Media_Server_ID, trxName); +/** if (CM_Media_Server_ID == 0) +{ +setCM_Media_Server_ID (0); +setCM_WebProject_ID (0); +setIsPassive (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Media_Server (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=859 */ +public static final int Table_ID=859; + +/** TableName=CM_Media_Server */ +public static final String Table_Name="CM_Media_Server"; + +protected static KeyNamePair Model = new KeyNamePair(859,"CM_Media_Server"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Media_Server[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Media Server. +@param CM_Media_Server_ID Media Server list to which content should get transfered */ +public void setCM_Media_Server_ID (int CM_Media_Server_ID) +{ +if (CM_Media_Server_ID < 1) throw new IllegalArgumentException ("CM_Media_Server_ID is mandatory."); +set_ValueNoCheck ("CM_Media_Server_ID", new Integer(CM_Media_Server_ID)); +} +/** Get Media Server. +@return Media Server list to which content should get transfered */ +public int getCM_Media_Server_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_Server_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Folder. +@param Folder A folder on a local or remote system to store data into */ +public void setFolder (String Folder) +{ +if (Folder != null && Folder.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Folder = Folder.substring(0,59); +} +set_Value ("Folder", Folder); +} +/** Get Folder. +@return A folder on a local or remote system to store data into */ +public String getFolder() +{ +return (String)get_Value("Folder"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set IP Address. +@param IP_Address Defines the IP address to transfer data to */ +public void setIP_Address (String IP_Address) +{ +if (IP_Address != null && IP_Address.length() > 20) +{ +log.warning("Length > 20 - truncated"); +IP_Address = IP_Address.substring(0,19); +} +set_Value ("IP_Address", IP_Address); +} +/** Get IP Address. +@return Defines the IP address to transfer data to */ +public String getIP_Address() +{ +return (String)get_Value("IP_Address"); +} +/** Set Transfer passive. +@param IsPassive FTP passive transfer */ +public void setIsPassive (boolean IsPassive) +{ +set_Value ("IsPassive", new Boolean(IsPassive)); +} +/** Get Transfer passive. +@return FTP passive transfer */ +public boolean isPassive() +{ +Object oo = get_Value("IsPassive"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Password. +@param Password Password of any length (case sensitive) */ +public void setPassword (String Password) +{ +if (Password != null && Password.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Password = Password.substring(0,39); +} +set_Value ("Password", Password); +} +/** Get Password. +@return Password of any length (case sensitive) */ +public String getPassword() +{ +return (String)get_Value("Password"); +} +/** Set URL. +@param URL Full URL address - e.g. http://www.adempiere.org */ +public void setURL (String URL) +{ +if (URL != null && URL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +URL = URL.substring(0,119); +} +set_Value ("URL", URL); +} +/** Get URL. +@return Full URL address - e.g. http://www.adempiere.org */ +public String getURL() +{ +return (String)get_Value("URL"); +} +/** Set Registered EMail. +@param UserName Email of the responsible for the System */ +public void setUserName (String UserName) +{ +if (UserName != null && UserName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +UserName = UserName.substring(0,39); +} +set_Value ("UserName", UserName); +} +/** Get Registered EMail. +@return Email of the responsible for the System */ +public String getUserName() +{ +return (String)get_Value("UserName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_NewsChannel.java b/dbPort/src/org/compiere/model/X_CM_NewsChannel.java new file mode 100644 index 0000000000..6e2aaddf43 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_NewsChannel.java @@ -0,0 +1,217 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_NewsChannel + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.906 */ +public class X_CM_NewsChannel extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_NewsChannel_ID id +@param trxName transaction +*/ +public X_CM_NewsChannel (Properties ctx, int CM_NewsChannel_ID, String trxName) +{ +super (ctx, CM_NewsChannel_ID, trxName); +/** if (CM_NewsChannel_ID == 0) +{ +setCM_NewsChannel_ID (0); +setCM_WebProject_ID (0); +setDescription (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_NewsChannel (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=870 */ +public static final int Table_ID=870; + +/** TableName=CM_NewsChannel */ +public static final String Table_Name="CM_NewsChannel"; + +protected static KeyNamePair Model = new KeyNamePair(870,"CM_NewsChannel"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_NewsChannel[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=106 */ +public static final int AD_LANGUAGE_AD_Reference_ID=106; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language != null && AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set News Channel. +@param CM_NewsChannel_ID News channel for rss feed */ +public void setCM_NewsChannel_ID (int CM_NewsChannel_ID) +{ +if (CM_NewsChannel_ID < 1) throw new IllegalArgumentException ("CM_NewsChannel_ID is mandatory."); +set_ValueNoCheck ("CM_NewsChannel_ID", new Integer(CM_NewsChannel_ID)); +} +/** Get News Channel. +@return News channel for rss feed */ +public int getCM_NewsChannel_ID() +{ +Integer ii = (Integer)get_Value("CM_NewsChannel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_Value ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description == null) throw new IllegalArgumentException ("Description is mandatory."); +if (Description.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Description = Description.substring(0,1999); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Link. +@param Link Contains URL to a target */ +public void setLink (String Link) +{ +if (Link != null && Link.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Link = Link.substring(0,254); +} +set_Value ("Link", Link); +} +/** Get Link. +@return Contains URL to a target */ +public String getLink() +{ +return (String)get_Value("Link"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_NewsItem.java b/dbPort/src/org/compiere/model/X_CM_NewsItem.java new file mode 100644 index 0000000000..1cd3936b04 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_NewsItem.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_NewsItem + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.921 */ +public class X_CM_NewsItem extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_NewsItem_ID id +@param trxName transaction +*/ +public X_CM_NewsItem (Properties ctx, int CM_NewsItem_ID, String trxName) +{ +super (ctx, CM_NewsItem_ID, trxName); +/** if (CM_NewsItem_ID == 0) +{ +setCM_NewsChannel_ID (0); +setCM_NewsItem_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_NewsItem (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=871 */ +public static final int Table_ID=871; + +/** TableName=CM_NewsItem */ +public static final String Table_Name="CM_NewsItem"; + +protected static KeyNamePair Model = new KeyNamePair(871,"CM_NewsItem"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_NewsItem[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Author. +@param Author Author/Creator of the Entity */ +public void setAuthor (String Author) +{ +if (Author != null && Author.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Author = Author.substring(0,254); +} +set_Value ("Author", Author); +} +/** Get Author. +@return Author/Creator of the Entity */ +public String getAuthor() +{ +return (String)get_Value("Author"); +} +/** Set News Channel. +@param CM_NewsChannel_ID News channel for rss feed */ +public void setCM_NewsChannel_ID (int CM_NewsChannel_ID) +{ +if (CM_NewsChannel_ID < 1) throw new IllegalArgumentException ("CM_NewsChannel_ID is mandatory."); +set_Value ("CM_NewsChannel_ID", new Integer(CM_NewsChannel_ID)); +} +/** Get News Channel. +@return News channel for rss feed */ +public int getCM_NewsChannel_ID() +{ +Integer ii = (Integer)get_Value("CM_NewsChannel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set News Item / Article. +@param CM_NewsItem_ID News item or article defines base content */ +public void setCM_NewsItem_ID (int CM_NewsItem_ID) +{ +if (CM_NewsItem_ID < 1) throw new IllegalArgumentException ("CM_NewsItem_ID is mandatory."); +set_ValueNoCheck ("CM_NewsItem_ID", new Integer(CM_NewsItem_ID)); +} +/** Get News Item / Article. +@return News item or article defines base content */ +public int getCM_NewsItem_ID() +{ +Integer ii = (Integer)get_Value("CM_NewsItem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Content HTML. +@param ContentHTML Contains the content itself */ +public void setContentHTML (String ContentHTML) +{ +set_Value ("ContentHTML", ContentHTML); +} +/** Get Content HTML. +@return Contains the content itself */ +public String getContentHTML() +{ +return (String)get_Value("ContentHTML"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set LinkURL. +@param LinkURL Contains URL to a target */ +public void setLinkURL (String LinkURL) +{ +if (LinkURL != null && LinkURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +LinkURL = LinkURL.substring(0,119); +} +set_Value ("LinkURL", LinkURL); +} +/** Get LinkURL. +@return Contains URL to a target */ +public String getLinkURL() +{ +return (String)get_Value("LinkURL"); +} +/** Set Publication Date. +@param PubDate Date on which this article will / should get published */ +public void setPubDate (Timestamp PubDate) +{ +set_Value ("PubDate", PubDate); +} +/** Get Publication Date. +@return Date on which this article will / should get published */ +public Timestamp getPubDate() +{ +return (Timestamp)get_Value("PubDate"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title != null && Title.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Title = Title.substring(0,254); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Template.java b/dbPort/src/org/compiere/model/X_CM_Template.java new file mode 100644 index 0000000000..49c8745377 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Template.java @@ -0,0 +1,339 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Template + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.921 */ +public class X_CM_Template extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Template_ID id +@param trxName transaction +*/ +public X_CM_Template (Properties ctx, int CM_Template_ID, String trxName) +{ +super (ctx, CM_Template_ID, trxName); +/** if (CM_Template_ID == 0) +{ +setCM_Template_ID (0); +setIsInclude (false); +setIsNews (false); +setIsSummary (false); +setIsUseAd (false); +setIsValid (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Template (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=854 */ +public static final int Table_ID=854; + +/** TableName=CM_Template */ +public static final String Table_Name="CM_Template"; + +protected static KeyNamePair Model = new KeyNamePair(854,"CM_Template"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Template[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Template. +@param CM_Template_ID Template defines how content is displayed */ +public void setCM_Template_ID (int CM_Template_ID) +{ +if (CM_Template_ID < 1) throw new IllegalArgumentException ("CM_Template_ID is mandatory."); +set_ValueNoCheck ("CM_Template_ID", new Integer(CM_Template_ID)); +} +/** Get Template. +@return Template defines how content is displayed */ +public int getCM_Template_ID() +{ +Integer ii = (Integer)get_Value("CM_Template_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID <= 0) set_ValueNoCheck ("CM_WebProject_ID", null); + else +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Elements. +@param Elements Contains list of elements seperated by CR */ +public void setElements (String Elements) +{ +if (Elements != null && Elements.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Elements = Elements.substring(0,1999); +} +set_Value ("Elements", Elements); +} +/** Get Elements. +@return Contains list of elements seperated by CR */ +public String getElements() +{ +return (String)get_Value("Elements"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Included. +@param IsInclude Defines whether this content / template is included into another one */ +public void setIsInclude (boolean IsInclude) +{ +set_Value ("IsInclude", new Boolean(IsInclude)); +} +/** Get Included. +@return Defines whether this content / template is included into another one */ +public boolean isInclude() +{ +Object oo = get_Value("IsInclude"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Uses News. +@param IsNews Template or container uses news channels */ +public void setIsNews (boolean IsNews) +{ +set_Value ("IsNews", new Boolean(IsNews)); +} +/** Get Uses News. +@return Template or container uses news channels */ +public boolean isNews() +{ +Object oo = get_Value("IsNews"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Use Ad. +@param IsUseAd Whether or not this templates uses Ad's */ +public void setIsUseAd (boolean IsUseAd) +{ +set_Value ("IsUseAd", new Boolean(IsUseAd)); +} +/** Get Use Ad. +@return Whether or not this templates uses Ad's */ +public boolean isUseAd() +{ +Object oo = get_Value("IsUseAd"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set TemplateXST. +@param TemplateXST Contains the template code itself */ +public void setTemplateXST (String TemplateXST) +{ +set_Value ("TemplateXST", TemplateXST); +} +/** Get TemplateXST. +@return Contains the template code itself */ +public String getTemplateXST() +{ +return (String)get_Value("TemplateXST"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_TemplateTable.java b/dbPort/src/org/compiere/model/X_CM_TemplateTable.java new file mode 100644 index 0000000000..60b8d6c167 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_TemplateTable.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_TemplateTable + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.953 */ +public class X_CM_TemplateTable extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_TemplateTable_ID id +@param trxName transaction +*/ +public X_CM_TemplateTable (Properties ctx, int CM_TemplateTable_ID, String trxName) +{ +super (ctx, CM_TemplateTable_ID, trxName); +/** if (CM_TemplateTable_ID == 0) +{ +setAD_Table_ID (0); +setCM_TemplateTable_ID (0); +setCM_Template_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_TemplateTable (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=879 */ +public static final int Table_ID=879; + +/** TableName=CM_TemplateTable */ +public static final String Table_Name="CM_TemplateTable"; + +protected static KeyNamePair Model = new KeyNamePair(879,"CM_TemplateTable"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_TemplateTable[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template Table. +@param CM_TemplateTable_ID CM Template Table Link */ +public void setCM_TemplateTable_ID (int CM_TemplateTable_ID) +{ +if (CM_TemplateTable_ID < 1) throw new IllegalArgumentException ("CM_TemplateTable_ID is mandatory."); +set_ValueNoCheck ("CM_TemplateTable_ID", new Integer(CM_TemplateTable_ID)); +} +/** Get Template Table. +@return CM Template Table Link */ +public int getCM_TemplateTable_ID() +{ +Integer ii = (Integer)get_Value("CM_TemplateTable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template. +@param CM_Template_ID Template defines how content is displayed */ +public void setCM_Template_ID (int CM_Template_ID) +{ +if (CM_Template_ID < 1) throw new IllegalArgumentException ("CM_Template_ID is mandatory."); +set_ValueNoCheck ("CM_Template_ID", new Integer(CM_Template_ID)); +} +/** Get Template. +@return Template defines how content is displayed */ +public int getCM_Template_ID() +{ +Integer ii = (Integer)get_Value("CM_Template_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Other SQL Clause. +@param OtherClause Other SQL Clause */ +public void setOtherClause (String OtherClause) +{ +if (OtherClause != null && OtherClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +OtherClause = OtherClause.substring(0,1999); +} +set_Value ("OtherClause", OtherClause); +} +/** Get Other SQL Clause. +@return Other SQL Clause */ +public String getOtherClause() +{ +return (String)get_Value("OtherClause"); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause != null && WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_Template_Ad_Cat.java b/dbPort/src/org/compiere/model/X_CM_Template_Ad_Cat.java new file mode 100644 index 0000000000..752a653e21 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_Template_Ad_Cat.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_Template_Ad_Cat + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.968 */ +public class X_CM_Template_Ad_Cat extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_Template_Ad_Cat_ID id +@param trxName transaction +*/ +public X_CM_Template_Ad_Cat (Properties ctx, int CM_Template_Ad_Cat_ID, String trxName) +{ +super (ctx, CM_Template_Ad_Cat_ID, trxName); +/** if (CM_Template_Ad_Cat_ID == 0) +{ +setCM_Ad_Cat_ID (0); +setCM_Template_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_Template_Ad_Cat (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=872 */ +public static final int Table_ID=872; + +/** TableName=CM_Template_Ad_Cat */ +public static final String Table_Name="CM_Template_Ad_Cat"; + +protected static KeyNamePair Model = new KeyNamePair(872,"CM_Template_Ad_Cat"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_Template_Ad_Cat[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Advertisement Category. +@param CM_Ad_Cat_ID Advertisement Category like Banner Homepage */ +public void setCM_Ad_Cat_ID (int CM_Ad_Cat_ID) +{ +if (CM_Ad_Cat_ID < 1) throw new IllegalArgumentException ("CM_Ad_Cat_ID is mandatory."); +set_Value ("CM_Ad_Cat_ID", new Integer(CM_Ad_Cat_ID)); +} +/** Get Advertisement Category. +@return Advertisement Category like Banner Homepage */ +public int getCM_Ad_Cat_ID() +{ +Integer ii = (Integer)get_Value("CM_Ad_Cat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Template. +@param CM_Template_ID Template defines how content is displayed */ +public void setCM_Template_ID (int CM_Template_ID) +{ +if (CM_Template_ID < 1) throw new IllegalArgumentException ("CM_Template_ID is mandatory."); +set_Value ("CM_Template_ID", new Integer(CM_Template_ID)); +} +/** Get Template. +@return Template defines how content is displayed */ +public int getCM_Template_ID() +{ +Integer ii = (Integer)get_Value("CM_Template_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_WebAccessLog.java b/dbPort/src/org/compiere/model/X_CM_WebAccessLog.java new file mode 100644 index 0000000000..59ca018d42 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_WebAccessLog.java @@ -0,0 +1,418 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_WebAccessLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:55.968 */ +public class X_CM_WebAccessLog extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_WebAccessLog_ID id +@param trxName transaction +*/ +public X_CM_WebAccessLog (Properties ctx, int CM_WebAccessLog_ID, String trxName) +{ +super (ctx, CM_WebAccessLog_ID, trxName); +/** if (CM_WebAccessLog_ID == 0) +{ +setCM_WebAccessLog_ID (0); +setIP_Address (null); +setLogType (null); +setProtocol (null); +setRequestType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_WebAccessLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=894 */ +public static final int Table_ID=894; + +/** TableName=CM_WebAccessLog */ +public static final String Table_Name="CM_WebAccessLog"; + +protected static KeyNamePair Model = new KeyNamePair(894,"CM_WebAccessLog"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_WebAccessLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accept Language. +@param AcceptLanguage Language accepted based on browser information */ +public void setAcceptLanguage (String AcceptLanguage) +{ +if (AcceptLanguage != null && AcceptLanguage.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AcceptLanguage = AcceptLanguage.substring(0,59); +} +set_Value ("AcceptLanguage", AcceptLanguage); +} +/** Get Accept Language. +@return Language accepted based on browser information */ +public String getAcceptLanguage() +{ +return (String)get_Value("AcceptLanguage"); +} +/** Set Broadcast Server. +@param CM_BroadcastServer_ID Web Broadcast Server */ +public void setCM_BroadcastServer_ID (int CM_BroadcastServer_ID) +{ +if (CM_BroadcastServer_ID <= 0) set_Value ("CM_BroadcastServer_ID", null); + else +set_Value ("CM_BroadcastServer_ID", new Integer(CM_BroadcastServer_ID)); +} +/** Get Broadcast Server. +@return Web Broadcast Server */ +public int getCM_BroadcastServer_ID() +{ +Integer ii = (Integer)get_Value("CM_BroadcastServer_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Media Item. +@param CM_Media_ID Contains media content like images, flash movies etc. */ +public void setCM_Media_ID (int CM_Media_ID) +{ +if (CM_Media_ID <= 0) set_Value ("CM_Media_ID", null); + else +set_Value ("CM_Media_ID", new Integer(CM_Media_ID)); +} +/** Get Media Item. +@return Contains media content like images, flash movies etc. */ +public int getCM_Media_ID() +{ +Integer ii = (Integer)get_Value("CM_Media_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Access Log. +@param CM_WebAccessLog_ID Web Access Log Information */ +public void setCM_WebAccessLog_ID (int CM_WebAccessLog_ID) +{ +if (CM_WebAccessLog_ID < 1) throw new IllegalArgumentException ("CM_WebAccessLog_ID is mandatory."); +set_ValueNoCheck ("CM_WebAccessLog_ID", new Integer(CM_WebAccessLog_ID)); +} +/** Get Web Access Log. +@return Web Access Log Information */ +public int getCM_WebAccessLog_ID() +{ +Integer ii = (Integer)get_Value("CM_WebAccessLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID <= 0) set_Value ("CM_WebProject_ID", null); + else +set_Value ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set File Size. +@param FileSize Size of the File in bytes */ +public void setFileSize (BigDecimal FileSize) +{ +set_Value ("FileSize", FileSize); +} +/** Get File Size. +@return Size of the File in bytes */ +public BigDecimal getFileSize() +{ +BigDecimal bd = (BigDecimal)get_Value("FileSize"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Hyphen. +@param Hyphen Hyphen */ +public void setHyphen (String Hyphen) +{ +if (Hyphen != null && Hyphen.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Hyphen = Hyphen.substring(0,19); +} +set_Value ("Hyphen", Hyphen); +} +/** Get Hyphen. +@return Hyphen */ +public String getHyphen() +{ +return (String)get_Value("Hyphen"); +} +/** Set IP Address. +@param IP_Address Defines the IP address to transfer data to */ +public void setIP_Address (String IP_Address) +{ +if (IP_Address == null) throw new IllegalArgumentException ("IP_Address is mandatory."); +if (IP_Address.length() > 20) +{ +log.warning("Length > 20 - truncated"); +IP_Address = IP_Address.substring(0,19); +} +set_Value ("IP_Address", IP_Address); +} +/** Get IP Address. +@return Defines the IP address to transfer data to */ +public String getIP_Address() +{ +return (String)get_Value("IP_Address"); +} + +/** LogType AD_Reference_ID=390 */ +public static final int LOGTYPE_AD_Reference_ID=390; +/** Ad display = A */ +public static final String LOGTYPE_AdDisplay = "A"; +/** Redirect = R */ +public static final String LOGTYPE_Redirect = "R"; +/** Web Access = W */ +public static final String LOGTYPE_WebAccess = "W"; +/** Set Log Type. +@param LogType Web Log Type */ +public void setLogType (String LogType) +{ +if (LogType == null) throw new IllegalArgumentException ("LogType is mandatory"); +if (LogType.equals("A") || LogType.equals("R") || LogType.equals("W")); + else throw new IllegalArgumentException ("LogType Invalid value - " + LogType + " - Reference_ID=390 - A - R - W"); +if (LogType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LogType = LogType.substring(0,0); +} +set_Value ("LogType", LogType); +} +/** Get Log Type. +@return Web Log Type */ +public String getLogType() +{ +return (String)get_Value("LogType"); +} +/** Set Page URL. +@param PageURL Page URL */ +public void setPageURL (String PageURL) +{ +if (PageURL != null && PageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +PageURL = PageURL.substring(0,119); +} +set_Value ("PageURL", PageURL); +} +/** Get Page URL. +@return Page URL */ +public String getPageURL() +{ +return (String)get_Value("PageURL"); +} +/** Set Protocol. +@param Protocol Protocol */ +public void setProtocol (String Protocol) +{ +if (Protocol == null) throw new IllegalArgumentException ("Protocol is mandatory."); +if (Protocol.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Protocol = Protocol.substring(0,19); +} +set_Value ("Protocol", Protocol); +} +/** Get Protocol. +@return Protocol */ +public String getProtocol() +{ +return (String)get_Value("Protocol"); +} +/** Set Referrer. +@param Referrer Referring web address */ +public void setReferrer (String Referrer) +{ +if (Referrer != null && Referrer.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Referrer = Referrer.substring(0,119); +} +set_Value ("Referrer", Referrer); +} +/** Get Referrer. +@return Referring web address */ +public String getReferrer() +{ +return (String)get_Value("Referrer"); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_Value ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_Value ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Request Type. +@param RequestType Request Type */ +public void setRequestType (String RequestType) +{ +if (RequestType == null) throw new IllegalArgumentException ("RequestType is mandatory."); +if (RequestType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +RequestType = RequestType.substring(0,3); +} +set_Value ("RequestType", RequestType); +} +/** Get Request Type. +@return Request Type */ +public String getRequestType() +{ +return (String)get_Value("RequestType"); +} +/** Set Status Code. +@param StatusCode Status Code */ +public void setStatusCode (int StatusCode) +{ +set_Value ("StatusCode", new Integer(StatusCode)); +} +/** Get Status Code. +@return Status Code */ +public int getStatusCode() +{ +Integer ii = (Integer)get_Value("StatusCode"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Agent. +@param UserAgent Browser Used */ +public void setUserAgent (String UserAgent) +{ +if (UserAgent != null && UserAgent.length() > 255) +{ +log.warning("Length > 255 - truncated"); +UserAgent = UserAgent.substring(0,254); +} +set_Value ("UserAgent", UserAgent); +} +/** Get User Agent. +@return Browser Used */ +public String getUserAgent() +{ +return (String)get_Value("UserAgent"); +} +/** Set Web Session. +@param WebSession Web Session ID */ +public void setWebSession (String WebSession) +{ +if (WebSession != null && WebSession.length() > 40) +{ +log.warning("Length > 40 - truncated"); +WebSession = WebSession.substring(0,39); +} +set_Value ("WebSession", WebSession); +} +/** Get Web Session. +@return Web Session ID */ +public String getWebSession() +{ +return (String)get_Value("WebSession"); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_WebProject.java b/dbPort/src/org/compiere/model/X_CM_WebProject.java new file mode 100644 index 0000000000..e780cd551a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_WebProject.java @@ -0,0 +1,336 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_WebProject + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.0 */ +public class X_CM_WebProject extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_WebProject_ID id +@param trxName transaction +*/ +public X_CM_WebProject (Properties ctx, int CM_WebProject_ID, String trxName) +{ +super (ctx, CM_WebProject_ID, trxName); +/** if (CM_WebProject_ID == 0) +{ +setCM_WebProject_ID (0); +setMeta_Author (null); // @AD_User_Name@ +setMeta_Content (null); // 'text/html; + charset=UTF-8' +setMeta_Copyright (null); // @AD_Client_Name@ +setMeta_Publisher (null); // @AD_Client_Name@ +setMeta_RobotsTag (null); // 'INDEX,FOLLOW' +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_WebProject (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=853 */ +public static final int Table_ID=853; + +/** TableName=CM_WebProject */ +public static final String Table_Name="CM_WebProject"; + +protected static KeyNamePair Model = new KeyNamePair(853,"CM_WebProject"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_WebProject[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_TreeCMC_ID AD_Reference_ID=184 */ +public static final int AD_TREECMC_ID_AD_Reference_ID=184; +/** Set Container Tree. +@param AD_TreeCMC_ID Container Tree */ +public void setAD_TreeCMC_ID (int AD_TreeCMC_ID) +{ +if (AD_TreeCMC_ID <= 0) set_ValueNoCheck ("AD_TreeCMC_ID", null); + else +set_ValueNoCheck ("AD_TreeCMC_ID", new Integer(AD_TreeCMC_ID)); +} +/** Get Container Tree. +@return Container Tree */ +public int getAD_TreeCMC_ID() +{ +Integer ii = (Integer)get_Value("AD_TreeCMC_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_TreeCMM_ID AD_Reference_ID=184 */ +public static final int AD_TREECMM_ID_AD_Reference_ID=184; +/** Set Media Tree. +@param AD_TreeCMM_ID Media Tree */ +public void setAD_TreeCMM_ID (int AD_TreeCMM_ID) +{ +if (AD_TreeCMM_ID <= 0) set_ValueNoCheck ("AD_TreeCMM_ID", null); + else +set_ValueNoCheck ("AD_TreeCMM_ID", new Integer(AD_TreeCMM_ID)); +} +/** Get Media Tree. +@return Media Tree */ +public int getAD_TreeCMM_ID() +{ +Integer ii = (Integer)get_Value("AD_TreeCMM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_TreeCMS_ID AD_Reference_ID=184 */ +public static final int AD_TREECMS_ID_AD_Reference_ID=184; +/** Set Stage Tree. +@param AD_TreeCMS_ID Stage Tree */ +public void setAD_TreeCMS_ID (int AD_TreeCMS_ID) +{ +if (AD_TreeCMS_ID <= 0) set_ValueNoCheck ("AD_TreeCMS_ID", null); + else +set_ValueNoCheck ("AD_TreeCMS_ID", new Integer(AD_TreeCMS_ID)); +} +/** Get Stage Tree. +@return Stage Tree */ +public int getAD_TreeCMS_ID() +{ +Integer ii = (Integer)get_Value("AD_TreeCMS_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_TreeCMT_ID AD_Reference_ID=184 */ +public static final int AD_TREECMT_ID_AD_Reference_ID=184; +/** Set Template Tree. +@param AD_TreeCMT_ID Template Tree */ +public void setAD_TreeCMT_ID (int AD_TreeCMT_ID) +{ +if (AD_TreeCMT_ID <= 0) set_ValueNoCheck ("AD_TreeCMT_ID", null); + else +set_ValueNoCheck ("AD_TreeCMT_ID", new Integer(AD_TreeCMT_ID)); +} +/** Get Template Tree. +@return Template Tree */ +public int getAD_TreeCMT_ID() +{ +Integer ii = (Integer)get_Value("AD_TreeCMT_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Meta Author. +@param Meta_Author Author of the content */ +public void setMeta_Author (String Meta_Author) +{ +if (Meta_Author == null) throw new IllegalArgumentException ("Meta_Author is mandatory."); +if (Meta_Author.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Author = Meta_Author.substring(0,1999); +} +set_Value ("Meta_Author", Meta_Author); +} +/** Get Meta Author. +@return Author of the content */ +public String getMeta_Author() +{ +return (String)get_Value("Meta_Author"); +} +/** Set Meta Content Type. +@param Meta_Content Defines the type of content i.e. "text/html; + charset=UTF-8" */ +public void setMeta_Content (String Meta_Content) +{ +if (Meta_Content == null) throw new IllegalArgumentException ("Meta_Content is mandatory."); +if (Meta_Content.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Content = Meta_Content.substring(0,1999); +} +set_Value ("Meta_Content", Meta_Content); +} +/** Get Meta Content Type. +@return Defines the type of content i.e. "text/html; + charset=UTF-8" */ +public String getMeta_Content() +{ +return (String)get_Value("Meta_Content"); +} +/** Set Meta Copyright. +@param Meta_Copyright Contains Copyright information for the content */ +public void setMeta_Copyright (String Meta_Copyright) +{ +if (Meta_Copyright == null) throw new IllegalArgumentException ("Meta_Copyright is mandatory."); +if (Meta_Copyright.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Copyright = Meta_Copyright.substring(0,1999); +} +set_Value ("Meta_Copyright", Meta_Copyright); +} +/** Get Meta Copyright. +@return Contains Copyright information for the content */ +public String getMeta_Copyright() +{ +return (String)get_Value("Meta_Copyright"); +} +/** Set Meta Publisher. +@param Meta_Publisher Meta Publisher defines the publisher of the content */ +public void setMeta_Publisher (String Meta_Publisher) +{ +if (Meta_Publisher == null) throw new IllegalArgumentException ("Meta_Publisher is mandatory."); +if (Meta_Publisher.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_Publisher = Meta_Publisher.substring(0,1999); +} +set_Value ("Meta_Publisher", Meta_Publisher); +} +/** Get Meta Publisher. +@return Meta Publisher defines the publisher of the content */ +public String getMeta_Publisher() +{ +return (String)get_Value("Meta_Publisher"); +} +/** Set Meta RobotsTag. +@param Meta_RobotsTag RobotsTag defines how search robots should handle this content */ +public void setMeta_RobotsTag (String Meta_RobotsTag) +{ +if (Meta_RobotsTag == null) throw new IllegalArgumentException ("Meta_RobotsTag is mandatory."); +if (Meta_RobotsTag.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Meta_RobotsTag = Meta_RobotsTag.substring(0,1999); +} +set_Value ("Meta_RobotsTag", Meta_RobotsTag); +} +/** Get Meta RobotsTag. +@return RobotsTag defines how search robots should handle this content */ +public String getMeta_RobotsTag() +{ +return (String)get_Value("Meta_RobotsTag"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_CM_WebProject_Domain.java b/dbPort/src/org/compiere/model/X_CM_WebProject_Domain.java new file mode 100644 index 0000000000..178fee2a8a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_CM_WebProject_Domain.java @@ -0,0 +1,213 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for CM_WebProject_Domain + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.015 */ +public class X_CM_WebProject_Domain extends PO +{ +/** Standard Constructor +@param ctx context +@param CM_WebProject_Domain_ID id +@param trxName transaction +*/ +public X_CM_WebProject_Domain (Properties ctx, int CM_WebProject_Domain_ID, String trxName) +{ +super (ctx, CM_WebProject_Domain_ID, trxName); +/** if (CM_WebProject_Domain_ID == 0) +{ +setCM_WebProject_Domain_ID (0); +setCM_WebProject_ID (0); +setFQDN (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_CM_WebProject_Domain (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=873 */ +public static final int Table_ID=873; + +/** TableName=CM_WebProject_Domain */ +public static final String Table_Name="CM_WebProject_Domain"; + +protected static KeyNamePair Model = new KeyNamePair(873,"CM_WebProject_Domain"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_CM_WebProject_Domain[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Container. +@param CM_Container_ID Web Container contains content like images, text etc. */ +public void setCM_Container_ID (int CM_Container_ID) +{ +if (CM_Container_ID <= 0) set_Value ("CM_Container_ID", null); + else +set_Value ("CM_Container_ID", new Integer(CM_Container_ID)); +} +/** Get Web Container. +@return Web Container contains content like images, text etc. */ +public int getCM_Container_ID() +{ +Integer ii = (Integer)get_Value("CM_Container_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set WebProject Domain. +@param CM_WebProject_Domain_ID Definition of Domainhandling */ +public void setCM_WebProject_Domain_ID (int CM_WebProject_Domain_ID) +{ +if (CM_WebProject_Domain_ID < 1) throw new IllegalArgumentException ("CM_WebProject_Domain_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_Domain_ID", new Integer(CM_WebProject_Domain_ID)); +} +/** Get WebProject Domain. +@return Definition of Domainhandling */ +public int getCM_WebProject_Domain_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_Domain_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID < 1) throw new IllegalArgumentException ("CM_WebProject_ID is mandatory."); +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Fully Qualified Domain Name. +@param FQDN Fully Qualified Domain Name i.e. www.comdivision.com */ +public void setFQDN (String FQDN) +{ +if (FQDN == null) throw new IllegalArgumentException ("FQDN is mandatory."); +if (FQDN.length() > 120) +{ +log.warning("Length > 120 - truncated"); +FQDN = FQDN.substring(0,119); +} +set_Value ("FQDN", FQDN); +} +/** Get Fully Qualified Domain Name. +@return Fully Qualified Domain Name i.e. www.comdivision.com */ +public String getFQDN() +{ +return (String)get_Value("FQDN"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AcctProcessor.java b/dbPort/src/org/compiere/model/X_C_AcctProcessor.java new file mode 100644 index 0000000000..7d4cc1c9c4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AcctProcessor.java @@ -0,0 +1,298 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AcctProcessor + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.031 */ +public class X_C_AcctProcessor extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AcctProcessor_ID id +@param trxName transaction +*/ +public X_C_AcctProcessor (Properties ctx, int C_AcctProcessor_ID, String trxName) +{ +super (ctx, C_AcctProcessor_ID, trxName); +/** if (C_AcctProcessor_ID == 0) +{ +setC_AcctProcessor_ID (0); +setFrequency (0); +setFrequencyType (null); +setKeepLogDays (0); // 7 +setName (null); +setSupervisor_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AcctProcessor (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=695 */ +public static final int Table_ID=695; + +/** TableName=C_AcctProcessor */ +public static final String Table_Name="C_AcctProcessor"; + +protected static KeyNamePair Model = new KeyNamePair(695,"C_AcctProcessor"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AcctProcessor[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Processor. +@param C_AcctProcessor_ID Accounting Processor/Server Parameters */ +public void setC_AcctProcessor_ID (int C_AcctProcessor_ID) +{ +if (C_AcctProcessor_ID < 1) throw new IllegalArgumentException ("C_AcctProcessor_ID is mandatory."); +set_ValueNoCheck ("C_AcctProcessor_ID", new Integer(C_AcctProcessor_ID)); +} +/** Get Accounting Processor. +@return Accounting Processor/Server Parameters */ +public int getC_AcctProcessor_ID() +{ +Integer ii = (Integer)get_Value("C_AcctProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID <= 0) set_Value ("C_AcctSchema_ID", null); + else +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +set_Value ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=221 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=221; +/** Day = D */ +public static final String FREQUENCYTYPE_Day = "D"; +/** Hour = H */ +public static final String FREQUENCYTYPE_Hour = "H"; +/** Minute = M */ +public static final String FREQUENCYTYPE_Minute = "M"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("H") || FrequencyType.equals("M")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=221 - D - H - M"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Days to keep Log. +@param KeepLogDays Number of days to keep the log entries */ +public void setKeepLogDays (int KeepLogDays) +{ +set_Value ("KeepLogDays", new Integer(KeepLogDays)); +} +/** Get Days to keep Log. +@return Number of days to keep the log entries */ +public int getKeepLogDays() +{ +Integer ii = (Integer)get_Value("KeepLogDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** Supervisor_ID AD_Reference_ID=286 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=286; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID < 1) throw new IllegalArgumentException ("Supervisor_ID is mandatory."); +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AcctProcessorLog.java b/dbPort/src/org/compiere/model/X_C_AcctProcessorLog.java new file mode 100644 index 0000000000..a54972e68a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AcctProcessorLog.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AcctProcessorLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.046 */ +public class X_C_AcctProcessorLog extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AcctProcessorLog_ID id +@param trxName transaction +*/ +public X_C_AcctProcessorLog (Properties ctx, int C_AcctProcessorLog_ID, String trxName) +{ +super (ctx, C_AcctProcessorLog_ID, trxName); +/** if (C_AcctProcessorLog_ID == 0) +{ +setC_AcctProcessorLog_ID (0); +setC_AcctProcessor_ID (0); +setIsError (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AcctProcessorLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=694 */ +public static final int Table_ID=694; + +/** TableName=C_AcctProcessorLog */ +public static final String Table_Name="C_AcctProcessorLog"; + +protected static KeyNamePair Model = new KeyNamePair(694,"C_AcctProcessorLog"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AcctProcessorLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Accounting Processor Log. +@param C_AcctProcessorLog_ID Result of the execution of the Accounting Processor */ +public void setC_AcctProcessorLog_ID (int C_AcctProcessorLog_ID) +{ +if (C_AcctProcessorLog_ID < 1) throw new IllegalArgumentException ("C_AcctProcessorLog_ID is mandatory."); +set_ValueNoCheck ("C_AcctProcessorLog_ID", new Integer(C_AcctProcessorLog_ID)); +} +/** Get Accounting Processor Log. +@return Result of the execution of the Accounting Processor */ +public int getC_AcctProcessorLog_ID() +{ +Integer ii = (Integer)get_Value("C_AcctProcessorLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Processor. +@param C_AcctProcessor_ID Accounting Processor/Server Parameters */ +public void setC_AcctProcessor_ID (int C_AcctProcessor_ID) +{ +if (C_AcctProcessor_ID < 1) throw new IllegalArgumentException ("C_AcctProcessor_ID is mandatory."); +set_ValueNoCheck ("C_AcctProcessor_ID", new Integer(C_AcctProcessor_ID)); +} +/** Get Accounting Processor. +@return Accounting Processor/Server Parameters */ +public int getC_AcctProcessor_ID() +{ +Integer ii = (Integer)get_Value("C_AcctProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Error. +@param IsError An Error occured in the execution */ +public void setIsError (boolean IsError) +{ +set_Value ("IsError", new Boolean(IsError)); +} +/** Get Error. +@return An Error occured in the execution */ +public boolean isError() +{ +Object oo = get_Value("IsError"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AcctSchema.java b/dbPort/src/org/compiere/model/X_C_AcctSchema.java new file mode 100644 index 0000000000..d179db6bce --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AcctSchema.java @@ -0,0 +1,616 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AcctSchema + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.062 */ +public class X_C_AcctSchema extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AcctSchema_ID id +@param trxName transaction +*/ +public X_C_AcctSchema (Properties ctx, int C_AcctSchema_ID, String trxName) +{ +super (ctx, C_AcctSchema_ID, trxName); +/** if (C_AcctSchema_ID == 0) +{ +setAutoPeriodControl (false); +setC_AcctSchema_ID (0); +setC_Currency_ID (0); +setCommitmentType (null); // N +setCostingLevel (null); // C +setCostingMethod (null); // S +setGAAP (null); +setHasAlias (false); +setHasCombination (false); +setIsAccrual (true); // Y +setIsAdjustCOGS (false); +setIsDiscountCorrectsTax (false); +setIsExplicitCostAdjustment (false); // N +setIsPostServices (false); // N +setIsTradeDiscountPosted (false); +setM_CostType_ID (0); +setName (null); +setSeparator (null); // - +setTaxCorrectionType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AcctSchema (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=265 */ +public static final int Table_ID=265; + +/** TableName=C_AcctSchema */ +public static final String Table_Name="C_AcctSchema"; + +protected static KeyNamePair Model = new KeyNamePair(265,"C_AcctSchema"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AcctSchema[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgOnly_ID AD_Reference_ID=322 */ +public static final int AD_ORGONLY_ID_AD_Reference_ID=322; +/** Set Only Organization. +@param AD_OrgOnly_ID Create posting entries only for this organization */ +public void setAD_OrgOnly_ID (int AD_OrgOnly_ID) +{ +if (AD_OrgOnly_ID <= 0) set_Value ("AD_OrgOnly_ID", null); + else +set_Value ("AD_OrgOnly_ID", new Integer(AD_OrgOnly_ID)); +} +/** Get Only Organization. +@return Create posting entries only for this organization */ +public int getAD_OrgOnly_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgOnly_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Automatic Period Control. +@param AutoPeriodControl If selected, the periods are automatically opened and closed */ +public void setAutoPeriodControl (boolean AutoPeriodControl) +{ +set_Value ("AutoPeriodControl", new Boolean(AutoPeriodControl)); +} +/** Get Automatic Period Control. +@return If selected, the periods are automatically opened and closed */ +public boolean isAutoPeriodControl() +{ +Object oo = get_Value("AutoPeriodControl"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID <= 0) set_ValueNoCheck ("C_Period_ID", null); + else +set_ValueNoCheck ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CommitmentType AD_Reference_ID=359 */ +public static final int COMMITMENTTYPE_AD_Reference_ID=359; +/** Commitment & Reservation = B */ +public static final String COMMITMENTTYPE_CommitmentReservation = "B"; +/** Commitment only = C */ +public static final String COMMITMENTTYPE_CommitmentOnly = "C"; +/** None = N */ +public static final String COMMITMENTTYPE_None = "N"; +/** Set Commitment Type. +@param CommitmentType Create Commitment and/or Reservations for Budget Control */ +public void setCommitmentType (String CommitmentType) +{ +if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType is mandatory"); +if (CommitmentType.equals("B") || CommitmentType.equals("C") || CommitmentType.equals("N")); + else throw new IllegalArgumentException ("CommitmentType Invalid value - " + CommitmentType + " - Reference_ID=359 - B - C - N"); +if (CommitmentType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CommitmentType = CommitmentType.substring(0,0); +} +set_Value ("CommitmentType", CommitmentType); +} +/** Get Commitment Type. +@return Create Commitment and/or Reservations for Budget Control */ +public String getCommitmentType() +{ +return (String)get_Value("CommitmentType"); +} + +/** CostingLevel AD_Reference_ID=355 */ +public static final int COSTINGLEVEL_AD_Reference_ID=355; +/** Batch/Lot = B */ +public static final String COSTINGLEVEL_BatchLot = "B"; +/** Client = C */ +public static final String COSTINGLEVEL_Client = "C"; +/** Organization = O */ +public static final String COSTINGLEVEL_Organization = "O"; +/** Set Costing Level. +@param CostingLevel The lowest level to accumulate Costing Information */ +public void setCostingLevel (String CostingLevel) +{ +if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is mandatory"); +if (CostingLevel.equals("B") || CostingLevel.equals("C") || CostingLevel.equals("O")); + else throw new IllegalArgumentException ("CostingLevel Invalid value - " + CostingLevel + " - Reference_ID=355 - B - C - O"); +if (CostingLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CostingLevel = CostingLevel.substring(0,0); +} +set_Value ("CostingLevel", CostingLevel); +} +/** Get Costing Level. +@return The lowest level to accumulate Costing Information */ +public String getCostingLevel() +{ +return (String)get_Value("CostingLevel"); +} + +/** CostingMethod AD_Reference_ID=122 */ +public static final int COSTINGMETHOD_AD_Reference_ID=122; +/** Average PO = A */ +public static final String COSTINGMETHOD_AveragePO = "A"; +/** Fifo = F */ +public static final String COSTINGMETHOD_Fifo = "F"; +/** Average Invoice = I */ +public static final String COSTINGMETHOD_AverageInvoice = "I"; +/** Lifo = L */ +public static final String COSTINGMETHOD_Lifo = "L"; +/** Standard Costing = S */ +public static final String COSTINGMETHOD_StandardCosting = "S"; +/** User Defined = U */ +public static final String COSTINGMETHOD_UserDefined = "U"; +/** Last Invoice = i */ +public static final String COSTINGMETHOD_LastInvoice = "i"; +/** Last PO Price = p */ +public static final String COSTINGMETHOD_LastPOPrice = "p"; +/** _ = x */ +public static final String COSTINGMETHOD__ = "x"; +/** Set Costing Method. +@param CostingMethod Indicates how Costs will be calculated */ +public void setCostingMethod (String CostingMethod) +{ +if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory"); +if (CostingMethod.equals("A") || CostingMethod.equals("F") || CostingMethod.equals("I") || CostingMethod.equals("L") || CostingMethod.equals("S") || CostingMethod.equals("U") || CostingMethod.equals("i") || CostingMethod.equals("p") || CostingMethod.equals("x")); + else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - A - F - I - L - S - U - i - p - x"); +if (CostingMethod.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CostingMethod = CostingMethod.substring(0,0); +} +set_Value ("CostingMethod", CostingMethod); +} +/** Get Costing Method. +@return Indicates how Costs will be calculated */ +public String getCostingMethod() +{ +return (String)get_Value("CostingMethod"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** GAAP AD_Reference_ID=123 */ +public static final int GAAP_AD_Reference_ID=123; +/** German HGB = DE */ +public static final String GAAP_GermanHGB = "DE"; +/** French Accounting Standard = FR */ +public static final String GAAP_FrenchAccountingStandard = "FR"; +/** International GAAP = UN */ +public static final String GAAP_InternationalGAAP = "UN"; +/** US GAAP = US */ +public static final String GAAP_USGAAP = "US"; +/** Custom Accounting Rules = XX */ +public static final String GAAP_CustomAccountingRules = "XX"; +/** Set GAAP. +@param GAAP Generally Accepted Accounting Principles */ +public void setGAAP (String GAAP) +{ +if (GAAP == null) throw new IllegalArgumentException ("GAAP is mandatory"); +if (GAAP.equals("DE") || GAAP.equals("FR") || GAAP.equals("UN") || GAAP.equals("US") || GAAP.equals("XX")); + else throw new IllegalArgumentException ("GAAP Invalid value - " + GAAP + " - Reference_ID=123 - DE - FR - UN - US - XX"); +if (GAAP.length() > 2) +{ +log.warning("Length > 2 - truncated"); +GAAP = GAAP.substring(0,1); +} +set_Value ("GAAP", GAAP); +} +/** Get GAAP. +@return Generally Accepted Accounting Principles */ +public String getGAAP() +{ +return (String)get_Value("GAAP"); +} +/** Set Use Account Alias. +@param HasAlias Ability to select (partial) account combinations by an Alias */ +public void setHasAlias (boolean HasAlias) +{ +set_Value ("HasAlias", new Boolean(HasAlias)); +} +/** Get Use Account Alias. +@return Ability to select (partial) account combinations by an Alias */ +public boolean isHasAlias() +{ +Object oo = get_Value("HasAlias"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Use Account Combination Control. +@param HasCombination Combination of account elements are checked */ +public void setHasCombination (boolean HasCombination) +{ +set_Value ("HasCombination", new Boolean(HasCombination)); +} +/** Get Use Account Combination Control. +@return Combination of account elements are checked */ +public boolean isHasCombination() +{ +Object oo = get_Value("HasCombination"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accrual. +@param IsAccrual Indicates if Accrual or Cash Based accounting will be used */ +public void setIsAccrual (boolean IsAccrual) +{ +set_Value ("IsAccrual", new Boolean(IsAccrual)); +} +/** Get Accrual. +@return Indicates if Accrual or Cash Based accounting will be used */ +public boolean isAccrual() +{ +Object oo = get_Value("IsAccrual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Adjust COGS. +@param IsAdjustCOGS Adjust Cost of Good Sold */ +public void setIsAdjustCOGS (boolean IsAdjustCOGS) +{ +set_Value ("IsAdjustCOGS", new Boolean(IsAdjustCOGS)); +} +/** Get Adjust COGS. +@return Adjust Cost of Good Sold */ +public boolean isAdjustCOGS() +{ +Object oo = get_Value("IsAdjustCOGS"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Correct tax for Discounts/Charges. +@param IsDiscountCorrectsTax Correct the tax for payment discount and charges */ +public void setIsDiscountCorrectsTax (boolean IsDiscountCorrectsTax) +{ +set_Value ("IsDiscountCorrectsTax", new Boolean(IsDiscountCorrectsTax)); +} +/** Get Correct tax for Discounts/Charges. +@return Correct the tax for payment discount and charges */ +public boolean isDiscountCorrectsTax() +{ +Object oo = get_Value("IsDiscountCorrectsTax"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Explicit Cost Adjustment. +@param IsExplicitCostAdjustment Post the cost adjustment explicitly */ +public void setIsExplicitCostAdjustment (boolean IsExplicitCostAdjustment) +{ +set_Value ("IsExplicitCostAdjustment", new Boolean(IsExplicitCostAdjustment)); +} +/** Get Explicit Cost Adjustment. +@return Post the cost adjustment explicitly */ +public boolean isExplicitCostAdjustment() +{ +Object oo = get_Value("IsExplicitCostAdjustment"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Services Separately. +@param IsPostServices Differentiate between Services and Product Receivable/Payables */ +public void setIsPostServices (boolean IsPostServices) +{ +set_Value ("IsPostServices", new Boolean(IsPostServices)); +} +/** Get Post Services Separately. +@return Differentiate between Services and Product Receivable/Payables */ +public boolean isPostServices() +{ +Object oo = get_Value("IsPostServices"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Trade Discount. +@param IsTradeDiscountPosted Generate postings for trade discounts */ +public void setIsTradeDiscountPosted (boolean IsTradeDiscountPosted) +{ +set_Value ("IsTradeDiscountPosted", new Boolean(IsTradeDiscountPosted)); +} +/** Get Post Trade Discount. +@return Generate postings for trade discounts */ +public boolean isTradeDiscountPosted() +{ +Object oo = get_Value("IsTradeDiscountPosted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Cost Type. +@param M_CostType_ID Type of Cost (e.g. Current, Plan, Future) */ +public void setM_CostType_ID (int M_CostType_ID) +{ +if (M_CostType_ID < 1) throw new IllegalArgumentException ("M_CostType_ID is mandatory."); +set_Value ("M_CostType_ID", new Integer(M_CostType_ID)); +} +/** Get Cost Type. +@return Type of Cost (e.g. Current, Plan, Future) */ +public int getM_CostType_ID() +{ +Integer ii = (Integer)get_Value("M_CostType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Future Days. +@param Period_OpenFuture Number of days to be able to post to a future date (based on system date) */ +public void setPeriod_OpenFuture (int Period_OpenFuture) +{ +set_Value ("Period_OpenFuture", new Integer(Period_OpenFuture)); +} +/** Get Future Days. +@return Number of days to be able to post to a future date (based on system date) */ +public int getPeriod_OpenFuture() +{ +Integer ii = (Integer)get_Value("Period_OpenFuture"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set History Days. +@param Period_OpenHistory Number of days to be able to post in the past (based on system date) */ +public void setPeriod_OpenHistory (int Period_OpenHistory) +{ +set_Value ("Period_OpenHistory", new Integer(Period_OpenHistory)); +} +/** Get History Days. +@return Number of days to be able to post in the past (based on system date) */ +public int getPeriod_OpenHistory() +{ +Integer ii = (Integer)get_Value("Period_OpenHistory"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Element Separator. +@param Separator Element Separator */ +public void setSeparator (String Separator) +{ +if (Separator == null) throw new IllegalArgumentException ("Separator is mandatory."); +if (Separator.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Separator = Separator.substring(0,0); +} +set_Value ("Separator", Separator); +} +/** Get Element Separator. +@return Element Separator */ +public String getSeparator() +{ +return (String)get_Value("Separator"); +} + +/** TaxCorrectionType AD_Reference_ID=392 */ +public static final int TAXCORRECTIONTYPE_AD_Reference_ID=392; +/** Write-off and Discount = B */ +public static final String TAXCORRECTIONTYPE_Write_OffAndDiscount = "B"; +/** Discount only = D */ +public static final String TAXCORRECTIONTYPE_DiscountOnly = "D"; +/** None = N */ +public static final String TAXCORRECTIONTYPE_None = "N"; +/** Write-off only = W */ +public static final String TAXCORRECTIONTYPE_Write_OffOnly = "W"; +/** Set Tax Correction. +@param TaxCorrectionType Type of Tax Correction */ +public void setTaxCorrectionType (String TaxCorrectionType) +{ +if (TaxCorrectionType == null) throw new IllegalArgumentException ("TaxCorrectionType is mandatory"); +if (TaxCorrectionType.equals("B") || TaxCorrectionType.equals("D") || TaxCorrectionType.equals("N") || TaxCorrectionType.equals("W")); + else throw new IllegalArgumentException ("TaxCorrectionType Invalid value - " + TaxCorrectionType + " - Reference_ID=392 - B - D - N - W"); +if (TaxCorrectionType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TaxCorrectionType = TaxCorrectionType.substring(0,0); +} +set_Value ("TaxCorrectionType", TaxCorrectionType); +} +/** Get Tax Correction. +@return Type of Tax Correction */ +public String getTaxCorrectionType() +{ +return (String)get_Value("TaxCorrectionType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AcctSchema_Default.java b/dbPort/src/org/compiere/model/X_C_AcctSchema_Default.java new file mode 100644 index 0000000000..0714a98a17 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AcctSchema_Default.java @@ -0,0 +1,1027 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AcctSchema_Default + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.109 */ +public class X_C_AcctSchema_Default extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AcctSchema_Default_ID id +@param trxName transaction +*/ +public X_C_AcctSchema_Default (Properties ctx, int C_AcctSchema_Default_ID, String trxName) +{ +super (ctx, C_AcctSchema_Default_ID, trxName); +/** if (C_AcctSchema_Default_ID == 0) +{ +setB_Asset_Acct (0); +setB_Expense_Acct (0); +setB_InTransit_Acct (0); +setB_InterestExp_Acct (0); +setB_InterestRev_Acct (0); +setB_PaymentSelect_Acct (0); +setB_RevaluationGain_Acct (0); +setB_RevaluationLoss_Acct (0); +setB_SettlementGain_Acct (0); +setB_SettlementLoss_Acct (0); +setB_UnallocatedCash_Acct (0); +setB_Unidentified_Acct (0); +setCB_Asset_Acct (0); +setCB_CashTransfer_Acct (0); +setCB_Differences_Acct (0); +setCB_Expense_Acct (0); +setCB_Receipt_Acct (0); +setC_AcctSchema_ID (0); +setC_Prepayment_Acct (0); +setC_Receivable_Acct (0); +setC_Receivable_Services_Acct (0); +setCh_Expense_Acct (0); +setCh_Revenue_Acct (0); +setE_Expense_Acct (0); +setE_Prepayment_Acct (0); +setNotInvoicedReceipts_Acct (0); +setNotInvoicedReceivables_Acct (0); +setNotInvoicedRevenue_Acct (0); +setPJ_Asset_Acct (0); +setPJ_WIP_Acct (0); +setP_Asset_Acct (0); +setP_COGS_Acct (0); +setP_CostAdjustment_Acct (0); +setP_Expense_Acct (0); +setP_InventoryClearing_Acct (0); +setP_InvoicePriceVariance_Acct (0); +setP_PurchasePriceVariance_Acct (0); +setP_Revenue_Acct (0); +setP_TradeDiscountGrant_Acct (0); +setP_TradeDiscountRec_Acct (0); +setPayDiscount_Exp_Acct (0); +setPayDiscount_Rev_Acct (0); +setRealizedGain_Acct (0); +setRealizedLoss_Acct (0); +setT_Credit_Acct (0); +setT_Due_Acct (0); +setT_Expense_Acct (0); +setT_Liability_Acct (0); +setT_Receivables_Acct (0); +setUnEarnedRevenue_Acct (0); +setUnrealizedGain_Acct (0); +setUnrealizedLoss_Acct (0); +setV_Liability_Acct (0); +setV_Liability_Services_Acct (0); +setV_Prepayment_Acct (0); +setW_Differences_Acct (0); +setW_InvActualAdjust_Acct (0); +setW_Inventory_Acct (0); +setW_Revaluation_Acct (0); +setWithholding_Acct (0); +setWriteOff_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AcctSchema_Default (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=315 */ +public static final int Table_ID=315; + +/** TableName=C_AcctSchema_Default */ +public static final String Table_Name="C_AcctSchema_Default"; + +protected static KeyNamePair Model = new KeyNamePair(315,"C_AcctSchema_Default"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AcctSchema_Default[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Bank Asset. +@param B_Asset_Acct Bank Asset Account */ +public void setB_Asset_Acct (int B_Asset_Acct) +{ +set_Value ("B_Asset_Acct", new Integer(B_Asset_Acct)); +} +/** Get Bank Asset. +@return Bank Asset Account */ +public int getB_Asset_Acct() +{ +Integer ii = (Integer)get_Value("B_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Expense. +@param B_Expense_Acct Bank Expense Account */ +public void setB_Expense_Acct (int B_Expense_Acct) +{ +set_Value ("B_Expense_Acct", new Integer(B_Expense_Acct)); +} +/** Get Bank Expense. +@return Bank Expense Account */ +public int getB_Expense_Acct() +{ +Integer ii = (Integer)get_Value("B_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank In Transit. +@param B_InTransit_Acct Bank In Transit Account */ +public void setB_InTransit_Acct (int B_InTransit_Acct) +{ +set_Value ("B_InTransit_Acct", new Integer(B_InTransit_Acct)); +} +/** Get Bank In Transit. +@return Bank In Transit Account */ +public int getB_InTransit_Acct() +{ +Integer ii = (Integer)get_Value("B_InTransit_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Interest Expense. +@param B_InterestExp_Acct Bank Interest Expense Account */ +public void setB_InterestExp_Acct (int B_InterestExp_Acct) +{ +set_Value ("B_InterestExp_Acct", new Integer(B_InterestExp_Acct)); +} +/** Get Bank Interest Expense. +@return Bank Interest Expense Account */ +public int getB_InterestExp_Acct() +{ +Integer ii = (Integer)get_Value("B_InterestExp_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Interest Revenue. +@param B_InterestRev_Acct Bank Interest Revenue Account */ +public void setB_InterestRev_Acct (int B_InterestRev_Acct) +{ +set_Value ("B_InterestRev_Acct", new Integer(B_InterestRev_Acct)); +} +/** Get Bank Interest Revenue. +@return Bank Interest Revenue Account */ +public int getB_InterestRev_Acct() +{ +Integer ii = (Integer)get_Value("B_InterestRev_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Selection. +@param B_PaymentSelect_Acct AP Payment Selection Clearing Account */ +public void setB_PaymentSelect_Acct (int B_PaymentSelect_Acct) +{ +set_Value ("B_PaymentSelect_Acct", new Integer(B_PaymentSelect_Acct)); +} +/** Get Payment Selection. +@return AP Payment Selection Clearing Account */ +public int getB_PaymentSelect_Acct() +{ +Integer ii = (Integer)get_Value("B_PaymentSelect_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Revaluation Gain. +@param B_RevaluationGain_Acct Bank Revaluation Gain Account */ +public void setB_RevaluationGain_Acct (int B_RevaluationGain_Acct) +{ +set_Value ("B_RevaluationGain_Acct", new Integer(B_RevaluationGain_Acct)); +} +/** Get Bank Revaluation Gain. +@return Bank Revaluation Gain Account */ +public int getB_RevaluationGain_Acct() +{ +Integer ii = (Integer)get_Value("B_RevaluationGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Revaluation Loss. +@param B_RevaluationLoss_Acct Bank Revaluation Loss Account */ +public void setB_RevaluationLoss_Acct (int B_RevaluationLoss_Acct) +{ +set_Value ("B_RevaluationLoss_Acct", new Integer(B_RevaluationLoss_Acct)); +} +/** Get Bank Revaluation Loss. +@return Bank Revaluation Loss Account */ +public int getB_RevaluationLoss_Acct() +{ +Integer ii = (Integer)get_Value("B_RevaluationLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Settlement Gain. +@param B_SettlementGain_Acct Bank Settlement Gain Account */ +public void setB_SettlementGain_Acct (int B_SettlementGain_Acct) +{ +set_Value ("B_SettlementGain_Acct", new Integer(B_SettlementGain_Acct)); +} +/** Get Bank Settlement Gain. +@return Bank Settlement Gain Account */ +public int getB_SettlementGain_Acct() +{ +Integer ii = (Integer)get_Value("B_SettlementGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Settlement Loss. +@param B_SettlementLoss_Acct Bank Settlement Loss Account */ +public void setB_SettlementLoss_Acct (int B_SettlementLoss_Acct) +{ +set_Value ("B_SettlementLoss_Acct", new Integer(B_SettlementLoss_Acct)); +} +/** Get Bank Settlement Loss. +@return Bank Settlement Loss Account */ +public int getB_SettlementLoss_Acct() +{ +Integer ii = (Integer)get_Value("B_SettlementLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unallocated Cash. +@param B_UnallocatedCash_Acct Unallocated Cash Clearing Account */ +public void setB_UnallocatedCash_Acct (int B_UnallocatedCash_Acct) +{ +set_Value ("B_UnallocatedCash_Acct", new Integer(B_UnallocatedCash_Acct)); +} +/** Get Unallocated Cash. +@return Unallocated Cash Clearing Account */ +public int getB_UnallocatedCash_Acct() +{ +Integer ii = (Integer)get_Value("B_UnallocatedCash_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Unidentified Receipts. +@param B_Unidentified_Acct Bank Unidentified Receipts Account */ +public void setB_Unidentified_Acct (int B_Unidentified_Acct) +{ +set_Value ("B_Unidentified_Acct", new Integer(B_Unidentified_Acct)); +} +/** Get Bank Unidentified Receipts. +@return Bank Unidentified Receipts Account */ +public int getB_Unidentified_Acct() +{ +Integer ii = (Integer)get_Value("B_Unidentified_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Asset. +@param CB_Asset_Acct Cash Book Asset Account */ +public void setCB_Asset_Acct (int CB_Asset_Acct) +{ +set_Value ("CB_Asset_Acct", new Integer(CB_Asset_Acct)); +} +/** Get Cash Book Asset. +@return Cash Book Asset Account */ +public int getCB_Asset_Acct() +{ +Integer ii = (Integer)get_Value("CB_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Transfer. +@param CB_CashTransfer_Acct Cash Transfer Clearing Account */ +public void setCB_CashTransfer_Acct (int CB_CashTransfer_Acct) +{ +set_Value ("CB_CashTransfer_Acct", new Integer(CB_CashTransfer_Acct)); +} +/** Get Cash Transfer. +@return Cash Transfer Clearing Account */ +public int getCB_CashTransfer_Acct() +{ +Integer ii = (Integer)get_Value("CB_CashTransfer_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Differences. +@param CB_Differences_Acct Cash Book Differences Account */ +public void setCB_Differences_Acct (int CB_Differences_Acct) +{ +set_Value ("CB_Differences_Acct", new Integer(CB_Differences_Acct)); +} +/** Get Cash Book Differences. +@return Cash Book Differences Account */ +public int getCB_Differences_Acct() +{ +Integer ii = (Integer)get_Value("CB_Differences_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Expense. +@param CB_Expense_Acct Cash Book Expense Account */ +public void setCB_Expense_Acct (int CB_Expense_Acct) +{ +set_Value ("CB_Expense_Acct", new Integer(CB_Expense_Acct)); +} +/** Get Cash Book Expense. +@return Cash Book Expense Account */ +public int getCB_Expense_Acct() +{ +Integer ii = (Integer)get_Value("CB_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Receipt. +@param CB_Receipt_Acct Cash Book Receipts Account */ +public void setCB_Receipt_Acct (int CB_Receipt_Acct) +{ +set_Value ("CB_Receipt_Acct", new Integer(CB_Receipt_Acct)); +} +/** Get Cash Book Receipt. +@return Cash Book Receipts Account */ +public int getCB_Receipt_Acct() +{ +Integer ii = (Integer)get_Value("CB_Receipt_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_AcctSchema_ID())); +} +/** Set Customer Prepayment. +@param C_Prepayment_Acct Account for customer prepayments */ +public void setC_Prepayment_Acct (int C_Prepayment_Acct) +{ +set_Value ("C_Prepayment_Acct", new Integer(C_Prepayment_Acct)); +} +/** Get Customer Prepayment. +@return Account for customer prepayments */ +public int getC_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("C_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer Receivables. +@param C_Receivable_Acct Account for Customer Receivables */ +public void setC_Receivable_Acct (int C_Receivable_Acct) +{ +set_Value ("C_Receivable_Acct", new Integer(C_Receivable_Acct)); +} +/** Get Customer Receivables. +@return Account for Customer Receivables */ +public int getC_Receivable_Acct() +{ +Integer ii = (Integer)get_Value("C_Receivable_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Receivable Services. +@param C_Receivable_Services_Acct Customer Accounts Receivables Services Account */ +public void setC_Receivable_Services_Acct (int C_Receivable_Services_Acct) +{ +set_Value ("C_Receivable_Services_Acct", new Integer(C_Receivable_Services_Acct)); +} +/** Get Receivable Services. +@return Customer Accounts Receivables Services Account */ +public int getC_Receivable_Services_Acct() +{ +Integer ii = (Integer)get_Value("C_Receivable_Services_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge Expense. +@param Ch_Expense_Acct Charge Expense Account */ +public void setCh_Expense_Acct (int Ch_Expense_Acct) +{ +set_Value ("Ch_Expense_Acct", new Integer(Ch_Expense_Acct)); +} +/** Get Charge Expense. +@return Charge Expense Account */ +public int getCh_Expense_Acct() +{ +Integer ii = (Integer)get_Value("Ch_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge Revenue. +@param Ch_Revenue_Acct Charge Revenue Account */ +public void setCh_Revenue_Acct (int Ch_Revenue_Acct) +{ +set_Value ("Ch_Revenue_Acct", new Integer(Ch_Revenue_Acct)); +} +/** Get Charge Revenue. +@return Charge Revenue Account */ +public int getCh_Revenue_Acct() +{ +Integer ii = (Integer)get_Value("Ch_Revenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Employee Expense. +@param E_Expense_Acct Account for Employee Expenses */ +public void setE_Expense_Acct (int E_Expense_Acct) +{ +set_Value ("E_Expense_Acct", new Integer(E_Expense_Acct)); +} +/** Get Employee Expense. +@return Account for Employee Expenses */ +public int getE_Expense_Acct() +{ +Integer ii = (Integer)get_Value("E_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Employee Prepayment. +@param E_Prepayment_Acct Account for Employee Expense Prepayments */ +public void setE_Prepayment_Acct (int E_Prepayment_Acct) +{ +set_Value ("E_Prepayment_Acct", new Integer(E_Prepayment_Acct)); +} +/** Get Employee Prepayment. +@return Account for Employee Expense Prepayments */ +public int getE_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("E_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Not-invoiced Receipts. +@param NotInvoicedReceipts_Acct Account for not-invoiced Material Receipts */ +public void setNotInvoicedReceipts_Acct (int NotInvoicedReceipts_Acct) +{ +set_Value ("NotInvoicedReceipts_Acct", new Integer(NotInvoicedReceipts_Acct)); +} +/** Get Not-invoiced Receipts. +@return Account for not-invoiced Material Receipts */ +public int getNotInvoicedReceipts_Acct() +{ +Integer ii = (Integer)get_Value("NotInvoicedReceipts_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Not-invoiced Receivables. +@param NotInvoicedReceivables_Acct Account for not invoiced Receivables */ +public void setNotInvoicedReceivables_Acct (int NotInvoicedReceivables_Acct) +{ +set_Value ("NotInvoicedReceivables_Acct", new Integer(NotInvoicedReceivables_Acct)); +} +/** Get Not-invoiced Receivables. +@return Account for not invoiced Receivables */ +public int getNotInvoicedReceivables_Acct() +{ +Integer ii = (Integer)get_Value("NotInvoicedReceivables_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Not-invoiced Revenue. +@param NotInvoicedRevenue_Acct Account for not invoiced Revenue */ +public void setNotInvoicedRevenue_Acct (int NotInvoicedRevenue_Acct) +{ +set_Value ("NotInvoicedRevenue_Acct", new Integer(NotInvoicedRevenue_Acct)); +} +/** Get Not-invoiced Revenue. +@return Account for not invoiced Revenue */ +public int getNotInvoicedRevenue_Acct() +{ +Integer ii = (Integer)get_Value("NotInvoicedRevenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Asset. +@param PJ_Asset_Acct Project Asset Account */ +public void setPJ_Asset_Acct (int PJ_Asset_Acct) +{ +set_Value ("PJ_Asset_Acct", new Integer(PJ_Asset_Acct)); +} +/** Get Project Asset. +@return Project Asset Account */ +public int getPJ_Asset_Acct() +{ +Integer ii = (Integer)get_Value("PJ_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Work In Progress. +@param PJ_WIP_Acct Account for Work in Progress */ +public void setPJ_WIP_Acct (int PJ_WIP_Acct) +{ +set_Value ("PJ_WIP_Acct", new Integer(PJ_WIP_Acct)); +} +/** Get Work In Progress. +@return Account for Work in Progress */ +public int getPJ_WIP_Acct() +{ +Integer ii = (Integer)get_Value("PJ_WIP_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Asset. +@param P_Asset_Acct Account for Product Asset (Inventory) */ +public void setP_Asset_Acct (int P_Asset_Acct) +{ +set_Value ("P_Asset_Acct", new Integer(P_Asset_Acct)); +} +/** Get Product Asset. +@return Account for Product Asset (Inventory) */ +public int getP_Asset_Acct() +{ +Integer ii = (Integer)get_Value("P_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product COGS. +@param P_COGS_Acct Account for Cost of Goods Sold */ +public void setP_COGS_Acct (int P_COGS_Acct) +{ +set_Value ("P_COGS_Acct", new Integer(P_COGS_Acct)); +} +/** Get Product COGS. +@return Account for Cost of Goods Sold */ +public int getP_COGS_Acct() +{ +Integer ii = (Integer)get_Value("P_COGS_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Adjustment. +@param P_CostAdjustment_Acct Product Cost Adjustment Account */ +public void setP_CostAdjustment_Acct (int P_CostAdjustment_Acct) +{ +set_Value ("P_CostAdjustment_Acct", new Integer(P_CostAdjustment_Acct)); +} +/** Get Cost Adjustment. +@return Product Cost Adjustment Account */ +public int getP_CostAdjustment_Acct() +{ +Integer ii = (Integer)get_Value("P_CostAdjustment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Expense. +@param P_Expense_Acct Account for Product Expense */ +public void setP_Expense_Acct (int P_Expense_Acct) +{ +set_Value ("P_Expense_Acct", new Integer(P_Expense_Acct)); +} +/** Get Product Expense. +@return Account for Product Expense */ +public int getP_Expense_Acct() +{ +Integer ii = (Integer)get_Value("P_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Clearing. +@param P_InventoryClearing_Acct Product Inventory Clearing Account */ +public void setP_InventoryClearing_Acct (int P_InventoryClearing_Acct) +{ +set_Value ("P_InventoryClearing_Acct", new Integer(P_InventoryClearing_Acct)); +} +/** Get Inventory Clearing. +@return Product Inventory Clearing Account */ +public int getP_InventoryClearing_Acct() +{ +Integer ii = (Integer)get_Value("P_InventoryClearing_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Price Variance. +@param P_InvoicePriceVariance_Acct Difference between Costs and Invoice Price (IPV) */ +public void setP_InvoicePriceVariance_Acct (int P_InvoicePriceVariance_Acct) +{ +set_Value ("P_InvoicePriceVariance_Acct", new Integer(P_InvoicePriceVariance_Acct)); +} +/** Get Invoice Price Variance. +@return Difference between Costs and Invoice Price (IPV) */ +public int getP_InvoicePriceVariance_Acct() +{ +Integer ii = (Integer)get_Value("P_InvoicePriceVariance_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Purchase Price Variance. +@param P_PurchasePriceVariance_Acct Difference between Standard Cost and Purchase Price (PPV) */ +public void setP_PurchasePriceVariance_Acct (int P_PurchasePriceVariance_Acct) +{ +set_Value ("P_PurchasePriceVariance_Acct", new Integer(P_PurchasePriceVariance_Acct)); +} +/** Get Purchase Price Variance. +@return Difference between Standard Cost and Purchase Price (PPV) */ +public int getP_PurchasePriceVariance_Acct() +{ +Integer ii = (Integer)get_Value("P_PurchasePriceVariance_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Revenue. +@param P_Revenue_Acct Account for Product Revenue (Sales Account) */ +public void setP_Revenue_Acct (int P_Revenue_Acct) +{ +set_Value ("P_Revenue_Acct", new Integer(P_Revenue_Acct)); +} +/** Get Product Revenue. +@return Account for Product Revenue (Sales Account) */ +public int getP_Revenue_Acct() +{ +Integer ii = (Integer)get_Value("P_Revenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trade Discount Granted. +@param P_TradeDiscountGrant_Acct Trade Discount Granted Account */ +public void setP_TradeDiscountGrant_Acct (int P_TradeDiscountGrant_Acct) +{ +set_Value ("P_TradeDiscountGrant_Acct", new Integer(P_TradeDiscountGrant_Acct)); +} +/** Get Trade Discount Granted. +@return Trade Discount Granted Account */ +public int getP_TradeDiscountGrant_Acct() +{ +Integer ii = (Integer)get_Value("P_TradeDiscountGrant_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trade Discount Received. +@param P_TradeDiscountRec_Acct Trade Discount Receivable Account */ +public void setP_TradeDiscountRec_Acct (int P_TradeDiscountRec_Acct) +{ +set_Value ("P_TradeDiscountRec_Acct", new Integer(P_TradeDiscountRec_Acct)); +} +/** Get Trade Discount Received. +@return Trade Discount Receivable Account */ +public int getP_TradeDiscountRec_Acct() +{ +Integer ii = (Integer)get_Value("P_TradeDiscountRec_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Discount Expense. +@param PayDiscount_Exp_Acct Payment Discount Expense Account */ +public void setPayDiscount_Exp_Acct (int PayDiscount_Exp_Acct) +{ +set_Value ("PayDiscount_Exp_Acct", new Integer(PayDiscount_Exp_Acct)); +} +/** Get Payment Discount Expense. +@return Payment Discount Expense Account */ +public int getPayDiscount_Exp_Acct() +{ +Integer ii = (Integer)get_Value("PayDiscount_Exp_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Discount Revenue. +@param PayDiscount_Rev_Acct Payment Discount Revenue Account */ +public void setPayDiscount_Rev_Acct (int PayDiscount_Rev_Acct) +{ +set_Value ("PayDiscount_Rev_Acct", new Integer(PayDiscount_Rev_Acct)); +} +/** Get Payment Discount Revenue. +@return Payment Discount Revenue Account */ +public int getPayDiscount_Rev_Acct() +{ +Integer ii = (Integer)get_Value("PayDiscount_Rev_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Realized Gain Acct. +@param RealizedGain_Acct Realized Gain Account */ +public void setRealizedGain_Acct (int RealizedGain_Acct) +{ +set_Value ("RealizedGain_Acct", new Integer(RealizedGain_Acct)); +} +/** Get Realized Gain Acct. +@return Realized Gain Account */ +public int getRealizedGain_Acct() +{ +Integer ii = (Integer)get_Value("RealizedGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Realized Loss Acct. +@param RealizedLoss_Acct Realized Loss Account */ +public void setRealizedLoss_Acct (int RealizedLoss_Acct) +{ +set_Value ("RealizedLoss_Acct", new Integer(RealizedLoss_Acct)); +} +/** Get Realized Loss Acct. +@return Realized Loss Account */ +public int getRealizedLoss_Acct() +{ +Integer ii = (Integer)get_Value("RealizedLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Credit. +@param T_Credit_Acct Account for Tax you can reclaim */ +public void setT_Credit_Acct (int T_Credit_Acct) +{ +set_Value ("T_Credit_Acct", new Integer(T_Credit_Acct)); +} +/** Get Tax Credit. +@return Account for Tax you can reclaim */ +public int getT_Credit_Acct() +{ +Integer ii = (Integer)get_Value("T_Credit_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Due. +@param T_Due_Acct Account for Tax you have to pay */ +public void setT_Due_Acct (int T_Due_Acct) +{ +set_Value ("T_Due_Acct", new Integer(T_Due_Acct)); +} +/** Get Tax Due. +@return Account for Tax you have to pay */ +public int getT_Due_Acct() +{ +Integer ii = (Integer)get_Value("T_Due_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Expense. +@param T_Expense_Acct Account for paid tax you cannot reclaim */ +public void setT_Expense_Acct (int T_Expense_Acct) +{ +set_Value ("T_Expense_Acct", new Integer(T_Expense_Acct)); +} +/** Get Tax Expense. +@return Account for paid tax you cannot reclaim */ +public int getT_Expense_Acct() +{ +Integer ii = (Integer)get_Value("T_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Liability. +@param T_Liability_Acct Account for Tax declaration liability */ +public void setT_Liability_Acct (int T_Liability_Acct) +{ +set_Value ("T_Liability_Acct", new Integer(T_Liability_Acct)); +} +/** Get Tax Liability. +@return Account for Tax declaration liability */ +public int getT_Liability_Acct() +{ +Integer ii = (Integer)get_Value("T_Liability_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Receivables. +@param T_Receivables_Acct Account for Tax credit after tax declaration */ +public void setT_Receivables_Acct (int T_Receivables_Acct) +{ +set_Value ("T_Receivables_Acct", new Integer(T_Receivables_Acct)); +} +/** Get Tax Receivables. +@return Account for Tax credit after tax declaration */ +public int getT_Receivables_Acct() +{ +Integer ii = (Integer)get_Value("T_Receivables_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unearned Revenue. +@param UnEarnedRevenue_Acct Account for unearned revenue */ +public void setUnEarnedRevenue_Acct (int UnEarnedRevenue_Acct) +{ +set_Value ("UnEarnedRevenue_Acct", new Integer(UnEarnedRevenue_Acct)); +} +/** Get Unearned Revenue. +@return Account for unearned revenue */ +public int getUnEarnedRevenue_Acct() +{ +Integer ii = (Integer)get_Value("UnEarnedRevenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unrealized Gain Acct. +@param UnrealizedGain_Acct Unrealized Gain Account for currency revaluation */ +public void setUnrealizedGain_Acct (int UnrealizedGain_Acct) +{ +set_Value ("UnrealizedGain_Acct", new Integer(UnrealizedGain_Acct)); +} +/** Get Unrealized Gain Acct. +@return Unrealized Gain Account for currency revaluation */ +public int getUnrealizedGain_Acct() +{ +Integer ii = (Integer)get_Value("UnrealizedGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unrealized Loss Acct. +@param UnrealizedLoss_Acct Unrealized Loss Account for currency revaluation */ +public void setUnrealizedLoss_Acct (int UnrealizedLoss_Acct) +{ +set_Value ("UnrealizedLoss_Acct", new Integer(UnrealizedLoss_Acct)); +} +/** Get Unrealized Loss Acct. +@return Unrealized Loss Account for currency revaluation */ +public int getUnrealizedLoss_Acct() +{ +Integer ii = (Integer)get_Value("UnrealizedLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Liability. +@param V_Liability_Acct Account for Vendor Liability */ +public void setV_Liability_Acct (int V_Liability_Acct) +{ +set_Value ("V_Liability_Acct", new Integer(V_Liability_Acct)); +} +/** Get Vendor Liability. +@return Account for Vendor Liability */ +public int getV_Liability_Acct() +{ +Integer ii = (Integer)get_Value("V_Liability_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Service Liability. +@param V_Liability_Services_Acct Account for Vender Service Liability */ +public void setV_Liability_Services_Acct (int V_Liability_Services_Acct) +{ +set_Value ("V_Liability_Services_Acct", new Integer(V_Liability_Services_Acct)); +} +/** Get Vendor Service Liability. +@return Account for Vender Service Liability */ +public int getV_Liability_Services_Acct() +{ +Integer ii = (Integer)get_Value("V_Liability_Services_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Prepayment. +@param V_Prepayment_Acct Account for Vendor Prepayments */ +public void setV_Prepayment_Acct (int V_Prepayment_Acct) +{ +set_Value ("V_Prepayment_Acct", new Integer(V_Prepayment_Acct)); +} +/** Get Vendor Prepayment. +@return Account for Vendor Prepayments */ +public int getV_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("V_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse Differences. +@param W_Differences_Acct Warehouse Differences Account */ +public void setW_Differences_Acct (int W_Differences_Acct) +{ +set_Value ("W_Differences_Acct", new Integer(W_Differences_Acct)); +} +/** Get Warehouse Differences. +@return Warehouse Differences Account */ +public int getW_Differences_Acct() +{ +Integer ii = (Integer)get_Value("W_Differences_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Adjustment. +@param W_InvActualAdjust_Acct Account for Inventory value adjustments for Actual Costing */ +public void setW_InvActualAdjust_Acct (int W_InvActualAdjust_Acct) +{ +set_Value ("W_InvActualAdjust_Acct", new Integer(W_InvActualAdjust_Acct)); +} +/** Get Inventory Adjustment. +@return Account for Inventory value adjustments for Actual Costing */ +public int getW_InvActualAdjust_Acct() +{ +Integer ii = (Integer)get_Value("W_InvActualAdjust_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set (Not Used). +@param W_Inventory_Acct Warehouse Inventory Asset Account - Currently not used */ +public void setW_Inventory_Acct (int W_Inventory_Acct) +{ +set_Value ("W_Inventory_Acct", new Integer(W_Inventory_Acct)); +} +/** Get (Not Used). +@return Warehouse Inventory Asset Account - Currently not used */ +public int getW_Inventory_Acct() +{ +Integer ii = (Integer)get_Value("W_Inventory_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Revaluation. +@param W_Revaluation_Acct Account for Inventory Revaluation */ +public void setW_Revaluation_Acct (int W_Revaluation_Acct) +{ +set_Value ("W_Revaluation_Acct", new Integer(W_Revaluation_Acct)); +} +/** Get Inventory Revaluation. +@return Account for Inventory Revaluation */ +public int getW_Revaluation_Acct() +{ +Integer ii = (Integer)get_Value("W_Revaluation_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Withholding. +@param Withholding_Acct Account for Withholdings */ +public void setWithholding_Acct (int Withholding_Acct) +{ +set_Value ("Withholding_Acct", new Integer(Withholding_Acct)); +} +/** Get Withholding. +@return Account for Withholdings */ +public int getWithholding_Acct() +{ +Integer ii = (Integer)get_Value("Withholding_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Write-off. +@param WriteOff_Acct Account for Receivables write-off */ +public void setWriteOff_Acct (int WriteOff_Acct) +{ +set_Value ("WriteOff_Acct", new Integer(WriteOff_Acct)); +} +/** Get Write-off. +@return Account for Receivables write-off */ +public int getWriteOff_Acct() +{ +Integer ii = (Integer)get_Value("WriteOff_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AcctSchema_Element.java b/dbPort/src/org/compiere/model/X_C_AcctSchema_Element.java new file mode 100644 index 0000000000..1c099e9ec0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AcctSchema_Element.java @@ -0,0 +1,434 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AcctSchema_Element + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.171 */ +public class X_C_AcctSchema_Element extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AcctSchema_Element_ID id +@param trxName transaction +*/ +public X_C_AcctSchema_Element (Properties ctx, int C_AcctSchema_Element_ID, String trxName) +{ +super (ctx, C_AcctSchema_Element_ID, trxName); +/** if (C_AcctSchema_Element_ID == 0) +{ +setC_AcctSchema_Element_ID (0); +setC_AcctSchema_ID (0); +setC_Element_ID (0); +setElementType (null); +setIsBalanced (false); +setIsMandatory (false); +setName (null); +setOrg_ID (0); +setSeqNo (0); // @SQL=SELECT COALESCE(MAX(SeqNo),0)+10 AS DefaultValue FROM C_AcctSchema_Element WHERE C_AcctSchema_ID=@C_AcctSchema_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AcctSchema_Element (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=279 */ +public static final int Table_ID=279; + +/** TableName=C_AcctSchema_Element */ +public static final String Table_Name="C_AcctSchema_Element"; + +protected static KeyNamePair Model = new KeyNamePair(279,"C_AcctSchema_Element"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AcctSchema_Element[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Acct.Schema Element. +@param C_AcctSchema_Element_ID Acct.Schema Element */ +public void setC_AcctSchema_Element_ID (int C_AcctSchema_Element_ID) +{ +if (C_AcctSchema_Element_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_Element_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_Element_ID", new Integer(C_AcctSchema_Element_ID)); +} +/** Get Acct.Schema Element. +@return Acct.Schema Element */ +public int getC_AcctSchema_Element_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID <= 0) set_Value ("C_ElementValue_ID", null); + else +set_Value ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Element. +@param C_Element_ID Accounting Element */ +public void setC_Element_ID (int C_Element_ID) +{ +if (C_Element_ID < 1) throw new IllegalArgumentException ("C_Element_ID is mandatory."); +set_Value ("C_Element_ID", new Integer(C_Element_ID)); +} +/** Get Element. +@return Accounting Element */ +public int getC_Element_ID() +{ +Integer ii = (Integer)get_Value("C_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ElementType AD_Reference_ID=181 */ +public static final int ELEMENTTYPE_AD_Reference_ID=181; +/** Account = AC */ +public static final String ELEMENTTYPE_Account = "AC"; +/** Activity = AY */ +public static final String ELEMENTTYPE_Activity = "AY"; +/** BPartner = BP */ +public static final String ELEMENTTYPE_BPartner = "BP"; +/** Location From = LF */ +public static final String ELEMENTTYPE_LocationFrom = "LF"; +/** Location To = LT */ +public static final String ELEMENTTYPE_LocationTo = "LT"; +/** Campaign = MC */ +public static final String ELEMENTTYPE_Campaign = "MC"; +/** Organization = OO */ +public static final String ELEMENTTYPE_Organization = "OO"; +/** Org Trx = OT */ +public static final String ELEMENTTYPE_OrgTrx = "OT"; +/** Project = PJ */ +public static final String ELEMENTTYPE_Project = "PJ"; +/** Product = PR */ +public static final String ELEMENTTYPE_Product = "PR"; +/** Sub Account = SA */ +public static final String ELEMENTTYPE_SubAccount = "SA"; +/** Sales Region = SR */ +public static final String ELEMENTTYPE_SalesRegion = "SR"; +/** User List 1 = U1 */ +public static final String ELEMENTTYPE_UserList1 = "U1"; +/** User List 2 = U2 */ +public static final String ELEMENTTYPE_UserList2 = "U2"; +/** User Element 1 = X1 */ +public static final String ELEMENTTYPE_UserElement1 = "X1"; +/** User Element 2 = X2 */ +public static final String ELEMENTTYPE_UserElement2 = "X2"; +/** Set Type. +@param ElementType Element Type (account or user defined) */ +public void setElementType (String ElementType) +{ +if (ElementType == null) throw new IllegalArgumentException ("ElementType is mandatory"); +if (ElementType.equals("AC") || ElementType.equals("AY") || ElementType.equals("BP") || ElementType.equals("LF") || ElementType.equals("LT") || ElementType.equals("MC") || ElementType.equals("OO") || ElementType.equals("OT") || ElementType.equals("PJ") || ElementType.equals("PR") || ElementType.equals("SA") || ElementType.equals("SR") || ElementType.equals("U1") || ElementType.equals("U2") || ElementType.equals("X1") || ElementType.equals("X2")); + else throw new IllegalArgumentException ("ElementType Invalid value - " + ElementType + " - Reference_ID=181 - AC - AY - BP - LF - LT - MC - OO - OT - PJ - PR - SA - SR - U1 - U2 - X1 - X2"); +if (ElementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +ElementType = ElementType.substring(0,1); +} +set_Value ("ElementType", ElementType); +} +/** Get Type. +@return Element Type (account or user defined) */ +public String getElementType() +{ +return (String)get_Value("ElementType"); +} +/** Set Balanced. +@param IsBalanced Balanced */ +public void setIsBalanced (boolean IsBalanced) +{ +set_Value ("IsBalanced", new Boolean(IsBalanced)); +} +/** Get Balanced. +@return Balanced */ +public boolean isBalanced() +{ +Object oo = get_Value("IsBalanced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory. +@param IsMandatory Data entry is required in this column */ +public void setIsMandatory (boolean IsMandatory) +{ +set_Value ("IsMandatory", new Boolean(IsMandatory)); +} +/** Get Mandatory. +@return Data entry is required in this column */ +public boolean isMandatory() +{ +Object oo = get_Value("IsMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Org_ID AD_Reference_ID=130 */ +public static final int ORG_ID_AD_Reference_ID=130; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID < 1) throw new IllegalArgumentException ("Org_ID is mandatory."); +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AcctSchema_GL.java b/dbPort/src/org/compiere/model/X_C_AcctSchema_GL.java new file mode 100644 index 0000000000..159bdfac6b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AcctSchema_GL.java @@ -0,0 +1,298 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AcctSchema_GL + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.203 */ +public class X_C_AcctSchema_GL extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AcctSchema_GL_ID id +@param trxName transaction +*/ +public X_C_AcctSchema_GL (Properties ctx, int C_AcctSchema_GL_ID, String trxName) +{ +super (ctx, C_AcctSchema_GL_ID, trxName); +/** if (C_AcctSchema_GL_ID == 0) +{ +setC_AcctSchema_ID (0); +setCommitmentOffset_Acct (0); +setIncomeSummary_Acct (0); +setIntercompanyDueFrom_Acct (0); +setIntercompanyDueTo_Acct (0); +setPPVOffset_Acct (0); +setRetainedEarning_Acct (0); +setUseCurrencyBalancing (false); +setUseSuspenseBalancing (false); +setUseSuspenseError (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AcctSchema_GL (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=266 */ +public static final int Table_ID=266; + +/** TableName=C_AcctSchema_GL */ +public static final String Table_Name="C_AcctSchema_GL"; + +protected static KeyNamePair Model = new KeyNamePair(266,"C_AcctSchema_GL"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AcctSchema_GL[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_AcctSchema_ID())); +} +/** Set Commitment Offset. +@param CommitmentOffset_Acct Budgetary Commitment Offset Account */ +public void setCommitmentOffset_Acct (int CommitmentOffset_Acct) +{ +set_Value ("CommitmentOffset_Acct", new Integer(CommitmentOffset_Acct)); +} +/** Get Commitment Offset. +@return Budgetary Commitment Offset Account */ +public int getCommitmentOffset_Acct() +{ +Integer ii = (Integer)get_Value("CommitmentOffset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Balancing Acct. +@param CurrencyBalancing_Acct Account used when a currency is out of balance */ +public void setCurrencyBalancing_Acct (int CurrencyBalancing_Acct) +{ +set_Value ("CurrencyBalancing_Acct", new Integer(CurrencyBalancing_Acct)); +} +/** Get Currency Balancing Acct. +@return Account used when a currency is out of balance */ +public int getCurrencyBalancing_Acct() +{ +Integer ii = (Integer)get_Value("CurrencyBalancing_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Income Summary Acct. +@param IncomeSummary_Acct Income Summary Account */ +public void setIncomeSummary_Acct (int IncomeSummary_Acct) +{ +set_Value ("IncomeSummary_Acct", new Integer(IncomeSummary_Acct)); +} +/** Get Income Summary Acct. +@return Income Summary Account */ +public int getIncomeSummary_Acct() +{ +Integer ii = (Integer)get_Value("IncomeSummary_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Intercompany Due From Acct. +@param IntercompanyDueFrom_Acct Intercompany Due From / Receivables Account */ +public void setIntercompanyDueFrom_Acct (int IntercompanyDueFrom_Acct) +{ +set_Value ("IntercompanyDueFrom_Acct", new Integer(IntercompanyDueFrom_Acct)); +} +/** Get Intercompany Due From Acct. +@return Intercompany Due From / Receivables Account */ +public int getIntercompanyDueFrom_Acct() +{ +Integer ii = (Integer)get_Value("IntercompanyDueFrom_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Intercompany Due To Acct. +@param IntercompanyDueTo_Acct Intercompany Due To / Payable Account */ +public void setIntercompanyDueTo_Acct (int IntercompanyDueTo_Acct) +{ +set_Value ("IntercompanyDueTo_Acct", new Integer(IntercompanyDueTo_Acct)); +} +/** Get Intercompany Due To Acct. +@return Intercompany Due To / Payable Account */ +public int getIntercompanyDueTo_Acct() +{ +Integer ii = (Integer)get_Value("IntercompanyDueTo_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set PPV Offset. +@param PPVOffset_Acct Purchase Price Variance Offset Account */ +public void setPPVOffset_Acct (int PPVOffset_Acct) +{ +set_Value ("PPVOffset_Acct", new Integer(PPVOffset_Acct)); +} +/** Get PPV Offset. +@return Purchase Price Variance Offset Account */ +public int getPPVOffset_Acct() +{ +Integer ii = (Integer)get_Value("PPVOffset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Retained Earning Acct. +@param RetainedEarning_Acct Retained Earning Acct */ +public void setRetainedEarning_Acct (int RetainedEarning_Acct) +{ +set_Value ("RetainedEarning_Acct", new Integer(RetainedEarning_Acct)); +} +/** Get Retained Earning Acct. +@return Retained Earning Acct */ +public int getRetainedEarning_Acct() +{ +Integer ii = (Integer)get_Value("RetainedEarning_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Suspense Balancing Acct. +@param SuspenseBalancing_Acct Suspense Balancing Acct */ +public void setSuspenseBalancing_Acct (int SuspenseBalancing_Acct) +{ +set_Value ("SuspenseBalancing_Acct", new Integer(SuspenseBalancing_Acct)); +} +/** Get Suspense Balancing Acct. +@return Suspense Balancing Acct */ +public int getSuspenseBalancing_Acct() +{ +Integer ii = (Integer)get_Value("SuspenseBalancing_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Suspense Error Acct. +@param SuspenseError_Acct Suspense Error Acct */ +public void setSuspenseError_Acct (int SuspenseError_Acct) +{ +set_Value ("SuspenseError_Acct", new Integer(SuspenseError_Acct)); +} +/** Get Suspense Error Acct. +@return Suspense Error Acct */ +public int getSuspenseError_Acct() +{ +Integer ii = (Integer)get_Value("SuspenseError_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Use Currency Balancing. +@param UseCurrencyBalancing Use Currency Balancing */ +public void setUseCurrencyBalancing (boolean UseCurrencyBalancing) +{ +set_Value ("UseCurrencyBalancing", new Boolean(UseCurrencyBalancing)); +} +/** Get Use Currency Balancing. +@return Use Currency Balancing */ +public boolean isUseCurrencyBalancing() +{ +Object oo = get_Value("UseCurrencyBalancing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Use Suspense Balancing. +@param UseSuspenseBalancing Use Suspense Balancing */ +public void setUseSuspenseBalancing (boolean UseSuspenseBalancing) +{ +set_Value ("UseSuspenseBalancing", new Boolean(UseSuspenseBalancing)); +} +/** Get Use Suspense Balancing. +@return Use Suspense Balancing */ +public boolean isUseSuspenseBalancing() +{ +Object oo = get_Value("UseSuspenseBalancing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Use Suspense Error. +@param UseSuspenseError Use Suspense Error */ +public void setUseSuspenseError (boolean UseSuspenseError) +{ +set_Value ("UseSuspenseError", new Boolean(UseSuspenseError)); +} +/** Get Use Suspense Error. +@return Use Suspense Error */ +public boolean isUseSuspenseError() +{ +Object oo = get_Value("UseSuspenseError"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Activity.java b/dbPort/src/org/compiere/model/X_C_Activity.java new file mode 100644 index 0000000000..30d7fb154c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Activity.java @@ -0,0 +1,200 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Activity + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.218 */ +public class X_C_Activity extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Activity_ID id +@param trxName transaction +*/ +public X_C_Activity (Properties ctx, int C_Activity_ID, String trxName) +{ +super (ctx, C_Activity_ID, trxName); +/** if (C_Activity_ID == 0) +{ +setC_Activity_ID (0); +setIsSummary (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Activity (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=316 */ +public static final int Table_ID=316; + +/** TableName=C_Activity */ +public static final String Table_Name="C_Activity"; + +protected static KeyNamePair Model = new KeyNamePair(316,"C_Activity"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Activity[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID < 1) throw new IllegalArgumentException ("C_Activity_ID is mandatory."); +set_ValueNoCheck ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AllocationHdr.java b/dbPort/src/org/compiere/model/X_C_AllocationHdr.java new file mode 100644 index 0000000000..292fe7e6e6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AllocationHdr.java @@ -0,0 +1,399 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AllocationHdr + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.234 */ +public class X_C_AllocationHdr extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AllocationHdr_ID id +@param trxName transaction +*/ +public X_C_AllocationHdr (Properties ctx, int C_AllocationHdr_ID, String trxName) +{ +super (ctx, C_AllocationHdr_ID, trxName); +/** if (C_AllocationHdr_ID == 0) +{ +setApprovalAmt (Env.ZERO); +setC_AllocationHdr_ID (0); +setC_Currency_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setDateTrx (new Timestamp(System.currentTimeMillis())); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setIsManual (false); +setPosted (false); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AllocationHdr (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=735 */ +public static final int Table_ID=735; + +/** TableName=C_AllocationHdr */ +public static final String Table_Name="C_AllocationHdr"; + +protected static KeyNamePair Model = new KeyNamePair(735,"C_AllocationHdr"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AllocationHdr[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Approval Amount. +@param ApprovalAmt Document Approval Amount */ +public void setApprovalAmt (BigDecimal ApprovalAmt) +{ +if (ApprovalAmt == null) throw new IllegalArgumentException ("ApprovalAmt is mandatory."); +set_Value ("ApprovalAmt", ApprovalAmt); +} +/** Get Approval Amount. +@return Document Approval Amount */ +public BigDecimal getApprovalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ApprovalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Allocation. +@param C_AllocationHdr_ID Payment allocation */ +public void setC_AllocationHdr_ID (int C_AllocationHdr_ID) +{ +if (C_AllocationHdr_ID < 1) throw new IllegalArgumentException ("C_AllocationHdr_ID is mandatory."); +set_ValueNoCheck ("C_AllocationHdr_ID", new Integer(C_AllocationHdr_ID)); +} +/** Get Allocation. +@return Payment allocation */ +public int getC_AllocationHdr_ID() +{ +Integer ii = (Integer)get_Value("C_AllocationHdr_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_Value ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_AllocationLine.java b/dbPort/src/org/compiere/model/X_C_AllocationLine.java new file mode 100644 index 0000000000..f9238cb9b3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_AllocationLine.java @@ -0,0 +1,297 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_AllocationLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.25 */ +public class X_C_AllocationLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_AllocationLine_ID id +@param trxName transaction +*/ +public X_C_AllocationLine (Properties ctx, int C_AllocationLine_ID, String trxName) +{ +super (ctx, C_AllocationLine_ID, trxName); +/** if (C_AllocationLine_ID == 0) +{ +setAmount (Env.ZERO); +setC_AllocationHdr_ID (0); +setC_AllocationLine_ID (0); +setDiscountAmt (Env.ZERO); +setWriteOffAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_AllocationLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=390 */ +public static final int Table_ID=390; + +/** TableName=C_AllocationLine */ +public static final String Table_Name="C_AllocationLine"; + +protected static KeyNamePair Model = new KeyNamePair(390,"C_AllocationLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_AllocationLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amount Amount in a defined currency */ +public void setAmount (BigDecimal Amount) +{ +if (Amount == null) throw new IllegalArgumentException ("Amount is mandatory."); +set_ValueNoCheck ("Amount", Amount); +} +/** Get Amount. +@return Amount in a defined currency */ +public BigDecimal getAmount() +{ +BigDecimal bd = (BigDecimal)get_Value("Amount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Allocation. +@param C_AllocationHdr_ID Payment allocation */ +public void setC_AllocationHdr_ID (int C_AllocationHdr_ID) +{ +if (C_AllocationHdr_ID < 1) throw new IllegalArgumentException ("C_AllocationHdr_ID is mandatory."); +set_ValueNoCheck ("C_AllocationHdr_ID", new Integer(C_AllocationHdr_ID)); +} +/** Get Allocation. +@return Payment allocation */ +public int getC_AllocationHdr_ID() +{ +Integer ii = (Integer)get_Value("C_AllocationHdr_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Allocation Line. +@param C_AllocationLine_ID Allocation Line */ +public void setC_AllocationLine_ID (int C_AllocationLine_ID) +{ +if (C_AllocationLine_ID < 1) throw new IllegalArgumentException ("C_AllocationLine_ID is mandatory."); +set_ValueNoCheck ("C_AllocationLine_ID", new Integer(C_AllocationLine_ID)); +} +/** Get Allocation Line. +@return Allocation Line */ +public int getC_AllocationLine_ID() +{ +Integer ii = (Integer)get_Value("C_AllocationLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_ValueNoCheck ("C_BPartner_ID", null); + else +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Journal Line. +@param C_CashLine_ID Cash Journal Line */ +public void setC_CashLine_ID (int C_CashLine_ID) +{ +if (C_CashLine_ID <= 0) set_ValueNoCheck ("C_CashLine_ID", null); + else +set_ValueNoCheck ("C_CashLine_ID", new Integer(C_CashLine_ID)); +} +/** Get Cash Journal Line. +@return Cash Journal Line */ +public int getC_CashLine_ID() +{ +Integer ii = (Integer)get_Value("C_CashLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_ValueNoCheck ("C_Payment_ID", null); + else +set_ValueNoCheck ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +set_ValueNoCheck ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +if (DiscountAmt == null) throw new IllegalArgumentException ("DiscountAmt is mandatory."); +set_ValueNoCheck ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_ValueNoCheck ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Over/Under Payment. +@param OverUnderAmt Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public void setOverUnderAmt (BigDecimal OverUnderAmt) +{ +set_Value ("OverUnderAmt", OverUnderAmt); +} +/** Get Over/Under Payment. +@return Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public BigDecimal getOverUnderAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OverUnderAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Write-off Amount. +@param WriteOffAmt Amount to write-off */ +public void setWriteOffAmt (BigDecimal WriteOffAmt) +{ +if (WriteOffAmt == null) throw new IllegalArgumentException ("WriteOffAmt is mandatory."); +set_ValueNoCheck ("WriteOffAmt", WriteOffAmt); +} +/** Get Write-off Amount. +@return Amount to write-off */ +public BigDecimal getWriteOffAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("WriteOffAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_BankAccount.java b/dbPort/src/org/compiere/model/X_C_BP_BankAccount.java new file mode 100644 index 0000000000..ee77beec09 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_BankAccount.java @@ -0,0 +1,549 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_BankAccount + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.343 */ +public class X_C_BP_BankAccount extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_BankAccount_ID id +@param trxName transaction +*/ +public X_C_BP_BankAccount (Properties ctx, int C_BP_BankAccount_ID, String trxName) +{ +super (ctx, C_BP_BankAccount_ID, trxName); +/** if (C_BP_BankAccount_ID == 0) +{ +setA_Name (null); +setC_BP_BankAccount_ID (0); +setC_BPartner_ID (0); +setIsACH (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_BankAccount (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=298 */ +public static final int Table_ID=298; + +/** TableName=C_BP_BankAccount */ +public static final String Table_Name="C_BP_BankAccount"; + +protected static KeyNamePair Model = new KeyNamePair(298,"C_BP_BankAccount"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_BankAccount[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account City. +@param A_City City or the Credit Card or Account Holder */ +public void setA_City (String A_City) +{ +if (A_City != null && A_City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_City = A_City.substring(0,59); +} +set_Value ("A_City", A_City); +} +/** Get Account City. +@return City or the Credit Card or Account Holder */ +public String getA_City() +{ +return (String)get_Value("A_City"); +} +/** Set Account Country. +@param A_Country Country */ +public void setA_Country (String A_Country) +{ +if (A_Country != null && A_Country.length() > 40) +{ +log.warning("Length > 40 - truncated"); +A_Country = A_Country.substring(0,39); +} +set_Value ("A_Country", A_Country); +} +/** Get Account Country. +@return Country */ +public String getA_Country() +{ +return (String)get_Value("A_Country"); +} +/** Set Account EMail. +@param A_EMail Email Address */ +public void setA_EMail (String A_EMail) +{ +if (A_EMail != null && A_EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_EMail = A_EMail.substring(0,59); +} +set_Value ("A_EMail", A_EMail); +} +/** Get Account EMail. +@return Email Address */ +public String getA_EMail() +{ +return (String)get_Value("A_EMail"); +} +/** Set Driver License. +@param A_Ident_DL Payment Identification - Driver License */ +public void setA_Ident_DL (String A_Ident_DL) +{ +if (A_Ident_DL != null && A_Ident_DL.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Ident_DL = A_Ident_DL.substring(0,19); +} +set_Value ("A_Ident_DL", A_Ident_DL); +} +/** Get Driver License. +@return Payment Identification - Driver License */ +public String getA_Ident_DL() +{ +return (String)get_Value("A_Ident_DL"); +} +/** Set Social Security No. +@param A_Ident_SSN Payment Identification - Social Security No */ +public void setA_Ident_SSN (String A_Ident_SSN) +{ +if (A_Ident_SSN != null && A_Ident_SSN.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Ident_SSN = A_Ident_SSN.substring(0,19); +} +set_Value ("A_Ident_SSN", A_Ident_SSN); +} +/** Get Social Security No. +@return Payment Identification - Social Security No */ +public String getA_Ident_SSN() +{ +return (String)get_Value("A_Ident_SSN"); +} +/** Set Account Name. +@param A_Name Name on Credit Card or Account holder */ +public void setA_Name (String A_Name) +{ +if (A_Name == null) throw new IllegalArgumentException ("A_Name is mandatory."); +if (A_Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_Name = A_Name.substring(0,59); +} +set_Value ("A_Name", A_Name); +} +/** Get Account Name. +@return Name on Credit Card or Account holder */ +public String getA_Name() +{ +return (String)get_Value("A_Name"); +} +/** Set Account State. +@param A_State State of the Credit Card or Account holder */ +public void setA_State (String A_State) +{ +if (A_State != null && A_State.length() > 40) +{ +log.warning("Length > 40 - truncated"); +A_State = A_State.substring(0,39); +} +set_Value ("A_State", A_State); +} +/** Get Account State. +@return State of the Credit Card or Account holder */ +public String getA_State() +{ +return (String)get_Value("A_State"); +} +/** Set Account Street. +@param A_Street Street address of the Credit Card or Account holder */ +public void setA_Street (String A_Street) +{ +if (A_Street != null && A_Street.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_Street = A_Street.substring(0,59); +} +set_Value ("A_Street", A_Street); +} +/** Get Account Street. +@return Street address of the Credit Card or Account holder */ +public String getA_Street() +{ +return (String)get_Value("A_Street"); +} +/** Set Account Zip/Postal. +@param A_Zip Zip Code of the Credit Card or Account Holder */ +public void setA_Zip (String A_Zip) +{ +if (A_Zip != null && A_Zip.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Zip = A_Zip.substring(0,19); +} +set_Value ("A_Zip", A_Zip); +} +/** Get Account Zip/Postal. +@return Zip Code of the Credit Card or Account Holder */ +public String getA_Zip() +{ +return (String)get_Value("A_Zip"); +} +/** Set Account No. +@param AccountNo Account Number */ +public void setAccountNo (String AccountNo) +{ +if (AccountNo != null && AccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +AccountNo = AccountNo.substring(0,19); +} +set_Value ("AccountNo", AccountNo); +} +/** Get Account No. +@return Account Number */ +public String getAccountNo() +{ +return (String)get_Value("AccountNo"); +} + +/** BankAccountType AD_Reference_ID=216 */ +public static final int BANKACCOUNTTYPE_AD_Reference_ID=216; +/** Checking = C */ +public static final String BANKACCOUNTTYPE_Checking = "C"; +/** Savings = S */ +public static final String BANKACCOUNTTYPE_Savings = "S"; +/** Set Bank Account Type. +@param BankAccountType Bank Account Type */ +public void setBankAccountType (String BankAccountType) +{ +if (BankAccountType == null) throw new IllegalArgumentException ("BankAccountType is mandatory"); +if (BankAccountType == null || BankAccountType.equals("C") || BankAccountType.equals("S")); + else throw new IllegalArgumentException ("BankAccountType Invalid value - " + BankAccountType + " - Reference_ID=216 - C - S"); +if (BankAccountType != null && BankAccountType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BankAccountType = BankAccountType.substring(0,0); +} +set_Value ("BankAccountType", BankAccountType); +} +/** Get Bank Account Type. +@return Bank Account Type */ +public String getBankAccountType() +{ +return (String)get_Value("BankAccountType"); +} +/** Set Partner Bank Account. +@param C_BP_BankAccount_ID Bank Account of the Business Partner */ +public void setC_BP_BankAccount_ID (int C_BP_BankAccount_ID) +{ +if (C_BP_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BP_BankAccount_ID is mandatory."); +set_ValueNoCheck ("C_BP_BankAccount_ID", new Integer(C_BP_BankAccount_ID)); +} +/** Get Partner Bank Account. +@return Bank Account of the Business Partner */ +public int getC_BP_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BP_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank. +@param C_Bank_ID Bank */ +public void setC_Bank_ID (int C_Bank_ID) +{ +if (C_Bank_ID <= 0) set_Value ("C_Bank_ID", null); + else +set_Value ("C_Bank_ID", new Integer(C_Bank_ID)); +} +/** Get Bank. +@return Bank */ +public int getC_Bank_ID() +{ +Integer ii = (Integer)get_Value("C_Bank_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Bank_ID())); +} +/** Set Exp. Month. +@param CreditCardExpMM Expiry Month */ +public void setCreditCardExpMM (int CreditCardExpMM) +{ +set_Value ("CreditCardExpMM", new Integer(CreditCardExpMM)); +} +/** Get Exp. Month. +@return Expiry Month */ +public int getCreditCardExpMM() +{ +Integer ii = (Integer)get_Value("CreditCardExpMM"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Exp. Year. +@param CreditCardExpYY Expiry Year */ +public void setCreditCardExpYY (int CreditCardExpYY) +{ +set_Value ("CreditCardExpYY", new Integer(CreditCardExpYY)); +} +/** Get Exp. Year. +@return Expiry Year */ +public int getCreditCardExpYY() +{ +Integer ii = (Integer)get_Value("CreditCardExpYY"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Number. +@param CreditCardNumber Credit Card Number */ +public void setCreditCardNumber (String CreditCardNumber) +{ +if (CreditCardNumber != null && CreditCardNumber.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CreditCardNumber = CreditCardNumber.substring(0,19); +} +set_Value ("CreditCardNumber", CreditCardNumber); +} +/** Get Number. +@return Credit Card Number */ +public String getCreditCardNumber() +{ +return (String)get_Value("CreditCardNumber"); +} + +/** CreditCardType AD_Reference_ID=149 */ +public static final int CREDITCARDTYPE_AD_Reference_ID=149; +/** Amex = A */ +public static final String CREDITCARDTYPE_Amex = "A"; +/** ATM = C */ +public static final String CREDITCARDTYPE_ATM = "C"; +/** Diners = D */ +public static final String CREDITCARDTYPE_Diners = "D"; +/** MasterCard = M */ +public static final String CREDITCARDTYPE_MasterCard = "M"; +/** Discover = N */ +public static final String CREDITCARDTYPE_Discover = "N"; +/** Purchase Card = P */ +public static final String CREDITCARDTYPE_PurchaseCard = "P"; +/** Visa = V */ +public static final String CREDITCARDTYPE_Visa = "V"; +/** Set Credit Card. +@param CreditCardType Credit Card (Visa, MC, AmEx) */ +public void setCreditCardType (String CreditCardType) +{ +if (CreditCardType == null) throw new IllegalArgumentException ("CreditCardType is mandatory"); +if (CreditCardType == null || CreditCardType.equals("A") || CreditCardType.equals("C") || CreditCardType.equals("D") || CreditCardType.equals("M") || CreditCardType.equals("N") || CreditCardType.equals("P") || CreditCardType.equals("V")); + else throw new IllegalArgumentException ("CreditCardType Invalid value - " + CreditCardType + " - Reference_ID=149 - A - C - D - M - N - P - V"); +if (CreditCardType != null && CreditCardType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreditCardType = CreditCardType.substring(0,0); +} +set_Value ("CreditCardType", CreditCardType); +} +/** Get Credit Card. +@return Credit Card (Visa, MC, AmEx) */ +public String getCreditCardType() +{ +return (String)get_Value("CreditCardType"); +} +/** Set Verification Code. +@param CreditCardVV Credit Card Verification code on credit card */ +public void setCreditCardVV (String CreditCardVV) +{ +if (CreditCardVV != null && CreditCardVV.length() > 4) +{ +log.warning("Length > 4 - truncated"); +CreditCardVV = CreditCardVV.substring(0,3); +} +set_Value ("CreditCardVV", CreditCardVV); +} +/** Get Verification Code. +@return Credit Card Verification code on credit card */ +public String getCreditCardVV() +{ +return (String)get_Value("CreditCardVV"); +} +/** Set ACH. +@param IsACH Automatic Clearing House */ +public void setIsACH (boolean IsACH) +{ +set_Value ("IsACH", new Boolean(IsACH)); +} +/** Get ACH. +@return Automatic Clearing House */ +public boolean isACH() +{ +Object oo = get_Value("IsACH"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** R_AvsAddr AD_Reference_ID=213 */ +public static final int R_AVSADDR_AD_Reference_ID=213; +/** No Match = N */ +public static final String R_AVSADDR_NoMatch = "N"; +/** Unavailable = X */ +public static final String R_AVSADDR_Unavailable = "X"; +/** Match = Y */ +public static final String R_AVSADDR_Match = "Y"; +/** Set Address verified. +@param R_AvsAddr This address has been verified */ +public void setR_AvsAddr (String R_AvsAddr) +{ +if (R_AvsAddr == null) throw new IllegalArgumentException ("R_AvsAddr is mandatory"); +if (R_AvsAddr == null || R_AvsAddr.equals("N") || R_AvsAddr.equals("X") || R_AvsAddr.equals("Y")); + else throw new IllegalArgumentException ("R_AvsAddr Invalid value - " + R_AvsAddr + " - Reference_ID=213 - N - X - Y"); +if (R_AvsAddr != null && R_AvsAddr.length() > 1) +{ +log.warning("Length > 1 - truncated"); +R_AvsAddr = R_AvsAddr.substring(0,0); +} +set_ValueNoCheck ("R_AvsAddr", R_AvsAddr); +} +/** Get Address verified. +@return This address has been verified */ +public String getR_AvsAddr() +{ +return (String)get_Value("R_AvsAddr"); +} + +/** R_AvsZip AD_Reference_ID=213 */ +public static final int R_AVSZIP_AD_Reference_ID=213; +/** No Match = N */ +public static final String R_AVSZIP_NoMatch = "N"; +/** Unavailable = X */ +public static final String R_AVSZIP_Unavailable = "X"; +/** Match = Y */ +public static final String R_AVSZIP_Match = "Y"; +/** Set Zip verified. +@param R_AvsZip The Zip Code has been verified */ +public void setR_AvsZip (String R_AvsZip) +{ +if (R_AvsZip == null) throw new IllegalArgumentException ("R_AvsZip is mandatory"); +if (R_AvsZip == null || R_AvsZip.equals("N") || R_AvsZip.equals("X") || R_AvsZip.equals("Y")); + else throw new IllegalArgumentException ("R_AvsZip Invalid value - " + R_AvsZip + " - Reference_ID=213 - N - X - Y"); +if (R_AvsZip != null && R_AvsZip.length() > 1) +{ +log.warning("Length > 1 - truncated"); +R_AvsZip = R_AvsZip.substring(0,0); +} +set_ValueNoCheck ("R_AvsZip", R_AvsZip); +} +/** Get Zip verified. +@return The Zip Code has been verified */ +public String getR_AvsZip() +{ +return (String)get_Value("R_AvsZip"); +} +/** Set Routing No. +@param RoutingNo Bank Routing Number */ +public void setRoutingNo (String RoutingNo) +{ +if (RoutingNo != null && RoutingNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RoutingNo = RoutingNo.substring(0,19); +} +set_Value ("RoutingNo", RoutingNo); +} +/** Get Routing No. +@return Bank Routing Number */ +public String getRoutingNo() +{ +return (String)get_Value("RoutingNo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Customer_Acct.java b/dbPort/src/org/compiere/model/X_C_BP_Customer_Acct.java new file mode 100644 index 0000000000..3d1feee2b9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Customer_Acct.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Customer_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.375 */ +public class X_C_BP_Customer_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Customer_Acct_ID id +@param trxName transaction +*/ +public X_C_BP_Customer_Acct (Properties ctx, int C_BP_Customer_Acct_ID, String trxName) +{ +super (ctx, C_BP_Customer_Acct_ID, trxName); +/** if (C_BP_Customer_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_BPartner_ID (0); +setC_Prepayment_Acct (0); +setC_Receivable_Acct (0); +setC_Receivable_Services_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Customer_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=183 */ +public static final int Table_ID=183; + +/** TableName=C_BP_Customer_Acct */ +public static final String Table_Name="C_BP_Customer_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(183,"C_BP_Customer_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Customer_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer Prepayment. +@param C_Prepayment_Acct Account for customer prepayments */ +public void setC_Prepayment_Acct (int C_Prepayment_Acct) +{ +set_Value ("C_Prepayment_Acct", new Integer(C_Prepayment_Acct)); +} +/** Get Customer Prepayment. +@return Account for customer prepayments */ +public int getC_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("C_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer Receivables. +@param C_Receivable_Acct Account for Customer Receivables */ +public void setC_Receivable_Acct (int C_Receivable_Acct) +{ +set_Value ("C_Receivable_Acct", new Integer(C_Receivable_Acct)); +} +/** Get Customer Receivables. +@return Account for Customer Receivables */ +public int getC_Receivable_Acct() +{ +Integer ii = (Integer)get_Value("C_Receivable_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Receivable Services. +@param C_Receivable_Services_Acct Customer Accounts Receivables Services Account */ +public void setC_Receivable_Services_Acct (int C_Receivable_Services_Acct) +{ +set_Value ("C_Receivable_Services_Acct", new Integer(C_Receivable_Services_Acct)); +} +/** Get Receivable Services. +@return Customer Accounts Receivables Services Account */ +public int getC_Receivable_Services_Acct() +{ +Integer ii = (Integer)get_Value("C_Receivable_Services_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_EDI.java b/dbPort/src/org/compiere/model/X_C_BP_EDI.java new file mode 100644 index 0000000000..0ab35fcbd5 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_EDI.java @@ -0,0 +1,465 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_EDI + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.39 */ +public class X_C_BP_EDI extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_EDI_ID id +@param trxName transaction +*/ +public X_C_BP_EDI (Properties ctx, int C_BP_EDI_ID, String trxName) +{ +super (ctx, C_BP_EDI_ID, trxName); +/** if (C_BP_EDI_ID == 0) +{ +setAD_Sequence_ID (0); +setC_BP_EDI_ID (0); +setC_BPartner_ID (0); +setCustomerNo (null); +setEDIType (null); +setEMail_Error_To (null); +setEMail_Info_To (null); +setIsAudited (false); +setIsInfoSent (false); +setM_Warehouse_ID (0); +setName (null); +setReceiveInquiryReply (false); +setReceiveOrderReply (false); +setSendInquiry (false); +setSendOrder (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_EDI (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=366 */ +public static final int Table_ID=366; + +/** TableName=C_BP_EDI */ +public static final String Table_Name="C_BP_EDI"; + +protected static KeyNamePair Model = new KeyNamePair(366,"C_BP_EDI"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_EDI[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Sequence_ID AD_Reference_ID=128 */ +public static final int AD_SEQUENCE_ID_AD_Reference_ID=128; +/** Set Sequence. +@param AD_Sequence_ID Document Sequence */ +public void setAD_Sequence_ID (int AD_Sequence_ID) +{ +if (AD_Sequence_ID < 1) throw new IllegalArgumentException ("AD_Sequence_ID is mandatory."); +set_Value ("AD_Sequence_ID", new Integer(AD_Sequence_ID)); +} +/** Get Sequence. +@return Document Sequence */ +public int getAD_Sequence_ID() +{ +Integer ii = (Integer)get_Value("AD_Sequence_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set EDI Definition. +@param C_BP_EDI_ID Electronic Data Interchange */ +public void setC_BP_EDI_ID (int C_BP_EDI_ID) +{ +if (C_BP_EDI_ID < 1) throw new IllegalArgumentException ("C_BP_EDI_ID is mandatory."); +set_ValueNoCheck ("C_BP_EDI_ID", new Integer(C_BP_EDI_ID)); +} +/** Get EDI Definition. +@return Electronic Data Interchange */ +public int getC_BP_EDI_ID() +{ +Integer ii = (Integer)get_Value("C_BP_EDI_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer No. +@param CustomerNo EDI Identification Number */ +public void setCustomerNo (String CustomerNo) +{ +if (CustomerNo == null) throw new IllegalArgumentException ("CustomerNo is mandatory."); +if (CustomerNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CustomerNo = CustomerNo.substring(0,19); +} +set_Value ("CustomerNo", CustomerNo); +} +/** Get Customer No. +@return EDI Identification Number */ +public String getCustomerNo() +{ +return (String)get_Value("CustomerNo"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EDIType AD_Reference_ID=201 */ +public static final int EDITYPE_AD_Reference_ID=201; +/** EDIFACT = E */ +public static final String EDITYPE_EDIFACT = "E"; +/** Email EDI = M */ +public static final String EDITYPE_EmailEDI = "M"; +/** ASC X12 = X */ +public static final String EDITYPE_ASCX12 = "X"; +/** Set EDI Type. +@param EDIType EDI Type */ +public void setEDIType (String EDIType) +{ +if (EDIType == null) throw new IllegalArgumentException ("EDIType is mandatory"); +if (EDIType.equals("E") || EDIType.equals("M") || EDIType.equals("X")); + else throw new IllegalArgumentException ("EDIType Invalid value - " + EDIType + " - Reference_ID=201 - E - M - X"); +if (EDIType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +EDIType = EDIType.substring(0,0); +} +set_Value ("EDIType", EDIType); +} +/** Get EDI Type. +@return EDI Type */ +public String getEDIType() +{ +return (String)get_Value("EDIType"); +} +/** Set Error EMail. +@param EMail_Error_To Email address to send error messages to */ +public void setEMail_Error_To (String EMail_Error_To) +{ +if (EMail_Error_To == null) throw new IllegalArgumentException ("EMail_Error_To is mandatory."); +if (EMail_Error_To.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail_Error_To = EMail_Error_To.substring(0,59); +} +set_Value ("EMail_Error_To", EMail_Error_To); +} +/** Get Error EMail. +@return Email address to send error messages to */ +public String getEMail_Error_To() +{ +return (String)get_Value("EMail_Error_To"); +} +/** Set From EMail. +@param EMail_From Full EMail address used to send requests - e.g. edi@organization.com */ +public void setEMail_From (String EMail_From) +{ +if (EMail_From != null && EMail_From.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail_From = EMail_From.substring(0,59); +} +set_Value ("EMail_From", EMail_From); +} +/** Get From EMail. +@return Full EMail address used to send requests - e.g. edi@organization.com */ +public String getEMail_From() +{ +return (String)get_Value("EMail_From"); +} +/** Set From EMail Password. +@param EMail_From_Pwd Password of the sending EMail address */ +public void setEMail_From_Pwd (String EMail_From_Pwd) +{ +if (EMail_From_Pwd != null && EMail_From_Pwd.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EMail_From_Pwd = EMail_From_Pwd.substring(0,19); +} +set_Value ("EMail_From_Pwd", EMail_From_Pwd); +} +/** Get From EMail Password. +@return Password of the sending EMail address */ +public String getEMail_From_Pwd() +{ +return (String)get_Value("EMail_From_Pwd"); +} +/** Set From EMail User ID. +@param EMail_From_Uid User ID of the sending EMail address (on default SMTP Host) - e.g. edi */ +public void setEMail_From_Uid (String EMail_From_Uid) +{ +if (EMail_From_Uid != null && EMail_From_Uid.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EMail_From_Uid = EMail_From_Uid.substring(0,19); +} +set_Value ("EMail_From_Uid", EMail_From_Uid); +} +/** Get From EMail User ID. +@return User ID of the sending EMail address (on default SMTP Host) - e.g. edi */ +public String getEMail_From_Uid() +{ +return (String)get_Value("EMail_From_Uid"); +} +/** Set Info EMail. +@param EMail_Info_To EMail address to send informational messages and copies */ +public void setEMail_Info_To (String EMail_Info_To) +{ +if (EMail_Info_To == null) throw new IllegalArgumentException ("EMail_Info_To is mandatory."); +if (EMail_Info_To.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail_Info_To = EMail_Info_To.substring(0,59); +} +set_Value ("EMail_Info_To", EMail_Info_To); +} +/** Get Info EMail. +@return EMail address to send informational messages and copies */ +public String getEMail_Info_To() +{ +return (String)get_Value("EMail_Info_To"); +} +/** Set To EMail. +@param EMail_To EMail address to send requests to - e.g. edi@manufacturer.com */ +public void setEMail_To (String EMail_To) +{ +if (EMail_To != null && EMail_To.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail_To = EMail_To.substring(0,59); +} +set_Value ("EMail_To", EMail_To); +} +/** Get To EMail. +@return EMail address to send requests to - e.g. edi@manufacturer.com */ +public String getEMail_To() +{ +return (String)get_Value("EMail_To"); +} +/** Set Activate Audit. +@param IsAudited Activate Audit Trail of what numbers are generated */ +public void setIsAudited (boolean IsAudited) +{ +set_Value ("IsAudited", new Boolean(IsAudited)); +} +/** Get Activate Audit. +@return Activate Audit Trail of what numbers are generated */ +public boolean isAudited() +{ +Object oo = get_Value("IsAudited"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Send Info. +@param IsInfoSent Send informational messages and copies */ +public void setIsInfoSent (boolean IsInfoSent) +{ +set_Value ("IsInfoSent", new Boolean(IsInfoSent)); +} +/** Get Send Info. +@return Send informational messages and copies */ +public boolean isInfoSent() +{ +Object oo = get_Value("IsInfoSent"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Received Inquiry Reply. +@param ReceiveInquiryReply Received Inquiry Reply */ +public void setReceiveInquiryReply (boolean ReceiveInquiryReply) +{ +set_Value ("ReceiveInquiryReply", new Boolean(ReceiveInquiryReply)); +} +/** Get Received Inquiry Reply. +@return Received Inquiry Reply */ +public boolean isReceiveInquiryReply() +{ +Object oo = get_Value("ReceiveInquiryReply"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Receive Order Reply. +@param ReceiveOrderReply Receive Order Reply */ +public void setReceiveOrderReply (boolean ReceiveOrderReply) +{ +set_Value ("ReceiveOrderReply", new Boolean(ReceiveOrderReply)); +} +/** Get Receive Order Reply. +@return Receive Order Reply */ +public boolean isReceiveOrderReply() +{ +Object oo = get_Value("ReceiveOrderReply"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Send Inquiry. +@param SendInquiry Quantity Availability Inquiry */ +public void setSendInquiry (boolean SendInquiry) +{ +set_Value ("SendInquiry", new Boolean(SendInquiry)); +} +/** Get Send Inquiry. +@return Quantity Availability Inquiry */ +public boolean isSendInquiry() +{ +Object oo = get_Value("SendInquiry"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Send Order. +@param SendOrder Send Order */ +public void setSendOrder (boolean SendOrder) +{ +set_Value ("SendOrder", new Boolean(SendOrder)); +} +/** Get Send Order. +@return Send Order */ +public boolean isSendOrder() +{ +Object oo = get_Value("SendOrder"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Employee_Acct.java b/dbPort/src/org/compiere/model/X_C_BP_Employee_Acct.java new file mode 100644 index 0000000000..ba1e73f81d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Employee_Acct.java @@ -0,0 +1,149 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Employee_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.406 */ +public class X_C_BP_Employee_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Employee_Acct_ID id +@param trxName transaction +*/ +public X_C_BP_Employee_Acct (Properties ctx, int C_BP_Employee_Acct_ID, String trxName) +{ +super (ctx, C_BP_Employee_Acct_ID, trxName); +/** if (C_BP_Employee_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_BPartner_ID (0); +setE_Expense_Acct (0); +setE_Prepayment_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Employee_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=184 */ +public static final int Table_ID=184; + +/** TableName=C_BP_Employee_Acct */ +public static final String Table_Name="C_BP_Employee_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(184,"C_BP_Employee_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Employee_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Employee Expense. +@param E_Expense_Acct Account for Employee Expenses */ +public void setE_Expense_Acct (int E_Expense_Acct) +{ +set_Value ("E_Expense_Acct", new Integer(E_Expense_Acct)); +} +/** Get Employee Expense. +@return Account for Employee Expenses */ +public int getE_Expense_Acct() +{ +Integer ii = (Integer)get_Value("E_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Employee Prepayment. +@param E_Prepayment_Acct Account for Employee Expense Prepayments */ +public void setE_Prepayment_Acct (int E_Prepayment_Acct) +{ +set_Value ("E_Prepayment_Acct", new Integer(E_Prepayment_Acct)); +} +/** Get Employee Prepayment. +@return Account for Employee Expense Prepayments */ +public int getE_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("E_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Group.java b/dbPort/src/org/compiere/model/X_C_BP_Group.java new file mode 100644 index 0000000000..b89207d96a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Group.java @@ -0,0 +1,364 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Group + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.421 */ +public class X_C_BP_Group extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Group_ID id +@param trxName transaction +*/ +public X_C_BP_Group (Properties ctx, int C_BP_Group_ID, String trxName) +{ +super (ctx, C_BP_Group_ID, trxName); +/** if (C_BP_Group_ID == 0) +{ +setC_BP_Group_ID (0); +setIsConfidentialInfo (false); // N +setIsDefault (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Group (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=394 */ +public static final int Table_ID=394; + +/** TableName=C_BP_Group */ +public static final String Table_Name="C_BP_Group"; + +protected static KeyNamePair Model = new KeyNamePair(394,"C_BP_Group"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Group[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID <= 0) set_Value ("AD_PrintColor_ID", null); + else +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID < 1) throw new IllegalArgumentException ("C_BP_Group_ID is mandatory."); +set_ValueNoCheck ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning. +@param C_Dunning_ID Dunning Rules for overdue invoices */ +public void setC_Dunning_ID (int C_Dunning_ID) +{ +if (C_Dunning_ID <= 0) set_Value ("C_Dunning_ID", null); + else +set_Value ("C_Dunning_ID", new Integer(C_Dunning_ID)); +} +/** Get Dunning. +@return Dunning Rules for overdue invoices */ +public int getC_Dunning_ID() +{ +Integer ii = (Integer)get_Value("C_Dunning_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Credit Watch %. +@param CreditWatchPercent Credit Watch - Percent of Credit Limit when OK switches to Watch */ +public void setCreditWatchPercent (BigDecimal CreditWatchPercent) +{ +set_Value ("CreditWatchPercent", CreditWatchPercent); +} +/** Get Credit Watch %. +@return Credit Watch - Percent of Credit Limit when OK switches to Watch */ +public BigDecimal getCreditWatchPercent() +{ +BigDecimal bd = (BigDecimal)get_Value("CreditWatchPercent"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Confidential Info. +@param IsConfidentialInfo Can enter confidential information */ +public void setIsConfidentialInfo (boolean IsConfidentialInfo) +{ +set_Value ("IsConfidentialInfo", new Boolean(IsConfidentialInfo)); +} +/** Get Confidential Info. +@return Can enter confidential information */ +public boolean isConfidentialInfo() +{ +Object oo = get_Value("IsConfidentialInfo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** M_DiscountSchema_ID AD_Reference_ID=325 */ +public static final int M_DISCOUNTSCHEMA_ID_AD_Reference_ID=325; +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID <= 0) set_Value ("M_DiscountSchema_ID", null); + else +set_Value ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID <= 0) set_Value ("M_PriceList_ID", null); + else +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** PO_DiscountSchema_ID AD_Reference_ID=325 */ +public static final int PO_DISCOUNTSCHEMA_ID_AD_Reference_ID=325; +/** Set PO Discount Schema. +@param PO_DiscountSchema_ID Schema to calculate the purchase trade discount percentage */ +public void setPO_DiscountSchema_ID (int PO_DiscountSchema_ID) +{ +if (PO_DiscountSchema_ID <= 0) set_Value ("PO_DiscountSchema_ID", null); + else +set_Value ("PO_DiscountSchema_ID", new Integer(PO_DiscountSchema_ID)); +} +/** Get PO Discount Schema. +@return Schema to calculate the purchase trade discount percentage */ +public int getPO_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("PO_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PO_PriceList_ID AD_Reference_ID=166 */ +public static final int PO_PRICELIST_ID_AD_Reference_ID=166; +/** Set Purchase Pricelist. +@param PO_PriceList_ID Price List used by this Business Partner */ +public void setPO_PriceList_ID (int PO_PriceList_ID) +{ +if (PO_PriceList_ID <= 0) set_Value ("PO_PriceList_ID", null); + else +set_Value ("PO_PriceList_ID", new Integer(PO_PriceList_ID)); +} +/** Get Purchase Pricelist. +@return Price List used by this Business Partner */ +public int getPO_PriceList_ID() +{ +Integer ii = (Integer)get_Value("PO_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price Match Tolerance. +@param PriceMatchTolerance PO-Invoice Match Price Tolerance in percent of the purchase price */ +public void setPriceMatchTolerance (BigDecimal PriceMatchTolerance) +{ +set_Value ("PriceMatchTolerance", PriceMatchTolerance); +} +/** Get Price Match Tolerance. +@return PO-Invoice Match Price Tolerance in percent of the purchase price */ +public BigDecimal getPriceMatchTolerance() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceMatchTolerance"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** PriorityBase AD_Reference_ID=350 */ +public static final int PRIORITYBASE_AD_Reference_ID=350; +/** Higher = H */ +public static final String PRIORITYBASE_Higher = "H"; +/** Lower = L */ +public static final String PRIORITYBASE_Lower = "L"; +/** Same = S */ +public static final String PRIORITYBASE_Same = "S"; +/** Set Priority Base. +@param PriorityBase Base of Priority */ +public void setPriorityBase (String PriorityBase) +{ +if (PriorityBase == null) throw new IllegalArgumentException ("PriorityBase is mandatory"); +if (PriorityBase == null || PriorityBase.equals("H") || PriorityBase.equals("L") || PriorityBase.equals("S")); + else throw new IllegalArgumentException ("PriorityBase Invalid value - " + PriorityBase + " - Reference_ID=350 - H - L - S"); +if (PriorityBase != null && PriorityBase.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityBase = PriorityBase.substring(0,0); +} +set_Value ("PriorityBase", PriorityBase); +} +/** Get Priority Base. +@return Base of Priority */ +public String getPriorityBase() +{ +return (String)get_Value("PriorityBase"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Group_Acct.java b/dbPort/src/org/compiere/model/X_C_BP_Group_Acct.java new file mode 100644 index 0000000000..1d83825f6b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Group_Acct.java @@ -0,0 +1,338 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Group_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.453 */ +public class X_C_BP_Group_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Group_Acct_ID id +@param trxName transaction +*/ +public X_C_BP_Group_Acct (Properties ctx, int C_BP_Group_Acct_ID, String trxName) +{ +super (ctx, C_BP_Group_Acct_ID, trxName); +/** if (C_BP_Group_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_BP_Group_ID (0); +setC_Prepayment_Acct (0); +setC_Receivable_Acct (0); +setC_Receivable_Services_Acct (0); +setNotInvoicedReceipts_Acct (0); +setNotInvoicedReceivables_Acct (0); +setNotInvoicedRevenue_Acct (0); +setPayDiscount_Exp_Acct (0); +setPayDiscount_Rev_Acct (0); +setUnEarnedRevenue_Acct (0); +setV_Liability_Acct (0); +setV_Liability_Services_Acct (0); +setV_Prepayment_Acct (0); +setWriteOff_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Group_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=395 */ +public static final int Table_ID=395; + +/** TableName=C_BP_Group_Acct */ +public static final String Table_Name="C_BP_Group_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(395,"C_BP_Group_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Group_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID < 1) throw new IllegalArgumentException ("C_BP_Group_ID is mandatory."); +set_ValueNoCheck ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_BP_Group_ID())); +} +/** Set Customer Prepayment. +@param C_Prepayment_Acct Account for customer prepayments */ +public void setC_Prepayment_Acct (int C_Prepayment_Acct) +{ +set_Value ("C_Prepayment_Acct", new Integer(C_Prepayment_Acct)); +} +/** Get Customer Prepayment. +@return Account for customer prepayments */ +public int getC_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("C_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer Receivables. +@param C_Receivable_Acct Account for Customer Receivables */ +public void setC_Receivable_Acct (int C_Receivable_Acct) +{ +set_Value ("C_Receivable_Acct", new Integer(C_Receivable_Acct)); +} +/** Get Customer Receivables. +@return Account for Customer Receivables */ +public int getC_Receivable_Acct() +{ +Integer ii = (Integer)get_Value("C_Receivable_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Receivable Services. +@param C_Receivable_Services_Acct Customer Accounts Receivables Services Account */ +public void setC_Receivable_Services_Acct (int C_Receivable_Services_Acct) +{ +set_Value ("C_Receivable_Services_Acct", new Integer(C_Receivable_Services_Acct)); +} +/** Get Receivable Services. +@return Customer Accounts Receivables Services Account */ +public int getC_Receivable_Services_Acct() +{ +Integer ii = (Integer)get_Value("C_Receivable_Services_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Not-invoiced Receipts. +@param NotInvoicedReceipts_Acct Account for not-invoiced Material Receipts */ +public void setNotInvoicedReceipts_Acct (int NotInvoicedReceipts_Acct) +{ +set_Value ("NotInvoicedReceipts_Acct", new Integer(NotInvoicedReceipts_Acct)); +} +/** Get Not-invoiced Receipts. +@return Account for not-invoiced Material Receipts */ +public int getNotInvoicedReceipts_Acct() +{ +Integer ii = (Integer)get_Value("NotInvoicedReceipts_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Not-invoiced Receivables. +@param NotInvoicedReceivables_Acct Account for not invoiced Receivables */ +public void setNotInvoicedReceivables_Acct (int NotInvoicedReceivables_Acct) +{ +set_Value ("NotInvoicedReceivables_Acct", new Integer(NotInvoicedReceivables_Acct)); +} +/** Get Not-invoiced Receivables. +@return Account for not invoiced Receivables */ +public int getNotInvoicedReceivables_Acct() +{ +Integer ii = (Integer)get_Value("NotInvoicedReceivables_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Not-invoiced Revenue. +@param NotInvoicedRevenue_Acct Account for not invoiced Revenue */ +public void setNotInvoicedRevenue_Acct (int NotInvoicedRevenue_Acct) +{ +set_Value ("NotInvoicedRevenue_Acct", new Integer(NotInvoicedRevenue_Acct)); +} +/** Get Not-invoiced Revenue. +@return Account for not invoiced Revenue */ +public int getNotInvoicedRevenue_Acct() +{ +Integer ii = (Integer)get_Value("NotInvoicedRevenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Discount Expense. +@param PayDiscount_Exp_Acct Payment Discount Expense Account */ +public void setPayDiscount_Exp_Acct (int PayDiscount_Exp_Acct) +{ +set_Value ("PayDiscount_Exp_Acct", new Integer(PayDiscount_Exp_Acct)); +} +/** Get Payment Discount Expense. +@return Payment Discount Expense Account */ +public int getPayDiscount_Exp_Acct() +{ +Integer ii = (Integer)get_Value("PayDiscount_Exp_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Discount Revenue. +@param PayDiscount_Rev_Acct Payment Discount Revenue Account */ +public void setPayDiscount_Rev_Acct (int PayDiscount_Rev_Acct) +{ +set_Value ("PayDiscount_Rev_Acct", new Integer(PayDiscount_Rev_Acct)); +} +/** Get Payment Discount Revenue. +@return Payment Discount Revenue Account */ +public int getPayDiscount_Rev_Acct() +{ +Integer ii = (Integer)get_Value("PayDiscount_Rev_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Unearned Revenue. +@param UnEarnedRevenue_Acct Account for unearned revenue */ +public void setUnEarnedRevenue_Acct (int UnEarnedRevenue_Acct) +{ +set_Value ("UnEarnedRevenue_Acct", new Integer(UnEarnedRevenue_Acct)); +} +/** Get Unearned Revenue. +@return Account for unearned revenue */ +public int getUnEarnedRevenue_Acct() +{ +Integer ii = (Integer)get_Value("UnEarnedRevenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Liability. +@param V_Liability_Acct Account for Vendor Liability */ +public void setV_Liability_Acct (int V_Liability_Acct) +{ +set_Value ("V_Liability_Acct", new Integer(V_Liability_Acct)); +} +/** Get Vendor Liability. +@return Account for Vendor Liability */ +public int getV_Liability_Acct() +{ +Integer ii = (Integer)get_Value("V_Liability_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Service Liability. +@param V_Liability_Services_Acct Account for Vender Service Liability */ +public void setV_Liability_Services_Acct (int V_Liability_Services_Acct) +{ +set_Value ("V_Liability_Services_Acct", new Integer(V_Liability_Services_Acct)); +} +/** Get Vendor Service Liability. +@return Account for Vender Service Liability */ +public int getV_Liability_Services_Acct() +{ +Integer ii = (Integer)get_Value("V_Liability_Services_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Prepayment. +@param V_Prepayment_Acct Account for Vendor Prepayments */ +public void setV_Prepayment_Acct (int V_Prepayment_Acct) +{ +set_Value ("V_Prepayment_Acct", new Integer(V_Prepayment_Acct)); +} +/** Get Vendor Prepayment. +@return Account for Vendor Prepayments */ +public int getV_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("V_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Write-off. +@param WriteOff_Acct Account for Receivables write-off */ +public void setWriteOff_Acct (int WriteOff_Acct) +{ +set_Value ("WriteOff_Acct", new Integer(WriteOff_Acct)); +} +/** Get Write-off. +@return Account for Receivables write-off */ +public int getWriteOff_Acct() +{ +Integer ii = (Integer)get_Value("WriteOff_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Relation.java b/dbPort/src/org/compiere/model/X_C_BP_Relation.java new file mode 100644 index 0000000000..28a9b63609 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Relation.java @@ -0,0 +1,291 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Relation + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.484 */ +public class X_C_BP_Relation extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Relation_ID id +@param trxName transaction +*/ +public X_C_BP_Relation (Properties ctx, int C_BP_Relation_ID, String trxName) +{ +super (ctx, C_BP_Relation_ID, trxName); +/** if (C_BP_Relation_ID == 0) +{ +setC_BP_Relation_ID (0); +setC_BPartnerRelation_ID (0); +setC_BPartnerRelation_Location_ID (0); +setC_BPartner_ID (0); +setIsBillTo (false); +setIsPayFrom (false); +setIsRemitTo (false); +setIsShipTo (false); // N +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Relation (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=678 */ +public static final int Table_ID=678; + +/** TableName=C_BP_Relation */ +public static final String Table_Name="C_BP_Relation"; + +protected static KeyNamePair Model = new KeyNamePair(678,"C_BP_Relation"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Relation[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Partner Relation. +@param C_BP_Relation_ID Business Partner Relation */ +public void setC_BP_Relation_ID (int C_BP_Relation_ID) +{ +if (C_BP_Relation_ID < 1) throw new IllegalArgumentException ("C_BP_Relation_ID is mandatory."); +set_ValueNoCheck ("C_BP_Relation_ID", new Integer(C_BP_Relation_ID)); +} +/** Get Partner Relation. +@return Business Partner Relation */ +public int getC_BP_Relation_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Relation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_BPartnerRelation_ID AD_Reference_ID=138 */ +public static final int C_BPARTNERRELATION_ID_AD_Reference_ID=138; +/** Set Related Partner. +@param C_BPartnerRelation_ID Related Business Partner */ +public void setC_BPartnerRelation_ID (int C_BPartnerRelation_ID) +{ +if (C_BPartnerRelation_ID < 1) throw new IllegalArgumentException ("C_BPartnerRelation_ID is mandatory."); +set_Value ("C_BPartnerRelation_ID", new Integer(C_BPartnerRelation_ID)); +} +/** Get Related Partner. +@return Related Business Partner */ +public int getC_BPartnerRelation_ID() +{ +Integer ii = (Integer)get_Value("C_BPartnerRelation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_BPartnerRelation_Location_ID AD_Reference_ID=159 */ +public static final int C_BPARTNERRELATION_LOCATION_ID_AD_Reference_ID=159; +/** Set Related Partner Location. +@param C_BPartnerRelation_Location_ID Location of the related Business Partner */ +public void setC_BPartnerRelation_Location_ID (int C_BPartnerRelation_Location_ID) +{ +if (C_BPartnerRelation_Location_ID < 1) throw new IllegalArgumentException ("C_BPartnerRelation_Location_ID is mandatory."); +set_Value ("C_BPartnerRelation_Location_ID", new Integer(C_BPartnerRelation_Location_ID)); +} +/** Get Related Partner Location. +@return Location of the related Business Partner */ +public int getC_BPartnerRelation_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartnerRelation_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Invoice Address. +@param IsBillTo Business Partner Invoice/Bill Address */ +public void setIsBillTo (boolean IsBillTo) +{ +set_Value ("IsBillTo", new Boolean(IsBillTo)); +} +/** Get Invoice Address. +@return Business Partner Invoice/Bill Address */ +public boolean isBillTo() +{ +Object oo = get_Value("IsBillTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Pay-From Address. +@param IsPayFrom Business Partner pays from that address and we'll send dunning letters there */ +public void setIsPayFrom (boolean IsPayFrom) +{ +set_Value ("IsPayFrom", new Boolean(IsPayFrom)); +} +/** Get Pay-From Address. +@return Business Partner pays from that address and we'll send dunning letters there */ +public boolean isPayFrom() +{ +Object oo = get_Value("IsPayFrom"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Remit-To Address. +@param IsRemitTo Business Partner payment address */ +public void setIsRemitTo (boolean IsRemitTo) +{ +set_Value ("IsRemitTo", new Boolean(IsRemitTo)); +} +/** Get Remit-To Address. +@return Business Partner payment address */ +public boolean isRemitTo() +{ +Object oo = get_Value("IsRemitTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ship Address. +@param IsShipTo Business Partner Shipment Address */ +public void setIsShipTo (boolean IsShipTo) +{ +set_ValueNoCheck ("IsShipTo", new Boolean(IsShipTo)); +} +/** Get Ship Address. +@return Business Partner Shipment Address */ +public boolean isShipTo() +{ +Object oo = get_Value("IsShipTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Vendor_Acct.java b/dbPort/src/org/compiere/model/X_C_BP_Vendor_Acct.java new file mode 100644 index 0000000000..cf65cb8851 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Vendor_Acct.java @@ -0,0 +1,163 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Vendor_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.5 */ +public class X_C_BP_Vendor_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Vendor_Acct_ID id +@param trxName transaction +*/ +public X_C_BP_Vendor_Acct (Properties ctx, int C_BP_Vendor_Acct_ID, String trxName) +{ +super (ctx, C_BP_Vendor_Acct_ID, trxName); +/** if (C_BP_Vendor_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_BPartner_ID (0); +setV_Liability_Acct (0); +setV_Prepayment_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Vendor_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=185 */ +public static final int Table_ID=185; + +/** TableName=C_BP_Vendor_Acct */ +public static final String Table_Name="C_BP_Vendor_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(185,"C_BP_Vendor_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Vendor_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Liability. +@param V_Liability_Acct Account for Vendor Liability */ +public void setV_Liability_Acct (int V_Liability_Acct) +{ +set_Value ("V_Liability_Acct", new Integer(V_Liability_Acct)); +} +/** Get Vendor Liability. +@return Account for Vendor Liability */ +public int getV_Liability_Acct() +{ +Integer ii = (Integer)get_Value("V_Liability_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Service Liability. +@param V_Liability_Services_Acct Account for Vender Service Liability */ +public void setV_Liability_Services_Acct (int V_Liability_Services_Acct) +{ +set_Value ("V_Liability_Services_Acct", new Integer(V_Liability_Services_Acct)); +} +/** Get Vendor Service Liability. +@return Account for Vender Service Liability */ +public int getV_Liability_Services_Acct() +{ +Integer ii = (Integer)get_Value("V_Liability_Services_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Vendor Prepayment. +@param V_Prepayment_Acct Account for Vendor Prepayments */ +public void setV_Prepayment_Acct (int V_Prepayment_Acct) +{ +set_Value ("V_Prepayment_Acct", new Integer(V_Prepayment_Acct)); +} +/** Get Vendor Prepayment. +@return Account for Vendor Prepayments */ +public int getV_Prepayment_Acct() +{ +Integer ii = (Integer)get_Value("V_Prepayment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BP_Withholding.java b/dbPort/src/org/compiere/model/X_C_BP_Withholding.java new file mode 100644 index 0000000000..6c36522451 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BP_Withholding.java @@ -0,0 +1,174 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BP_Withholding + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.5 */ +public class X_C_BP_Withholding extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BP_Withholding_ID id +@param trxName transaction +*/ +public X_C_BP_Withholding (Properties ctx, int C_BP_Withholding_ID, String trxName) +{ +super (ctx, C_BP_Withholding_ID, trxName); +/** if (C_BP_Withholding_ID == 0) +{ +setC_BPartner_ID (0); +setC_Withholding_ID (0); +setIsMandatoryWithholding (false); +setIsTemporaryExempt (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BP_Withholding (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=299 */ +public static final int Table_ID=299; + +/** TableName=C_BP_Withholding */ +public static final String Table_Name="C_BP_Withholding"; + +protected static KeyNamePair Model = new KeyNamePair(299,"C_BP_Withholding"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BP_Withholding[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Withholding. +@param C_Withholding_ID Withholding type defined */ +public void setC_Withholding_ID (int C_Withholding_ID) +{ +if (C_Withholding_ID < 1) throw new IllegalArgumentException ("C_Withholding_ID is mandatory."); +set_ValueNoCheck ("C_Withholding_ID", new Integer(C_Withholding_ID)); +} +/** Get Withholding. +@return Withholding type defined */ +public int getC_Withholding_ID() +{ +Integer ii = (Integer)get_Value("C_Withholding_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Exempt reason. +@param ExemptReason Reason for not withholding */ +public void setExemptReason (String ExemptReason) +{ +if (ExemptReason != null && ExemptReason.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ExemptReason = ExemptReason.substring(0,19); +} +set_Value ("ExemptReason", ExemptReason); +} +/** Get Exempt reason. +@return Reason for not withholding */ +public String getExemptReason() +{ +return (String)get_Value("ExemptReason"); +} +/** Set Mandatory Withholding. +@param IsMandatoryWithholding Monies must be withheld */ +public void setIsMandatoryWithholding (boolean IsMandatoryWithholding) +{ +set_Value ("IsMandatoryWithholding", new Boolean(IsMandatoryWithholding)); +} +/** Get Mandatory Withholding. +@return Monies must be withheld */ +public boolean isMandatoryWithholding() +{ +Object oo = get_Value("IsMandatoryWithholding"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Temporary exempt. +@param IsTemporaryExempt Temporarily do not withhold taxes */ +public void setIsTemporaryExempt (boolean IsTemporaryExempt) +{ +set_Value ("IsTemporaryExempt", new Boolean(IsTemporaryExempt)); +} +/** Get Temporary exempt. +@return Temporarily do not withhold taxes */ +public boolean isTemporaryExempt() +{ +Object oo = get_Value("IsTemporaryExempt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BPartner.java b/dbPort/src/org/compiere/model/X_C_BPartner.java new file mode 100644 index 0000000000..0bb7ea103a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BPartner.java @@ -0,0 +1,1181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BPartner + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.515 */ +public class X_C_BPartner extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BPartner_ID id +@param trxName transaction +*/ +public X_C_BPartner (Properties ctx, int C_BPartner_ID, String trxName) +{ +super (ctx, C_BPartner_ID, trxName); +/** if (C_BPartner_ID == 0) +{ +setC_BP_Group_ID (0); +setC_BPartner_ID (0); +setIsCustomer (false); +setIsEmployee (false); +setIsOneTime (false); +setIsProspect (false); +setIsSalesRep (false); +setIsSummary (false); +setIsVendor (false); +setName (null); +setSO_CreditLimit (Env.ZERO); +setSO_CreditUsed (Env.ZERO); +setSendEMail (false); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BPartner (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=291 */ +public static final int Table_ID=291; + +/** TableName=C_BPartner */ +public static final String Table_Name="C_BPartner"; + +protected static KeyNamePair Model = new KeyNamePair(291,"C_BPartner"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BPartner[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=327 */ +public static final int AD_LANGUAGE_AD_Reference_ID=327; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language != null && AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set Linked Organization. +@param AD_OrgBP_ID The Business Partner is another Organization for explicit Inter-Org transactions */ +public void setAD_OrgBP_ID (String AD_OrgBP_ID) +{ +if (AD_OrgBP_ID != null && AD_OrgBP_ID.length() > 22) +{ +log.warning("Length > 22 - truncated"); +AD_OrgBP_ID = AD_OrgBP_ID.substring(0,21); +} +set_Value ("AD_OrgBP_ID", AD_OrgBP_ID); +} +/** Get Linked Organization. +@return The Business Partner is another Organization for explicit Inter-Org transactions */ +public String getAD_OrgBP_ID() +{ +return (String)get_Value("AD_OrgBP_ID"); +} +/** Set Acquisition Cost. +@param AcqusitionCost The cost of gaining the prospect as a customer */ +public void setAcqusitionCost (BigDecimal AcqusitionCost) +{ +set_Value ("AcqusitionCost", AcqusitionCost); +} +/** Get Acquisition Cost. +@return The cost of gaining the prospect as a customer */ +public BigDecimal getAcqusitionCost() +{ +BigDecimal bd = (BigDecimal)get_Value("AcqusitionCost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Actual Life Time Value. +@param ActualLifeTimeValue Actual Life Time Revenue */ +public void setActualLifeTimeValue (BigDecimal ActualLifeTimeValue) +{ +set_Value ("ActualLifeTimeValue", ActualLifeTimeValue); +} +/** Get Actual Life Time Value. +@return Actual Life Time Revenue */ +public BigDecimal getActualLifeTimeValue() +{ +BigDecimal bd = (BigDecimal)get_Value("ActualLifeTimeValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Partner Parent. +@param BPartner_Parent_ID Business Partner Parent */ +public void setBPartner_Parent_ID (int BPartner_Parent_ID) +{ +if (BPartner_Parent_ID <= 0) set_Value ("BPartner_Parent_ID", null); + else +set_Value ("BPartner_Parent_ID", new Integer(BPartner_Parent_ID)); +} +/** Get Partner Parent. +@return Business Partner Parent */ +public int getBPartner_Parent_ID() +{ +Integer ii = (Integer)get_Value("BPartner_Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID < 1) throw new IllegalArgumentException ("C_BP_Group_ID is mandatory."); +set_Value ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning. +@param C_Dunning_ID Dunning Rules for overdue invoices */ +public void setC_Dunning_ID (int C_Dunning_ID) +{ +if (C_Dunning_ID <= 0) set_Value ("C_Dunning_ID", null); + else +set_Value ("C_Dunning_ID", new Integer(C_Dunning_ID)); +} +/** Get Dunning. +@return Dunning Rules for overdue invoices */ +public int getC_Dunning_ID() +{ +Integer ii = (Integer)get_Value("C_Dunning_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Greeting. +@param C_Greeting_ID Greeting to print on correspondence */ +public void setC_Greeting_ID (int C_Greeting_ID) +{ +if (C_Greeting_ID <= 0) set_Value ("C_Greeting_ID", null); + else +set_Value ("C_Greeting_ID", new Integer(C_Greeting_ID)); +} +/** Get Greeting. +@return Greeting to print on correspondence */ +public int getC_Greeting_ID() +{ +Integer ii = (Integer)get_Value("C_Greeting_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Schedule. +@param C_InvoiceSchedule_ID Schedule for generating Invoices */ +public void setC_InvoiceSchedule_ID (int C_InvoiceSchedule_ID) +{ +if (C_InvoiceSchedule_ID <= 0) set_Value ("C_InvoiceSchedule_ID", null); + else +set_Value ("C_InvoiceSchedule_ID", new Integer(C_InvoiceSchedule_ID)); +} +/** Get Invoice Schedule. +@return Schedule for generating Invoices */ +public int getC_InvoiceSchedule_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceSchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID <= 0) set_Value ("C_PaymentTerm_ID", null); + else +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set D-U-N-S. +@param DUNS Dun & Bradstreet Number */ +public void setDUNS (String DUNS) +{ +if (DUNS != null && DUNS.length() > 11) +{ +log.warning("Length > 11 - truncated"); +DUNS = DUNS.substring(0,10); +} +set_Value ("DUNS", DUNS); +} +/** Get D-U-N-S. +@return Dun & Bradstreet Number */ +public String getDUNS() +{ +return (String)get_Value("DUNS"); +} + +/** DeliveryRule AD_Reference_ID=151 */ +public static final int DELIVERYRULE_AD_Reference_ID=151; +/** Availability = A */ +public static final String DELIVERYRULE_Availability = "A"; +/** Force = F */ +public static final String DELIVERYRULE_Force = "F"; +/** Complete Line = L */ +public static final String DELIVERYRULE_CompleteLine = "L"; +/** Manual = M */ +public static final String DELIVERYRULE_Manual = "M"; +/** Complete Order = O */ +public static final String DELIVERYRULE_CompleteOrder = "O"; +/** After Receipt = R */ +public static final String DELIVERYRULE_AfterReceipt = "R"; +/** Set Delivery Rule. +@param DeliveryRule Defines the timing of Delivery */ +public void setDeliveryRule (String DeliveryRule) +{ +if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); +if (DeliveryRule == null || DeliveryRule.equals("A") || DeliveryRule.equals("F") || DeliveryRule.equals("L") || DeliveryRule.equals("M") || DeliveryRule.equals("O") || DeliveryRule.equals("R")); + else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - A - F - L - M - O - R"); +if (DeliveryRule != null && DeliveryRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryRule = DeliveryRule.substring(0,0); +} +set_Value ("DeliveryRule", DeliveryRule); +} +/** Get Delivery Rule. +@return Defines the timing of Delivery */ +public String getDeliveryRule() +{ +return (String)get_Value("DeliveryRule"); +} + +/** DeliveryViaRule AD_Reference_ID=152 */ +public static final int DELIVERYVIARULE_AD_Reference_ID=152; +/** Delivery = D */ +public static final String DELIVERYVIARULE_Delivery = "D"; +/** Pickup = P */ +public static final String DELIVERYVIARULE_Pickup = "P"; +/** Shipper = S */ +public static final String DELIVERYVIARULE_Shipper = "S"; +/** Set Delivery Via. +@param DeliveryViaRule How the order will be delivered */ +public void setDeliveryViaRule (String DeliveryViaRule) +{ +if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); +if (DeliveryViaRule == null || DeliveryViaRule.equals("D") || DeliveryViaRule.equals("P") || DeliveryViaRule.equals("S")); + else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - D - P - S"); +if (DeliveryViaRule != null && DeliveryViaRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryViaRule = DeliveryViaRule.substring(0,0); +} +set_Value ("DeliveryViaRule", DeliveryViaRule); +} +/** Get Delivery Via. +@return How the order will be delivered */ +public String getDeliveryViaRule() +{ +return (String)get_Value("DeliveryViaRule"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Copies. +@param DocumentCopies Number of copies to be printed */ +public void setDocumentCopies (int DocumentCopies) +{ +set_Value ("DocumentCopies", new Integer(DocumentCopies)); +} +/** Get Document Copies. +@return Number of copies to be printed */ +public int getDocumentCopies() +{ +Integer ii = (Integer)get_Value("DocumentCopies"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set First Sale. +@param FirstSale Date of First Sale */ +public void setFirstSale (Timestamp FirstSale) +{ +set_Value ("FirstSale", FirstSale); +} +/** Get First Sale. +@return Date of First Sale */ +public Timestamp getFirstSale() +{ +return (Timestamp)get_Value("FirstSale"); +} +/** Set Flat Discount %. +@param FlatDiscount Flat discount percentage */ +public void setFlatDiscount (BigDecimal FlatDiscount) +{ +set_Value ("FlatDiscount", FlatDiscount); +} +/** Get Flat Discount %. +@return Flat discount percentage */ +public BigDecimal getFlatDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("FlatDiscount"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** FreightCostRule AD_Reference_ID=153 */ +public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; +/** Calculated = C */ +public static final String FREIGHTCOSTRULE_Calculated = "C"; +/** Fix price = F */ +public static final String FREIGHTCOSTRULE_FixPrice = "F"; +/** Freight included = I */ +public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; +/** Line = L */ +public static final String FREIGHTCOSTRULE_Line = "L"; +/** Set Freight Cost Rule. +@param FreightCostRule Method for charging Freight */ +public void setFreightCostRule (String FreightCostRule) +{ +if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); +if (FreightCostRule == null || FreightCostRule.equals("C") || FreightCostRule.equals("F") || FreightCostRule.equals("I") || FreightCostRule.equals("L")); + else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - C - F - I - L"); +if (FreightCostRule != null && FreightCostRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FreightCostRule = FreightCostRule.substring(0,0); +} +set_Value ("FreightCostRule", FreightCostRule); +} +/** Get Freight Cost Rule. +@return Method for charging Freight */ +public String getFreightCostRule() +{ +return (String)get_Value("FreightCostRule"); +} + +/** InvoiceRule AD_Reference_ID=150 */ +public static final int INVOICERULE_AD_Reference_ID=150; +/** After Delivery = D */ +public static final String INVOICERULE_AfterDelivery = "D"; +/** Immediate = I */ +public static final String INVOICERULE_Immediate = "I"; +/** After Order delivered = O */ +public static final String INVOICERULE_AfterOrderDelivered = "O"; +/** Customer Schedule after Delivery = S */ +public static final String INVOICERULE_CustomerScheduleAfterDelivery = "S"; +/** Set Invoice Rule. +@param InvoiceRule Frequency and method of invoicing */ +public void setInvoiceRule (String InvoiceRule) +{ +if (InvoiceRule == null) throw new IllegalArgumentException ("InvoiceRule is mandatory"); +if (InvoiceRule == null || InvoiceRule.equals("D") || InvoiceRule.equals("I") || InvoiceRule.equals("O") || InvoiceRule.equals("S")); + else throw new IllegalArgumentException ("InvoiceRule Invalid value - " + InvoiceRule + " - Reference_ID=150 - D - I - O - S"); +if (InvoiceRule != null && InvoiceRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceRule = InvoiceRule.substring(0,0); +} +set_Value ("InvoiceRule", InvoiceRule); +} +/** Get Invoice Rule. +@return Frequency and method of invoicing */ +public String getInvoiceRule() +{ +return (String)get_Value("InvoiceRule"); +} + +/** Invoice_PrintFormat_ID AD_Reference_ID=261 */ +public static final int INVOICE_PRINTFORMAT_ID_AD_Reference_ID=261; +/** Set Invoice Print Format. +@param Invoice_PrintFormat_ID Print Format for printing Invoices */ +public void setInvoice_PrintFormat_ID (int Invoice_PrintFormat_ID) +{ +if (Invoice_PrintFormat_ID <= 0) set_Value ("Invoice_PrintFormat_ID", null); + else +set_Value ("Invoice_PrintFormat_ID", new Integer(Invoice_PrintFormat_ID)); +} +/** Get Invoice Print Format. +@return Print Format for printing Invoices */ +public int getInvoice_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Invoice_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer. +@param IsCustomer Indicates if this Business Partner is a Customer */ +public void setIsCustomer (boolean IsCustomer) +{ +set_Value ("IsCustomer", new Boolean(IsCustomer)); +} +/** Get Customer. +@return Indicates if this Business Partner is a Customer */ +public boolean isCustomer() +{ +Object oo = get_Value("IsCustomer"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discount Printed. +@param IsDiscountPrinted Print Discount on Invoice and Order */ +public void setIsDiscountPrinted (boolean IsDiscountPrinted) +{ +set_Value ("IsDiscountPrinted", new Boolean(IsDiscountPrinted)); +} +/** Get Discount Printed. +@return Print Discount on Invoice and Order */ +public boolean isDiscountPrinted() +{ +Object oo = get_Value("IsDiscountPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Employee. +@param IsEmployee Indicates if this Business Partner is an employee */ +public void setIsEmployee (boolean IsEmployee) +{ +set_Value ("IsEmployee", new Boolean(IsEmployee)); +} +/** Get Employee. +@return Indicates if this Business Partner is an employee */ +public boolean isEmployee() +{ +Object oo = get_Value("IsEmployee"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set One time transaction. +@param IsOneTime One time transaction */ +public void setIsOneTime (boolean IsOneTime) +{ +set_Value ("IsOneTime", new Boolean(IsOneTime)); +} +/** Get One time transaction. +@return One time transaction */ +public boolean isOneTime() +{ +Object oo = get_Value("IsOneTime"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Prospect. +@param IsProspect Indicates this is a Prospect */ +public void setIsProspect (boolean IsProspect) +{ +set_Value ("IsProspect", new Boolean(IsProspect)); +} +/** Get Prospect. +@return Indicates this is a Prospect */ +public boolean isProspect() +{ +Object oo = get_Value("IsProspect"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Representative. +@param IsSalesRep Indicates if the business partner is a sales representative or company agent */ +public void setIsSalesRep (boolean IsSalesRep) +{ +set_Value ("IsSalesRep", new Boolean(IsSalesRep)); +} +/** Get Sales Representative. +@return Indicates if the business partner is a sales representative or company agent */ +public boolean isSalesRep() +{ +Object oo = get_Value("IsSalesRep"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax exempt. +@param IsTaxExempt Business partner is exempt from tax */ +public void setIsTaxExempt (boolean IsTaxExempt) +{ +set_Value ("IsTaxExempt", new Boolean(IsTaxExempt)); +} +/** Get Tax exempt. +@return Business partner is exempt from tax */ +public boolean isTaxExempt() +{ +Object oo = get_Value("IsTaxExempt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Vendor. +@param IsVendor Indicates if this Business Partner is a Vendor */ +public void setIsVendor (boolean IsVendor) +{ +set_Value ("IsVendor", new Boolean(IsVendor)); +} +/** Get Vendor. +@return Indicates if this Business Partner is a Vendor */ +public boolean isVendor() +{ +Object oo = get_Value("IsVendor"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** M_DiscountSchema_ID AD_Reference_ID=325 */ +public static final int M_DISCOUNTSCHEMA_ID_AD_Reference_ID=325; +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID <= 0) set_Value ("M_DiscountSchema_ID", null); + else +set_Value ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID <= 0) set_Value ("M_PriceList_ID", null); + else +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set NAICS/SIC. +@param NAICS Standard Industry Code or its successor NAIC - http://www.osha.gov/oshstats/sicser.html */ +public void setNAICS (String NAICS) +{ +if (NAICS != null && NAICS.length() > 6) +{ +log.warning("Length > 6 - truncated"); +NAICS = NAICS.substring(0,5); +} +set_Value ("NAICS", NAICS); +} +/** Get NAICS/SIC. +@return Standard Industry Code or its successor NAIC - http://www.osha.gov/oshstats/sicser.html */ +public String getNAICS() +{ +return (String)get_Value("NAICS"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Name 2. +@param Name2 Additional Name */ +public void setName2 (String Name2) +{ +if (Name2 != null && Name2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name2 = Name2.substring(0,59); +} +set_Value ("Name2", Name2); +} +/** Get Name 2. +@return Additional Name */ +public String getName2() +{ +return (String)get_Value("Name2"); +} +/** Set Employees. +@param NumberEmployees Number of employees */ +public void setNumberEmployees (int NumberEmployees) +{ +set_Value ("NumberEmployees", new Integer(NumberEmployees)); +} +/** Get Employees. +@return Number of employees */ +public int getNumberEmployees() +{ +Integer ii = (Integer)get_Value("NumberEmployees"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order Reference. +@param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} +/** Get Order Reference. +@return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public String getPOReference() +{ +return (String)get_Value("POReference"); +} + +/** PO_DiscountSchema_ID AD_Reference_ID=325 */ +public static final int PO_DISCOUNTSCHEMA_ID_AD_Reference_ID=325; +/** Set PO Discount Schema. +@param PO_DiscountSchema_ID Schema to calculate the purchase trade discount percentage */ +public void setPO_DiscountSchema_ID (int PO_DiscountSchema_ID) +{ +if (PO_DiscountSchema_ID <= 0) set_Value ("PO_DiscountSchema_ID", null); + else +set_Value ("PO_DiscountSchema_ID", new Integer(PO_DiscountSchema_ID)); +} +/** Get PO Discount Schema. +@return Schema to calculate the purchase trade discount percentage */ +public int getPO_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("PO_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PO_PaymentTerm_ID AD_Reference_ID=227 */ +public static final int PO_PAYMENTTERM_ID_AD_Reference_ID=227; +/** Set PO Payment Term. +@param PO_PaymentTerm_ID Payment rules for a purchase order */ +public void setPO_PaymentTerm_ID (int PO_PaymentTerm_ID) +{ +if (PO_PaymentTerm_ID <= 0) set_Value ("PO_PaymentTerm_ID", null); + else +set_Value ("PO_PaymentTerm_ID", new Integer(PO_PaymentTerm_ID)); +} +/** Get PO Payment Term. +@return Payment rules for a purchase order */ +public int getPO_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("PO_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PO_PriceList_ID AD_Reference_ID=166 */ +public static final int PO_PRICELIST_ID_AD_Reference_ID=166; +/** Set Purchase Pricelist. +@param PO_PriceList_ID Price List used by this Business Partner */ +public void setPO_PriceList_ID (int PO_PriceList_ID) +{ +if (PO_PriceList_ID <= 0) set_Value ("PO_PriceList_ID", null); + else +set_Value ("PO_PriceList_ID", new Integer(PO_PriceList_ID)); +} +/** Get Purchase Pricelist. +@return Price List used by this Business Partner */ +public int getPO_PriceList_ID() +{ +Integer ii = (Integer)get_Value("PO_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule == null || PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule != null && PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} + +/** PaymentRulePO AD_Reference_ID=195 */ +public static final int PAYMENTRULEPO_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULEPO_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULEPO_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULEPO_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULEPO_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULEPO_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULEPO_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRulePO Purchase payment option */ +public void setPaymentRulePO (String PaymentRulePO) +{ +if (PaymentRulePO == null) throw new IllegalArgumentException ("PaymentRulePO is mandatory"); +if (PaymentRulePO == null || PaymentRulePO.equals("B") || PaymentRulePO.equals("D") || PaymentRulePO.equals("K") || PaymentRulePO.equals("P") || PaymentRulePO.equals("S") || PaymentRulePO.equals("T")); + else throw new IllegalArgumentException ("PaymentRulePO Invalid value - " + PaymentRulePO + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRulePO != null && PaymentRulePO.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRulePO = PaymentRulePO.substring(0,0); +} +set_Value ("PaymentRulePO", PaymentRulePO); +} +/** Get Payment Rule. +@return Purchase payment option */ +public String getPaymentRulePO() +{ +return (String)get_Value("PaymentRulePO"); +} +/** Set Potential Life Time Value. +@param PotentialLifeTimeValue Total Revenue expected */ +public void setPotentialLifeTimeValue (BigDecimal PotentialLifeTimeValue) +{ +set_Value ("PotentialLifeTimeValue", PotentialLifeTimeValue); +} +/** Get Potential Life Time Value. +@return Total Revenue expected */ +public BigDecimal getPotentialLifeTimeValue() +{ +BigDecimal bd = (BigDecimal)get_Value("PotentialLifeTimeValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Rating. +@param Rating Classification or Importance */ +public void setRating (String Rating) +{ +if (Rating != null && Rating.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Rating = Rating.substring(0,0); +} +set_Value ("Rating", Rating); +} +/** Get Rating. +@return Classification or Importance */ +public String getRating() +{ +return (String)get_Value("Rating"); +} +/** Set Reference No. +@param ReferenceNo Your customer or vendor number at the Business Partner's site */ +public void setReferenceNo (String ReferenceNo) +{ +if (ReferenceNo != null && ReferenceNo.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ReferenceNo = ReferenceNo.substring(0,39); +} +set_Value ("ReferenceNo", ReferenceNo); +} +/** Get Reference No. +@return Your customer or vendor number at the Business Partner's site */ +public String getReferenceNo() +{ +return (String)get_Value("ReferenceNo"); +} + +/** SOCreditStatus AD_Reference_ID=289 */ +public static final int SOCREDITSTATUS_AD_Reference_ID=289; +/** Credit Hold = H */ +public static final String SOCREDITSTATUS_CreditHold = "H"; +/** Credit OK = O */ +public static final String SOCREDITSTATUS_CreditOK = "O"; +/** Credit Stop = S */ +public static final String SOCREDITSTATUS_CreditStop = "S"; +/** Credit Watch = W */ +public static final String SOCREDITSTATUS_CreditWatch = "W"; +/** No Credit Check = X */ +public static final String SOCREDITSTATUS_NoCreditCheck = "X"; +/** Set Credit Status. +@param SOCreditStatus Business Partner Credit Status */ +public void setSOCreditStatus (String SOCreditStatus) +{ +if (SOCreditStatus == null) throw new IllegalArgumentException ("SOCreditStatus is mandatory"); +if (SOCreditStatus == null || SOCreditStatus.equals("H") || SOCreditStatus.equals("O") || SOCreditStatus.equals("S") || SOCreditStatus.equals("W") || SOCreditStatus.equals("X")); + else throw new IllegalArgumentException ("SOCreditStatus Invalid value - " + SOCreditStatus + " - Reference_ID=289 - H - O - S - W - X"); +if (SOCreditStatus != null && SOCreditStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SOCreditStatus = SOCreditStatus.substring(0,0); +} +set_Value ("SOCreditStatus", SOCreditStatus); +} +/** Get Credit Status. +@return Business Partner Credit Status */ +public String getSOCreditStatus() +{ +return (String)get_Value("SOCreditStatus"); +} +/** Set Credit Limit. +@param SO_CreditLimit Total outstanding invoice amounts allowed */ +public void setSO_CreditLimit (BigDecimal SO_CreditLimit) +{ +if (SO_CreditLimit == null) throw new IllegalArgumentException ("SO_CreditLimit is mandatory."); +set_Value ("SO_CreditLimit", SO_CreditLimit); +} +/** Get Credit Limit. +@return Total outstanding invoice amounts allowed */ +public BigDecimal getSO_CreditLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("SO_CreditLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Credit Used. +@param SO_CreditUsed Current open balance */ +public void setSO_CreditUsed (BigDecimal SO_CreditUsed) +{ +if (SO_CreditUsed == null) throw new IllegalArgumentException ("SO_CreditUsed is mandatory."); +set_ValueNoCheck ("SO_CreditUsed", SO_CreditUsed); +} +/** Get Credit Used. +@return Current open balance */ +public BigDecimal getSO_CreditUsed() +{ +BigDecimal bd = (BigDecimal)get_Value("SO_CreditUsed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Order Description. +@param SO_Description Description to be used on orders */ +public void setSO_Description (String SO_Description) +{ +if (SO_Description != null && SO_Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +SO_Description = SO_Description.substring(0,254); +} +set_Value ("SO_Description", SO_Description); +} +/** Get Order Description. +@return Description to be used on orders */ +public String getSO_Description() +{ +return (String)get_Value("SO_Description"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Volume in 1.000. +@param SalesVolume Total Volume of Sales in Thousands of Currency */ +public void setSalesVolume (int SalesVolume) +{ +set_Value ("SalesVolume", new Integer(SalesVolume)); +} +/** Get Sales Volume in 1.000. +@return Total Volume of Sales in Thousands of Currency */ +public int getSalesVolume() +{ +Integer ii = (Integer)get_Value("SalesVolume"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Send EMail. +@param SendEMail Enable sending Document EMail */ +public void setSendEMail (boolean SendEMail) +{ +set_Value ("SendEMail", new Boolean(SendEMail)); +} +/** Get Send EMail. +@return Enable sending Document EMail */ +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Share. +@param ShareOfCustomer Share of Customer's business as a percentage */ +public void setShareOfCustomer (int ShareOfCustomer) +{ +set_Value ("ShareOfCustomer", new Integer(ShareOfCustomer)); +} +/** Get Share. +@return Share of Customer's business as a percentage */ +public int getShareOfCustomer() +{ +Integer ii = (Integer)get_Value("ShareOfCustomer"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Min Shelf Life %. +@param ShelfLifeMinPct Minimum Shelf Life in percent based on Product Instance Guarantee Date */ +public void setShelfLifeMinPct (int ShelfLifeMinPct) +{ +set_Value ("ShelfLifeMinPct", new Integer(ShelfLifeMinPct)); +} +/** Get Min Shelf Life %. +@return Minimum Shelf Life in percent based on Product Instance Guarantee Date */ +public int getShelfLifeMinPct() +{ +Integer ii = (Integer)get_Value("ShelfLifeMinPct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax ID. +@param TaxID Tax Identification */ +public void setTaxID (String TaxID) +{ +if (TaxID != null && TaxID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TaxID = TaxID.substring(0,19); +} +set_Value ("TaxID", TaxID); +} +/** Get Tax ID. +@return Tax Identification */ +public String getTaxID() +{ +return (String)get_Value("TaxID"); +} +/** Set Open Balance. +@param TotalOpenBalance Total Open Balance Amount in primary Accounting Currency */ +public void setTotalOpenBalance (BigDecimal TotalOpenBalance) +{ +set_Value ("TotalOpenBalance", TotalOpenBalance); +} +/** Get Open Balance. +@return Total Open Balance Amount in primary Accounting Currency */ +public BigDecimal getTotalOpenBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalOpenBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set URL. +@param URL Full URL address - e.g. http://www.adempiere.org */ +public void setURL (String URL) +{ +if (URL != null && URL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +URL = URL.substring(0,119); +} +set_Value ("URL", URL); +} +/** Get URL. +@return Full URL address - e.g. http://www.adempiere.org */ +public String getURL() +{ +return (String)get_Value("URL"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BPartner_Location.java b/dbPort/src/org/compiere/model/X_C_BPartner_Location.java new file mode 100644 index 0000000000..2fb035dbb3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BPartner_Location.java @@ -0,0 +1,320 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BPartner_Location + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.609 */ +public class X_C_BPartner_Location extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BPartner_Location_ID id +@param trxName transaction +*/ +public X_C_BPartner_Location (Properties ctx, int C_BPartner_Location_ID, String trxName) +{ +super (ctx, C_BPartner_Location_ID, trxName); +/** if (C_BPartner_Location_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Location_ID (0); +setIsBillTo (true); // Y +setIsPayFrom (true); // Y +setIsRemitTo (true); // Y +setIsShipTo (true); // Y +setName (null); // . +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BPartner_Location (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=293 */ +public static final int Table_ID=293; + +/** TableName=C_BPartner_Location */ +public static final String Table_Name="C_BPartner_Location"; + +protected static KeyNamePair Model = new KeyNamePair(293,"C_BPartner_Location"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BPartner_Location[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID < 1) throw new IllegalArgumentException ("C_Location_ID is mandatory."); +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Fax. +@param Fax Facsimile number */ +public void setFax (String Fax) +{ +if (Fax != null && Fax.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Fax = Fax.substring(0,39); +} +set_Value ("Fax", Fax); +} +/** Get Fax. +@return Facsimile number */ +public String getFax() +{ +return (String)get_Value("Fax"); +} +/** Set ISDN. +@param ISDN ISDN or modem line */ +public void setISDN (String ISDN) +{ +if (ISDN != null && ISDN.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ISDN = ISDN.substring(0,39); +} +set_Value ("ISDN", ISDN); +} +/** Get ISDN. +@return ISDN or modem line */ +public String getISDN() +{ +return (String)get_Value("ISDN"); +} +/** Set Invoice Address. +@param IsBillTo Business Partner Invoice/Bill Address */ +public void setIsBillTo (boolean IsBillTo) +{ +set_Value ("IsBillTo", new Boolean(IsBillTo)); +} +/** Get Invoice Address. +@return Business Partner Invoice/Bill Address */ +public boolean isBillTo() +{ +Object oo = get_Value("IsBillTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Pay-From Address. +@param IsPayFrom Business Partner pays from that address and we'll send dunning letters there */ +public void setIsPayFrom (boolean IsPayFrom) +{ +set_Value ("IsPayFrom", new Boolean(IsPayFrom)); +} +/** Get Pay-From Address. +@return Business Partner pays from that address and we'll send dunning letters there */ +public boolean isPayFrom() +{ +Object oo = get_Value("IsPayFrom"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Remit-To Address. +@param IsRemitTo Business Partner payment address */ +public void setIsRemitTo (boolean IsRemitTo) +{ +set_Value ("IsRemitTo", new Boolean(IsRemitTo)); +} +/** Get Remit-To Address. +@return Business Partner payment address */ +public boolean isRemitTo() +{ +Object oo = get_Value("IsRemitTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ship Address. +@param IsShipTo Business Partner Shipment Address */ +public void setIsShipTo (boolean IsShipTo) +{ +set_Value ("IsShipTo", new Boolean(IsShipTo)); +} +/** Get Ship Address. +@return Business Partner Shipment Address */ +public boolean isShipTo() +{ +Object oo = get_Value("IsShipTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Phone. +@param Phone Identifies a telephone number */ +public void setPhone (String Phone) +{ +if (Phone != null && Phone.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone = Phone.substring(0,39); +} +set_Value ("Phone", Phone); +} +/** Get Phone. +@return Identifies a telephone number */ +public String getPhone() +{ +return (String)get_Value("Phone"); +} +/** Set 2nd Phone. +@param Phone2 Identifies an alternate telephone number. */ +public void setPhone2 (String Phone2) +{ +if (Phone2 != null && Phone2.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone2 = Phone2.substring(0,39); +} +set_Value ("Phone2", Phone2); +} +/** Get 2nd Phone. +@return Identifies an alternate telephone number. */ +public String getPhone2() +{ +return (String)get_Value("Phone2"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BPartner_Product.java b/dbPort/src/org/compiere/model/X_C_BPartner_Product.java new file mode 100644 index 0000000000..8d2f4accd4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BPartner_Product.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BPartner_Product + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.64 */ +public class X_C_BPartner_Product extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BPartner_Product_ID id +@param trxName transaction +*/ +public X_C_BPartner_Product (Properties ctx, int C_BPartner_Product_ID, String trxName) +{ +super (ctx, C_BPartner_Product_ID, trxName); +/** if (C_BPartner_Product_ID == 0) +{ +setC_BPartner_ID (0); +setM_Product_ID (0); +setShelfLifeMinDays (0); +setShelfLifeMinPct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BPartner_Product (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=632 */ +public static final int Table_ID=632; + +/** TableName=C_BPartner_Product */ +public static final String Table_Name="C_BPartner_Product"; + +protected static KeyNamePair Model = new KeyNamePair(632,"C_BPartner_Product"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BPartner_Product[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Manufacturer. +@param Manufacturer Manufacturer of the Product */ +public void setManufacturer (String Manufacturer) +{ +if (Manufacturer != null && Manufacturer.length() > 30) +{ +log.warning("Length > 30 - truncated"); +Manufacturer = Manufacturer.substring(0,29); +} +set_Value ("Manufacturer", Manufacturer); +} +/** Get Manufacturer. +@return Manufacturer of the Product */ +public String getManufacturer() +{ +return (String)get_Value("Manufacturer"); +} +/** Set Quality Rating. +@param QualityRating Method for rating vendors */ +public void setQualityRating (BigDecimal QualityRating) +{ +set_Value ("QualityRating", QualityRating); +} +/** Get Quality Rating. +@return Method for rating vendors */ +public BigDecimal getQualityRating() +{ +BigDecimal bd = (BigDecimal)get_Value("QualityRating"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Min Shelf Life Days. +@param ShelfLifeMinDays Minimum Shelf Life in days based on Product Instance Guarantee Date */ +public void setShelfLifeMinDays (int ShelfLifeMinDays) +{ +set_Value ("ShelfLifeMinDays", new Integer(ShelfLifeMinDays)); +} +/** Get Min Shelf Life Days. +@return Minimum Shelf Life in days based on Product Instance Guarantee Date */ +public int getShelfLifeMinDays() +{ +Integer ii = (Integer)get_Value("ShelfLifeMinDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Min Shelf Life %. +@param ShelfLifeMinPct Minimum Shelf Life in percent based on Product Instance Guarantee Date */ +public void setShelfLifeMinPct (int ShelfLifeMinPct) +{ +set_Value ("ShelfLifeMinPct", new Integer(ShelfLifeMinPct)); +} +/** Get Min Shelf Life %. +@return Minimum Shelf Life in percent based on Product Instance Guarantee Date */ +public int getShelfLifeMinPct() +{ +Integer ii = (Integer)get_Value("ShelfLifeMinPct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Category. +@param VendorCategory Product Category of the Business Partner */ +public void setVendorCategory (String VendorCategory) +{ +if (VendorCategory != null && VendorCategory.length() > 30) +{ +log.warning("Length > 30 - truncated"); +VendorCategory = VendorCategory.substring(0,29); +} +set_Value ("VendorCategory", VendorCategory); +} +/** Get Partner Category. +@return Product Category of the Business Partner */ +public String getVendorCategory() +{ +return (String)get_Value("VendorCategory"); +} +/** Set Partner Product Key. +@param VendorProductNo Product Key of the Business Partner */ +public void setVendorProductNo (String VendorProductNo) +{ +if (VendorProductNo != null && VendorProductNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +VendorProductNo = VendorProductNo.substring(0,29); +} +set_Value ("VendorProductNo", VendorProductNo); +} +/** Get Partner Product Key. +@return Product Key of the Business Partner */ +public String getVendorProductNo() +{ +return (String)get_Value("VendorProductNo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Bank.java b/dbPort/src/org/compiere/model/X_C_Bank.java new file mode 100644 index 0000000000..d2e4288054 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Bank.java @@ -0,0 +1,216 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Bank + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.656 */ +public class X_C_Bank extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Bank_ID id +@param trxName transaction +*/ +public X_C_Bank (Properties ctx, int C_Bank_ID, String trxName) +{ +super (ctx, C_Bank_ID, trxName); +/** if (C_Bank_ID == 0) +{ +setC_Bank_ID (0); +setIsOwnBank (true); // Y +setName (null); +setRoutingNo (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Bank (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=296 */ +public static final int Table_ID=296; + +/** TableName=C_Bank */ +public static final String Table_Name="C_Bank"; + +protected static KeyNamePair Model = new KeyNamePair(296,"C_Bank"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Bank[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Bank. +@param C_Bank_ID Bank */ +public void setC_Bank_ID (int C_Bank_ID) +{ +if (C_Bank_ID < 1) throw new IllegalArgumentException ("C_Bank_ID is mandatory."); +set_ValueNoCheck ("C_Bank_ID", new Integer(C_Bank_ID)); +} +/** Get Bank. +@return Bank */ +public int getC_Bank_ID() +{ +Integer ii = (Integer)get_Value("C_Bank_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Own Bank. +@param IsOwnBank Bank for this Organization */ +public void setIsOwnBank (boolean IsOwnBank) +{ +set_Value ("IsOwnBank", new Boolean(IsOwnBank)); +} +/** Get Own Bank. +@return Bank for this Organization */ +public boolean isOwnBank() +{ +Object oo = get_Value("IsOwnBank"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Routing No. +@param RoutingNo Bank Routing Number */ +public void setRoutingNo (String RoutingNo) +{ +if (RoutingNo == null) throw new IllegalArgumentException ("RoutingNo is mandatory."); +if (RoutingNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RoutingNo = RoutingNo.substring(0,19); +} +set_Value ("RoutingNo", RoutingNo); +} +/** Get Routing No. +@return Bank Routing Number */ +public String getRoutingNo() +{ +return (String)get_Value("RoutingNo"); +} +/** Set Swift code. +@param SwiftCode Swift Code or BIC */ +public void setSwiftCode (String SwiftCode) +{ +if (SwiftCode != null && SwiftCode.length() > 20) +{ +log.warning("Length > 20 - truncated"); +SwiftCode = SwiftCode.substring(0,19); +} +set_Value ("SwiftCode", SwiftCode); +} +/** Get Swift code. +@return Swift Code or BIC */ +public String getSwiftCode() +{ +return (String)get_Value("SwiftCode"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankAccount.java b/dbPort/src/org/compiere/model/X_C_BankAccount.java new file mode 100644 index 0000000000..4efec709de --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankAccount.java @@ -0,0 +1,290 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankAccount + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.671 */ +public class X_C_BankAccount extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankAccount_ID id +@param trxName transaction +*/ +public X_C_BankAccount (Properties ctx, int C_BankAccount_ID, String trxName) +{ +super (ctx, C_BankAccount_ID, trxName); +/** if (C_BankAccount_ID == 0) +{ +setAccountNo (null); +setBankAccountType (null); +setC_BankAccount_ID (0); +setC_Bank_ID (0); +setC_Currency_ID (0); +setCreditLimit (Env.ZERO); +setCurrentBalance (Env.ZERO); +setIsDefault (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankAccount (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=297 */ +public static final int Table_ID=297; + +/** TableName=C_BankAccount */ +public static final String Table_Name="C_BankAccount"; + +protected static KeyNamePair Model = new KeyNamePair(297,"C_BankAccount"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankAccount[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Account No. +@param AccountNo Account Number */ +public void setAccountNo (String AccountNo) +{ +if (AccountNo == null) throw new IllegalArgumentException ("AccountNo is mandatory."); +if (AccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +AccountNo = AccountNo.substring(0,19); +} +set_Value ("AccountNo", AccountNo); +} +/** Get Account No. +@return Account Number */ +public String getAccountNo() +{ +return (String)get_Value("AccountNo"); +} +/** Set BBAN. +@param BBAN Basic Bank Account Number */ +public void setBBAN (String BBAN) +{ +if (BBAN != null && BBAN.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BBAN = BBAN.substring(0,39); +} +set_Value ("BBAN", BBAN); +} +/** Get BBAN. +@return Basic Bank Account Number */ +public String getBBAN() +{ +return (String)get_Value("BBAN"); +} + +/** BankAccountType AD_Reference_ID=216 */ +public static final int BANKACCOUNTTYPE_AD_Reference_ID=216; +/** Checking = C */ +public static final String BANKACCOUNTTYPE_Checking = "C"; +/** Savings = S */ +public static final String BANKACCOUNTTYPE_Savings = "S"; +/** Set Bank Account Type. +@param BankAccountType Bank Account Type */ +public void setBankAccountType (String BankAccountType) +{ +if (BankAccountType == null) throw new IllegalArgumentException ("BankAccountType is mandatory"); +if (BankAccountType.equals("C") || BankAccountType.equals("S")); + else throw new IllegalArgumentException ("BankAccountType Invalid value - " + BankAccountType + " - Reference_ID=216 - C - S"); +if (BankAccountType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BankAccountType = BankAccountType.substring(0,0); +} +set_Value ("BankAccountType", BankAccountType); +} +/** Get Bank Account Type. +@return Bank Account Type */ +public String getBankAccountType() +{ +return (String)get_Value("BankAccountType"); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_ValueNoCheck ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank. +@param C_Bank_ID Bank */ +public void setC_Bank_ID (int C_Bank_ID) +{ +if (C_Bank_ID < 1) throw new IllegalArgumentException ("C_Bank_ID is mandatory."); +set_ValueNoCheck ("C_Bank_ID", new Integer(C_Bank_ID)); +} +/** Get Bank. +@return Bank */ +public int getC_Bank_ID() +{ +Integer ii = (Integer)get_Value("C_Bank_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Bank_ID())); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Credit limit. +@param CreditLimit Amount of Credit allowed */ +public void setCreditLimit (BigDecimal CreditLimit) +{ +if (CreditLimit == null) throw new IllegalArgumentException ("CreditLimit is mandatory."); +set_Value ("CreditLimit", CreditLimit); +} +/** Get Credit limit. +@return Amount of Credit allowed */ +public BigDecimal getCreditLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("CreditLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Current balance. +@param CurrentBalance Current Balance */ +public void setCurrentBalance (BigDecimal CurrentBalance) +{ +if (CurrentBalance == null) throw new IllegalArgumentException ("CurrentBalance is mandatory."); +set_Value ("CurrentBalance", CurrentBalance); +} +/** Get Current balance. +@return Current Balance */ +public BigDecimal getCurrentBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrentBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set IBAN. +@param IBAN International Bank Account Number */ +public void setIBAN (String IBAN) +{ +if (IBAN != null && IBAN.length() > 40) +{ +log.warning("Length > 40 - truncated"); +IBAN = IBAN.substring(0,39); +} +set_Value ("IBAN", IBAN); +} +/** Get IBAN. +@return International Bank Account Number */ +public String getIBAN() +{ +return (String)get_Value("IBAN"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankAccountDoc.java b/dbPort/src/org/compiere/model/X_C_BankAccountDoc.java new file mode 100644 index 0000000000..806ef91f0a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankAccountDoc.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankAccountDoc + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.687 */ +public class X_C_BankAccountDoc extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankAccountDoc_ID id +@param trxName transaction +*/ +public X_C_BankAccountDoc (Properties ctx, int C_BankAccountDoc_ID, String trxName) +{ +super (ctx, C_BankAccountDoc_ID, trxName); +/** if (C_BankAccountDoc_ID == 0) +{ +setC_BankAccountDoc_ID (0); +setC_BankAccount_ID (0); +setCurrentNext (0); +setName (null); +setPaymentRule (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankAccountDoc (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=455 */ +public static final int Table_ID=455; + +/** TableName=C_BankAccountDoc */ +public static final String Table_Name="C_BankAccountDoc"; + +protected static KeyNamePair Model = new KeyNamePair(455,"C_BankAccountDoc"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankAccountDoc[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Bank Account Document. +@param C_BankAccountDoc_ID Checks, Transfers, etc. */ +public void setC_BankAccountDoc_ID (int C_BankAccountDoc_ID) +{ +if (C_BankAccountDoc_ID < 1) throw new IllegalArgumentException ("C_BankAccountDoc_ID is mandatory."); +set_ValueNoCheck ("C_BankAccountDoc_ID", new Integer(C_BankAccountDoc_ID)); +} +/** Get Bank Account Document. +@return Checks, Transfers, etc. */ +public int getC_BankAccountDoc_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccountDoc_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_ValueNoCheck ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Check_PrintFormat_ID AD_Reference_ID=268 */ +public static final int CHECK_PRINTFORMAT_ID_AD_Reference_ID=268; +/** Set Check Print Format. +@param Check_PrintFormat_ID Print Format for printing Checks */ +public void setCheck_PrintFormat_ID (int Check_PrintFormat_ID) +{ +if (Check_PrintFormat_ID <= 0) set_Value ("Check_PrintFormat_ID", null); + else +set_Value ("Check_PrintFormat_ID", new Integer(Check_PrintFormat_ID)); +} +/** Get Check Print Format. +@return Print Format for printing Checks */ +public int getCheck_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Check_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Current Next. +@param CurrentNext The next number to be used */ +public void setCurrentNext (int CurrentNext) +{ +set_Value ("CurrentNext", new Integer(CurrentNext)); +} +/** Get Current Next. +@return The next number to be used */ +public int getCurrentNext() +{ +Integer ii = (Integer)get_Value("CurrentNext"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankAccount_Acct.java b/dbPort/src/org/compiere/model/X_C_BankAccount_Acct.java new file mode 100644 index 0000000000..b844e40f3c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankAccount_Acct.java @@ -0,0 +1,299 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankAccount_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.703 */ +public class X_C_BankAccount_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankAccount_Acct_ID id +@param trxName transaction +*/ +public X_C_BankAccount_Acct (Properties ctx, int C_BankAccount_Acct_ID, String trxName) +{ +super (ctx, C_BankAccount_Acct_ID, trxName); +/** if (C_BankAccount_Acct_ID == 0) +{ +setB_Asset_Acct (0); +setB_Expense_Acct (0); +setB_InTransit_Acct (0); +setB_InterestExp_Acct (0); +setB_InterestRev_Acct (0); +setB_PaymentSelect_Acct (0); +setB_RevaluationGain_Acct (0); +setB_RevaluationLoss_Acct (0); +setB_SettlementGain_Acct (0); +setB_SettlementLoss_Acct (0); +setB_UnallocatedCash_Acct (0); +setB_Unidentified_Acct (0); +setC_AcctSchema_ID (0); +setC_BankAccount_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankAccount_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=391 */ +public static final int Table_ID=391; + +/** TableName=C_BankAccount_Acct */ +public static final String Table_Name="C_BankAccount_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(391,"C_BankAccount_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankAccount_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Bank Asset. +@param B_Asset_Acct Bank Asset Account */ +public void setB_Asset_Acct (int B_Asset_Acct) +{ +set_Value ("B_Asset_Acct", new Integer(B_Asset_Acct)); +} +/** Get Bank Asset. +@return Bank Asset Account */ +public int getB_Asset_Acct() +{ +Integer ii = (Integer)get_Value("B_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Expense. +@param B_Expense_Acct Bank Expense Account */ +public void setB_Expense_Acct (int B_Expense_Acct) +{ +set_Value ("B_Expense_Acct", new Integer(B_Expense_Acct)); +} +/** Get Bank Expense. +@return Bank Expense Account */ +public int getB_Expense_Acct() +{ +Integer ii = (Integer)get_Value("B_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank In Transit. +@param B_InTransit_Acct Bank In Transit Account */ +public void setB_InTransit_Acct (int B_InTransit_Acct) +{ +set_Value ("B_InTransit_Acct", new Integer(B_InTransit_Acct)); +} +/** Get Bank In Transit. +@return Bank In Transit Account */ +public int getB_InTransit_Acct() +{ +Integer ii = (Integer)get_Value("B_InTransit_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Interest Expense. +@param B_InterestExp_Acct Bank Interest Expense Account */ +public void setB_InterestExp_Acct (int B_InterestExp_Acct) +{ +set_Value ("B_InterestExp_Acct", new Integer(B_InterestExp_Acct)); +} +/** Get Bank Interest Expense. +@return Bank Interest Expense Account */ +public int getB_InterestExp_Acct() +{ +Integer ii = (Integer)get_Value("B_InterestExp_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Interest Revenue. +@param B_InterestRev_Acct Bank Interest Revenue Account */ +public void setB_InterestRev_Acct (int B_InterestRev_Acct) +{ +set_Value ("B_InterestRev_Acct", new Integer(B_InterestRev_Acct)); +} +/** Get Bank Interest Revenue. +@return Bank Interest Revenue Account */ +public int getB_InterestRev_Acct() +{ +Integer ii = (Integer)get_Value("B_InterestRev_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Selection. +@param B_PaymentSelect_Acct AP Payment Selection Clearing Account */ +public void setB_PaymentSelect_Acct (int B_PaymentSelect_Acct) +{ +set_Value ("B_PaymentSelect_Acct", new Integer(B_PaymentSelect_Acct)); +} +/** Get Payment Selection. +@return AP Payment Selection Clearing Account */ +public int getB_PaymentSelect_Acct() +{ +Integer ii = (Integer)get_Value("B_PaymentSelect_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Revaluation Gain. +@param B_RevaluationGain_Acct Bank Revaluation Gain Account */ +public void setB_RevaluationGain_Acct (int B_RevaluationGain_Acct) +{ +set_Value ("B_RevaluationGain_Acct", new Integer(B_RevaluationGain_Acct)); +} +/** Get Bank Revaluation Gain. +@return Bank Revaluation Gain Account */ +public int getB_RevaluationGain_Acct() +{ +Integer ii = (Integer)get_Value("B_RevaluationGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Revaluation Loss. +@param B_RevaluationLoss_Acct Bank Revaluation Loss Account */ +public void setB_RevaluationLoss_Acct (int B_RevaluationLoss_Acct) +{ +set_Value ("B_RevaluationLoss_Acct", new Integer(B_RevaluationLoss_Acct)); +} +/** Get Bank Revaluation Loss. +@return Bank Revaluation Loss Account */ +public int getB_RevaluationLoss_Acct() +{ +Integer ii = (Integer)get_Value("B_RevaluationLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Settlement Gain. +@param B_SettlementGain_Acct Bank Settlement Gain Account */ +public void setB_SettlementGain_Acct (int B_SettlementGain_Acct) +{ +set_Value ("B_SettlementGain_Acct", new Integer(B_SettlementGain_Acct)); +} +/** Get Bank Settlement Gain. +@return Bank Settlement Gain Account */ +public int getB_SettlementGain_Acct() +{ +Integer ii = (Integer)get_Value("B_SettlementGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Settlement Loss. +@param B_SettlementLoss_Acct Bank Settlement Loss Account */ +public void setB_SettlementLoss_Acct (int B_SettlementLoss_Acct) +{ +set_Value ("B_SettlementLoss_Acct", new Integer(B_SettlementLoss_Acct)); +} +/** Get Bank Settlement Loss. +@return Bank Settlement Loss Account */ +public int getB_SettlementLoss_Acct() +{ +Integer ii = (Integer)get_Value("B_SettlementLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unallocated Cash. +@param B_UnallocatedCash_Acct Unallocated Cash Clearing Account */ +public void setB_UnallocatedCash_Acct (int B_UnallocatedCash_Acct) +{ +set_Value ("B_UnallocatedCash_Acct", new Integer(B_UnallocatedCash_Acct)); +} +/** Get Unallocated Cash. +@return Unallocated Cash Clearing Account */ +public int getB_UnallocatedCash_Acct() +{ +Integer ii = (Integer)get_Value("B_UnallocatedCash_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Unidentified Receipts. +@param B_Unidentified_Acct Bank Unidentified Receipts Account */ +public void setB_Unidentified_Acct (int B_Unidentified_Acct) +{ +set_Value ("B_Unidentified_Acct", new Integer(B_Unidentified_Acct)); +} +/** Get Bank Unidentified Receipts. +@return Bank Unidentified Receipts Account */ +public int getB_Unidentified_Acct() +{ +Integer ii = (Integer)get_Value("B_Unidentified_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_ValueNoCheck ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankStatement.java b/dbPort/src/org/compiere/model/X_C_BankStatement.java new file mode 100644 index 0000000000..276d75c65b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankStatement.java @@ -0,0 +1,476 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankStatement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.718 */ +public class X_C_BankStatement extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankStatement_ID id +@param trxName transaction +*/ +public X_C_BankStatement (Properties ctx, int C_BankStatement_ID, String trxName) +{ +super (ctx, C_BankStatement_ID, trxName); +/** if (C_BankStatement_ID == 0) +{ +setC_BankAccount_ID (0); +setC_BankStatement_ID (0); +setDocAction (null); // CO +setDocStatus (null); // DR +setEndingBalance (Env.ZERO); +setIsApproved (false); // N +setIsManual (true); // Y +setName (null); // @#Date@ +setPosted (false); // N +setProcessed (false); +setStatementDate (new Timestamp(System.currentTimeMillis())); // @Date@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankStatement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=392 */ +public static final int Table_ID=392; + +/** TableName=C_BankStatement */ +public static final String Table_Name="C_BankStatement"; + +protected static KeyNamePair Model = new KeyNamePair(392,"C_BankStatement"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankStatement[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Beginning Balance. +@param BeginningBalance Balance prior to any transactions */ +public void setBeginningBalance (BigDecimal BeginningBalance) +{ +set_Value ("BeginningBalance", BeginningBalance); +} +/** Get Beginning Balance. +@return Balance prior to any transactions */ +public BigDecimal getBeginningBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("BeginningBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Statement. +@param C_BankStatement_ID Bank Statement of account */ +public void setC_BankStatement_ID (int C_BankStatement_ID) +{ +if (C_BankStatement_ID < 1) throw new IllegalArgumentException ("C_BankStatement_ID is mandatory."); +set_ValueNoCheck ("C_BankStatement_ID", new Integer(C_BankStatement_ID)); +} +/** Get Bank Statement. +@return Bank Statement of account */ +public int getC_BankStatement_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Create lines from. +@param CreateFrom Process which will generate a new document lines based on an existing document */ +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} +/** Get Create lines from. +@return Process which will generate a new document lines based on an existing document */ +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set EFT Statement Date. +@param EftStatementDate Electronic Funds Transfer Statement Date */ +public void setEftStatementDate (Timestamp EftStatementDate) +{ +set_Value ("EftStatementDate", EftStatementDate); +} +/** Get EFT Statement Date. +@return Electronic Funds Transfer Statement Date */ +public Timestamp getEftStatementDate() +{ +return (Timestamp)get_Value("EftStatementDate"); +} +/** Set EFT Statement Reference. +@param EftStatementReference Electronic Funds Transfer Statement Reference */ +public void setEftStatementReference (String EftStatementReference) +{ +if (EftStatementReference != null && EftStatementReference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EftStatementReference = EftStatementReference.substring(0,59); +} +set_Value ("EftStatementReference", EftStatementReference); +} +/** Get EFT Statement Reference. +@return Electronic Funds Transfer Statement Reference */ +public String getEftStatementReference() +{ +return (String)get_Value("EftStatementReference"); +} +/** Set Ending balance. +@param EndingBalance Ending or closing balance */ +public void setEndingBalance (BigDecimal EndingBalance) +{ +if (EndingBalance == null) throw new IllegalArgumentException ("EndingBalance is mandatory."); +set_Value ("EndingBalance", EndingBalance); +} +/** Get Ending balance. +@return Ending or closing balance */ +public BigDecimal getEndingBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("EndingBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Match Statement. +@param MatchStatement Match Statement */ +public void setMatchStatement (String MatchStatement) +{ +if (MatchStatement != null && MatchStatement.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MatchStatement = MatchStatement.substring(0,0); +} +set_Value ("MatchStatement", MatchStatement); +} +/** Get Match Statement. +@return Match Statement */ +public String getMatchStatement() +{ +return (String)get_Value("MatchStatement"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Statement date. +@param StatementDate Date of the statement */ +public void setStatementDate (Timestamp StatementDate) +{ +if (StatementDate == null) throw new IllegalArgumentException ("StatementDate is mandatory."); +set_Value ("StatementDate", StatementDate); +} +/** Get Statement date. +@return Date of the statement */ +public Timestamp getStatementDate() +{ +return (Timestamp)get_Value("StatementDate"); +} +/** Set Statement difference. +@param StatementDifference Difference between statement ending balance and actual ending balance */ +public void setStatementDifference (BigDecimal StatementDifference) +{ +set_Value ("StatementDifference", StatementDifference); +} +/** Get Statement difference. +@return Difference between statement ending balance and actual ending balance */ +public BigDecimal getStatementDifference() +{ +BigDecimal bd = (BigDecimal)get_Value("StatementDifference"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankStatementLine.java b/dbPort/src/org/compiere/model/X_C_BankStatementLine.java new file mode 100644 index 0000000000..2d409a2849 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankStatementLine.java @@ -0,0 +1,642 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankStatementLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.734 */ +public class X_C_BankStatementLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankStatementLine_ID id +@param trxName transaction +*/ +public X_C_BankStatementLine (Properties ctx, int C_BankStatementLine_ID, String trxName) +{ +super (ctx, C_BankStatementLine_ID, trxName); +/** if (C_BankStatementLine_ID == 0) +{ +setC_BankStatementLine_ID (0); +setC_BankStatement_ID (0); +setC_Charge_ID (0); +setC_Currency_ID (0); // @SQL=SELECT C_Currency_ID FROM C_BankAccount WHERE C_BankAccount_ID=@C_BankAccount_ID@ +setChargeAmt (Env.ZERO); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @StatementDate@ +setInterestAmt (Env.ZERO); +setIsManual (true); // Y +setIsReversal (false); +setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 FROM C_BankStatementLine WHERE C_BankStatement_ID=@C_BankStatement_ID@ +setProcessed (false); +setStatementLineDate (new Timestamp(System.currentTimeMillis())); // @StatementLineDate@ +setStmtAmt (Env.ZERO); +setTrxAmt (Env.ZERO); +setValutaDate (new Timestamp(System.currentTimeMillis())); // @StatementDate@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankStatementLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=393 */ +public static final int Table_ID=393; + +/** TableName=C_BankStatementLine */ +public static final String Table_Name="C_BankStatementLine"; + +protected static KeyNamePair Model = new KeyNamePair(393,"C_BankStatementLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankStatementLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank statement line. +@param C_BankStatementLine_ID Line on a statement from this Bank */ +public void setC_BankStatementLine_ID (int C_BankStatementLine_ID) +{ +if (C_BankStatementLine_ID < 1) throw new IllegalArgumentException ("C_BankStatementLine_ID is mandatory."); +set_ValueNoCheck ("C_BankStatementLine_ID", new Integer(C_BankStatementLine_ID)); +} +/** Get Bank statement line. +@return Line on a statement from this Bank */ +public int getC_BankStatementLine_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Statement. +@param C_BankStatement_ID Bank Statement of account */ +public void setC_BankStatement_ID (int C_BankStatement_ID) +{ +if (C_BankStatement_ID < 1) throw new IllegalArgumentException ("C_BankStatement_ID is mandatory."); +set_ValueNoCheck ("C_BankStatement_ID", new Integer(C_BankStatement_ID)); +} +/** Get Bank Statement. +@return Bank Statement of account */ +public int getC_BankStatement_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID < 1) throw new IllegalArgumentException ("C_Charge_ID is mandatory."); +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +if (ChargeAmt == null) throw new IllegalArgumentException ("ChargeAmt is mandatory."); +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Create Payment. +@param CreatePayment Create Payment */ +public void setCreatePayment (String CreatePayment) +{ +if (CreatePayment != null && CreatePayment.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreatePayment = CreatePayment.substring(0,0); +} +set_Value ("CreatePayment", CreatePayment); +} +/** Get Create Payment. +@return Create Payment */ +public String getCreatePayment() +{ +return (String)get_Value("CreatePayment"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EFT Amount. +@param EftAmt Electronic Funds Transfer Amount */ +public void setEftAmt (BigDecimal EftAmt) +{ +set_Value ("EftAmt", EftAmt); +} +/** Get EFT Amount. +@return Electronic Funds Transfer Amount */ +public BigDecimal getEftAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("EftAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set EFT Check No. +@param EftCheckNo Electronic Funds Transfer Check No */ +public void setEftCheckNo (String EftCheckNo) +{ +if (EftCheckNo != null && EftCheckNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EftCheckNo = EftCheckNo.substring(0,19); +} +set_Value ("EftCheckNo", EftCheckNo); +} +/** Get EFT Check No. +@return Electronic Funds Transfer Check No */ +public String getEftCheckNo() +{ +return (String)get_Value("EftCheckNo"); +} +/** Set EFT Currency. +@param EftCurrency Electronic Funds Transfer Currency */ +public void setEftCurrency (String EftCurrency) +{ +if (EftCurrency != null && EftCurrency.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EftCurrency = EftCurrency.substring(0,19); +} +set_Value ("EftCurrency", EftCurrency); +} +/** Get EFT Currency. +@return Electronic Funds Transfer Currency */ +public String getEftCurrency() +{ +return (String)get_Value("EftCurrency"); +} +/** Set EFT Memo. +@param EftMemo Electronic Funds Transfer Memo */ +public void setEftMemo (String EftMemo) +{ +if (EftMemo != null && EftMemo.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +EftMemo = EftMemo.substring(0,1999); +} +set_Value ("EftMemo", EftMemo); +} +/** Get EFT Memo. +@return Electronic Funds Transfer Memo */ +public String getEftMemo() +{ +return (String)get_Value("EftMemo"); +} +/** Set EFT Payee. +@param EftPayee Electronic Funds Transfer Payee information */ +public void setEftPayee (String EftPayee) +{ +if (EftPayee != null && EftPayee.length() > 255) +{ +log.warning("Length > 255 - truncated"); +EftPayee = EftPayee.substring(0,254); +} +set_Value ("EftPayee", EftPayee); +} +/** Get EFT Payee. +@return Electronic Funds Transfer Payee information */ +public String getEftPayee() +{ +return (String)get_Value("EftPayee"); +} +/** Set EFT Payee Account. +@param EftPayeeAccount Electronic Funds Transfer Payyee Account Information */ +public void setEftPayeeAccount (String EftPayeeAccount) +{ +if (EftPayeeAccount != null && EftPayeeAccount.length() > 40) +{ +log.warning("Length > 40 - truncated"); +EftPayeeAccount = EftPayeeAccount.substring(0,39); +} +set_Value ("EftPayeeAccount", EftPayeeAccount); +} +/** Get EFT Payee Account. +@return Electronic Funds Transfer Payyee Account Information */ +public String getEftPayeeAccount() +{ +return (String)get_Value("EftPayeeAccount"); +} +/** Set EFT Reference. +@param EftReference Electronic Funds Transfer Reference */ +public void setEftReference (String EftReference) +{ +if (EftReference != null && EftReference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EftReference = EftReference.substring(0,59); +} +set_Value ("EftReference", EftReference); +} +/** Get EFT Reference. +@return Electronic Funds Transfer Reference */ +public String getEftReference() +{ +return (String)get_Value("EftReference"); +} +/** Set EFT Statement Line Date. +@param EftStatementLineDate Electronic Funds Transfer Statement Line Date */ +public void setEftStatementLineDate (Timestamp EftStatementLineDate) +{ +set_Value ("EftStatementLineDate", EftStatementLineDate); +} +/** Get EFT Statement Line Date. +@return Electronic Funds Transfer Statement Line Date */ +public Timestamp getEftStatementLineDate() +{ +return (Timestamp)get_Value("EftStatementLineDate"); +} +/** Set EFT Trx ID. +@param EftTrxID Electronic Funds Transfer Transaction ID */ +public void setEftTrxID (String EftTrxID) +{ +if (EftTrxID != null && EftTrxID.length() > 40) +{ +log.warning("Length > 40 - truncated"); +EftTrxID = EftTrxID.substring(0,39); +} +set_Value ("EftTrxID", EftTrxID); +} +/** Get EFT Trx ID. +@return Electronic Funds Transfer Transaction ID */ +public String getEftTrxID() +{ +return (String)get_Value("EftTrxID"); +} +/** Set EFT Trx Type. +@param EftTrxType Electronic Funds Transfer Transaction Type */ +public void setEftTrxType (String EftTrxType) +{ +if (EftTrxType != null && EftTrxType.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EftTrxType = EftTrxType.substring(0,19); +} +set_Value ("EftTrxType", EftTrxType); +} +/** Get EFT Trx Type. +@return Electronic Funds Transfer Transaction Type */ +public String getEftTrxType() +{ +return (String)get_Value("EftTrxType"); +} +/** Set EFT Effective Date. +@param EftValutaDate Electronic Funds Transfer Valuta (effective) Date */ +public void setEftValutaDate (Timestamp EftValutaDate) +{ +set_Value ("EftValutaDate", EftValutaDate); +} +/** Get EFT Effective Date. +@return Electronic Funds Transfer Valuta (effective) Date */ +public Timestamp getEftValutaDate() +{ +return (Timestamp)get_Value("EftValutaDate"); +} +/** Set Interest Amount. +@param InterestAmt Interest Amount */ +public void setInterestAmt (BigDecimal InterestAmt) +{ +if (InterestAmt == null) throw new IllegalArgumentException ("InterestAmt is mandatory."); +set_Value ("InterestAmt", InterestAmt); +} +/** Get Interest Amount. +@return Interest Amount */ +public BigDecimal getInterestAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InterestAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reversal. +@param IsReversal This is a reversing transaction */ +public void setIsReversal (boolean IsReversal) +{ +set_Value ("IsReversal", new Boolean(IsReversal)); +} +/** Get Reversal. +@return This is a reversing transaction */ +public boolean isReversal() +{ +Object oo = get_Value("IsReversal"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Match Statement. +@param MatchStatement Match Statement */ +public void setMatchStatement (String MatchStatement) +{ +if (MatchStatement != null && MatchStatement.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MatchStatement = MatchStatement.substring(0,0); +} +set_Value ("MatchStatement", MatchStatement); +} +/** Get Match Statement. +@return Match Statement */ +public String getMatchStatement() +{ +return (String)get_Value("MatchStatement"); +} +/** Set Memo. +@param Memo Memo Text */ +public void setMemo (String Memo) +{ +if (Memo != null && Memo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Memo = Memo.substring(0,254); +} +set_Value ("Memo", Memo); +} +/** Get Memo. +@return Memo Text */ +public String getMemo() +{ +return (String)get_Value("Memo"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reference No. +@param ReferenceNo Your customer or vendor number at the Business Partner's site */ +public void setReferenceNo (String ReferenceNo) +{ +if (ReferenceNo != null && ReferenceNo.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ReferenceNo = ReferenceNo.substring(0,39); +} +set_Value ("ReferenceNo", ReferenceNo); +} +/** Get Reference No. +@return Your customer or vendor number at the Business Partner's site */ +public String getReferenceNo() +{ +return (String)get_Value("ReferenceNo"); +} +/** Set Statement Line Date. +@param StatementLineDate Date of the Statement Line */ +public void setStatementLineDate (Timestamp StatementLineDate) +{ +if (StatementLineDate == null) throw new IllegalArgumentException ("StatementLineDate is mandatory."); +set_Value ("StatementLineDate", StatementLineDate); +} +/** Get Statement Line Date. +@return Date of the Statement Line */ +public Timestamp getStatementLineDate() +{ +return (Timestamp)get_Value("StatementLineDate"); +} +/** Set Statement amount. +@param StmtAmt Statement Amount */ +public void setStmtAmt (BigDecimal StmtAmt) +{ +if (StmtAmt == null) throw new IllegalArgumentException ("StmtAmt is mandatory."); +set_Value ("StmtAmt", StmtAmt); +} +/** Get Statement amount. +@return Statement Amount */ +public BigDecimal getStmtAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("StmtAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Transaction Amount. +@param TrxAmt Amount of a transaction */ +public void setTrxAmt (BigDecimal TrxAmt) +{ +if (TrxAmt == null) throw new IllegalArgumentException ("TrxAmt is mandatory."); +set_Value ("TrxAmt", TrxAmt); +} +/** Get Transaction Amount. +@return Amount of a transaction */ +public BigDecimal getTrxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TrxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Effective date. +@param ValutaDate Date when money is available */ +public void setValutaDate (Timestamp ValutaDate) +{ +if (ValutaDate == null) throw new IllegalArgumentException ("ValutaDate is mandatory."); +set_Value ("ValutaDate", ValutaDate); +} +/** Get Effective date. +@return Date when money is available */ +public Timestamp getValutaDate() +{ +return (Timestamp)get_Value("ValutaDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankStatementLoader.java b/dbPort/src/org/compiere/model/X_C_BankStatementLoader.java new file mode 100644 index 0000000000..322376fc5c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankStatementLoader.java @@ -0,0 +1,422 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankStatementLoader + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.765 */ +public class X_C_BankStatementLoader extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankStatementLoader_ID id +@param trxName transaction +*/ +public X_C_BankStatementLoader (Properties ctx, int C_BankStatementLoader_ID, String trxName) +{ +super (ctx, C_BankStatementLoader_ID, trxName); +/** if (C_BankStatementLoader_ID == 0) +{ +setC_BankAccount_ID (0); +setC_BankStatementLoader_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankStatementLoader (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=640 */ +public static final int Table_ID=640; + +/** TableName=C_BankStatementLoader */ +public static final String Table_Name="C_BankStatementLoader"; + +protected static KeyNamePair Model = new KeyNamePair(640,"C_BankStatementLoader"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankStatementLoader[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Account No. +@param AccountNo Account Number */ +public void setAccountNo (String AccountNo) +{ +if (AccountNo != null && AccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +AccountNo = AccountNo.substring(0,19); +} +set_Value ("AccountNo", AccountNo); +} +/** Get Account No. +@return Account Number */ +public String getAccountNo() +{ +return (String)get_Value("AccountNo"); +} +/** Set Branch ID. +@param BranchID Bank Branch ID */ +public void setBranchID (String BranchID) +{ +if (BranchID != null && BranchID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +BranchID = BranchID.substring(0,19); +} +set_Value ("BranchID", BranchID); +} +/** Get Branch ID. +@return Bank Branch ID */ +public String getBranchID() +{ +return (String)get_Value("BranchID"); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_ValueNoCheck ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Statement Loader. +@param C_BankStatementLoader_ID Definition of Bank Statement Loader (SWIFT, OFX) */ +public void setC_BankStatementLoader_ID (int C_BankStatementLoader_ID) +{ +if (C_BankStatementLoader_ID < 1) throw new IllegalArgumentException ("C_BankStatementLoader_ID is mandatory."); +set_ValueNoCheck ("C_BankStatementLoader_ID", new Integer(C_BankStatementLoader_ID)); +} +/** Get Bank Statement Loader. +@return Definition of Bank Statement Loader (SWIFT, OFX) */ +public int getC_BankStatementLoader_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatementLoader_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date Format. +@param DateFormat Date format used in the imput format */ +public void setDateFormat (String DateFormat) +{ +if (DateFormat != null && DateFormat.length() > 20) +{ +log.warning("Length > 20 - truncated"); +DateFormat = DateFormat.substring(0,19); +} +set_Value ("DateFormat", DateFormat); +} +/** Get Date Format. +@return Date format used in the imput format */ +public String getDateFormat() +{ +return (String)get_Value("DateFormat"); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set File Name. +@param FileName Name of the local file or URL */ +public void setFileName (String FileName) +{ +if (FileName != null && FileName.length() > 120) +{ +log.warning("Length > 120 - truncated"); +FileName = FileName.substring(0,119); +} +set_Value ("FileName", FileName); +} +/** Get File Name. +@return Name of the local file or URL */ +public String getFileName() +{ +return (String)get_Value("FileName"); +} +/** Set Financial Institution ID. +@param FinancialInstitutionID The ID of the Financial Institution / Bank */ +public void setFinancialInstitutionID (String FinancialInstitutionID) +{ +if (FinancialInstitutionID != null && FinancialInstitutionID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +FinancialInstitutionID = FinancialInstitutionID.substring(0,19); +} +set_Value ("FinancialInstitutionID", FinancialInstitutionID); +} +/** Get Financial Institution ID. +@return The ID of the Financial Institution / Bank */ +public String getFinancialInstitutionID() +{ +return (String)get_Value("FinancialInstitutionID"); +} +/** Set Host Address. +@param HostAddress Host Address URL or DNS */ +public void setHostAddress (String HostAddress) +{ +if (HostAddress != null && HostAddress.length() > 60) +{ +log.warning("Length > 60 - truncated"); +HostAddress = HostAddress.substring(0,59); +} +set_Value ("HostAddress", HostAddress); +} +/** Get Host Address. +@return Host Address URL or DNS */ +public String getHostAddress() +{ +return (String)get_Value("HostAddress"); +} +/** Set Host port. +@param HostPort Host Communication Port */ +public void setHostPort (int HostPort) +{ +set_Value ("HostPort", new Integer(HostPort)); +} +/** Get Host port. +@return Host Communication Port */ +public int getHostPort() +{ +Integer ii = (Integer)get_Value("HostPort"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set PIN. +@param PIN Personal Identification Number */ +public void setPIN (String PIN) +{ +if (PIN != null && PIN.length() > 20) +{ +log.warning("Length > 20 - truncated"); +PIN = PIN.substring(0,19); +} +set_Value ("PIN", PIN); +} +/** Get PIN. +@return Personal Identification Number */ +public String getPIN() +{ +return (String)get_Value("PIN"); +} +/** Set Password. +@param Password Password of any length (case sensitive) */ +public void setPassword (String Password) +{ +if (Password != null && Password.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Password = Password.substring(0,59); +} +set_Value ("Password", Password); +} +/** Get Password. +@return Password of any length (case sensitive) */ +public String getPassword() +{ +return (String)get_Value("Password"); +} +/** Set Proxy address. +@param ProxyAddress Address of your proxy server */ +public void setProxyAddress (String ProxyAddress) +{ +if (ProxyAddress != null && ProxyAddress.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProxyAddress = ProxyAddress.substring(0,59); +} +set_Value ("ProxyAddress", ProxyAddress); +} +/** Get Proxy address. +@return Address of your proxy server */ +public String getProxyAddress() +{ +return (String)get_Value("ProxyAddress"); +} +/** Set Proxy logon. +@param ProxyLogon Logon of your proxy server */ +public void setProxyLogon (String ProxyLogon) +{ +if (ProxyLogon != null && ProxyLogon.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProxyLogon = ProxyLogon.substring(0,59); +} +set_Value ("ProxyLogon", ProxyLogon); +} +/** Get Proxy logon. +@return Logon of your proxy server */ +public String getProxyLogon() +{ +return (String)get_Value("ProxyLogon"); +} +/** Set Proxy password. +@param ProxyPassword Password of your proxy server */ +public void setProxyPassword (String ProxyPassword) +{ +if (ProxyPassword != null && ProxyPassword.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProxyPassword = ProxyPassword.substring(0,59); +} +set_Value ("ProxyPassword", ProxyPassword); +} +/** Get Proxy password. +@return Password of your proxy server */ +public String getProxyPassword() +{ +return (String)get_Value("ProxyPassword"); +} +/** Set Proxy port. +@param ProxyPort Port of your proxy server */ +public void setProxyPort (int ProxyPort) +{ +set_Value ("ProxyPort", new Integer(ProxyPort)); +} +/** Get Proxy port. +@return Port of your proxy server */ +public int getProxyPort() +{ +Integer ii = (Integer)get_Value("ProxyPort"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Statement Loader Class. +@param StmtLoaderClass Class name of the bank statement loader */ +public void setStmtLoaderClass (String StmtLoaderClass) +{ +if (StmtLoaderClass != null && StmtLoaderClass.length() > 60) +{ +log.warning("Length > 60 - truncated"); +StmtLoaderClass = StmtLoaderClass.substring(0,59); +} +set_Value ("StmtLoaderClass", StmtLoaderClass); +} +/** Get Statement Loader Class. +@return Class name of the bank statement loader */ +public String getStmtLoaderClass() +{ +return (String)get_Value("StmtLoaderClass"); +} +/** Set User ID. +@param UserID User ID or account number */ +public void setUserID (String UserID) +{ +if (UserID != null && UserID.length() > 60) +{ +log.warning("Length > 60 - truncated"); +UserID = UserID.substring(0,59); +} +set_Value ("UserID", UserID); +} +/** Get User ID. +@return User ID or account number */ +public String getUserID() +{ +return (String)get_Value("UserID"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_BankStatementMatcher.java b/dbPort/src/org/compiere/model/X_C_BankStatementMatcher.java new file mode 100644 index 0000000000..393bf8fcf0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_BankStatementMatcher.java @@ -0,0 +1,181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_BankStatementMatcher + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.781 */ +public class X_C_BankStatementMatcher extends PO +{ +/** Standard Constructor +@param ctx context +@param C_BankStatementMatcher_ID id +@param trxName transaction +*/ +public X_C_BankStatementMatcher (Properties ctx, int C_BankStatementMatcher_ID, String trxName) +{ +super (ctx, C_BankStatementMatcher_ID, trxName); +/** if (C_BankStatementMatcher_ID == 0) +{ +setC_BankStatementMatcher_ID (0); +setClassname (null); +setName (null); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_BankStatementMatcher (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=658 */ +public static final int Table_ID=658; + +/** TableName=C_BankStatementMatcher */ +public static final String Table_Name="C_BankStatementMatcher"; + +protected static KeyNamePair Model = new KeyNamePair(658,"C_BankStatementMatcher"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_BankStatementMatcher[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Bank Statement Matcher. +@param C_BankStatementMatcher_ID Algorithm to match Bank Statement Info to Business Partners, Invoices and Payments */ +public void setC_BankStatementMatcher_ID (int C_BankStatementMatcher_ID) +{ +if (C_BankStatementMatcher_ID < 1) throw new IllegalArgumentException ("C_BankStatementMatcher_ID is mandatory."); +set_ValueNoCheck ("C_BankStatementMatcher_ID", new Integer(C_BankStatementMatcher_ID)); +} +/** Get Bank Statement Matcher. +@return Algorithm to match Bank Statement Info to Business Partners, Invoices and Payments */ +public int getC_BankStatementMatcher_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatementMatcher_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Classname. +@param Classname Java Classname */ +public void setClassname (String Classname) +{ +if (Classname == null) throw new IllegalArgumentException ("Classname is mandatory."); +if (Classname.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Classname = Classname.substring(0,59); +} +set_Value ("Classname", Classname); +} +/** Get Classname. +@return Java Classname */ +public String getClassname() +{ +return (String)get_Value("Classname"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Calendar.java b/dbPort/src/org/compiere/model/X_C_Calendar.java new file mode 100644 index 0000000000..ee6c83d6d1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Calendar.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Calendar + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.796 */ +public class X_C_Calendar extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Calendar_ID id +@param trxName transaction +*/ +public X_C_Calendar (Properties ctx, int C_Calendar_ID, String trxName) +{ +super (ctx, C_Calendar_ID, trxName); +/** if (C_Calendar_ID == 0) +{ +setC_Calendar_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Calendar (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=139 */ +public static final int Table_ID=139; + +/** TableName=C_Calendar */ +public static final String Table_Name="C_Calendar"; + +protected static KeyNamePair Model = new KeyNamePair(139,"C_Calendar"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Calendar[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID < 1) throw new IllegalArgumentException ("C_Calendar_ID is mandatory."); +set_ValueNoCheck ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Campaign.java b/dbPort/src/org/compiere/model/X_C_Campaign.java new file mode 100644 index 0000000000..9c25060e22 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Campaign.java @@ -0,0 +1,239 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Campaign + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.812 */ +public class X_C_Campaign extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Campaign_ID id +@param trxName transaction +*/ +public X_C_Campaign (Properties ctx, int C_Campaign_ID, String trxName) +{ +super (ctx, C_Campaign_ID, trxName); +/** if (C_Campaign_ID == 0) +{ +setC_Campaign_ID (0); +setCosts (Env.ZERO); +setIsSummary (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Campaign (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=274 */ +public static final int Table_ID=274; + +/** TableName=C_Campaign */ +public static final String Table_Name="C_Campaign"; + +protected static KeyNamePair Model = new KeyNamePair(274,"C_Campaign"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Campaign[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID < 1) throw new IllegalArgumentException ("C_Campaign_ID is mandatory."); +set_ValueNoCheck ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Channel. +@param C_Channel_ID Sales Channel */ +public void setC_Channel_ID (int C_Channel_ID) +{ +if (C_Channel_ID <= 0) set_Value ("C_Channel_ID", null); + else +set_Value ("C_Channel_ID", new Integer(C_Channel_ID)); +} +/** Get Channel. +@return Sales Channel */ +public int getC_Channel_ID() +{ +Integer ii = (Integer)get_Value("C_Channel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Costs. +@param Costs Costs in accounting currency */ +public void setCosts (BigDecimal Costs) +{ +if (Costs == null) throw new IllegalArgumentException ("Costs is mandatory."); +set_Value ("Costs", Costs); +} +/** Get Costs. +@return Costs in accounting currency */ +public BigDecimal getCosts() +{ +BigDecimal bd = (BigDecimal)get_Value("Costs"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set End Date. +@param EndDate Last effective date (inclusive) */ +public void setEndDate (Timestamp EndDate) +{ +set_Value ("EndDate", EndDate); +} +/** Get End Date. +@return Last effective date (inclusive) */ +public Timestamp getEndDate() +{ +return (Timestamp)get_Value("EndDate"); +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Cash.java b/dbPort/src/org/compiere/model/X_C_Cash.java new file mode 100644 index 0000000000..0aeebc9133 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Cash.java @@ -0,0 +1,515 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Cash + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.812 */ +public class X_C_Cash extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Cash_ID id +@param trxName transaction +*/ +public X_C_Cash (Properties ctx, int C_Cash_ID, String trxName) +{ +super (ctx, C_Cash_ID, trxName); +/** if (C_Cash_ID == 0) +{ +setBeginningBalance (Env.ZERO); +setC_CashBook_ID (0); +setC_Cash_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDocAction (null); // CO +setDocStatus (null); // DR +setEndingBalance (Env.ZERO); +setIsApproved (false); +setName (null); // @#Date@ +setPosted (false); // N +setProcessed (false); +setStatementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Cash (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=407 */ +public static final int Table_ID=407; + +/** TableName=C_Cash */ +public static final String Table_Name="C_Cash"; + +protected static KeyNamePair Model = new KeyNamePair(407,"C_Cash"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Cash[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Beginning Balance. +@param BeginningBalance Balance prior to any transactions */ +public void setBeginningBalance (BigDecimal BeginningBalance) +{ +if (BeginningBalance == null) throw new IllegalArgumentException ("BeginningBalance is mandatory."); +set_Value ("BeginningBalance", BeginningBalance); +} +/** Get Beginning Balance. +@return Balance prior to any transactions */ +public BigDecimal getBeginningBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("BeginningBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book. +@param C_CashBook_ID Cash Book for recording petty cash transactions */ +public void setC_CashBook_ID (int C_CashBook_ID) +{ +if (C_CashBook_ID < 1) throw new IllegalArgumentException ("C_CashBook_ID is mandatory."); +set_ValueNoCheck ("C_CashBook_ID", new Integer(C_CashBook_ID)); +} +/** Get Cash Book. +@return Cash Book for recording petty cash transactions */ +public int getC_CashBook_ID() +{ +Integer ii = (Integer)get_Value("C_CashBook_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Journal. +@param C_Cash_ID Cash Journal */ +public void setC_Cash_ID (int C_Cash_ID) +{ +if (C_Cash_ID < 1) throw new IllegalArgumentException ("C_Cash_ID is mandatory."); +set_ValueNoCheck ("C_Cash_ID", new Integer(C_Cash_ID)); +} +/** Get Cash Journal. +@return Cash Journal */ +public int getC_Cash_ID() +{ +Integer ii = (Integer)get_Value("C_Cash_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Ending balance. +@param EndingBalance Ending or closing balance */ +public void setEndingBalance (BigDecimal EndingBalance) +{ +if (EndingBalance == null) throw new IllegalArgumentException ("EndingBalance is mandatory."); +set_Value ("EndingBalance", EndingBalance); +} +/** Get Ending balance. +@return Ending or closing balance */ +public BigDecimal getEndingBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("EndingBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Statement date. +@param StatementDate Date of the statement */ +public void setStatementDate (Timestamp StatementDate) +{ +if (StatementDate == null) throw new IllegalArgumentException ("StatementDate is mandatory."); +set_Value ("StatementDate", StatementDate); +} +/** Get Statement date. +@return Date of the statement */ +public Timestamp getStatementDate() +{ +return (Timestamp)get_Value("StatementDate"); +} +/** Set Statement difference. +@param StatementDifference Difference between statement ending balance and actual ending balance */ +public void setStatementDifference (BigDecimal StatementDifference) +{ +set_Value ("StatementDifference", StatementDifference); +} +/** Get Statement difference. +@return Difference between statement ending balance and actual ending balance */ +public BigDecimal getStatementDifference() +{ +BigDecimal bd = (BigDecimal)get_Value("StatementDifference"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CashBook.java b/dbPort/src/org/compiere/model/X_C_CashBook.java new file mode 100644 index 0000000000..aba8ea03aa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CashBook.java @@ -0,0 +1,180 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CashBook + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.859 */ +public class X_C_CashBook extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CashBook_ID id +@param trxName transaction +*/ +public X_C_CashBook (Properties ctx, int C_CashBook_ID, String trxName) +{ +super (ctx, C_CashBook_ID, trxName); +/** if (C_CashBook_ID == 0) +{ +setC_CashBook_ID (0); +setC_Currency_ID (0); // SQL=SELECT cb.C_Currency_ID FROM C_CashBook cb INNER JOIN C_Cash c ON (cb.C_CashBook_ID=c.C_CashBook_ID) WHERE c.C_Cash_ID=@C_Cash_ID@ +setIsDefault (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CashBook (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=408 */ +public static final int Table_ID=408; + +/** TableName=C_CashBook */ +public static final String Table_Name="C_CashBook"; + +protected static KeyNamePair Model = new KeyNamePair(408,"C_CashBook"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CashBook[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Cash Book. +@param C_CashBook_ID Cash Book for recording petty cash transactions */ +public void setC_CashBook_ID (int C_CashBook_ID) +{ +if (C_CashBook_ID < 1) throw new IllegalArgumentException ("C_CashBook_ID is mandatory."); +set_ValueNoCheck ("C_CashBook_ID", new Integer(C_CashBook_ID)); +} +/** Get Cash Book. +@return Cash Book for recording petty cash transactions */ +public int getC_CashBook_ID() +{ +Integer ii = (Integer)get_Value("C_CashBook_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CashBook_Acct.java b/dbPort/src/org/compiere/model/X_C_CashBook_Acct.java new file mode 100644 index 0000000000..bc6635afb8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CashBook_Acct.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CashBook_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.875 */ +public class X_C_CashBook_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CashBook_Acct_ID id +@param trxName transaction +*/ +public X_C_CashBook_Acct (Properties ctx, int C_CashBook_Acct_ID, String trxName) +{ +super (ctx, C_CashBook_Acct_ID, trxName); +/** if (C_CashBook_Acct_ID == 0) +{ +setCB_Asset_Acct (0); +setCB_CashTransfer_Acct (0); +setCB_Differences_Acct (0); +setCB_Expense_Acct (0); +setCB_Receipt_Acct (0); +setC_AcctSchema_ID (0); +setC_CashBook_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CashBook_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=409 */ +public static final int Table_ID=409; + +/** TableName=C_CashBook_Acct */ +public static final String Table_Name="C_CashBook_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(409,"C_CashBook_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CashBook_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Cash Book Asset. +@param CB_Asset_Acct Cash Book Asset Account */ +public void setCB_Asset_Acct (int CB_Asset_Acct) +{ +set_Value ("CB_Asset_Acct", new Integer(CB_Asset_Acct)); +} +/** Get Cash Book Asset. +@return Cash Book Asset Account */ +public int getCB_Asset_Acct() +{ +Integer ii = (Integer)get_Value("CB_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Transfer. +@param CB_CashTransfer_Acct Cash Transfer Clearing Account */ +public void setCB_CashTransfer_Acct (int CB_CashTransfer_Acct) +{ +set_Value ("CB_CashTransfer_Acct", new Integer(CB_CashTransfer_Acct)); +} +/** Get Cash Transfer. +@return Cash Transfer Clearing Account */ +public int getCB_CashTransfer_Acct() +{ +Integer ii = (Integer)get_Value("CB_CashTransfer_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Differences. +@param CB_Differences_Acct Cash Book Differences Account */ +public void setCB_Differences_Acct (int CB_Differences_Acct) +{ +set_Value ("CB_Differences_Acct", new Integer(CB_Differences_Acct)); +} +/** Get Cash Book Differences. +@return Cash Book Differences Account */ +public int getCB_Differences_Acct() +{ +Integer ii = (Integer)get_Value("CB_Differences_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Expense. +@param CB_Expense_Acct Cash Book Expense Account */ +public void setCB_Expense_Acct (int CB_Expense_Acct) +{ +set_Value ("CB_Expense_Acct", new Integer(CB_Expense_Acct)); +} +/** Get Cash Book Expense. +@return Cash Book Expense Account */ +public int getCB_Expense_Acct() +{ +Integer ii = (Integer)get_Value("CB_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book Receipt. +@param CB_Receipt_Acct Cash Book Receipts Account */ +public void setCB_Receipt_Acct (int CB_Receipt_Acct) +{ +set_Value ("CB_Receipt_Acct", new Integer(CB_Receipt_Acct)); +} +/** Get Cash Book Receipt. +@return Cash Book Receipts Account */ +public int getCB_Receipt_Acct() +{ +Integer ii = (Integer)get_Value("CB_Receipt_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book. +@param C_CashBook_ID Cash Book for recording petty cash transactions */ +public void setC_CashBook_ID (int C_CashBook_ID) +{ +if (C_CashBook_ID < 1) throw new IllegalArgumentException ("C_CashBook_ID is mandatory."); +set_ValueNoCheck ("C_CashBook_ID", new Integer(C_CashBook_ID)); +} +/** Get Cash Book. +@return Cash Book for recording petty cash transactions */ +public int getC_CashBook_ID() +{ +Integer ii = (Integer)get_Value("C_CashBook_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CashLine.java b/dbPort/src/org/compiere/model/X_C_CashLine.java new file mode 100644 index 0000000000..7defe1db69 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CashLine.java @@ -0,0 +1,338 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CashLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.89 */ +public class X_C_CashLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CashLine_ID id +@param trxName transaction +*/ +public X_C_CashLine (Properties ctx, int C_CashLine_ID, String trxName) +{ +super (ctx, C_CashLine_ID, trxName); +/** if (C_CashLine_ID == 0) +{ +setAmount (Env.ZERO); +setC_CashLine_ID (0); +setC_Cash_ID (0); +setCashType (null); // E +setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_CashLine WHERE C_Cash_ID=@C_Cash_ID@ +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CashLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=410 */ +public static final int Table_ID=410; + +/** TableName=C_CashLine */ +public static final String Table_Name="C_CashLine"; + +protected static KeyNamePair Model = new KeyNamePair(410,"C_CashLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CashLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amount Amount in a defined currency */ +public void setAmount (BigDecimal Amount) +{ +if (Amount == null) throw new IllegalArgumentException ("Amount is mandatory."); +set_Value ("Amount", Amount); +} +/** Get Amount. +@return Amount in a defined currency */ +public BigDecimal getAmount() +{ +BigDecimal bd = (BigDecimal)get_Value("Amount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID <= 0) set_Value ("C_BankAccount_ID", null); + else +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Journal Line. +@param C_CashLine_ID Cash Journal Line */ +public void setC_CashLine_ID (int C_CashLine_ID) +{ +if (C_CashLine_ID < 1) throw new IllegalArgumentException ("C_CashLine_ID is mandatory."); +set_ValueNoCheck ("C_CashLine_ID", new Integer(C_CashLine_ID)); +} +/** Get Cash Journal Line. +@return Cash Journal Line */ +public int getC_CashLine_ID() +{ +Integer ii = (Integer)get_Value("C_CashLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Journal. +@param C_Cash_ID Cash Journal */ +public void setC_Cash_ID (int C_Cash_ID) +{ +if (C_Cash_ID < 1) throw new IllegalArgumentException ("C_Cash_ID is mandatory."); +set_ValueNoCheck ("C_Cash_ID", new Integer(C_Cash_ID)); +} +/** Get Cash Journal. +@return Cash Journal */ +public int getC_Cash_ID() +{ +Integer ii = (Integer)get_Value("C_Cash_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Cash_ID())); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_ValueNoCheck ("C_Currency_ID", null); + else +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CashType AD_Reference_ID=217 */ +public static final int CASHTYPE_AD_Reference_ID=217; +/** Charge = C */ +public static final String CASHTYPE_Charge = "C"; +/** Difference = D */ +public static final String CASHTYPE_Difference = "D"; +/** General Expense = E */ +public static final String CASHTYPE_GeneralExpense = "E"; +/** Invoice = I */ +public static final String CASHTYPE_Invoice = "I"; +/** General Receipts = R */ +public static final String CASHTYPE_GeneralReceipts = "R"; +/** Bank Account Transfer = T */ +public static final String CASHTYPE_BankAccountTransfer = "T"; +/** Set Cash Type. +@param CashType Source of Cash */ +public void setCashType (String CashType) +{ +if (CashType == null) throw new IllegalArgumentException ("CashType is mandatory"); +if (CashType.equals("C") || CashType.equals("D") || CashType.equals("E") || CashType.equals("I") || CashType.equals("R") || CashType.equals("T")); + else throw new IllegalArgumentException ("CashType Invalid value - " + CashType + " - Reference_ID=217 - C - D - E - I - R - T"); +if (CashType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CashType = CashType.substring(0,0); +} +set_ValueNoCheck ("CashType", CashType); +} +/** Get Cash Type. +@return Source of Cash */ +public String getCashType() +{ +return (String)get_Value("CashType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +set_Value ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Generated. +@param IsGenerated This Line is generated */ +public void setIsGenerated (boolean IsGenerated) +{ +set_ValueNoCheck ("IsGenerated", new Boolean(IsGenerated)); +} +/** Get Generated. +@return This Line is generated */ +public boolean isGenerated() +{ +Object oo = get_Value("IsGenerated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Write-off Amount. +@param WriteOffAmt Amount to write-off */ +public void setWriteOffAmt (BigDecimal WriteOffAmt) +{ +set_Value ("WriteOffAmt", WriteOffAmt); +} +/** Get Write-off Amount. +@return Amount to write-off */ +public BigDecimal getWriteOffAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("WriteOffAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Channel.java b/dbPort/src/org/compiere/model/X_C_Channel.java new file mode 100644 index 0000000000..ef12bb9e36 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Channel.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Channel + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.906 */ +public class X_C_Channel extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Channel_ID id +@param trxName transaction +*/ +public X_C_Channel (Properties ctx, int C_Channel_ID, String trxName) +{ +super (ctx, C_Channel_ID, trxName); +/** if (C_Channel_ID == 0) +{ +setC_Channel_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Channel (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=275 */ +public static final int Table_ID=275; + +/** TableName=C_Channel */ +public static final String Table_Name="C_Channel"; + +protected static KeyNamePair Model = new KeyNamePair(275,"C_Channel"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Channel[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID <= 0) set_Value ("AD_PrintColor_ID", null); + else +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Channel. +@param C_Channel_ID Sales Channel */ +public void setC_Channel_ID (int C_Channel_ID) +{ +if (C_Channel_ID < 1) throw new IllegalArgumentException ("C_Channel_ID is mandatory."); +set_ValueNoCheck ("C_Channel_ID", new Integer(C_Channel_ID)); +} +/** Get Channel. +@return Sales Channel */ +public int getC_Channel_ID() +{ +Integer ii = (Integer)get_Value("C_Channel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Charge.java b/dbPort/src/org/compiere/model/X_C_Charge.java new file mode 100644 index 0000000000..d098a34f4b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Charge.java @@ -0,0 +1,250 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Charge + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.921 */ +public class X_C_Charge extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Charge_ID id +@param trxName transaction +*/ +public X_C_Charge (Properties ctx, int C_Charge_ID, String trxName) +{ +super (ctx, C_Charge_ID, trxName); +/** if (C_Charge_ID == 0) +{ +setC_Charge_ID (0); +setC_TaxCategory_ID (0); +setChargeAmt (Env.ZERO); +setIsSameCurrency (false); +setIsSameTax (false); +setIsTaxIncluded (false); // N +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Charge (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=313 */ +public static final int Table_ID=313; + +/** TableName=C_Charge */ +public static final String Table_Name="C_Charge"; + +protected static KeyNamePair Model = new KeyNamePair(313,"C_Charge"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Charge[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID < 1) throw new IllegalArgumentException ("C_Charge_ID is mandatory."); +set_ValueNoCheck ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_Value ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +if (ChargeAmt == null) throw new IllegalArgumentException ("ChargeAmt is mandatory."); +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Same Currency. +@param IsSameCurrency Same Currency */ +public void setIsSameCurrency (boolean IsSameCurrency) +{ +set_Value ("IsSameCurrency", new Boolean(IsSameCurrency)); +} +/** Get Same Currency. +@return Same Currency */ +public boolean isSameCurrency() +{ +Object oo = get_Value("IsSameCurrency"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Same Tax. +@param IsSameTax Use the same tax as the main transaction */ +public void setIsSameTax (boolean IsSameTax) +{ +set_Value ("IsSameTax", new Boolean(IsSameTax)); +} +/** Get Same Tax. +@return Use the same tax as the main transaction */ +public boolean isSameTax() +{ +Object oo = get_Value("IsSameTax"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Charge_Acct.java b/dbPort/src/org/compiere/model/X_C_Charge_Acct.java new file mode 100644 index 0000000000..26c5e91162 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Charge_Acct.java @@ -0,0 +1,149 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Charge_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.937 */ +public class X_C_Charge_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Charge_Acct_ID id +@param trxName transaction +*/ +public X_C_Charge_Acct (Properties ctx, int C_Charge_Acct_ID, String trxName) +{ +super (ctx, C_Charge_Acct_ID, trxName); +/** if (C_Charge_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Charge_ID (0); +setCh_Expense_Acct (0); +setCh_Revenue_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Charge_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=396 */ +public static final int Table_ID=396; + +/** TableName=C_Charge_Acct */ +public static final String Table_Name="C_Charge_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(396,"C_Charge_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Charge_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID < 1) throw new IllegalArgumentException ("C_Charge_ID is mandatory."); +set_ValueNoCheck ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge Expense. +@param Ch_Expense_Acct Charge Expense Account */ +public void setCh_Expense_Acct (int Ch_Expense_Acct) +{ +set_Value ("Ch_Expense_Acct", new Integer(Ch_Expense_Acct)); +} +/** Get Charge Expense. +@return Charge Expense Account */ +public int getCh_Expense_Acct() +{ +Integer ii = (Integer)get_Value("Ch_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge Revenue. +@param Ch_Revenue_Acct Charge Revenue Account */ +public void setCh_Revenue_Acct (int Ch_Revenue_Acct) +{ +set_Value ("Ch_Revenue_Acct", new Integer(Ch_Revenue_Acct)); +} +/** Get Charge Revenue. +@return Charge Revenue Account */ +public int getCh_Revenue_Acct() +{ +Integer ii = (Integer)get_Value("Ch_Revenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_City.java b/dbPort/src/org/compiere/model/X_C_City.java new file mode 100644 index 0000000000..8a64273dfe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_City.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_City + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.937 */ +public class X_C_City extends PO +{ +/** Standard Constructor +@param ctx context +@param C_City_ID id +@param trxName transaction +*/ +public X_C_City (Properties ctx, int C_City_ID, String trxName) +{ +super (ctx, C_City_ID, trxName); +/** if (C_City_ID == 0) +{ +setC_City_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_City (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=186 */ +public static final int Table_ID=186; + +/** TableName=C_City */ +public static final String Table_Name="C_City"; + +protected static KeyNamePair Model = new KeyNamePair(186,"C_City"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_City[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Area Code. +@param AreaCode Phone Area Code */ +public void setAreaCode (String AreaCode) +{ +if (AreaCode != null && AreaCode.length() > 10) +{ +log.warning("Length > 10 - truncated"); +AreaCode = AreaCode.substring(0,9); +} +set_Value ("AreaCode", AreaCode); +} +/** Get Area Code. +@return Phone Area Code */ +public String getAreaCode() +{ +return (String)get_Value("AreaCode"); +} +/** Set City. +@param C_City_ID City */ +public void setC_City_ID (int C_City_ID) +{ +if (C_City_ID < 1) throw new IllegalArgumentException ("C_City_ID is mandatory."); +set_ValueNoCheck ("C_City_ID", new Integer(C_City_ID)); +} +/** Get City. +@return City */ +public int getC_City_ID() +{ +Integer ii = (Integer)get_Value("C_City_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID <= 0) set_ValueNoCheck ("C_Country_ID", null); + else +set_ValueNoCheck ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Region_ID AD_Reference_ID=157 */ +public static final int C_REGION_ID_AD_Reference_ID=157; +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Coordinates. +@param Coordinates Location coordinate */ +public void setCoordinates (String Coordinates) +{ +if (Coordinates != null && Coordinates.length() > 15) +{ +log.warning("Length > 15 - truncated"); +Coordinates = Coordinates.substring(0,14); +} +set_Value ("Coordinates", Coordinates); +} +/** Get Coordinates. +@return Location coordinate */ +public String getCoordinates() +{ +return (String)get_Value("Coordinates"); +} +/** Set Locode. +@param Locode Location code - UN/LOCODE */ +public void setLocode (String Locode) +{ +if (Locode != null && Locode.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Locode = Locode.substring(0,9); +} +set_Value ("Locode", Locode); +} +/** Get Locode. +@return Location code - UN/LOCODE */ +public String getLocode() +{ +return (String)get_Value("Locode"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal != null && Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_Value ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Commission.java b/dbPort/src/org/compiere/model/X_C_Commission.java new file mode 100644 index 0000000000..5340cfb2d1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Commission.java @@ -0,0 +1,324 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Commission + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:56.953 */ +public class X_C_Commission extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Commission_ID id +@param trxName transaction +*/ +public X_C_Commission (Properties ctx, int C_Commission_ID, String trxName) +{ +super (ctx, C_Commission_ID, trxName); +/** if (C_Commission_ID == 0) +{ +setC_BPartner_ID (0); +setC_Charge_ID (0); +setC_Commission_ID (0); +setC_Currency_ID (0); +setDocBasisType (null); // I +setFrequencyType (null); // M +setListDetails (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Commission (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=429 */ +public static final int Table_ID=429; + +/** TableName=C_Commission */ +public static final String Table_Name="C_Commission"; + +protected static KeyNamePair Model = new KeyNamePair(429,"C_Commission"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Commission[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** C_BPartner_ID AD_Reference_ID=232 */ +public static final int C_BPARTNER_ID_AD_Reference_ID=232; +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID < 1) throw new IllegalArgumentException ("C_Charge_ID is mandatory."); +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission. +@param C_Commission_ID Commission */ +public void setC_Commission_ID (int C_Commission_ID) +{ +if (C_Commission_ID < 1) throw new IllegalArgumentException ("C_Commission_ID is mandatory."); +set_ValueNoCheck ("C_Commission_ID", new Integer(C_Commission_ID)); +} +/** Get Commission. +@return Commission */ +public int getC_Commission_ID() +{ +Integer ii = (Integer)get_Value("C_Commission_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Create lines from. +@param CreateFrom Process which will generate a new document lines based on an existing document */ +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} +/** Get Create lines from. +@return Process which will generate a new document lines based on an existing document */ +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_ValueNoCheck ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocBasisType AD_Reference_ID=224 */ +public static final int DOCBASISTYPE_AD_Reference_ID=224; +/** Invoice = I */ +public static final String DOCBASISTYPE_Invoice = "I"; +/** Order = O */ +public static final String DOCBASISTYPE_Order = "O"; +/** Receipt = R */ +public static final String DOCBASISTYPE_Receipt = "R"; +/** Set Calculation Basis. +@param DocBasisType Basis for the calculation the commission */ +public void setDocBasisType (String DocBasisType) +{ +if (DocBasisType == null) throw new IllegalArgumentException ("DocBasisType is mandatory"); +if (DocBasisType.equals("I") || DocBasisType.equals("O") || DocBasisType.equals("R")); + else throw new IllegalArgumentException ("DocBasisType Invalid value - " + DocBasisType + " - Reference_ID=224 - I - O - R"); +if (DocBasisType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DocBasisType = DocBasisType.substring(0,0); +} +set_Value ("DocBasisType", DocBasisType); +} +/** Get Calculation Basis. +@return Basis for the calculation the commission */ +public String getDocBasisType() +{ +return (String)get_Value("DocBasisType"); +} + +/** FrequencyType AD_Reference_ID=225 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=225; +/** Monthly = M */ +public static final String FREQUENCYTYPE_Monthly = "M"; +/** Quarterly = Q */ +public static final String FREQUENCYTYPE_Quarterly = "Q"; +/** Weekly = W */ +public static final String FREQUENCYTYPE_Weekly = "W"; +/** Yearly = Y */ +public static final String FREQUENCYTYPE_Yearly = "Y"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("M") || FrequencyType.equals("Q") || FrequencyType.equals("W") || FrequencyType.equals("Y")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=225 - M - Q - W - Y"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set List Details. +@param ListDetails List document details */ +public void setListDetails (boolean ListDetails) +{ +set_Value ("ListDetails", new Boolean(ListDetails)); +} +/** Get List Details. +@return List document details */ +public boolean isListDetails() +{ +Object oo = get_Value("ListDetails"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CommissionAmt.java b/dbPort/src/org/compiere/model/X_C_CommissionAmt.java new file mode 100644 index 0000000000..64efaf410d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CommissionAmt.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CommissionAmt + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.015 */ +public class X_C_CommissionAmt extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CommissionAmt_ID id +@param trxName transaction +*/ +public X_C_CommissionAmt (Properties ctx, int C_CommissionAmt_ID, String trxName) +{ +super (ctx, C_CommissionAmt_ID, trxName); +/** if (C_CommissionAmt_ID == 0) +{ +setActualQty (Env.ZERO); +setC_CommissionAmt_ID (0); +setC_CommissionLine_ID (0); +setC_CommissionRun_ID (0); +setCommissionAmt (Env.ZERO); +setConvertedAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CommissionAmt (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=430 */ +public static final int Table_ID=430; + +/** TableName=C_CommissionAmt */ +public static final String Table_Name="C_CommissionAmt"; + +protected static KeyNamePair Model = new KeyNamePair(430,"C_CommissionAmt"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CommissionAmt[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Actual Quantity. +@param ActualQty The actual quantity */ +public void setActualQty (BigDecimal ActualQty) +{ +if (ActualQty == null) throw new IllegalArgumentException ("ActualQty is mandatory."); +set_Value ("ActualQty", ActualQty); +} +/** Get Actual Quantity. +@return The actual quantity */ +public BigDecimal getActualQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ActualQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Commission Amount. +@param C_CommissionAmt_ID Generated Commission Amount */ +public void setC_CommissionAmt_ID (int C_CommissionAmt_ID) +{ +if (C_CommissionAmt_ID < 1) throw new IllegalArgumentException ("C_CommissionAmt_ID is mandatory."); +set_ValueNoCheck ("C_CommissionAmt_ID", new Integer(C_CommissionAmt_ID)); +} +/** Get Commission Amount. +@return Generated Commission Amount */ +public int getC_CommissionAmt_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionAmt_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission Line. +@param C_CommissionLine_ID Commission Line */ +public void setC_CommissionLine_ID (int C_CommissionLine_ID) +{ +if (C_CommissionLine_ID < 1) throw new IllegalArgumentException ("C_CommissionLine_ID is mandatory."); +set_Value ("C_CommissionLine_ID", new Integer(C_CommissionLine_ID)); +} +/** Get Commission Line. +@return Commission Line */ +public int getC_CommissionLine_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission Run. +@param C_CommissionRun_ID Commission Run or Process */ +public void setC_CommissionRun_ID (int C_CommissionRun_ID) +{ +if (C_CommissionRun_ID < 1) throw new IllegalArgumentException ("C_CommissionRun_ID is mandatory."); +set_ValueNoCheck ("C_CommissionRun_ID", new Integer(C_CommissionRun_ID)); +} +/** Get Commission Run. +@return Commission Run or Process */ +public int getC_CommissionRun_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_CommissionRun_ID())); +} +/** Set Commission Amount. +@param CommissionAmt Commission Amount */ +public void setCommissionAmt (BigDecimal CommissionAmt) +{ +if (CommissionAmt == null) throw new IllegalArgumentException ("CommissionAmt is mandatory."); +set_Value ("CommissionAmt", CommissionAmt); +} +/** Get Commission Amount. +@return Commission Amount */ +public BigDecimal getCommissionAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommissionAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Converted Amount. +@param ConvertedAmt Converted Amount */ +public void setConvertedAmt (BigDecimal ConvertedAmt) +{ +if (ConvertedAmt == null) throw new IllegalArgumentException ("ConvertedAmt is mandatory."); +set_Value ("ConvertedAmt", ConvertedAmt); +} +/** Get Converted Amount. +@return Converted Amount */ +public BigDecimal getConvertedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ConvertedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CommissionDetail.java b/dbPort/src/org/compiere/model/X_C_CommissionDetail.java new file mode 100644 index 0000000000..c08f4e5350 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CommissionDetail.java @@ -0,0 +1,255 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CommissionDetail + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.031 */ +public class X_C_CommissionDetail extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CommissionDetail_ID id +@param trxName transaction +*/ +public X_C_CommissionDetail (Properties ctx, int C_CommissionDetail_ID, String trxName) +{ +super (ctx, C_CommissionDetail_ID, trxName); +/** if (C_CommissionDetail_ID == 0) +{ +setActualAmt (Env.ZERO); +setActualQty (Env.ZERO); +setC_CommissionAmt_ID (0); +setC_CommissionDetail_ID (0); +setC_Currency_ID (0); +setConvertedAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CommissionDetail (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=437 */ +public static final int Table_ID=437; + +/** TableName=C_CommissionDetail */ +public static final String Table_Name="C_CommissionDetail"; + +protected static KeyNamePair Model = new KeyNamePair(437,"C_CommissionDetail"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CommissionDetail[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Actual Amount. +@param ActualAmt The actual amount */ +public void setActualAmt (BigDecimal ActualAmt) +{ +if (ActualAmt == null) throw new IllegalArgumentException ("ActualAmt is mandatory."); +set_Value ("ActualAmt", ActualAmt); +} +/** Get Actual Amount. +@return The actual amount */ +public BigDecimal getActualAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ActualAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Actual Quantity. +@param ActualQty The actual quantity */ +public void setActualQty (BigDecimal ActualQty) +{ +if (ActualQty == null) throw new IllegalArgumentException ("ActualQty is mandatory."); +set_Value ("ActualQty", ActualQty); +} +/** Get Actual Quantity. +@return The actual quantity */ +public BigDecimal getActualQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ActualQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Commission Amount. +@param C_CommissionAmt_ID Generated Commission Amount */ +public void setC_CommissionAmt_ID (int C_CommissionAmt_ID) +{ +if (C_CommissionAmt_ID < 1) throw new IllegalArgumentException ("C_CommissionAmt_ID is mandatory."); +set_ValueNoCheck ("C_CommissionAmt_ID", new Integer(C_CommissionAmt_ID)); +} +/** Get Commission Amount. +@return Generated Commission Amount */ +public int getC_CommissionAmt_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionAmt_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission Detail. +@param C_CommissionDetail_ID Supporting information for Commission Amounts */ +public void setC_CommissionDetail_ID (int C_CommissionDetail_ID) +{ +if (C_CommissionDetail_ID < 1) throw new IllegalArgumentException ("C_CommissionDetail_ID is mandatory."); +set_ValueNoCheck ("C_CommissionDetail_ID", new Integer(C_CommissionDetail_ID)); +} +/** Get Commission Detail. +@return Supporting information for Commission Amounts */ +public int getC_CommissionDetail_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionDetail_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_ValueNoCheck ("C_InvoiceLine_ID", null); + else +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); + else +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Converted Amount. +@param ConvertedAmt Converted Amount */ +public void setConvertedAmt (BigDecimal ConvertedAmt) +{ +if (ConvertedAmt == null) throw new IllegalArgumentException ("ConvertedAmt is mandatory."); +set_Value ("ConvertedAmt", ConvertedAmt); +} +/** Get Converted Amount. +@return Converted Amount */ +public BigDecimal getConvertedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ConvertedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Info. +@param Info Information */ +public void setInfo (String Info) +{ +if (Info != null && Info.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Info = Info.substring(0,59); +} +set_Value ("Info", Info); +} +/** Get Info. +@return Information */ +public String getInfo() +{ +return (String)get_Value("Info"); +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getReference()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CommissionLine.java b/dbPort/src/org/compiere/model/X_C_CommissionLine.java new file mode 100644 index 0000000000..21ee710a58 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CommissionLine.java @@ -0,0 +1,358 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CommissionLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.046 */ +public class X_C_CommissionLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CommissionLine_ID id +@param trxName transaction +*/ +public X_C_CommissionLine (Properties ctx, int C_CommissionLine_ID, String trxName) +{ +super (ctx, C_CommissionLine_ID, trxName); +/** if (C_CommissionLine_ID == 0) +{ +setAmtMultiplier (Env.ZERO); +setAmtSubtract (Env.ZERO); +setC_CommissionLine_ID (0); +setC_Commission_ID (0); +setCommissionOrders (false); +setIsPositiveOnly (false); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_CommissionLine WHERE C_Commission_ID=@C_Commission_ID@ +setQtyMultiplier (Env.ZERO); +setQtySubtract (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CommissionLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=431 */ +public static final int Table_ID=431; + +/** TableName=C_CommissionLine */ +public static final String Table_Name="C_CommissionLine"; + +protected static KeyNamePair Model = new KeyNamePair(431,"C_CommissionLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CommissionLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Multiplier Amount. +@param AmtMultiplier Multiplier Amount for generating commissions */ +public void setAmtMultiplier (BigDecimal AmtMultiplier) +{ +if (AmtMultiplier == null) throw new IllegalArgumentException ("AmtMultiplier is mandatory."); +set_Value ("AmtMultiplier", AmtMultiplier); +} +/** Get Multiplier Amount. +@return Multiplier Amount for generating commissions */ +public BigDecimal getAmtMultiplier() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtMultiplier"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Subtract Amount. +@param AmtSubtract Subtract Amount for generating commissions */ +public void setAmtSubtract (BigDecimal AmtSubtract) +{ +if (AmtSubtract == null) throw new IllegalArgumentException ("AmtSubtract is mandatory."); +set_Value ("AmtSubtract", AmtSubtract); +} +/** Get Subtract Amount. +@return Subtract Amount for generating commissions */ +public BigDecimal getAmtSubtract() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSubtract"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID <= 0) set_Value ("C_BP_Group_ID", null); + else +set_Value ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission Line. +@param C_CommissionLine_ID Commission Line */ +public void setC_CommissionLine_ID (int C_CommissionLine_ID) +{ +if (C_CommissionLine_ID < 1) throw new IllegalArgumentException ("C_CommissionLine_ID is mandatory."); +set_ValueNoCheck ("C_CommissionLine_ID", new Integer(C_CommissionLine_ID)); +} +/** Get Commission Line. +@return Commission Line */ +public int getC_CommissionLine_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission. +@param C_Commission_ID Commission */ +public void setC_Commission_ID (int C_Commission_ID) +{ +if (C_Commission_ID < 1) throw new IllegalArgumentException ("C_Commission_ID is mandatory."); +set_ValueNoCheck ("C_Commission_ID", new Integer(C_Commission_ID)); +} +/** Get Commission. +@return Commission */ +public int getC_Commission_ID() +{ +Integer ii = (Integer)get_Value("C_Commission_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Commission_ID())); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission only specified Orders. +@param CommissionOrders Commission only Orders or Invoices, where this Sales Rep is entered */ +public void setCommissionOrders (boolean CommissionOrders) +{ +set_Value ("CommissionOrders", new Boolean(CommissionOrders)); +} +/** Get Commission only specified Orders. +@return Commission only Orders or Invoices, where this Sales Rep is entered */ +public boolean isCommissionOrders() +{ +Object oo = get_Value("CommissionOrders"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Positive only. +@param IsPositiveOnly Do not generate negative commissions */ +public void setIsPositiveOnly (boolean IsPositiveOnly) +{ +set_Value ("IsPositiveOnly", new Boolean(IsPositiveOnly)); +} +/** Get Positive only. +@return Do not generate negative commissions */ +public boolean isPositiveOnly() +{ +Object oo = get_Value("IsPositiveOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Org_ID AD_Reference_ID=130 */ +public static final int ORG_ID_AD_Reference_ID=130; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID <= 0) set_Value ("Org_ID", null); + else +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Multiplier Quantity. +@param QtyMultiplier Value to multiply quantities by for generating commissions. */ +public void setQtyMultiplier (BigDecimal QtyMultiplier) +{ +if (QtyMultiplier == null) throw new IllegalArgumentException ("QtyMultiplier is mandatory."); +set_Value ("QtyMultiplier", QtyMultiplier); +} +/** Get Multiplier Quantity. +@return Value to multiply quantities by for generating commissions. */ +public BigDecimal getQtyMultiplier() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyMultiplier"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Subtract Quantity. +@param QtySubtract Quantity to subtract when generating commissions */ +public void setQtySubtract (BigDecimal QtySubtract) +{ +if (QtySubtract == null) throw new IllegalArgumentException ("QtySubtract is mandatory."); +set_Value ("QtySubtract", QtySubtract); +} +/** Get Subtract Quantity. +@return Quantity to subtract when generating commissions */ +public BigDecimal getQtySubtract() +{ +BigDecimal bd = (BigDecimal)get_Value("QtySubtract"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CommissionRun.java b/dbPort/src/org/compiere/model/X_C_CommissionRun.java new file mode 100644 index 0000000000..e181f93474 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CommissionRun.java @@ -0,0 +1,228 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CommissionRun + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.062 */ +public class X_C_CommissionRun extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CommissionRun_ID id +@param trxName transaction +*/ +public X_C_CommissionRun (Properties ctx, int C_CommissionRun_ID, String trxName) +{ +super (ctx, C_CommissionRun_ID, trxName); +/** if (C_CommissionRun_ID == 0) +{ +setC_CommissionRun_ID (0); +setC_Commission_ID (0); +setDocumentNo (null); +setGrandTotal (Env.ZERO); +setProcessed (false); +setStartDate (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CommissionRun (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=436 */ +public static final int Table_ID=436; + +/** TableName=C_CommissionRun */ +public static final String Table_Name="C_CommissionRun"; + +protected static KeyNamePair Model = new KeyNamePair(436,"C_CommissionRun"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CommissionRun[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Commission Run. +@param C_CommissionRun_ID Commission Run or Process */ +public void setC_CommissionRun_ID (int C_CommissionRun_ID) +{ +if (C_CommissionRun_ID < 1) throw new IllegalArgumentException ("C_CommissionRun_ID is mandatory."); +set_ValueNoCheck ("C_CommissionRun_ID", new Integer(C_CommissionRun_ID)); +} +/** Get Commission Run. +@return Commission Run or Process */ +public int getC_CommissionRun_ID() +{ +Integer ii = (Integer)get_Value("C_CommissionRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission. +@param C_Commission_ID Commission */ +public void setC_Commission_ID (int C_Commission_ID) +{ +if (C_Commission_ID < 1) throw new IllegalArgumentException ("C_Commission_ID is mandatory."); +set_ValueNoCheck ("C_Commission_ID", new Integer(C_Commission_ID)); +} +/** Get Commission. +@return Commission */ +public int getC_Commission_ID() +{ +Integer ii = (Integer)get_Value("C_Commission_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Grand Total. +@param GrandTotal Total amount of document */ +public void setGrandTotal (BigDecimal GrandTotal) +{ +if (GrandTotal == null) throw new IllegalArgumentException ("GrandTotal is mandatory."); +set_ValueNoCheck ("GrandTotal", GrandTotal); +} +/** Get Grand Total. +@return Total amount of document */ +public BigDecimal getGrandTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("GrandTotal"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +if (StartDate == null) throw new IllegalArgumentException ("StartDate is mandatory."); +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ConversionType.java b/dbPort/src/org/compiere/model/X_C_ConversionType.java new file mode 100644 index 0000000000..0217f68927 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ConversionType.java @@ -0,0 +1,183 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ConversionType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.078 */ +public class X_C_ConversionType extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ConversionType_ID id +@param trxName transaction +*/ +public X_C_ConversionType (Properties ctx, int C_ConversionType_ID, String trxName) +{ +super (ctx, C_ConversionType_ID, trxName); +/** if (C_ConversionType_ID == 0) +{ +setC_ConversionType_ID (0); +setIsDefault (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ConversionType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=637 */ +public static final int Table_ID=637; + +/** TableName=C_ConversionType */ +public static final String Table_Name="C_ConversionType"; + +protected static KeyNamePair Model = new KeyNamePair(637,"C_ConversionType"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ConversionType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID < 1) throw new IllegalArgumentException ("C_ConversionType_ID is mandatory."); +set_ValueNoCheck ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Conversion_Rate.java b/dbPort/src/org/compiere/model/X_C_Conversion_Rate.java new file mode 100644 index 0000000000..c07dc5f67d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Conversion_Rate.java @@ -0,0 +1,220 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Conversion_Rate + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.078 */ +public class X_C_Conversion_Rate extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Conversion_Rate_ID id +@param trxName transaction +*/ +public X_C_Conversion_Rate (Properties ctx, int C_Conversion_Rate_ID, String trxName) +{ +super (ctx, C_Conversion_Rate_ID, trxName); +/** if (C_Conversion_Rate_ID == 0) +{ +setC_ConversionType_ID (0); +setC_Conversion_Rate_ID (0); +setC_Currency_ID (0); +setC_Currency_ID_To (0); +setDivideRate (Env.ZERO); +setMultiplyRate (Env.ZERO); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Conversion_Rate (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=140 */ +public static final int Table_ID=140; + +/** TableName=C_Conversion_Rate */ +public static final String Table_Name="C_Conversion_Rate"; + +protected static KeyNamePair Model = new KeyNamePair(140,"C_Conversion_Rate"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Conversion_Rate[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID < 1) throw new IllegalArgumentException ("C_ConversionType_ID is mandatory."); +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Conversion Rate. +@param C_Conversion_Rate_ID Rate used for converting currencies */ +public void setC_Conversion_Rate_ID (int C_Conversion_Rate_ID) +{ +if (C_Conversion_Rate_ID < 1) throw new IllegalArgumentException ("C_Conversion_Rate_ID is mandatory."); +set_ValueNoCheck ("C_Conversion_Rate_ID", new Integer(C_Conversion_Rate_ID)); +} +/** Get Conversion Rate. +@return Rate used for converting currencies */ +public int getC_Conversion_Rate_ID() +{ +Integer ii = (Integer)get_Value("C_Conversion_Rate_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Conversion_Rate_ID())); +} + +/** C_Currency_ID AD_Reference_ID=112 */ +public static final int C_CURRENCY_ID_AD_Reference_ID=112; +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Currency_ID_To AD_Reference_ID=112 */ +public static final int C_CURRENCY_ID_TO_AD_Reference_ID=112; +/** Set Currency To. +@param C_Currency_ID_To Target currency */ +public void setC_Currency_ID_To (int C_Currency_ID_To) +{ +set_Value ("C_Currency_ID_To", new Integer(C_Currency_ID_To)); +} +/** Get Currency To. +@return Target currency */ +public int getC_Currency_ID_To() +{ +Integer ii = (Integer)get_Value("C_Currency_ID_To"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Divide Rate. +@param DivideRate To convert Source number to Target number, the Source is divided */ +public void setDivideRate (BigDecimal DivideRate) +{ +if (DivideRate == null) throw new IllegalArgumentException ("DivideRate is mandatory."); +set_Value ("DivideRate", DivideRate); +} +/** Get Divide Rate. +@return To convert Source number to Target number, the Source is divided */ +public BigDecimal getDivideRate() +{ +BigDecimal bd = (BigDecimal)get_Value("DivideRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Multiply Rate. +@param MultiplyRate Rate to multiple the source by to calculate the target. */ +public void setMultiplyRate (BigDecimal MultiplyRate) +{ +if (MultiplyRate == null) throw new IllegalArgumentException ("MultiplyRate is mandatory."); +set_Value ("MultiplyRate", MultiplyRate); +} +/** Get Multiply Rate. +@return Rate to multiple the source by to calculate the target. */ +public BigDecimal getMultiplyRate() +{ +BigDecimal bd = (BigDecimal)get_Value("MultiplyRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Country.java b/dbPort/src/org/compiere/model/X_C_Country.java new file mode 100644 index 0000000000..992b1b6a74 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Country.java @@ -0,0 +1,437 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Country + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.093 */ +public class X_C_Country extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Country_ID id +@param trxName transaction +*/ +public X_C_Country (Properties ctx, int C_Country_ID, String trxName) +{ +super (ctx, C_Country_ID, trxName); +/** if (C_Country_ID == 0) +{ +setC_Country_ID (0); +setCountryCode (null); +setDisplaySequence (null); // @C@, @R@ @P@ +setHasPostal_Add (false); +setHasRegion (false); +setIsAddressLinesLocalReverse (false); +setIsAddressLinesReverse (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Country (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=170 */ +public static final int Table_ID=170; + +/** TableName=C_Country */ +public static final String Table_Name="C_Country"; + +protected static KeyNamePair Model = new KeyNamePair(170,"C_Country"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Country[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=106 */ +public static final int AD_LANGUAGE_AD_Reference_ID=106; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language != null && AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID < 1) throw new IllegalArgumentException ("C_Country_ID is mandatory."); +set_ValueNoCheck ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set ISO Country Code. +@param CountryCode Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public void setCountryCode (String CountryCode) +{ +if (CountryCode == null) throw new IllegalArgumentException ("CountryCode is mandatory."); +if (CountryCode.length() > 2) +{ +log.warning("Length > 2 - truncated"); +CountryCode = CountryCode.substring(0,1); +} +set_Value ("CountryCode", CountryCode); +} +/** Get ISO Country Code. +@return Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public String getCountryCode() +{ +return (String)get_Value("CountryCode"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Address Print Format. +@param DisplaySequence Format for printing this Address */ +public void setDisplaySequence (String DisplaySequence) +{ +if (DisplaySequence == null) throw new IllegalArgumentException ("DisplaySequence is mandatory."); +if (DisplaySequence.length() > 20) +{ +log.warning("Length > 20 - truncated"); +DisplaySequence = DisplaySequence.substring(0,19); +} +set_Value ("DisplaySequence", DisplaySequence); +} +/** Get Address Print Format. +@return Format for printing this Address */ +public String getDisplaySequence() +{ +return (String)get_Value("DisplaySequence"); +} +/** Set Local Address Format. +@param DisplaySequenceLocal Format for printing this Address locally */ +public void setDisplaySequenceLocal (String DisplaySequenceLocal) +{ +if (DisplaySequenceLocal != null && DisplaySequenceLocal.length() > 20) +{ +log.warning("Length > 20 - truncated"); +DisplaySequenceLocal = DisplaySequenceLocal.substring(0,19); +} +set_Value ("DisplaySequenceLocal", DisplaySequenceLocal); +} +/** Get Local Address Format. +@return Format for printing this Address locally */ +public String getDisplaySequenceLocal() +{ +return (String)get_Value("DisplaySequenceLocal"); +} +/** Set Bank Account No Format. +@param ExpressionBankAccountNo Format of the Bank Account */ +public void setExpressionBankAccountNo (String ExpressionBankAccountNo) +{ +if (ExpressionBankAccountNo != null && ExpressionBankAccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ExpressionBankAccountNo = ExpressionBankAccountNo.substring(0,19); +} +set_Value ("ExpressionBankAccountNo", ExpressionBankAccountNo); +} +/** Get Bank Account No Format. +@return Format of the Bank Account */ +public String getExpressionBankAccountNo() +{ +return (String)get_Value("ExpressionBankAccountNo"); +} +/** Set Bank Routing No Format. +@param ExpressionBankRoutingNo Format of the Bank Routing Number */ +public void setExpressionBankRoutingNo (String ExpressionBankRoutingNo) +{ +if (ExpressionBankRoutingNo != null && ExpressionBankRoutingNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ExpressionBankRoutingNo = ExpressionBankRoutingNo.substring(0,19); +} +set_Value ("ExpressionBankRoutingNo", ExpressionBankRoutingNo); +} +/** Get Bank Routing No Format. +@return Format of the Bank Routing Number */ +public String getExpressionBankRoutingNo() +{ +return (String)get_Value("ExpressionBankRoutingNo"); +} +/** Set Phone Format. +@param ExpressionPhone Format of the phone; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setExpressionPhone (String ExpressionPhone) +{ +if (ExpressionPhone != null && ExpressionPhone.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ExpressionPhone = ExpressionPhone.substring(0,19); +} +set_Value ("ExpressionPhone", ExpressionPhone); +} +/** Get Phone Format. +@return Format of the phone; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getExpressionPhone() +{ +return (String)get_Value("ExpressionPhone"); +} +/** Set Postal Code Format. +@param ExpressionPostal Format of the postal code; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setExpressionPostal (String ExpressionPostal) +{ +if (ExpressionPostal != null && ExpressionPostal.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ExpressionPostal = ExpressionPostal.substring(0,19); +} +set_Value ("ExpressionPostal", ExpressionPostal); +} +/** Get Postal Code Format. +@return Format of the postal code; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getExpressionPostal() +{ +return (String)get_Value("ExpressionPostal"); +} +/** Set Additional Postal Format. +@param ExpressionPostal_Add Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setExpressionPostal_Add (String ExpressionPostal_Add) +{ +if (ExpressionPostal_Add != null && ExpressionPostal_Add.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ExpressionPostal_Add = ExpressionPostal_Add.substring(0,19); +} +set_Value ("ExpressionPostal_Add", ExpressionPostal_Add); +} +/** Get Additional Postal Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getExpressionPostal_Add() +{ +return (String)get_Value("ExpressionPostal_Add"); +} +/** Set Additional Postal code. +@param HasPostal_Add Has Additional Postal Code */ +public void setHasPostal_Add (boolean HasPostal_Add) +{ +set_Value ("HasPostal_Add", new Boolean(HasPostal_Add)); +} +/** Get Additional Postal code. +@return Has Additional Postal Code */ +public boolean isHasPostal_Add() +{ +Object oo = get_Value("HasPostal_Add"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Country has Region. +@param HasRegion Country contains Regions */ +public void setHasRegion (boolean HasRegion) +{ +set_Value ("HasRegion", new Boolean(HasRegion)); +} +/** Get Country has Region. +@return Country contains Regions */ +public boolean isHasRegion() +{ +Object oo = get_Value("HasRegion"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reverse Local Address Lines. +@param IsAddressLinesLocalReverse Print Local Address in reverse Order */ +public void setIsAddressLinesLocalReverse (boolean IsAddressLinesLocalReverse) +{ +set_Value ("IsAddressLinesLocalReverse", new Boolean(IsAddressLinesLocalReverse)); +} +/** Get Reverse Local Address Lines. +@return Print Local Address in reverse Order */ +public boolean isAddressLinesLocalReverse() +{ +Object oo = get_Value("IsAddressLinesLocalReverse"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reverse Address Lines. +@param IsAddressLinesReverse Print Address in reverse Order */ +public void setIsAddressLinesReverse (boolean IsAddressLinesReverse) +{ +set_Value ("IsAddressLinesReverse", new Boolean(IsAddressLinesReverse)); +} +/** Get Reverse Address Lines. +@return Print Address in reverse Order */ +public boolean isAddressLinesReverse() +{ +Object oo = get_Value("IsAddressLinesReverse"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Media Size. +@param MediaSize Java Media Size */ +public void setMediaSize (String MediaSize) +{ +if (MediaSize != null && MediaSize.length() > 40) +{ +log.warning("Length > 40 - truncated"); +MediaSize = MediaSize.substring(0,39); +} +set_Value ("MediaSize", MediaSize); +} +/** Get Media Size. +@return Java Media Size */ +public String getMediaSize() +{ +return (String)get_Value("MediaSize"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Region. +@param RegionName Name of the Region */ +public void setRegionName (String RegionName) +{ +if (RegionName != null && RegionName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RegionName = RegionName.substring(0,59); +} +set_Value ("RegionName", RegionName); +} +/** Get Region. +@return Name of the Region */ +public String getRegionName() +{ +return (String)get_Value("RegionName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Currency.java b/dbPort/src/org/compiere/model/X_C_Currency.java new file mode 100644 index 0000000000..c5f999ffe6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Currency.java @@ -0,0 +1,258 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Currency + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.125 */ +public class X_C_Currency extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Currency_ID id +@param trxName transaction +*/ +public X_C_Currency (Properties ctx, int C_Currency_ID, String trxName) +{ +super (ctx, C_Currency_ID, trxName); +/** if (C_Currency_ID == 0) +{ +setC_Currency_ID (0); +setCostingPrecision (0); // 4 +setDescription (null); +setISO_Code (null); +setIsEMUMember (false); // N +setIsEuro (false); // N +setStdPrecision (0); // 2 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Currency (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=141 */ +public static final int Table_ID=141; + +/** TableName=C_Currency */ +public static final String Table_Name="C_Currency"; + +protected static KeyNamePair Model = new KeyNamePair(141,"C_Currency"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Currency[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Costing Precision. +@param CostingPrecision Rounding used costing calculations */ +public void setCostingPrecision (int CostingPrecision) +{ +set_Value ("CostingPrecision", new Integer(CostingPrecision)); +} +/** Get Costing Precision. +@return Rounding used costing calculations */ +public int getCostingPrecision() +{ +Integer ii = (Integer)get_Value("CostingPrecision"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Symbol. +@param CurSymbol Symbol of the currency (opt used for printing only) */ +public void setCurSymbol (String CurSymbol) +{ +if (CurSymbol != null && CurSymbol.length() > 10) +{ +log.warning("Length > 10 - truncated"); +CurSymbol = CurSymbol.substring(0,9); +} +set_Value ("CurSymbol", CurSymbol); +} +/** Get Symbol. +@return Symbol of the currency (opt used for printing only) */ +public String getCurSymbol() +{ +return (String)get_Value("CurSymbol"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description == null) throw new IllegalArgumentException ("Description is mandatory."); +if (Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EMU Entry Date. +@param EMUEntryDate Date when the currency joined / will join the EMU */ +public void setEMUEntryDate (Timestamp EMUEntryDate) +{ +set_Value ("EMUEntryDate", EMUEntryDate); +} +/** Get EMU Entry Date. +@return Date when the currency joined / will join the EMU */ +public Timestamp getEMUEntryDate() +{ +return (Timestamp)get_Value("EMUEntryDate"); +} +/** Set EMU Rate. +@param EMURate Official rate to the Euro */ +public void setEMURate (BigDecimal EMURate) +{ +set_Value ("EMURate", EMURate); +} +/** Get EMU Rate. +@return Official rate to the Euro */ +public BigDecimal getEMURate() +{ +BigDecimal bd = (BigDecimal)get_Value("EMURate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set ISO Currency Code. +@param ISO_Code Three letter ISO 4217 Code of the Currency */ +public void setISO_Code (String ISO_Code) +{ +if (ISO_Code == null) throw new IllegalArgumentException ("ISO_Code is mandatory."); +if (ISO_Code.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code = ISO_Code.substring(0,2); +} +set_Value ("ISO_Code", ISO_Code); +} +/** Get ISO Currency Code. +@return Three letter ISO 4217 Code of the Currency */ +public String getISO_Code() +{ +return (String)get_Value("ISO_Code"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getISO_Code()); +} +/** Set EMU Member. +@param IsEMUMember This currency is member if the European Monetary Union */ +public void setIsEMUMember (boolean IsEMUMember) +{ +set_Value ("IsEMUMember", new Boolean(IsEMUMember)); +} +/** Get EMU Member. +@return This currency is member if the European Monetary Union */ +public boolean isEMUMember() +{ +Object oo = get_Value("IsEMUMember"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set The Euro Currency. +@param IsEuro This currency is the Euro */ +public void setIsEuro (boolean IsEuro) +{ +set_Value ("IsEuro", new Boolean(IsEuro)); +} +/** Get The Euro Currency. +@return This currency is the Euro */ +public boolean isEuro() +{ +Object oo = get_Value("IsEuro"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Standard Precision. +@param StdPrecision Rule for rounding calculated amounts */ +public void setStdPrecision (int StdPrecision) +{ +set_Value ("StdPrecision", new Integer(StdPrecision)); +} +/** Get Standard Precision. +@return Rule for rounding calculated amounts */ +public int getStdPrecision() +{ +Integer ii = (Integer)get_Value("StdPrecision"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Currency_Acct.java b/dbPort/src/org/compiere/model/X_C_Currency_Acct.java new file mode 100644 index 0000000000..48b62f1b5c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Currency_Acct.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Currency_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.14 */ +public class X_C_Currency_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Currency_Acct_ID id +@param trxName transaction +*/ +public X_C_Currency_Acct (Properties ctx, int C_Currency_Acct_ID, String trxName) +{ +super (ctx, C_Currency_Acct_ID, trxName); +/** if (C_Currency_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Currency_ID (0); +setRealizedGain_Acct (0); +setRealizedLoss_Acct (0); +setUnrealizedGain_Acct (0); +setUnrealizedLoss_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Currency_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=638 */ +public static final int Table_ID=638; + +/** TableName=C_Currency_Acct */ +public static final String Table_Name="C_Currency_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(638,"C_Currency_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Currency_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Realized Gain Acct. +@param RealizedGain_Acct Realized Gain Account */ +public void setRealizedGain_Acct (int RealizedGain_Acct) +{ +set_Value ("RealizedGain_Acct", new Integer(RealizedGain_Acct)); +} +/** Get Realized Gain Acct. +@return Realized Gain Account */ +public int getRealizedGain_Acct() +{ +Integer ii = (Integer)get_Value("RealizedGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Realized Loss Acct. +@param RealizedLoss_Acct Realized Loss Account */ +public void setRealizedLoss_Acct (int RealizedLoss_Acct) +{ +set_Value ("RealizedLoss_Acct", new Integer(RealizedLoss_Acct)); +} +/** Get Realized Loss Acct. +@return Realized Loss Account */ +public int getRealizedLoss_Acct() +{ +Integer ii = (Integer)get_Value("RealizedLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unrealized Gain Acct. +@param UnrealizedGain_Acct Unrealized Gain Account for currency revaluation */ +public void setUnrealizedGain_Acct (int UnrealizedGain_Acct) +{ +set_Value ("UnrealizedGain_Acct", new Integer(UnrealizedGain_Acct)); +} +/** Get Unrealized Gain Acct. +@return Unrealized Gain Account for currency revaluation */ +public int getUnrealizedGain_Acct() +{ +Integer ii = (Integer)get_Value("UnrealizedGain_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unrealized Loss Acct. +@param UnrealizedLoss_Acct Unrealized Loss Account for currency revaluation */ +public void setUnrealizedLoss_Acct (int UnrealizedLoss_Acct) +{ +set_Value ("UnrealizedLoss_Acct", new Integer(UnrealizedLoss_Acct)); +} +/** Get Unrealized Loss Acct. +@return Unrealized Loss Account for currency revaluation */ +public int getUnrealizedLoss_Acct() +{ +Integer ii = (Integer)get_Value("UnrealizedLoss_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Cycle.java b/dbPort/src/org/compiere/model/X_C_Cycle.java new file mode 100644 index 0000000000..24970a023c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Cycle.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Cycle + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.156 */ +public class X_C_Cycle extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Cycle_ID id +@param trxName transaction +*/ +public X_C_Cycle (Properties ctx, int C_Cycle_ID, String trxName) +{ +super (ctx, C_Cycle_ID, trxName); +/** if (C_Cycle_ID == 0) +{ +setC_Currency_ID (0); +setC_Cycle_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Cycle (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=432 */ +public static final int Table_ID=432; + +/** TableName=C_Cycle */ +public static final String Table_Name="C_Cycle"; + +protected static KeyNamePair Model = new KeyNamePair(432,"C_Cycle"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Cycle[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Cycle. +@param C_Cycle_ID Identifier for this Project Reporting Cycle */ +public void setC_Cycle_ID (int C_Cycle_ID) +{ +if (C_Cycle_ID < 1) throw new IllegalArgumentException ("C_Cycle_ID is mandatory."); +set_ValueNoCheck ("C_Cycle_ID", new Integer(C_Cycle_ID)); +} +/** Get Project Cycle. +@return Identifier for this Project Reporting Cycle */ +public int getC_Cycle_ID() +{ +Integer ii = (Integer)get_Value("C_Cycle_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CyclePhase.java b/dbPort/src/org/compiere/model/X_C_CyclePhase.java new file mode 100644 index 0000000000..2c4ee001cb --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CyclePhase.java @@ -0,0 +1,119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CyclePhase + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.156 */ +public class X_C_CyclePhase extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CyclePhase_ID id +@param trxName transaction +*/ +public X_C_CyclePhase (Properties ctx, int C_CyclePhase_ID, String trxName) +{ +super (ctx, C_CyclePhase_ID, trxName); +/** if (C_CyclePhase_ID == 0) +{ +setC_CycleStep_ID (0); +setC_Phase_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CyclePhase (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=433 */ +public static final int Table_ID=433; + +/** TableName=C_CyclePhase */ +public static final String Table_Name="C_CyclePhase"; + +protected static KeyNamePair Model = new KeyNamePair(433,"C_CyclePhase"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CyclePhase[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Cycle Step. +@param C_CycleStep_ID The step for this Cycle */ +public void setC_CycleStep_ID (int C_CycleStep_ID) +{ +if (C_CycleStep_ID < 1) throw new IllegalArgumentException ("C_CycleStep_ID is mandatory."); +set_ValueNoCheck ("C_CycleStep_ID", new Integer(C_CycleStep_ID)); +} +/** Get Cycle Step. +@return The step for this Cycle */ +public int getC_CycleStep_ID() +{ +Integer ii = (Integer)get_Value("C_CycleStep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Phase. +@param C_Phase_ID Standard Phase of the Project Type */ +public void setC_Phase_ID (int C_Phase_ID) +{ +if (C_Phase_ID < 1) throw new IllegalArgumentException ("C_Phase_ID is mandatory."); +set_ValueNoCheck ("C_Phase_ID", new Integer(C_Phase_ID)); +} +/** Get Standard Phase. +@return Standard Phase of the Project Type */ +public int getC_Phase_ID() +{ +Integer ii = (Integer)get_Value("C_Phase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_CycleStep.java b/dbPort/src/org/compiere/model/X_C_CycleStep.java new file mode 100644 index 0000000000..47040a9146 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_CycleStep.java @@ -0,0 +1,177 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_CycleStep + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.171 */ +public class X_C_CycleStep extends PO +{ +/** Standard Constructor +@param ctx context +@param C_CycleStep_ID id +@param trxName transaction +*/ +public X_C_CycleStep (Properties ctx, int C_CycleStep_ID, String trxName) +{ +super (ctx, C_CycleStep_ID, trxName); +/** if (C_CycleStep_ID == 0) +{ +setC_CycleStep_ID (0); +setC_Cycle_ID (0); +setName (null); +setRelativeWeight (Env.ZERO); // 1 +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM C_CycleStep WHERE C_Cycle_ID=@C_Cycle_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_CycleStep (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=590 */ +public static final int Table_ID=590; + +/** TableName=C_CycleStep */ +public static final String Table_Name="C_CycleStep"; + +protected static KeyNamePair Model = new KeyNamePair(590,"C_CycleStep"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_CycleStep[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Cycle Step. +@param C_CycleStep_ID The step for this Cycle */ +public void setC_CycleStep_ID (int C_CycleStep_ID) +{ +if (C_CycleStep_ID < 1) throw new IllegalArgumentException ("C_CycleStep_ID is mandatory."); +set_ValueNoCheck ("C_CycleStep_ID", new Integer(C_CycleStep_ID)); +} +/** Get Cycle Step. +@return The step for this Cycle */ +public int getC_CycleStep_ID() +{ +Integer ii = (Integer)get_Value("C_CycleStep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Cycle. +@param C_Cycle_ID Identifier for this Project Reporting Cycle */ +public void setC_Cycle_ID (int C_Cycle_ID) +{ +if (C_Cycle_ID < 1) throw new IllegalArgumentException ("C_Cycle_ID is mandatory."); +set_ValueNoCheck ("C_Cycle_ID", new Integer(C_Cycle_ID)); +} +/** Get Project Cycle. +@return Identifier for this Project Reporting Cycle */ +public int getC_Cycle_ID() +{ +Integer ii = (Integer)get_Value("C_Cycle_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Relative Weight. +@param RelativeWeight Relative weight of this step (0 = ignored) */ +public void setRelativeWeight (BigDecimal RelativeWeight) +{ +if (RelativeWeight == null) throw new IllegalArgumentException ("RelativeWeight is mandatory."); +set_Value ("RelativeWeight", RelativeWeight); +} +/** Get Relative Weight. +@return Relative weight of this step (0 = ignored) */ +public BigDecimal getRelativeWeight() +{ +BigDecimal bd = (BigDecimal)get_Value("RelativeWeight"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_DocType.java b/dbPort/src/org/compiere/model/X_C_DocType.java new file mode 100644 index 0000000000..697d7a822b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_DocType.java @@ -0,0 +1,659 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_DocType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.187 */ +public class X_C_DocType extends PO +{ +/** Standard Constructor +@param ctx context +@param C_DocType_ID id +@param trxName transaction +*/ +public X_C_DocType (Properties ctx, int C_DocType_ID, String trxName) +{ +super (ctx, C_DocType_ID, trxName); +/** if (C_DocType_ID == 0) +{ +setC_DocType_ID (0); +setDocBaseType (null); +setDocumentCopies (0); // 1 +setGL_Category_ID (0); +setHasCharges (false); +setIsCreateCounter (true); // Y +setIsDefault (false); +setIsDefaultCounterDoc (false); +setIsDocNoControlled (true); // Y +setIsInTransit (false); +setIsIndexed (false); +setIsPickQAConfirm (false); +setIsSOTrx (false); +setIsShipConfirm (false); +setIsSplitWhenDifference (false); // N +setName (null); +setPrintName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_DocType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=217 */ +public static final int Table_ID=217; + +/** TableName=C_DocType */ +public static final String Table_Name="C_DocType"; + +protected static KeyNamePair Model = new KeyNamePair(217,"C_DocType"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_DocType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID <= 0) set_Value ("AD_PrintFormat_ID", null); + else +set_Value ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeDifference_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPEDIFFERENCE_ID_AD_Reference_ID=170; +/** Set Difference Document. +@param C_DocTypeDifference_ID Document type for generating in dispute Shipments */ +public void setC_DocTypeDifference_ID (int C_DocTypeDifference_ID) +{ +if (C_DocTypeDifference_ID <= 0) set_Value ("C_DocTypeDifference_ID", null); + else +set_Value ("C_DocTypeDifference_ID", new Integer(C_DocTypeDifference_ID)); +} +/** Get Difference Document. +@return Document type for generating in dispute Shipments */ +public int getC_DocTypeDifference_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeDifference_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeInvoice_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPEINVOICE_ID_AD_Reference_ID=170; +/** Set Document Type for Invoice. +@param C_DocTypeInvoice_ID Document type used for invoices generated from this sales document */ +public void setC_DocTypeInvoice_ID (int C_DocTypeInvoice_ID) +{ +if (C_DocTypeInvoice_ID <= 0) set_Value ("C_DocTypeInvoice_ID", null); + else +set_Value ("C_DocTypeInvoice_ID", new Integer(C_DocTypeInvoice_ID)); +} +/** Get Document Type for Invoice. +@return Document type used for invoices generated from this sales document */ +public int getC_DocTypeInvoice_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeInvoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeProforma_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPEPROFORMA_ID_AD_Reference_ID=170; +/** Set Document Type for ProForma. +@param C_DocTypeProforma_ID Document type used for pro forma invoices generated from this sales document */ +public void setC_DocTypeProforma_ID (int C_DocTypeProforma_ID) +{ +if (C_DocTypeProforma_ID <= 0) set_Value ("C_DocTypeProforma_ID", null); + else +set_Value ("C_DocTypeProforma_ID", new Integer(C_DocTypeProforma_ID)); +} +/** Get Document Type for ProForma. +@return Document type used for pro forma invoices generated from this sales document */ +public int getC_DocTypeProforma_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeProforma_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeShipment_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPESHIPMENT_ID_AD_Reference_ID=170; +/** Set Document Type for Shipment. +@param C_DocTypeShipment_ID Document type used for shipments generated from this sales document */ +public void setC_DocTypeShipment_ID (int C_DocTypeShipment_ID) +{ +if (C_DocTypeShipment_ID <= 0) set_Value ("C_DocTypeShipment_ID", null); + else +set_Value ("C_DocTypeShipment_ID", new Integer(C_DocTypeShipment_ID)); +} +/** Get Document Type for Shipment. +@return Document type used for shipments generated from this sales document */ +public int getC_DocTypeShipment_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeShipment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_ValueNoCheck ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocBaseType AD_Reference_ID=183 */ +public static final int DOCBASETYPE_AD_Reference_ID=183; +/** AP Credit Memo = APC */ +public static final String DOCBASETYPE_APCreditMemo = "APC"; +/** AP Invoice = API */ +public static final String DOCBASETYPE_APInvoice = "API"; +/** AP Payment = APP */ +public static final String DOCBASETYPE_APPayment = "APP"; +/** AR Credit Memo = ARC */ +public static final String DOCBASETYPE_ARCreditMemo = "ARC"; +/** AR Pro Forma Invoice = ARF */ +public static final String DOCBASETYPE_ARProFormaInvoice = "ARF"; +/** AR Invoice = ARI */ +public static final String DOCBASETYPE_ARInvoice = "ARI"; +/** AR Receipt = ARR */ +public static final String DOCBASETYPE_ARReceipt = "ARR"; +/** Payment Allocation = CMA */ +public static final String DOCBASETYPE_PaymentAllocation = "CMA"; +/** Bank Statement = CMB */ +public static final String DOCBASETYPE_BankStatement = "CMB"; +/** Cash Journal = CMC */ +public static final String DOCBASETYPE_CashJournal = "CMC"; +/** GL Document = GLD */ +public static final String DOCBASETYPE_GLDocument = "GLD"; +/** GL Journal = GLJ */ +public static final String DOCBASETYPE_GLJournal = "GLJ"; +/** Material Physical Inventory = MMI */ +public static final String DOCBASETYPE_MaterialPhysicalInventory = "MMI"; +/** Material Movement = MMM */ +public static final String DOCBASETYPE_MaterialMovement = "MMM"; +/** Material Production = MMP */ +public static final String DOCBASETYPE_MaterialProduction = "MMP"; +/** Material Receipt = MMR */ +public static final String DOCBASETYPE_MaterialReceipt = "MMR"; +/** Material Delivery = MMS */ +public static final String DOCBASETYPE_MaterialDelivery = "MMS"; +/** Match Invoice = MXI */ +public static final String DOCBASETYPE_MatchInvoice = "MXI"; +/** Match PO = MXP */ +public static final String DOCBASETYPE_MatchPO = "MXP"; +/** Project Issue = PJI */ +public static final String DOCBASETYPE_ProjectIssue = "PJI"; +/** Purchase Order = POO */ +public static final String DOCBASETYPE_PurchaseOrder = "POO"; +/** Purchase Requisition = POR */ +public static final String DOCBASETYPE_PurchaseRequisition = "POR"; +/** Sales Order = SOO */ +public static final String DOCBASETYPE_SalesOrder = "SOO"; +/** Set Document BaseType. +@param DocBaseType Logical type of document */ +public void setDocBaseType (String DocBaseType) +{ +if (DocBaseType == null) throw new IllegalArgumentException ("DocBaseType is mandatory"); +if (DocBaseType.equals("APC") || DocBaseType.equals("API") || DocBaseType.equals("APP") || DocBaseType.equals("ARC") || DocBaseType.equals("ARF") || DocBaseType.equals("ARI") || DocBaseType.equals("ARR") || DocBaseType.equals("CMA") || DocBaseType.equals("CMB") || DocBaseType.equals("CMC") || DocBaseType.equals("GLD") || DocBaseType.equals("GLJ") || DocBaseType.equals("MMI") || DocBaseType.equals("MMM") || DocBaseType.equals("MMP") || DocBaseType.equals("MMR") || DocBaseType.equals("MMS") || DocBaseType.equals("MXI") || DocBaseType.equals("MXP") || DocBaseType.equals("PJI") || DocBaseType.equals("POO") || DocBaseType.equals("POR") || DocBaseType.equals("SOO")); + else throw new IllegalArgumentException ("DocBaseType Invalid value - " + DocBaseType + " - Reference_ID=183 - APC - API - APP - ARC - ARF - ARI - ARR - CMA - CMB - CMC - GLD - GLJ - MMI - MMM - MMP - MMR - MMS - MXI - MXP - PJI - POO - POR - SOO"); +if (DocBaseType.length() > 3) +{ +log.warning("Length > 3 - truncated"); +DocBaseType = DocBaseType.substring(0,2); +} +set_Value ("DocBaseType", DocBaseType); +} +/** Get Document BaseType. +@return Logical type of document */ +public String getDocBaseType() +{ +return (String)get_Value("DocBaseType"); +} + +/** DocNoSequence_ID AD_Reference_ID=128 */ +public static final int DOCNOSEQUENCE_ID_AD_Reference_ID=128; +/** Set Document Sequence. +@param DocNoSequence_ID Document sequence determines the numbering of documents */ +public void setDocNoSequence_ID (int DocNoSequence_ID) +{ +if (DocNoSequence_ID <= 0) set_Value ("DocNoSequence_ID", null); + else +set_Value ("DocNoSequence_ID", new Integer(DocNoSequence_ID)); +} +/** Get Document Sequence. +@return Document sequence determines the numbering of documents */ +public int getDocNoSequence_ID() +{ +Integer ii = (Integer)get_Value("DocNoSequence_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** DocSubTypeSO AD_Reference_ID=148 */ +public static final int DOCSUBTYPESO_AD_Reference_ID=148; +/** Quotation = OB */ +public static final String DOCSUBTYPESO_Quotation = "OB"; +/** Proposal = ON */ +public static final String DOCSUBTYPESO_Proposal = "ON"; +/** Prepay Order = PR */ +public static final String DOCSUBTYPESO_PrepayOrder = "PR"; +/** Return Material = RM */ +public static final String DOCSUBTYPESO_ReturnMaterial = "RM"; +/** Standard Order = SO */ +public static final String DOCSUBTYPESO_StandardOrder = "SO"; +/** On Credit Order = WI */ +public static final String DOCSUBTYPESO_OnCreditOrder = "WI"; +/** Warehouse Order = WP */ +public static final String DOCSUBTYPESO_WarehouseOrder = "WP"; +/** POS Order = WR */ +public static final String DOCSUBTYPESO_POSOrder = "WR"; +/** Set SO Sub Type. +@param DocSubTypeSO Sales Order Sub Type */ +public void setDocSubTypeSO (String DocSubTypeSO) +{ +if (DocSubTypeSO == null) throw new IllegalArgumentException ("DocSubTypeSO is mandatory"); +if (DocSubTypeSO == null || DocSubTypeSO.equals("OB") || DocSubTypeSO.equals("ON") || DocSubTypeSO.equals("PR") || DocSubTypeSO.equals("RM") || DocSubTypeSO.equals("SO") || DocSubTypeSO.equals("WI") || DocSubTypeSO.equals("WP") || DocSubTypeSO.equals("WR")); + else throw new IllegalArgumentException ("DocSubTypeSO Invalid value - " + DocSubTypeSO + " - Reference_ID=148 - OB - ON - PR - RM - SO - WI - WP - WR"); +if (DocSubTypeSO != null && DocSubTypeSO.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocSubTypeSO = DocSubTypeSO.substring(0,1); +} +set_Value ("DocSubTypeSO", DocSubTypeSO); +} +/** Get SO Sub Type. +@return Sales Order Sub Type */ +public String getDocSubTypeSO() +{ +return (String)get_Value("DocSubTypeSO"); +} +/** Set Document Copies. +@param DocumentCopies Number of copies to be printed */ +public void setDocumentCopies (int DocumentCopies) +{ +set_Value ("DocumentCopies", new Integer(DocumentCopies)); +} +/** Get Document Copies. +@return Number of copies to be printed */ +public int getDocumentCopies() +{ +Integer ii = (Integer)get_Value("DocumentCopies"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Note. +@param DocumentNote Additional information for a Document */ +public void setDocumentNote (String DocumentNote) +{ +if (DocumentNote != null && DocumentNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DocumentNote = DocumentNote.substring(0,1999); +} +set_Value ("DocumentNote", DocumentNote); +} +/** Get Document Note. +@return Additional information for a Document */ +public String getDocumentNote() +{ +return (String)get_Value("DocumentNote"); +} +/** Set GL Category. +@param GL_Category_ID General Ledger Category */ +public void setGL_Category_ID (int GL_Category_ID) +{ +if (GL_Category_ID < 1) throw new IllegalArgumentException ("GL_Category_ID is mandatory."); +set_Value ("GL_Category_ID", new Integer(GL_Category_ID)); +} +/** Get GL Category. +@return General Ledger Category */ +public int getGL_Category_ID() +{ +Integer ii = (Integer)get_Value("GL_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charges. +@param HasCharges Charges can be added to the document */ +public void setHasCharges (boolean HasCharges) +{ +set_Value ("HasCharges", new Boolean(HasCharges)); +} +/** Get Charges. +@return Charges can be added to the document */ +public boolean isHasCharges() +{ +Object oo = get_Value("HasCharges"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Pro forma Invoice. +@param HasProforma Indicates if Pro Forma Invoices can be generated from this document */ +public void setHasProforma (boolean HasProforma) +{ +set_Value ("HasProforma", new Boolean(HasProforma)); +} +/** Get Pro forma Invoice. +@return Indicates if Pro Forma Invoices can be generated from this document */ +public boolean isHasProforma() +{ +Object oo = get_Value("HasProforma"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Create Counter Document. +@param IsCreateCounter Create Counter Document */ +public void setIsCreateCounter (boolean IsCreateCounter) +{ +set_Value ("IsCreateCounter", new Boolean(IsCreateCounter)); +} +/** Get Create Counter Document. +@return Create Counter Document */ +public boolean isCreateCounter() +{ +Object oo = get_Value("IsCreateCounter"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default Counter Document. +@param IsDefaultCounterDoc The document type is the default counter document type */ +public void setIsDefaultCounterDoc (boolean IsDefaultCounterDoc) +{ +set_Value ("IsDefaultCounterDoc", new Boolean(IsDefaultCounterDoc)); +} +/** Get Default Counter Document. +@return The document type is the default counter document type */ +public boolean isDefaultCounterDoc() +{ +Object oo = get_Value("IsDefaultCounterDoc"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Document is Number Controlled. +@param IsDocNoControlled The document has a document sequence */ +public void setIsDocNoControlled (boolean IsDocNoControlled) +{ +set_Value ("IsDocNoControlled", new Boolean(IsDocNoControlled)); +} +/** Get Document is Number Controlled. +@return The document has a document sequence */ +public boolean isDocNoControlled() +{ +Object oo = get_Value("IsDocNoControlled"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Transit. +@param IsInTransit Movement is in transit */ +public void setIsInTransit (boolean IsInTransit) +{ +set_Value ("IsInTransit", new Boolean(IsInTransit)); +} +/** Get In Transit. +@return Movement is in transit */ +public boolean isInTransit() +{ +Object oo = get_Value("IsInTransit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Indexed. +@param IsIndexed Index the document for the internal search engine */ +public void setIsIndexed (boolean IsIndexed) +{ +set_Value ("IsIndexed", new Boolean(IsIndexed)); +} +/** Get Indexed. +@return Index the document for the internal search engine */ +public boolean isIndexed() +{ +Object oo = get_Value("IsIndexed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Pick/QA Confirmation. +@param IsPickQAConfirm Require Pick or QA Confirmation before processing */ +public void setIsPickQAConfirm (boolean IsPickQAConfirm) +{ +set_Value ("IsPickQAConfirm", new Boolean(IsPickQAConfirm)); +} +/** Get Pick/QA Confirmation. +@return Require Pick or QA Confirmation before processing */ +public boolean isPickQAConfirm() +{ +Object oo = get_Value("IsPickQAConfirm"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ship/Receipt Confirmation. +@param IsShipConfirm Require Ship or Receipt Confirmation before processing */ +public void setIsShipConfirm (boolean IsShipConfirm) +{ +set_Value ("IsShipConfirm", new Boolean(IsShipConfirm)); +} +/** Get Ship/Receipt Confirmation. +@return Require Ship or Receipt Confirmation before processing */ +public boolean isShipConfirm() +{ +Object oo = get_Value("IsShipConfirm"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Split when Difference. +@param IsSplitWhenDifference Split document when there is a difference */ +public void setIsSplitWhenDifference (boolean IsSplitWhenDifference) +{ +set_Value ("IsSplitWhenDifference", new Boolean(IsSplitWhenDifference)); +} +/** Get Split when Difference. +@return Split document when there is a difference */ +public boolean isSplitWhenDifference() +{ +Object oo = get_Value("IsSplitWhenDifference"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Print Text. +@param PrintName The label text to be printed on a document or correspondence. */ +public void setPrintName (String PrintName) +{ +if (PrintName == null) throw new IllegalArgumentException ("PrintName is mandatory."); +if (PrintName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PrintName = PrintName.substring(0,59); +} +set_Value ("PrintName", PrintName); +} +/** Get Print Text. +@return The label text to be printed on a document or correspondence. */ +public String getPrintName() +{ +return (String)get_Value("PrintName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_DocTypeCounter.java b/dbPort/src/org/compiere/model/X_C_DocTypeCounter.java new file mode 100644 index 0000000000..78f579d08e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_DocTypeCounter.java @@ -0,0 +1,287 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_DocTypeCounter + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.25 */ +public class X_C_DocTypeCounter extends PO +{ +/** Standard Constructor +@param ctx context +@param C_DocTypeCounter_ID id +@param trxName transaction +*/ +public X_C_DocTypeCounter (Properties ctx, int C_DocTypeCounter_ID, String trxName) +{ +super (ctx, C_DocTypeCounter_ID, trxName); +/** if (C_DocTypeCounter_ID == 0) +{ +setC_DocTypeCounter_ID (0); +setC_DocType_ID (0); +setCounter_C_DocType_ID (0); +setIsCreateCounter (true); // Y +setIsValid (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_DocTypeCounter (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=718 */ +public static final int Table_ID=718; + +/** TableName=C_DocTypeCounter */ +public static final String Table_Name="C_DocTypeCounter"; + +protected static KeyNamePair Model = new KeyNamePair(718,"C_DocTypeCounter"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_DocTypeCounter[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Counter Document. +@param C_DocTypeCounter_ID Counter Document Relationship */ +public void setC_DocTypeCounter_ID (int C_DocTypeCounter_ID) +{ +if (C_DocTypeCounter_ID < 1) throw new IllegalArgumentException ("C_DocTypeCounter_ID is mandatory."); +set_ValueNoCheck ("C_DocTypeCounter_ID", new Integer(C_DocTypeCounter_ID)); +} +/** Get Counter Document. +@return Counter Document Relationship */ +public int getC_DocTypeCounter_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeCounter_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Counter_C_DocType_ID AD_Reference_ID=170 */ +public static final int COUNTER_C_DOCTYPE_ID_AD_Reference_ID=170; +/** Set Counter Document Type. +@param Counter_C_DocType_ID Generated Counter Document Type (To) */ +public void setCounter_C_DocType_ID (int Counter_C_DocType_ID) +{ +if (Counter_C_DocType_ID < 1) throw new IllegalArgumentException ("Counter_C_DocType_ID is mandatory."); +set_Value ("Counter_C_DocType_ID", new Integer(Counter_C_DocType_ID)); +} +/** Get Counter Document Type. +@return Generated Counter Document Type (To) */ +public int getCounter_C_DocType_ID() +{ +Integer ii = (Integer)get_Value("Counter_C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction == null || DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction != null && DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} +/** Set Create Counter Document. +@param IsCreateCounter Create Counter Document */ +public void setIsCreateCounter (boolean IsCreateCounter) +{ +set_Value ("IsCreateCounter", new Boolean(IsCreateCounter)); +} +/** Get Create Counter Document. +@return Create Counter Document */ +public boolean isCreateCounter() +{ +Object oo = get_Value("IsCreateCounter"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Dunning.java b/dbPort/src/org/compiere/model/X_C_Dunning.java new file mode 100644 index 0000000000..a094797faa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Dunning.java @@ -0,0 +1,183 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Dunning + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.281 */ +public class X_C_Dunning extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Dunning_ID id +@param trxName transaction +*/ +public X_C_Dunning (Properties ctx, int C_Dunning_ID, String trxName) +{ +super (ctx, C_Dunning_ID, trxName); +/** if (C_Dunning_ID == 0) +{ +setC_Dunning_ID (0); +setIsDefault (false); +setName (null); +setSendDunningLetter (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Dunning (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=301 */ +public static final int Table_ID=301; + +/** TableName=C_Dunning */ +public static final String Table_Name="C_Dunning"; + +protected static KeyNamePair Model = new KeyNamePair(301,"C_Dunning"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Dunning[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Dunning. +@param C_Dunning_ID Dunning Rules for overdue invoices */ +public void setC_Dunning_ID (int C_Dunning_ID) +{ +if (C_Dunning_ID < 1) throw new IllegalArgumentException ("C_Dunning_ID is mandatory."); +set_ValueNoCheck ("C_Dunning_ID", new Integer(C_Dunning_ID)); +} +/** Get Dunning. +@return Dunning Rules for overdue invoices */ +public int getC_Dunning_ID() +{ +Integer ii = (Integer)get_Value("C_Dunning_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Send dunning letters. +@param SendDunningLetter Indicates if dunning letters will be sent */ +public void setSendDunningLetter (boolean SendDunningLetter) +{ +set_Value ("SendDunningLetter", new Boolean(SendDunningLetter)); +} +/** Get Send dunning letters. +@return Indicates if dunning letters will be sent */ +public boolean isSendDunningLetter() +{ +Object oo = get_Value("SendDunningLetter"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_DunningLevel.java b/dbPort/src/org/compiere/model/X_C_DunningLevel.java new file mode 100644 index 0000000000..473186a3c9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_DunningLevel.java @@ -0,0 +1,313 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_DunningLevel + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.281 */ +public class X_C_DunningLevel extends PO +{ +/** Standard Constructor +@param ctx context +@param C_DunningLevel_ID id +@param trxName transaction +*/ +public X_C_DunningLevel (Properties ctx, int C_DunningLevel_ID, String trxName) +{ +super (ctx, C_DunningLevel_ID, trxName); +/** if (C_DunningLevel_ID == 0) +{ +setC_DunningLevel_ID (0); +setC_Dunning_ID (0); +setChargeFee (false); +setChargeInterest (false); +setDaysAfterDue (Env.ZERO); +setDaysBetweenDunning (0); +setName (null); +setPrintName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_DunningLevel (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=331 */ +public static final int Table_ID=331; + +/** TableName=C_DunningLevel */ +public static final String Table_Name="C_DunningLevel"; + +protected static KeyNamePair Model = new KeyNamePair(331,"C_DunningLevel"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_DunningLevel[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Dunning Level. +@param C_DunningLevel_ID Dunning Level */ +public void setC_DunningLevel_ID (int C_DunningLevel_ID) +{ +if (C_DunningLevel_ID < 1) throw new IllegalArgumentException ("C_DunningLevel_ID is mandatory."); +set_ValueNoCheck ("C_DunningLevel_ID", new Integer(C_DunningLevel_ID)); +} +/** Get Dunning Level. +@return Dunning Level */ +public int getC_DunningLevel_ID() +{ +Integer ii = (Integer)get_Value("C_DunningLevel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning. +@param C_Dunning_ID Dunning Rules for overdue invoices */ +public void setC_Dunning_ID (int C_Dunning_ID) +{ +if (C_Dunning_ID < 1) throw new IllegalArgumentException ("C_Dunning_ID is mandatory."); +set_ValueNoCheck ("C_Dunning_ID", new Integer(C_Dunning_ID)); +} +/** Get Dunning. +@return Dunning Rules for overdue invoices */ +public int getC_Dunning_ID() +{ +Integer ii = (Integer)get_Value("C_Dunning_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge fee. +@param ChargeFee Indicates if fees will be charged for overdue invoices */ +public void setChargeFee (boolean ChargeFee) +{ +set_Value ("ChargeFee", new Boolean(ChargeFee)); +} +/** Get Charge fee. +@return Indicates if fees will be charged for overdue invoices */ +public boolean isChargeFee() +{ +Object oo = get_Value("ChargeFee"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Charge Interest. +@param ChargeInterest Indicates if interest will be charged on overdue invoices */ +public void setChargeInterest (boolean ChargeInterest) +{ +set_Value ("ChargeInterest", new Boolean(ChargeInterest)); +} +/** Get Charge Interest. +@return Indicates if interest will be charged on overdue invoices */ +public boolean isChargeInterest() +{ +Object oo = get_Value("ChargeInterest"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Days after due date. +@param DaysAfterDue Days after due date to dun (if negative days until due) */ +public void setDaysAfterDue (BigDecimal DaysAfterDue) +{ +if (DaysAfterDue == null) throw new IllegalArgumentException ("DaysAfterDue is mandatory."); +set_Value ("DaysAfterDue", DaysAfterDue); +} +/** Get Days after due date. +@return Days after due date to dun (if negative days until due) */ +public BigDecimal getDaysAfterDue() +{ +BigDecimal bd = (BigDecimal)get_Value("DaysAfterDue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Days between dunning. +@param DaysBetweenDunning Days between sending dunning notices */ +public void setDaysBetweenDunning (int DaysBetweenDunning) +{ +set_Value ("DaysBetweenDunning", new Integer(DaysBetweenDunning)); +} +/** Get Days between dunning. +@return Days between sending dunning notices */ +public int getDaysBetweenDunning() +{ +Integer ii = (Integer)get_Value("DaysBetweenDunning"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** Dunning_PrintFormat_ID AD_Reference_ID=259 */ +public static final int DUNNING_PRINTFORMAT_ID_AD_Reference_ID=259; +/** Set Dunning Print Format. +@param Dunning_PrintFormat_ID Print Format for printing Dunning Letters */ +public void setDunning_PrintFormat_ID (int Dunning_PrintFormat_ID) +{ +if (Dunning_PrintFormat_ID <= 0) set_Value ("Dunning_PrintFormat_ID", null); + else +set_Value ("Dunning_PrintFormat_ID", new Integer(Dunning_PrintFormat_ID)); +} +/** Get Dunning Print Format. +@return Print Format for printing Dunning Letters */ +public int getDunning_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Dunning_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Fee Amount. +@param FeeAmt Fee amount in invoice currency */ +public void setFeeAmt (BigDecimal FeeAmt) +{ +set_Value ("FeeAmt", FeeAmt); +} +/** Get Fee Amount. +@return Fee amount in invoice currency */ +public BigDecimal getFeeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FeeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Interest in percent. +@param InterestPercent Percentage interest to charge on overdue invoices */ +public void setInterestPercent (BigDecimal InterestPercent) +{ +set_Value ("InterestPercent", InterestPercent); +} +/** Get Interest in percent. +@return Percentage interest to charge on overdue invoices */ +public BigDecimal getInterestPercent() +{ +BigDecimal bd = (BigDecimal)get_Value("InterestPercent"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Note = Note.substring(0,1999); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Print Text. +@param PrintName The label text to be printed on a document or correspondence. */ +public void setPrintName (String PrintName) +{ +if (PrintName == null) throw new IllegalArgumentException ("PrintName is mandatory."); +if (PrintName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PrintName = PrintName.substring(0,59); +} +set_Value ("PrintName", PrintName); +} +/** Get Print Text. +@return The label text to be printed on a document or correspondence. */ +public String getPrintName() +{ +return (String)get_Value("PrintName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_DunningRun.java b/dbPort/src/org/compiere/model/X_C_DunningRun.java new file mode 100644 index 0000000000..2de5fc66f4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_DunningRun.java @@ -0,0 +1,210 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_DunningRun + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.296 */ +public class X_C_DunningRun extends PO +{ +/** Standard Constructor +@param ctx context +@param C_DunningRun_ID id +@param trxName transaction +*/ +public X_C_DunningRun (Properties ctx, int C_DunningRun_ID, String trxName) +{ +super (ctx, C_DunningRun_ID, trxName); +/** if (C_DunningRun_ID == 0) +{ +setC_DunningLevel_ID (0); +setC_DunningRun_ID (0); +setDunningDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_DunningRun (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=526 */ +public static final int Table_ID=526; + +/** TableName=C_DunningRun */ +public static final String Table_Name="C_DunningRun"; + +protected static KeyNamePair Model = new KeyNamePair(526,"C_DunningRun"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_DunningRun[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Dunning Level. +@param C_DunningLevel_ID Dunning Level */ +public void setC_DunningLevel_ID (int C_DunningLevel_ID) +{ +if (C_DunningLevel_ID < 1) throw new IllegalArgumentException ("C_DunningLevel_ID is mandatory."); +set_ValueNoCheck ("C_DunningLevel_ID", new Integer(C_DunningLevel_ID)); +} +/** Get Dunning Level. +@return Dunning Level */ +public int getC_DunningLevel_ID() +{ +Integer ii = (Integer)get_Value("C_DunningLevel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning Run. +@param C_DunningRun_ID Dunning Run */ +public void setC_DunningRun_ID (int C_DunningRun_ID) +{ +if (C_DunningRun_ID < 1) throw new IllegalArgumentException ("C_DunningRun_ID is mandatory."); +set_ValueNoCheck ("C_DunningRun_ID", new Integer(C_DunningRun_ID)); +} +/** Get Dunning Run. +@return Dunning Run */ +public int getC_DunningRun_ID() +{ +Integer ii = (Integer)get_Value("C_DunningRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Dunning Date. +@param DunningDate Date of Dunning */ +public void setDunningDate (Timestamp DunningDate) +{ +if (DunningDate == null) throw new IllegalArgumentException ("DunningDate is mandatory."); +set_Value ("DunningDate", DunningDate); +} +/** Get Dunning Date. +@return Date of Dunning */ +public Timestamp getDunningDate() +{ +return (Timestamp)get_Value("DunningDate"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getDunningDate())); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Send. +@param SendIt Send */ +public void setSendIt (String SendIt) +{ +if (SendIt != null && SendIt.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SendIt = SendIt.substring(0,0); +} +set_Value ("SendIt", SendIt); +} +/** Get Send. +@return Send */ +public String getSendIt() +{ +return (String)get_Value("SendIt"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_DunningRunEntry.java b/dbPort/src/org/compiere/model/X_C_DunningRunEntry.java new file mode 100644 index 0000000000..f989a0eecd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_DunningRunEntry.java @@ -0,0 +1,276 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_DunningRunEntry + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.312 */ +public class X_C_DunningRunEntry extends PO +{ +/** Standard Constructor +@param ctx context +@param C_DunningRunEntry_ID id +@param trxName transaction +*/ +public X_C_DunningRunEntry (Properties ctx, int C_DunningRunEntry_ID, String trxName) +{ +super (ctx, C_DunningRunEntry_ID, trxName); +/** if (C_DunningRunEntry_ID == 0) +{ +setAmt (Env.ZERO); +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Currency_ID (0); +setC_DunningRunEntry_ID (0); +setC_DunningRun_ID (0); +setProcessed (false); +setQty (Env.ZERO); +setSalesRep_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_DunningRunEntry (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=527 */ +public static final int Table_ID=527; + +/** TableName=C_DunningRunEntry */ +public static final String Table_Name="C_DunningRunEntry"; + +protected static KeyNamePair Model = new KeyNamePair(527,"C_DunningRunEntry"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_DunningRunEntry[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +if (Amt == null) throw new IllegalArgumentException ("Amt is mandatory."); +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning Run Entry. +@param C_DunningRunEntry_ID Dunning Run Entry */ +public void setC_DunningRunEntry_ID (int C_DunningRunEntry_ID) +{ +if (C_DunningRunEntry_ID < 1) throw new IllegalArgumentException ("C_DunningRunEntry_ID is mandatory."); +set_ValueNoCheck ("C_DunningRunEntry_ID", new Integer(C_DunningRunEntry_ID)); +} +/** Get Dunning Run Entry. +@return Dunning Run Entry */ +public int getC_DunningRunEntry_ID() +{ +Integer ii = (Integer)get_Value("C_DunningRunEntry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning Run. +@param C_DunningRun_ID Dunning Run */ +public void setC_DunningRun_ID (int C_DunningRun_ID) +{ +if (C_DunningRun_ID < 1) throw new IllegalArgumentException ("C_DunningRun_ID is mandatory."); +set_ValueNoCheck ("C_DunningRun_ID", new Integer(C_DunningRun_ID)); +} +/** Get Dunning Run. +@return Dunning Run */ +public int getC_DunningRun_ID() +{ +Integer ii = (Integer)get_Value("C_DunningRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_DunningRun_ID())); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Note = Note.substring(0,1999); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_DunningRunLine.java b/dbPort/src/org/compiere/model/X_C_DunningRunLine.java new file mode 100644 index 0000000000..f27f0457c9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_DunningRunLine.java @@ -0,0 +1,321 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_DunningRunLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.328 */ +public class X_C_DunningRunLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_DunningRunLine_ID id +@param trxName transaction +*/ +public X_C_DunningRunLine (Properties ctx, int C_DunningRunLine_ID, String trxName) +{ +super (ctx, C_DunningRunLine_ID, trxName); +/** if (C_DunningRunLine_ID == 0) +{ +setAmt (Env.ZERO); +setC_DunningRunEntry_ID (0); +setC_DunningRunLine_ID (0); +setConvertedAmt (Env.ZERO); +setDaysDue (0); +setFeeAmt (Env.ZERO); +setInterestAmt (Env.ZERO); +setIsInDispute (false); +setOpenAmt (Env.ZERO); +setProcessed (false); +setTimesDunned (0); +setTotalAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_DunningRunLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=524 */ +public static final int Table_ID=524; + +/** TableName=C_DunningRunLine */ +public static final String Table_Name="C_DunningRunLine"; + +protected static KeyNamePair Model = new KeyNamePair(524,"C_DunningRunLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_DunningRunLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +if (Amt == null) throw new IllegalArgumentException ("Amt is mandatory."); +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Dunning Run Entry. +@param C_DunningRunEntry_ID Dunning Run Entry */ +public void setC_DunningRunEntry_ID (int C_DunningRunEntry_ID) +{ +if (C_DunningRunEntry_ID < 1) throw new IllegalArgumentException ("C_DunningRunEntry_ID is mandatory."); +set_ValueNoCheck ("C_DunningRunEntry_ID", new Integer(C_DunningRunEntry_ID)); +} +/** Get Dunning Run Entry. +@return Dunning Run Entry */ +public int getC_DunningRunEntry_ID() +{ +Integer ii = (Integer)get_Value("C_DunningRunEntry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning Run Line. +@param C_DunningRunLine_ID Dunning Run Line */ +public void setC_DunningRunLine_ID (int C_DunningRunLine_ID) +{ +if (C_DunningRunLine_ID < 1) throw new IllegalArgumentException ("C_DunningRunLine_ID is mandatory."); +set_ValueNoCheck ("C_DunningRunLine_ID", new Integer(C_DunningRunLine_ID)); +} +/** Get Dunning Run Line. +@return Dunning Run Line */ +public int getC_DunningRunLine_ID() +{ +Integer ii = (Integer)get_Value("C_DunningRunLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Converted Amount. +@param ConvertedAmt Converted Amount */ +public void setConvertedAmt (BigDecimal ConvertedAmt) +{ +if (ConvertedAmt == null) throw new IllegalArgumentException ("ConvertedAmt is mandatory."); +set_Value ("ConvertedAmt", ConvertedAmt); +} +/** Get Converted Amount. +@return Converted Amount */ +public BigDecimal getConvertedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ConvertedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Days due. +@param DaysDue Number of days due (negative: due in number of days) */ +public void setDaysDue (int DaysDue) +{ +set_Value ("DaysDue", new Integer(DaysDue)); +} +/** Get Days due. +@return Number of days due (negative: due in number of days) */ +public int getDaysDue() +{ +Integer ii = (Integer)get_Value("DaysDue"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Fee Amount. +@param FeeAmt Fee amount in invoice currency */ +public void setFeeAmt (BigDecimal FeeAmt) +{ +if (FeeAmt == null) throw new IllegalArgumentException ("FeeAmt is mandatory."); +set_Value ("FeeAmt", FeeAmt); +} +/** Get Fee Amount. +@return Fee amount in invoice currency */ +public BigDecimal getFeeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FeeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Interest Amount. +@param InterestAmt Interest Amount */ +public void setInterestAmt (BigDecimal InterestAmt) +{ +if (InterestAmt == null) throw new IllegalArgumentException ("InterestAmt is mandatory."); +set_Value ("InterestAmt", InterestAmt); +} +/** Get Interest Amount. +@return Interest Amount */ +public BigDecimal getInterestAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InterestAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set In Dispute. +@param IsInDispute Document is in dispute */ +public void setIsInDispute (boolean IsInDispute) +{ +set_Value ("IsInDispute", new Boolean(IsInDispute)); +} +/** Get In Dispute. +@return Document is in dispute */ +public boolean isInDispute() +{ +Object oo = get_Value("IsInDispute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Open Amount. +@param OpenAmt Open item amount */ +public void setOpenAmt (BigDecimal OpenAmt) +{ +if (OpenAmt == null) throw new IllegalArgumentException ("OpenAmt is mandatory."); +set_Value ("OpenAmt", OpenAmt); +} +/** Get Open Amount. +@return Open item amount */ +public BigDecimal getOpenAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OpenAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Times Dunned. +@param TimesDunned Number of times dunned previously */ +public void setTimesDunned (int TimesDunned) +{ +set_Value ("TimesDunned", new Integer(TimesDunned)); +} +/** Get Times Dunned. +@return Number of times dunned previously */ +public int getTimesDunned() +{ +Integer ii = (Integer)get_Value("TimesDunned"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Total Amount. +@param TotalAmt Total Amount */ +public void setTotalAmt (BigDecimal TotalAmt) +{ +if (TotalAmt == null) throw new IllegalArgumentException ("TotalAmt is mandatory."); +set_Value ("TotalAmt", TotalAmt); +} +/** Get Total Amount. +@return Total Amount */ +public BigDecimal getTotalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Element.java b/dbPort/src/org/compiere/model/X_C_Element.java new file mode 100644 index 0000000000..355703c777 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Element.java @@ -0,0 +1,246 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Element + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.406 */ +public class X_C_Element extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Element_ID id +@param trxName transaction +*/ +public X_C_Element (Properties ctx, int C_Element_ID, String trxName) +{ +super (ctx, C_Element_ID, trxName); +/** if (C_Element_ID == 0) +{ +setAD_Tree_ID (0); +setC_Element_ID (0); +setElementType (null); // A +setIsBalancing (false); +setIsNaturalAccount (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Element (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=142 */ +public static final int Table_ID=142; + +/** TableName=C_Element */ +public static final String Table_Name="C_Element"; + +protected static KeyNamePair Model = new KeyNamePair(142,"C_Element"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Element[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tree. +@param AD_Tree_ID Identifies a Tree */ +public void setAD_Tree_ID (int AD_Tree_ID) +{ +if (AD_Tree_ID < 1) throw new IllegalArgumentException ("AD_Tree_ID is mandatory."); +set_ValueNoCheck ("AD_Tree_ID", new Integer(AD_Tree_ID)); +} +/** Get Tree. +@return Identifies a Tree */ +public int getAD_Tree_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Element. +@param C_Element_ID Accounting Element */ +public void setC_Element_ID (int C_Element_ID) +{ +if (C_Element_ID < 1) throw new IllegalArgumentException ("C_Element_ID is mandatory."); +set_ValueNoCheck ("C_Element_ID", new Integer(C_Element_ID)); +} +/** Get Element. +@return Accounting Element */ +public int getC_Element_ID() +{ +Integer ii = (Integer)get_Value("C_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** ElementType AD_Reference_ID=116 */ +public static final int ELEMENTTYPE_AD_Reference_ID=116; +/** Account = A */ +public static final String ELEMENTTYPE_Account = "A"; +/** User defined = U */ +public static final String ELEMENTTYPE_UserDefined = "U"; +/** Set Type. +@param ElementType Element Type (account or user defined) */ +public void setElementType (String ElementType) +{ +if (ElementType == null) throw new IllegalArgumentException ("ElementType is mandatory"); +if (ElementType.equals("A") || ElementType.equals("U")); + else throw new IllegalArgumentException ("ElementType Invalid value - " + ElementType + " - Reference_ID=116 - A - U"); +if (ElementType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ElementType = ElementType.substring(0,0); +} +set_ValueNoCheck ("ElementType", ElementType); +} +/** Get Type. +@return Element Type (account or user defined) */ +public String getElementType() +{ +return (String)get_Value("ElementType"); +} +/** Set Balancing. +@param IsBalancing All transactions within an element value must balance (e.g. cost centers) */ +public void setIsBalancing (boolean IsBalancing) +{ +set_Value ("IsBalancing", new Boolean(IsBalancing)); +} +/** Get Balancing. +@return All transactions within an element value must balance (e.g. cost centers) */ +public boolean isBalancing() +{ +Object oo = get_Value("IsBalancing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Natural Account. +@param IsNaturalAccount The primary natural account */ +public void setIsNaturalAccount (boolean IsNaturalAccount) +{ +set_Value ("IsNaturalAccount", new Boolean(IsNaturalAccount)); +} +/** Get Natural Account. +@return The primary natural account */ +public boolean isNaturalAccount() +{ +Object oo = get_Value("IsNaturalAccount"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Value Format. +@param VFormat Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public void setVFormat (String VFormat) +{ +if (VFormat != null && VFormat.length() > 40) +{ +log.warning("Length > 40 - truncated"); +VFormat = VFormat.substring(0,39); +} +set_Value ("VFormat", VFormat); +} +/** Get Value Format. +@return Format of the value; + Can contain fixed format elements, Variables: "_lLoOaAcCa09" */ +public String getVFormat() +{ +return (String)get_Value("VFormat"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ElementValue.java b/dbPort/src/org/compiere/model/X_C_ElementValue.java new file mode 100644 index 0000000000..bc0e63b2b2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ElementValue.java @@ -0,0 +1,451 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ElementValue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.421 */ +public class X_C_ElementValue extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ElementValue_ID id +@param trxName transaction +*/ +public X_C_ElementValue (Properties ctx, int C_ElementValue_ID, String trxName) +{ +super (ctx, C_ElementValue_ID, trxName); +/** if (C_ElementValue_ID == 0) +{ +setAccountSign (null); // N +setAccountType (null); // E +setC_ElementValue_ID (0); +setC_Element_ID (0); +setIsSummary (false); +setName (null); +setPostActual (true); // Y +setPostBudget (true); // Y +setPostEncumbrance (true); // Y +setPostStatistical (true); // Y +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ElementValue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=188 */ +public static final int Table_ID=188; + +/** TableName=C_ElementValue */ +public static final String Table_Name="C_ElementValue"; + +protected static KeyNamePair Model = new KeyNamePair(188,"C_ElementValue"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ElementValue[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AccountSign AD_Reference_ID=118 */ +public static final int ACCOUNTSIGN_AD_Reference_ID=118; +/** Credit = C */ +public static final String ACCOUNTSIGN_Credit = "C"; +/** Debit = D */ +public static final String ACCOUNTSIGN_Debit = "D"; +/** Natural = N */ +public static final String ACCOUNTSIGN_Natural = "N"; +/** Set Account Sign. +@param AccountSign Indicates the Natural Sign of the Account as a Debit or Credit */ +public void setAccountSign (String AccountSign) +{ +if (AccountSign == null) throw new IllegalArgumentException ("AccountSign is mandatory"); +if (AccountSign.equals("C") || AccountSign.equals("D") || AccountSign.equals("N")); + else throw new IllegalArgumentException ("AccountSign Invalid value - " + AccountSign + " - Reference_ID=118 - C - D - N"); +if (AccountSign.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccountSign = AccountSign.substring(0,0); +} +set_Value ("AccountSign", AccountSign); +} +/** Get Account Sign. +@return Indicates the Natural Sign of the Account as a Debit or Credit */ +public String getAccountSign() +{ +return (String)get_Value("AccountSign"); +} + +/** AccountType AD_Reference_ID=117 */ +public static final int ACCOUNTTYPE_AD_Reference_ID=117; +/** Asset = A */ +public static final String ACCOUNTTYPE_Asset = "A"; +/** Expense = E */ +public static final String ACCOUNTTYPE_Expense = "E"; +/** Liability = L */ +public static final String ACCOUNTTYPE_Liability = "L"; +/** Memo = M */ +public static final String ACCOUNTTYPE_Memo = "M"; +/** Owner's Equity = O */ +public static final String ACCOUNTTYPE_OwnerSEquity = "O"; +/** Revenue = R */ +public static final String ACCOUNTTYPE_Revenue = "R"; +/** Set Account Type. +@param AccountType Indicates the type of account */ +public void setAccountType (String AccountType) +{ +if (AccountType == null) throw new IllegalArgumentException ("AccountType is mandatory"); +if (AccountType.equals("A") || AccountType.equals("E") || AccountType.equals("L") || AccountType.equals("M") || AccountType.equals("O") || AccountType.equals("R")); + else throw new IllegalArgumentException ("AccountType Invalid value - " + AccountType + " - Reference_ID=117 - A - E - L - M - O - R"); +if (AccountType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccountType = AccountType.substring(0,0); +} +set_Value ("AccountType", AccountType); +} +/** Get Account Type. +@return Indicates the type of account */ +public String getAccountType() +{ +return (String)get_Value("AccountType"); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID <= 0) set_Value ("C_BankAccount_ID", null); + else +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID < 1) throw new IllegalArgumentException ("C_ElementValue_ID is mandatory."); +set_ValueNoCheck ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Element. +@param C_Element_ID Accounting Element */ +public void setC_Element_ID (int C_Element_ID) +{ +if (C_Element_ID < 1) throw new IllegalArgumentException ("C_Element_ID is mandatory."); +set_ValueNoCheck ("C_Element_ID", new Integer(C_Element_ID)); +} +/** Get Element. +@return Accounting Element */ +public int getC_Element_ID() +{ +Integer ii = (Integer)get_Value("C_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Bank Account. +@param IsBankAccount Indicates if this is the Bank Account */ +public void setIsBankAccount (boolean IsBankAccount) +{ +set_Value ("IsBankAccount", new Boolean(IsBankAccount)); +} +/** Get Bank Account. +@return Indicates if this is the Bank Account */ +public boolean isBankAccount() +{ +Object oo = get_Value("IsBankAccount"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Document Controlled. +@param IsDocControlled Control account - If an account is controlled by a document, you cannot post manually to it */ +public void setIsDocControlled (boolean IsDocControlled) +{ +set_Value ("IsDocControlled", new Boolean(IsDocControlled)); +} +/** Get Document Controlled. +@return Control account - If an account is controlled by a document, you cannot post manually to it */ +public boolean isDocControlled() +{ +Object oo = get_Value("IsDocControlled"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Foreign Currency Account. +@param IsForeignCurrency Balances in foreign currency accounts are held in the nominated currency */ +public void setIsForeignCurrency (boolean IsForeignCurrency) +{ +set_Value ("IsForeignCurrency", new Boolean(IsForeignCurrency)); +} +/** Get Foreign Currency Account. +@return Balances in foreign currency accounts are held in the nominated currency */ +public boolean isForeignCurrency() +{ +Object oo = get_Value("IsForeignCurrency"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Post Actual. +@param PostActual Actual Values can be posted */ +public void setPostActual (boolean PostActual) +{ +set_Value ("PostActual", new Boolean(PostActual)); +} +/** Get Post Actual. +@return Actual Values can be posted */ +public boolean isPostActual() +{ +Object oo = get_Value("PostActual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Budget. +@param PostBudget Budget values can be posted */ +public void setPostBudget (boolean PostBudget) +{ +set_Value ("PostBudget", new Boolean(PostBudget)); +} +/** Get Post Budget. +@return Budget values can be posted */ +public boolean isPostBudget() +{ +Object oo = get_Value("PostBudget"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Encumbrance. +@param PostEncumbrance Post commitments to this account */ +public void setPostEncumbrance (boolean PostEncumbrance) +{ +set_Value ("PostEncumbrance", new Boolean(PostEncumbrance)); +} +/** Get Post Encumbrance. +@return Post commitments to this account */ +public boolean isPostEncumbrance() +{ +Object oo = get_Value("PostEncumbrance"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Statistical. +@param PostStatistical Post statistical quantities to this account? */ +public void setPostStatistical (boolean PostStatistical) +{ +set_Value ("PostStatistical", new Boolean(PostStatistical)); +} +/** Get Post Statistical. +@return Post statistical quantities to this account? */ +public boolean isPostStatistical() +{ +Object oo = get_Value("PostStatistical"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Greeting.java b/dbPort/src/org/compiere/model/X_C_Greeting.java new file mode 100644 index 0000000000..793255177a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Greeting.java @@ -0,0 +1,201 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Greeting + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.453 */ +public class X_C_Greeting extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Greeting_ID id +@param trxName transaction +*/ +public X_C_Greeting (Properties ctx, int C_Greeting_ID, String trxName) +{ +super (ctx, C_Greeting_ID, trxName); +/** if (C_Greeting_ID == 0) +{ +setC_Greeting_ID (0); +setIsDefault (false); +setIsFirstNameOnly (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Greeting (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=346 */ +public static final int Table_ID=346; + +/** TableName=C_Greeting */ +public static final String Table_Name="C_Greeting"; + +protected static KeyNamePair Model = new KeyNamePair(346,"C_Greeting"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Greeting[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Greeting. +@param C_Greeting_ID Greeting to print on correspondence */ +public void setC_Greeting_ID (int C_Greeting_ID) +{ +if (C_Greeting_ID < 1) throw new IllegalArgumentException ("C_Greeting_ID is mandatory."); +set_ValueNoCheck ("C_Greeting_ID", new Integer(C_Greeting_ID)); +} +/** Get Greeting. +@return Greeting to print on correspondence */ +public int getC_Greeting_ID() +{ +Integer ii = (Integer)get_Value("C_Greeting_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Greeting. +@param Greeting For letters, e.g. "Dear +{ +0} +" or "Dear Mr. +{ +0} +" - At runtime, " +{ +0} +" is replaced by the name */ +public void setGreeting (String Greeting) +{ +if (Greeting != null && Greeting.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Greeting = Greeting.substring(0,59); +} +set_Value ("Greeting", Greeting); +} +/** Get Greeting. +@return For letters, e.g. "Dear +{ +0} +" or "Dear Mr. +{ +0} +" - At runtime, " +{ +0} +" is replaced by the name */ +public String getGreeting() +{ +return (String)get_Value("Greeting"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set First name only. +@param IsFirstNameOnly Print only the first name in greetings */ +public void setIsFirstNameOnly (boolean IsFirstNameOnly) +{ +set_Value ("IsFirstNameOnly", new Boolean(IsFirstNameOnly)); +} +/** Get First name only. +@return Print only the first name in greetings */ +public boolean isFirstNameOnly() +{ +Object oo = get_Value("IsFirstNameOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InterOrg_Acct.java b/dbPort/src/org/compiere/model/X_C_InterOrg_Acct.java new file mode 100644 index 0000000000..ca1e2c55a2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InterOrg_Acct.java @@ -0,0 +1,152 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InterOrg_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.453 */ +public class X_C_InterOrg_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InterOrg_Acct_ID id +@param trxName transaction +*/ +public X_C_InterOrg_Acct (Properties ctx, int C_InterOrg_Acct_ID, String trxName) +{ +super (ctx, C_InterOrg_Acct_ID, trxName); +/** if (C_InterOrg_Acct_ID == 0) +{ +setAD_OrgTo_ID (0); +setC_AcctSchema_ID (0); +setIntercompanyDueFrom_Acct (0); +setIntercompanyDueTo_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InterOrg_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=397 */ +public static final int Table_ID=397; + +/** TableName=C_InterOrg_Acct */ +public static final String Table_Name="C_InterOrg_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(397,"C_InterOrg_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InterOrg_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTo_ID AD_Reference_ID=130 */ +public static final int AD_ORGTO_ID_AD_Reference_ID=130; +/** Set Inter-Organization. +@param AD_OrgTo_ID Organization valid for intercompany documents */ +public void setAD_OrgTo_ID (int AD_OrgTo_ID) +{ +if (AD_OrgTo_ID < 1) throw new IllegalArgumentException ("AD_OrgTo_ID is mandatory."); +set_ValueNoCheck ("AD_OrgTo_ID", new Integer(AD_OrgTo_ID)); +} +/** Get Inter-Organization. +@return Organization valid for intercompany documents */ +public int getAD_OrgTo_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Intercompany Due From Acct. +@param IntercompanyDueFrom_Acct Intercompany Due From / Receivables Account */ +public void setIntercompanyDueFrom_Acct (int IntercompanyDueFrom_Acct) +{ +set_Value ("IntercompanyDueFrom_Acct", new Integer(IntercompanyDueFrom_Acct)); +} +/** Get Intercompany Due From Acct. +@return Intercompany Due From / Receivables Account */ +public int getIntercompanyDueFrom_Acct() +{ +Integer ii = (Integer)get_Value("IntercompanyDueFrom_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Intercompany Due To Acct. +@param IntercompanyDueTo_Acct Intercompany Due To / Payable Account */ +public void setIntercompanyDueTo_Acct (int IntercompanyDueTo_Acct) +{ +set_Value ("IntercompanyDueTo_Acct", new Integer(IntercompanyDueTo_Acct)); +} +/** Get Intercompany Due To Acct. +@return Intercompany Due To / Payable Account */ +public int getIntercompanyDueTo_Acct() +{ +Integer ii = (Integer)get_Value("IntercompanyDueTo_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Invoice.java b/dbPort/src/org/compiere/model/X_C_Invoice.java new file mode 100644 index 0000000000..0ba0c4aff5 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Invoice.java @@ -0,0 +1,1066 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Invoice + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.468 */ +public class X_C_Invoice extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Invoice_ID id +@param trxName transaction +*/ +public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) +{ +super (ctx, C_Invoice_ID, trxName); +/** if (C_Invoice_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Currency_ID (0); // @C_Currency_ID@ +setC_DocTypeTarget_ID (0); +setC_DocType_ID (0); // 0 +setC_Invoice_ID (0); +setC_PaymentTerm_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDateInvoiced (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setGrandTotal (Env.ZERO); +setIsApproved (false); // @IsApproved@ +setIsDiscountPrinted (false); +setIsInDispute (false); // N +setIsPaid (false); +setIsPayScheduleValid (false); +setIsPrinted (false); +setIsSOTrx (false); // @IsSOTrx@ +setIsSelfService (false); +setIsTaxIncluded (false); +setIsTransferred (false); +setM_PriceList_ID (0); +setPaymentRule (null); // P +setPosted (false); // N +setProcessed (false); +setSendEMail (false); +setTotalLines (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Invoice (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=318 */ +public static final int Table_ID=318; + +/** TableName=C_Invoice */ +public static final String Table_Name="C_Invoice"; + +protected static KeyNamePair Model = new KeyNamePair(318,"C_Invoice"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Invoice[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Journal Line. +@param C_CashLine_ID Cash Journal Line */ +public void setC_CashLine_ID (int C_CashLine_ID) +{ +if (C_CashLine_ID <= 0) set_Value ("C_CashLine_ID", null); + else +set_Value ("C_CashLine_ID", new Integer(C_CashLine_ID)); +} +/** Get Cash Journal Line. +@return Cash Journal Line */ +public int getC_CashLine_ID() +{ +Integer ii = (Integer)get_Value("C_CashLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Charge_ID AD_Reference_ID=200 */ +public static final int C_CHARGE_ID_AD_Reference_ID=200; +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); + else +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeTarget_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; +/** Set Target Document Type. +@param C_DocTypeTarget_ID Target document type for conversing documents */ +public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) +{ +if (C_DocTypeTarget_ID < 1) throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); +set_Value ("C_DocTypeTarget_ID", new Integer(C_DocTypeTarget_ID)); +} +/** Get Target Document Type. +@return Target document type for conversing documents */ +public int getC_DocTypeTarget_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeTarget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_ValueNoCheck ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Copy From. +@param CopyFrom Copy From Record */ +public void setCopyFrom (String CopyFrom) +{ +if (CopyFrom != null && CopyFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CopyFrom = CopyFrom.substring(0,0); +} +set_Value ("CopyFrom", CopyFrom); +} +/** Get Copy From. +@return Copy From Record */ +public String getCopyFrom() +{ +return (String)get_Value("CopyFrom"); +} +/** Set Create lines from. +@param CreateFrom Process which will generate a new document lines based on an existing document */ +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} +/** Get Create lines from. +@return Process which will generate a new document lines based on an existing document */ +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Date Invoiced. +@param DateInvoiced Date printed on Invoice */ +public void setDateInvoiced (Timestamp DateInvoiced) +{ +if (DateInvoiced == null) throw new IllegalArgumentException ("DateInvoiced is mandatory."); +set_Value ("DateInvoiced", DateInvoiced); +} +/** Get Date Invoiced. +@return Date printed on Invoice */ +public Timestamp getDateInvoiced() +{ +return (Timestamp)get_Value("DateInvoiced"); +} +/** Set Date Ordered. +@param DateOrdered Date of Order */ +public void setDateOrdered (Timestamp DateOrdered) +{ +set_ValueNoCheck ("DateOrdered", DateOrdered); +} +/** Get Date Ordered. +@return Date of Order */ +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} +/** Set Date printed. +@param DatePrinted Date the document was printed. */ +public void setDatePrinted (Timestamp DatePrinted) +{ +set_Value ("DatePrinted", DatePrinted); +} +/** Get Date printed. +@return Date the document was printed. */ +public Timestamp getDatePrinted() +{ +return (Timestamp)get_Value("DatePrinted"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Generate To. +@param GenerateTo Generate To */ +public void setGenerateTo (String GenerateTo) +{ +if (GenerateTo != null && GenerateTo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateTo = GenerateTo.substring(0,0); +} +set_Value ("GenerateTo", GenerateTo); +} +/** Get Generate To. +@return Generate To */ +public String getGenerateTo() +{ +return (String)get_Value("GenerateTo"); +} +/** Set Grand Total. +@param GrandTotal Total amount of document */ +public void setGrandTotal (BigDecimal GrandTotal) +{ +if (GrandTotal == null) throw new IllegalArgumentException ("GrandTotal is mandatory."); +set_ValueNoCheck ("GrandTotal", GrandTotal); +} +/** Get Grand Total. +@return Total amount of document */ +public BigDecimal getGrandTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("GrandTotal"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_ValueNoCheck ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discount Printed. +@param IsDiscountPrinted Print Discount on Invoice and Order */ +public void setIsDiscountPrinted (boolean IsDiscountPrinted) +{ +set_Value ("IsDiscountPrinted", new Boolean(IsDiscountPrinted)); +} +/** Get Discount Printed. +@return Print Discount on Invoice and Order */ +public boolean isDiscountPrinted() +{ +Object oo = get_Value("IsDiscountPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Dispute. +@param IsInDispute Document is in dispute */ +public void setIsInDispute (boolean IsInDispute) +{ +set_Value ("IsInDispute", new Boolean(IsInDispute)); +} +/** Get In Dispute. +@return Document is in dispute */ +public boolean isInDispute() +{ +Object oo = get_Value("IsInDispute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Paid. +@param IsPaid The document is paid */ +public void setIsPaid (boolean IsPaid) +{ +set_Value ("IsPaid", new Boolean(IsPaid)); +} +/** Get Paid. +@return The document is paid */ +public boolean isPaid() +{ +Object oo = get_Value("IsPaid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Pay Schedule valid. +@param IsPayScheduleValid Is the Payment Schedule is valid */ +public void setIsPayScheduleValid (boolean IsPayScheduleValid) +{ +set_ValueNoCheck ("IsPayScheduleValid", new Boolean(IsPayScheduleValid)); +} +/** Get Pay Schedule valid. +@return Is the Payment Schedule is valid */ +public boolean isPayScheduleValid() +{ +Object oo = get_Value("IsPayScheduleValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_ValueNoCheck ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_ValueNoCheck ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Transferred. +@param IsTransferred Transferred to General Ledger (i.e. accounted) */ +public void setIsTransferred (boolean IsTransferred) +{ +set_ValueNoCheck ("IsTransferred", new Boolean(IsTransferred)); +} +/** Get Transferred. +@return Transferred to General Ledger (i.e. accounted) */ +public boolean isTransferred() +{ +Object oo = get_Value("IsTransferred"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order Reference. +@param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} +/** Get Order Reference. +@return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public String getPOReference() +{ +return (String)get_Value("POReference"); +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Referenced Invoice. +@param Ref_Invoice_ID Referenced Invoice */ +public void setRef_Invoice_ID (int Ref_Invoice_ID) +{ +if (Ref_Invoice_ID <= 0) set_Value ("Ref_Invoice_ID", null); + else +set_Value ("Ref_Invoice_ID", new Integer(Ref_Invoice_ID)); +} +/** Get Referenced Invoice. +@return Referenced Invoice */ +public int getRef_Invoice_ID() +{ +Integer ii = (Integer)get_Value("Ref_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Send EMail. +@param SendEMail Enable sending Document EMail */ +public void setSendEMail (boolean SendEMail) +{ +set_Value ("SendEMail", new Boolean(SendEMail)); +} +/** Get Send EMail. +@return Enable sending Document EMail */ +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Lines. +@param TotalLines Total of all document lines */ +public void setTotalLines (BigDecimal TotalLines) +{ +if (TotalLines == null) throw new IllegalArgumentException ("TotalLines is mandatory."); +set_ValueNoCheck ("TotalLines", TotalLines); +} +/** Get Total Lines. +@return Total of all document lines */ +public BigDecimal getTotalLines() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalLines"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InvoiceBatch.java b/dbPort/src/org/compiere/model/X_C_InvoiceBatch.java new file mode 100644 index 0000000000..e8f5bc0461 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InvoiceBatch.java @@ -0,0 +1,298 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InvoiceBatch + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.546 */ +public class X_C_InvoiceBatch extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InvoiceBatch_ID id +@param trxName transaction +*/ +public X_C_InvoiceBatch (Properties ctx, int C_InvoiceBatch_ID, String trxName) +{ +super (ctx, C_InvoiceBatch_ID, trxName); +/** if (C_InvoiceBatch_ID == 0) +{ +setC_Currency_ID (0); // @$C_Currency_ID@ +setC_InvoiceBatch_ID (0); +setControlAmt (Env.ZERO); // 0 +setDateDoc (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDocumentAmt (Env.ZERO); +setDocumentNo (null); +setIsSOTrx (false); // N +setProcessed (false); +setSalesRep_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InvoiceBatch (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=767 */ +public static final int Table_ID=767; + +/** TableName=C_InvoiceBatch */ +public static final String Table_Name="C_InvoiceBatch"; + +protected static KeyNamePair Model = new KeyNamePair(767,"C_InvoiceBatch"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoiceBatch[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); + else +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Batch. +@param C_InvoiceBatch_ID Expense Invoice Batch Header */ +public void setC_InvoiceBatch_ID (int C_InvoiceBatch_ID) +{ +if (C_InvoiceBatch_ID < 1) throw new IllegalArgumentException ("C_InvoiceBatch_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceBatch_ID", new Integer(C_InvoiceBatch_ID)); +} +/** Get Invoice Batch. +@return Expense Invoice Batch Header */ +public int getC_InvoiceBatch_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Control Amount. +@param ControlAmt If not zero, the Debit amount of the document must be equal this amount */ +public void setControlAmt (BigDecimal ControlAmt) +{ +if (ControlAmt == null) throw new IllegalArgumentException ("ControlAmt is mandatory."); +set_Value ("ControlAmt", ControlAmt); +} +/** Get Control Amount. +@return If not zero, the Debit amount of the document must be equal this amount */ +public BigDecimal getControlAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ControlAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Document Date. +@param DateDoc Date of the Document */ +public void setDateDoc (Timestamp DateDoc) +{ +if (DateDoc == null) throw new IllegalArgumentException ("DateDoc is mandatory."); +set_Value ("DateDoc", DateDoc); +} +/** Get Document Date. +@return Date of the Document */ +public Timestamp getDateDoc() +{ +return (Timestamp)get_Value("DateDoc"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Amt. +@param DocumentAmt Document Amount */ +public void setDocumentAmt (BigDecimal DocumentAmt) +{ +if (DocumentAmt == null) throw new IllegalArgumentException ("DocumentAmt is mandatory."); +set_ValueNoCheck ("DocumentAmt", DocumentAmt); +} +/** Get Document Amt. +@return Document Amount */ +public BigDecimal getDocumentAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DocumentAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InvoiceBatchLine.java b/dbPort/src/org/compiere/model/X_C_InvoiceBatchLine.java new file mode 100644 index 0000000000..2ede17fd53 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InvoiceBatchLine.java @@ -0,0 +1,541 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InvoiceBatchLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.562 */ +public class X_C_InvoiceBatchLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InvoiceBatchLine_ID id +@param trxName transaction +*/ +public X_C_InvoiceBatchLine (Properties ctx, int C_InvoiceBatchLine_ID, String trxName) +{ +super (ctx, C_InvoiceBatchLine_ID, trxName); +/** if (C_InvoiceBatchLine_ID == 0) +{ +setC_BPartner_ID (0); // @C_BPartner_ID@ +setC_BPartner_Location_ID (0); // @C_BPartner_Location_ID@ +setC_Charge_ID (0); +setC_DocType_ID (0); // @C_DocType_ID@ +setC_InvoiceBatchLine_ID (0); +setC_InvoiceBatch_ID (0); +setC_Tax_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @DateAcct@; +@DateDoc@ +setDateInvoiced (new Timestamp(System.currentTimeMillis())); // @DateInvoiced@; +@DateDoc@ +setDocumentNo (null); // @DocumentNo@ +setIsTaxIncluded (false); // @IsTaxIncluded@ +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_InvoiceBatchLine WHERE C_InvoiceBatch_ID=@C_InvoiceBatch_ID@ +setLineNetAmt (Env.ZERO); +setLineTotalAmt (Env.ZERO); +setPriceEntered (Env.ZERO); +setProcessed (false); +setQtyEntered (Env.ZERO); // 1 +setTaxAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InvoiceBatchLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=768 */ +public static final int Table_ID=768; + +/** TableName=C_InvoiceBatchLine */ +public static final String Table_Name="C_InvoiceBatchLine"; + +protected static KeyNamePair Model = new KeyNamePair(768,"C_InvoiceBatchLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoiceBatchLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID < 1) throw new IllegalArgumentException ("C_Charge_ID is mandatory."); +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Batch Line. +@param C_InvoiceBatchLine_ID Expense Invoice Batch Line */ +public void setC_InvoiceBatchLine_ID (int C_InvoiceBatchLine_ID) +{ +if (C_InvoiceBatchLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceBatchLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceBatchLine_ID", new Integer(C_InvoiceBatchLine_ID)); +} +/** Get Invoice Batch Line. +@return Expense Invoice Batch Line */ +public int getC_InvoiceBatchLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceBatchLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Batch. +@param C_InvoiceBatch_ID Expense Invoice Batch Header */ +public void setC_InvoiceBatch_ID (int C_InvoiceBatch_ID) +{ +if (C_InvoiceBatch_ID < 1) throw new IllegalArgumentException ("C_InvoiceBatch_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceBatch_ID", new Integer(C_InvoiceBatch_ID)); +} +/** Get Invoice Batch. +@return Expense Invoice Batch Header */ +public int getC_InvoiceBatch_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_ValueNoCheck ("C_InvoiceLine_ID", null); + else +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_Value ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Date Invoiced. +@param DateInvoiced Date printed on Invoice */ +public void setDateInvoiced (Timestamp DateInvoiced) +{ +if (DateInvoiced == null) throw new IllegalArgumentException ("DateInvoiced is mandatory."); +set_Value ("DateInvoiced", DateInvoiced); +} +/** Get Date Invoiced. +@return Date printed on Invoice */ +public Timestamp getDateInvoiced() +{ +return (Timestamp)get_Value("DateInvoiced"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Line Amount. +@param LineNetAmt Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public void setLineNetAmt (BigDecimal LineNetAmt) +{ +if (LineNetAmt == null) throw new IllegalArgumentException ("LineNetAmt is mandatory."); +set_ValueNoCheck ("LineNetAmt", LineNetAmt); +} +/** Get Line Amount. +@return Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public BigDecimal getLineNetAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Line Total. +@param LineTotalAmt Total line amount incl. Tax */ +public void setLineTotalAmt (BigDecimal LineTotalAmt) +{ +if (LineTotalAmt == null) throw new IllegalArgumentException ("LineTotalAmt is mandatory."); +set_ValueNoCheck ("LineTotalAmt", LineTotalAmt); +} +/** Get Line Total. +@return Total line amount incl. Tax */ +public BigDecimal getLineTotalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineTotalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Price. +@param PriceEntered Price Entered - the price based on the selected/base UoM */ +public void setPriceEntered (BigDecimal PriceEntered) +{ +if (PriceEntered == null) throw new IllegalArgumentException ("PriceEntered is mandatory."); +set_Value ("PriceEntered", PriceEntered); +} +/** Get Price. +@return Price Entered - the price based on the selected/base UoM */ +public BigDecimal getPriceEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param QtyEntered The Quantity Entered is based on the selected UoM */ +public void setQtyEntered (BigDecimal QtyEntered) +{ +if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); +set_Value ("QtyEntered", QtyEntered); +} +/** Get Quantity. +@return The Quantity Entered is based on the selected UoM */ +public BigDecimal getQtyEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +if (TaxAmt == null) throw new IllegalArgumentException ("TaxAmt is mandatory."); +set_Value ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InvoiceLine.java b/dbPort/src/org/compiere/model/X_C_InvoiceLine.java new file mode 100644 index 0000000000..3cfffc4e4d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InvoiceLine.java @@ -0,0 +1,677 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InvoiceLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.593 */ +public class X_C_InvoiceLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InvoiceLine_ID id +@param trxName transaction +*/ +public X_C_InvoiceLine (Properties ctx, int C_InvoiceLine_ID, String trxName) +{ +super (ctx, C_InvoiceLine_ID, trxName); +/** if (C_InvoiceLine_ID == 0) +{ +setC_InvoiceLine_ID (0); +setC_Invoice_ID (0); +setC_Tax_ID (0); +setIsDescription (false); // N +setIsPrinted (true); // Y +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_InvoiceLine WHERE C_Invoice_ID=@C_Invoice_ID@ +setLineNetAmt (Env.ZERO); +setM_AttributeSetInstance_ID (0); +setPriceActual (Env.ZERO); +setPriceEntered (Env.ZERO); +setPriceLimit (Env.ZERO); +setPriceList (Env.ZERO); +setProcessed (false); +setQtyEntered (Env.ZERO); // 1 +setQtyInvoiced (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InvoiceLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=333 */ +public static final int Table_ID=333; + +/** TableName=C_InvoiceLine */ +public static final String Table_Name="C_InvoiceLine"; + +protected static KeyNamePair Model = new KeyNamePair(333,"C_InvoiceLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoiceLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); + else +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_ValueNoCheck ("C_ProjectPhase_ID", null); + else +set_ValueNoCheck ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_ValueNoCheck ("C_ProjectTask_ID", null); + else +set_ValueNoCheck ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_Value ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_ValueNoCheck ("C_UOM_ID", null); + else +set_ValueNoCheck ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Description Only. +@param IsDescription if true, the line is just description and no transaction */ +public void setIsDescription (boolean IsDescription) +{ +set_Value ("IsDescription", new Boolean(IsDescription)); +} +/** Get Description Only. +@return if true, the line is just description and no transaction */ +public boolean isDescription() +{ +Object oo = get_Value("IsDescription"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line Amount. +@param LineNetAmt Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public void setLineNetAmt (BigDecimal LineNetAmt) +{ +if (LineNetAmt == null) throw new IllegalArgumentException ("LineNetAmt is mandatory."); +set_ValueNoCheck ("LineNetAmt", LineNetAmt); +} +/** Get Line Amount. +@return Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public BigDecimal getLineNetAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Line Total. +@param LineTotalAmt Total line amount incl. Tax */ +public void setLineTotalAmt (BigDecimal LineTotalAmt) +{ +set_Value ("LineTotalAmt", LineTotalAmt); +} +/** Get Line Total. +@return Total line amount incl. Tax */ +public BigDecimal getLineTotalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineTotalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_ValueNoCheck ("M_InOutLine_ID", null); + else +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unit Price. +@param PriceActual Actual Price */ +public void setPriceActual (BigDecimal PriceActual) +{ +if (PriceActual == null) throw new IllegalArgumentException ("PriceActual is mandatory."); +set_ValueNoCheck ("PriceActual", PriceActual); +} +/** Get Unit Price. +@return Actual Price */ +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Price. +@param PriceEntered Price Entered - the price based on the selected/base UoM */ +public void setPriceEntered (BigDecimal PriceEntered) +{ +if (PriceEntered == null) throw new IllegalArgumentException ("PriceEntered is mandatory."); +set_Value ("PriceEntered", PriceEntered); +} +/** Get Price. +@return Price Entered - the price based on the selected/base UoM */ +public BigDecimal getPriceEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Limit Price. +@param PriceLimit Lowest price for a product */ +public void setPriceLimit (BigDecimal PriceLimit) +{ +if (PriceLimit == null) throw new IllegalArgumentException ("PriceLimit is mandatory."); +set_Value ("PriceLimit", PriceLimit); +} +/** Get Limit Price. +@return Lowest price for a product */ +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +if (PriceList == null) throw new IllegalArgumentException ("PriceList is mandatory."); +set_Value ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param QtyEntered The Quantity Entered is based on the selected UoM */ +public void setQtyEntered (BigDecimal QtyEntered) +{ +if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); +set_Value ("QtyEntered", QtyEntered); +} +/** Get Quantity. +@return The Quantity Entered is based on the selected UoM */ +public BigDecimal getQtyEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Invoiced. +@param QtyInvoiced Invoiced Quantity */ +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +if (QtyInvoiced == null) throw new IllegalArgumentException ("QtyInvoiced is mandatory."); +set_Value ("QtyInvoiced", QtyInvoiced); +} +/** Get Quantity Invoiced. +@return Invoiced Quantity */ +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revenue Recognition Amt. +@param RRAmt Revenue Recognition Amount */ +public void setRRAmt (BigDecimal RRAmt) +{ +set_Value ("RRAmt", RRAmt); +} +/** Get Revenue Recognition Amt. +@return Revenue Recognition Amount */ +public BigDecimal getRRAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RRAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revenue Recognition Start. +@param RRStartDate Revenue Recognition Start Date */ +public void setRRStartDate (Timestamp RRStartDate) +{ +set_Value ("RRStartDate", RRStartDate); +} +/** Get Revenue Recognition Start. +@return Revenue Recognition Start Date */ +public Timestamp getRRStartDate() +{ +return (Timestamp)get_Value("RRStartDate"); +} +/** Set Referenced Invoice Line. +@param Ref_InvoiceLine_ID Referenced Invoice Line */ +public void setRef_InvoiceLine_ID (int Ref_InvoiceLine_ID) +{ +if (Ref_InvoiceLine_ID <= 0) set_Value ("Ref_InvoiceLine_ID", null); + else +set_Value ("Ref_InvoiceLine_ID", new Integer(Ref_InvoiceLine_ID)); +} +/** Get Referenced Invoice Line. +@return Referenced Invoice Line */ +public int getRef_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("Ref_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resource Assignment. +@param S_ResourceAssignment_ID Resource Assignment */ +public void setS_ResourceAssignment_ID (int S_ResourceAssignment_ID) +{ +if (S_ResourceAssignment_ID <= 0) set_ValueNoCheck ("S_ResourceAssignment_ID", null); + else +set_ValueNoCheck ("S_ResourceAssignment_ID", new Integer(S_ResourceAssignment_ID)); +} +/** Get Resource Assignment. +@return Resource Assignment */ +public int getS_ResourceAssignment_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +set_Value ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InvoicePaySchedule.java b/dbPort/src/org/compiere/model/X_C_InvoicePaySchedule.java new file mode 100644 index 0000000000..541cd7c42c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InvoicePaySchedule.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InvoicePaySchedule + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.64 */ +public class X_C_InvoicePaySchedule extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InvoicePaySchedule_ID id +@param trxName transaction +*/ +public X_C_InvoicePaySchedule (Properties ctx, int C_InvoicePaySchedule_ID, String trxName) +{ +super (ctx, C_InvoicePaySchedule_ID, trxName); +/** if (C_InvoicePaySchedule_ID == 0) +{ +setC_InvoicePaySchedule_ID (0); +setC_Invoice_ID (0); +setDiscountAmt (Env.ZERO); +setDiscountDate (new Timestamp(System.currentTimeMillis())); +setDueAmt (Env.ZERO); +setDueDate (new Timestamp(System.currentTimeMillis())); +setIsValid (false); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InvoicePaySchedule (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=551 */ +public static final int Table_ID=551; + +/** TableName=C_InvoicePaySchedule */ +public static final String Table_Name="C_InvoicePaySchedule"; + +protected static KeyNamePair Model = new KeyNamePair(551,"C_InvoicePaySchedule"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoicePaySchedule[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice Payment Schedule. +@param C_InvoicePaySchedule_ID Invoice Payment Schedule */ +public void setC_InvoicePaySchedule_ID (int C_InvoicePaySchedule_ID) +{ +if (C_InvoicePaySchedule_ID < 1) throw new IllegalArgumentException ("C_InvoicePaySchedule_ID is mandatory."); +set_ValueNoCheck ("C_InvoicePaySchedule_ID", new Integer(C_InvoicePaySchedule_ID)); +} +/** Get Invoice Payment Schedule. +@return Invoice Payment Schedule */ +public int getC_InvoicePaySchedule_ID() +{ +Integer ii = (Integer)get_Value("C_InvoicePaySchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Schedule. +@param C_PaySchedule_ID Payment Schedule Template */ +public void setC_PaySchedule_ID (int C_PaySchedule_ID) +{ +if (C_PaySchedule_ID <= 0) set_ValueNoCheck ("C_PaySchedule_ID", null); + else +set_ValueNoCheck ("C_PaySchedule_ID", new Integer(C_PaySchedule_ID)); +} +/** Get Payment Schedule. +@return Payment Schedule Template */ +public int getC_PaySchedule_ID() +{ +Integer ii = (Integer)get_Value("C_PaySchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +if (DiscountAmt == null) throw new IllegalArgumentException ("DiscountAmt is mandatory."); +set_Value ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Discount Date. +@param DiscountDate Last Date for payments with discount */ +public void setDiscountDate (Timestamp DiscountDate) +{ +if (DiscountDate == null) throw new IllegalArgumentException ("DiscountDate is mandatory."); +set_Value ("DiscountDate", DiscountDate); +} +/** Get Discount Date. +@return Last Date for payments with discount */ +public Timestamp getDiscountDate() +{ +return (Timestamp)get_Value("DiscountDate"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getDiscountDate())); +} +/** Set Amount due. +@param DueAmt Amount of the payment due */ +public void setDueAmt (BigDecimal DueAmt) +{ +if (DueAmt == null) throw new IllegalArgumentException ("DueAmt is mandatory."); +set_Value ("DueAmt", DueAmt); +} +/** Get Amount due. +@return Amount of the payment due */ +public BigDecimal getDueAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DueAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due Date. +@param DueDate Date when the payment is due */ +public void setDueDate (Timestamp DueDate) +{ +if (DueDate == null) throw new IllegalArgumentException ("DueDate is mandatory."); +set_Value ("DueDate", DueDate); +} +/** Get Due Date. +@return Date when the payment is due */ +public Timestamp getDueDate() +{ +return (Timestamp)get_Value("DueDate"); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InvoiceSchedule.java b/dbPort/src/org/compiere/model/X_C_InvoiceSchedule.java new file mode 100644 index 0000000000..0a718b7068 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InvoiceSchedule.java @@ -0,0 +1,353 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InvoiceSchedule + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.671 */ +public class X_C_InvoiceSchedule extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InvoiceSchedule_ID id +@param trxName transaction +*/ +public X_C_InvoiceSchedule (Properties ctx, int C_InvoiceSchedule_ID, String trxName) +{ +super (ctx, C_InvoiceSchedule_ID, trxName); +/** if (C_InvoiceSchedule_ID == 0) +{ +setAmt (Env.ZERO); +setC_InvoiceSchedule_ID (0); +setInvoiceDay (0); // 1 +setInvoiceFrequency (null); +setInvoiceWeekDay (null); +setIsAmount (false); +setIsDefault (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InvoiceSchedule (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=257 */ +public static final int Table_ID=257; + +/** TableName=C_InvoiceSchedule */ +public static final String Table_Name="C_InvoiceSchedule"; + +protected static KeyNamePair Model = new KeyNamePair(257,"C_InvoiceSchedule"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoiceSchedule[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +if (Amt == null) throw new IllegalArgumentException ("Amt is mandatory."); +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice Schedule. +@param C_InvoiceSchedule_ID Schedule for generating Invoices */ +public void setC_InvoiceSchedule_ID (int C_InvoiceSchedule_ID) +{ +if (C_InvoiceSchedule_ID < 1) throw new IllegalArgumentException ("C_InvoiceSchedule_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceSchedule_ID", new Integer(C_InvoiceSchedule_ID)); +} +/** Get Invoice Schedule. +@return Schedule for generating Invoices */ +public int getC_InvoiceSchedule_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceSchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Invoice on even weeks. +@param EvenInvoiceWeek Send invoices on even weeks */ +public void setEvenInvoiceWeek (boolean EvenInvoiceWeek) +{ +set_Value ("EvenInvoiceWeek", new Boolean(EvenInvoiceWeek)); +} +/** Get Invoice on even weeks. +@return Send invoices on even weeks */ +public boolean isEvenInvoiceWeek() +{ +Object oo = get_Value("EvenInvoiceWeek"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Invoice Day. +@param InvoiceDay Day of Invoice Generation */ +public void setInvoiceDay (int InvoiceDay) +{ +set_Value ("InvoiceDay", new Integer(InvoiceDay)); +} +/** Get Invoice Day. +@return Day of Invoice Generation */ +public int getInvoiceDay() +{ +Integer ii = (Integer)get_Value("InvoiceDay"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice day cut-off. +@param InvoiceDayCutoff Last day for including shipments */ +public void setInvoiceDayCutoff (int InvoiceDayCutoff) +{ +set_Value ("InvoiceDayCutoff", new Integer(InvoiceDayCutoff)); +} +/** Get Invoice day cut-off. +@return Last day for including shipments */ +public int getInvoiceDayCutoff() +{ +Integer ii = (Integer)get_Value("InvoiceDayCutoff"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** InvoiceFrequency AD_Reference_ID=168 */ +public static final int INVOICEFREQUENCY_AD_Reference_ID=168; +/** Daily = D */ +public static final String INVOICEFREQUENCY_Daily = "D"; +/** Monthly = M */ +public static final String INVOICEFREQUENCY_Monthly = "M"; +/** Twice Monthly = T */ +public static final String INVOICEFREQUENCY_TwiceMonthly = "T"; +/** Weekly = W */ +public static final String INVOICEFREQUENCY_Weekly = "W"; +/** Set Invoice Frequency. +@param InvoiceFrequency How often invoices will be generated */ +public void setInvoiceFrequency (String InvoiceFrequency) +{ +if (InvoiceFrequency == null) throw new IllegalArgumentException ("InvoiceFrequency is mandatory"); +if (InvoiceFrequency.equals("D") || InvoiceFrequency.equals("M") || InvoiceFrequency.equals("T") || InvoiceFrequency.equals("W")); + else throw new IllegalArgumentException ("InvoiceFrequency Invalid value - " + InvoiceFrequency + " - Reference_ID=168 - D - M - T - W"); +if (InvoiceFrequency.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceFrequency = InvoiceFrequency.substring(0,0); +} +set_Value ("InvoiceFrequency", InvoiceFrequency); +} +/** Get Invoice Frequency. +@return How often invoices will be generated */ +public String getInvoiceFrequency() +{ +return (String)get_Value("InvoiceFrequency"); +} + +/** InvoiceWeekDay AD_Reference_ID=167 */ +public static final int INVOICEWEEKDAY_AD_Reference_ID=167; +/** Monday = 1 */ +public static final String INVOICEWEEKDAY_Monday = "1"; +/** Tuesday = 2 */ +public static final String INVOICEWEEKDAY_Tuesday = "2"; +/** Wednesday = 3 */ +public static final String INVOICEWEEKDAY_Wednesday = "3"; +/** Thursday = 4 */ +public static final String INVOICEWEEKDAY_Thursday = "4"; +/** Friday = 5 */ +public static final String INVOICEWEEKDAY_Friday = "5"; +/** Saturday = 6 */ +public static final String INVOICEWEEKDAY_Saturday = "6"; +/** Sunday = 7 */ +public static final String INVOICEWEEKDAY_Sunday = "7"; +/** Set Invoice Week Day. +@param InvoiceWeekDay Day to generate invoices */ +public void setInvoiceWeekDay (String InvoiceWeekDay) +{ +if (InvoiceWeekDay == null) throw new IllegalArgumentException ("InvoiceWeekDay is mandatory"); +if (InvoiceWeekDay.equals("1") || InvoiceWeekDay.equals("2") || InvoiceWeekDay.equals("3") || InvoiceWeekDay.equals("4") || InvoiceWeekDay.equals("5") || InvoiceWeekDay.equals("6") || InvoiceWeekDay.equals("7")); + else throw new IllegalArgumentException ("InvoiceWeekDay Invalid value - " + InvoiceWeekDay + " - Reference_ID=167 - 1 - 2 - 3 - 4 - 5 - 6 - 7"); +if (InvoiceWeekDay.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceWeekDay = InvoiceWeekDay.substring(0,0); +} +set_Value ("InvoiceWeekDay", InvoiceWeekDay); +} +/** Get Invoice Week Day. +@return Day to generate invoices */ +public String getInvoiceWeekDay() +{ +return (String)get_Value("InvoiceWeekDay"); +} + +/** InvoiceWeekDayCutoff AD_Reference_ID=167 */ +public static final int INVOICEWEEKDAYCUTOFF_AD_Reference_ID=167; +/** Monday = 1 */ +public static final String INVOICEWEEKDAYCUTOFF_Monday = "1"; +/** Tuesday = 2 */ +public static final String INVOICEWEEKDAYCUTOFF_Tuesday = "2"; +/** Wednesday = 3 */ +public static final String INVOICEWEEKDAYCUTOFF_Wednesday = "3"; +/** Thursday = 4 */ +public static final String INVOICEWEEKDAYCUTOFF_Thursday = "4"; +/** Friday = 5 */ +public static final String INVOICEWEEKDAYCUTOFF_Friday = "5"; +/** Saturday = 6 */ +public static final String INVOICEWEEKDAYCUTOFF_Saturday = "6"; +/** Sunday = 7 */ +public static final String INVOICEWEEKDAYCUTOFF_Sunday = "7"; +/** Set Invoice weekday cutoff. +@param InvoiceWeekDayCutoff Last day in the week for shipments to be included */ +public void setInvoiceWeekDayCutoff (String InvoiceWeekDayCutoff) +{ +if (InvoiceWeekDayCutoff == null) throw new IllegalArgumentException ("InvoiceWeekDayCutoff is mandatory"); +if (InvoiceWeekDayCutoff == null || InvoiceWeekDayCutoff.equals("1") || InvoiceWeekDayCutoff.equals("2") || InvoiceWeekDayCutoff.equals("3") || InvoiceWeekDayCutoff.equals("4") || InvoiceWeekDayCutoff.equals("5") || InvoiceWeekDayCutoff.equals("6") || InvoiceWeekDayCutoff.equals("7")); + else throw new IllegalArgumentException ("InvoiceWeekDayCutoff Invalid value - " + InvoiceWeekDayCutoff + " - Reference_ID=167 - 1 - 2 - 3 - 4 - 5 - 6 - 7"); +if (InvoiceWeekDayCutoff != null && InvoiceWeekDayCutoff.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceWeekDayCutoff = InvoiceWeekDayCutoff.substring(0,0); +} +set_Value ("InvoiceWeekDayCutoff", InvoiceWeekDayCutoff); +} +/** Get Invoice weekday cutoff. +@return Last day in the week for shipments to be included */ +public String getInvoiceWeekDayCutoff() +{ +return (String)get_Value("InvoiceWeekDayCutoff"); +} +/** Set Amount Limit. +@param IsAmount Send invoices only if the amount exceeds the limit */ +public void setIsAmount (boolean IsAmount) +{ +set_Value ("IsAmount", new Boolean(IsAmount)); +} +/** Get Amount Limit. +@return Send invoices only if the amount exceeds the limit */ +public boolean isAmount() +{ +Object oo = get_Value("IsAmount"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_InvoiceTax.java b/dbPort/src/org/compiere/model/X_C_InvoiceTax.java new file mode 100644 index 0000000000..e1cbf53712 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_InvoiceTax.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_InvoiceTax + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.703 */ +public class X_C_InvoiceTax extends PO +{ +/** Standard Constructor +@param ctx context +@param C_InvoiceTax_ID id +@param trxName transaction +*/ +public X_C_InvoiceTax (Properties ctx, int C_InvoiceTax_ID, String trxName) +{ +super (ctx, C_InvoiceTax_ID, trxName); +/** if (C_InvoiceTax_ID == 0) +{ +setC_Invoice_ID (0); +setC_Tax_ID (0); +setIsTaxIncluded (false); +setProcessed (false); +setTaxAmt (Env.ZERO); +setTaxBaseAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_InvoiceTax (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=334 */ +public static final int Table_ID=334; + +/** TableName=C_InvoiceTax */ +public static final String Table_Name="C_InvoiceTax"; + +protected static KeyNamePair Model = new KeyNamePair(334,"C_InvoiceTax"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoiceTax[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +if (TaxAmt == null) throw new IllegalArgumentException ("TaxAmt is mandatory."); +set_ValueNoCheck ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tax base Amount. +@param TaxBaseAmt Base for calculating the tax amount */ +public void setTaxBaseAmt (BigDecimal TaxBaseAmt) +{ +if (TaxBaseAmt == null) throw new IllegalArgumentException ("TaxBaseAmt is mandatory."); +set_ValueNoCheck ("TaxBaseAmt", TaxBaseAmt); +} +/** Get Tax base Amount. +@return Base for calculating the tax amount */ +public BigDecimal getTaxBaseAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxBaseAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Job.java b/dbPort/src/org/compiere/model/X_C_Job.java new file mode 100644 index 0000000000..4a90d8a37f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Job.java @@ -0,0 +1,197 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Job + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.703 */ +public class X_C_Job extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Job_ID id +@param trxName transaction +*/ +public X_C_Job (Properties ctx, int C_Job_ID, String trxName) +{ +super (ctx, C_Job_ID, trxName); +/** if (C_Job_ID == 0) +{ +setC_JobCategory_ID (0); +setC_Job_ID (0); +setIsEmployee (true); // Y +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Job (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=789 */ +public static final int Table_ID=789; + +/** TableName=C_Job */ +public static final String Table_Name="C_Job"; + +protected static KeyNamePair Model = new KeyNamePair(789,"C_Job"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Job[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Position Category. +@param C_JobCategory_ID Job Position Category */ +public void setC_JobCategory_ID (int C_JobCategory_ID) +{ +if (C_JobCategory_ID < 1) throw new IllegalArgumentException ("C_JobCategory_ID is mandatory."); +set_Value ("C_JobCategory_ID", new Integer(C_JobCategory_ID)); +} +/** Get Position Category. +@return Job Position Category */ +public int getC_JobCategory_ID() +{ +Integer ii = (Integer)get_Value("C_JobCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Position. +@param C_Job_ID Job Position */ +public void setC_Job_ID (int C_Job_ID) +{ +if (C_Job_ID < 1) throw new IllegalArgumentException ("C_Job_ID is mandatory."); +set_ValueNoCheck ("C_Job_ID", new Integer(C_Job_ID)); +} +/** Get Position. +@return Job Position */ +public int getC_Job_ID() +{ +Integer ii = (Integer)get_Value("C_Job_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Employee. +@param IsEmployee Indicates if this Business Partner is an employee */ +public void setIsEmployee (boolean IsEmployee) +{ +set_Value ("IsEmployee", new Boolean(IsEmployee)); +} +/** Get Employee. +@return Indicates if this Business Partner is an employee */ +public boolean isEmployee() +{ +Object oo = get_Value("IsEmployee"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_JobAssignment.java b/dbPort/src/org/compiere/model/X_C_JobAssignment.java new file mode 100644 index 0000000000..32cffa3888 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_JobAssignment.java @@ -0,0 +1,184 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_JobAssignment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.718 */ +public class X_C_JobAssignment extends PO +{ +/** Standard Constructor +@param ctx context +@param C_JobAssignment_ID id +@param trxName transaction +*/ +public X_C_JobAssignment (Properties ctx, int C_JobAssignment_ID, String trxName) +{ +super (ctx, C_JobAssignment_ID, trxName); +/** if (C_JobAssignment_ID == 0) +{ +setAD_User_ID (0); +setC_JobAssignment_ID (0); +setC_Job_ID (0); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_JobAssignment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=791 */ +public static final int Table_ID=791; + +/** TableName=C_JobAssignment */ +public static final String Table_Name="C_JobAssignment"; + +protected static KeyNamePair Model = new KeyNamePair(791,"C_JobAssignment"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_JobAssignment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Position Assignment. +@param C_JobAssignment_ID Assignemt of Employee (User) to Job Position */ +public void setC_JobAssignment_ID (int C_JobAssignment_ID) +{ +if (C_JobAssignment_ID < 1) throw new IllegalArgumentException ("C_JobAssignment_ID is mandatory."); +set_ValueNoCheck ("C_JobAssignment_ID", new Integer(C_JobAssignment_ID)); +} +/** Get Position Assignment. +@return Assignemt of Employee (User) to Job Position */ +public int getC_JobAssignment_ID() +{ +Integer ii = (Integer)get_Value("C_JobAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Position. +@param C_Job_ID Job Position */ +public void setC_Job_ID (int C_Job_ID) +{ +if (C_Job_ID < 1) throw new IllegalArgumentException ("C_Job_ID is mandatory."); +set_ValueNoCheck ("C_Job_ID", new Integer(C_Job_ID)); +} +/** Get Position. +@return Job Position */ +public int getC_Job_ID() +{ +Integer ii = (Integer)get_Value("C_Job_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Job_ID())); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_JobCategory.java b/dbPort/src/org/compiere/model/X_C_JobCategory.java new file mode 100644 index 0000000000..ae965c4956 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_JobCategory.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_JobCategory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.734 */ +public class X_C_JobCategory extends PO +{ +/** Standard Constructor +@param ctx context +@param C_JobCategory_ID id +@param trxName transaction +*/ +public X_C_JobCategory (Properties ctx, int C_JobCategory_ID, String trxName) +{ +super (ctx, C_JobCategory_ID, trxName); +/** if (C_JobCategory_ID == 0) +{ +setC_JobCategory_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_JobCategory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=790 */ +public static final int Table_ID=790; + +/** TableName=C_JobCategory */ +public static final String Table_Name="C_JobCategory"; + +protected static KeyNamePair Model = new KeyNamePair(790,"C_JobCategory"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_JobCategory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Position Category. +@param C_JobCategory_ID Job Position Category */ +public void setC_JobCategory_ID (int C_JobCategory_ID) +{ +if (C_JobCategory_ID < 1) throw new IllegalArgumentException ("C_JobCategory_ID is mandatory."); +set_ValueNoCheck ("C_JobCategory_ID", new Integer(C_JobCategory_ID)); +} +/** Get Position Category. +@return Job Position Category */ +public int getC_JobCategory_ID() +{ +Integer ii = (Integer)get_Value("C_JobCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_JobRemuneration.java b/dbPort/src/org/compiere/model/X_C_JobRemuneration.java new file mode 100644 index 0000000000..be05011171 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_JobRemuneration.java @@ -0,0 +1,184 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_JobRemuneration + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.734 */ +public class X_C_JobRemuneration extends PO +{ +/** Standard Constructor +@param ctx context +@param C_JobRemuneration_ID id +@param trxName transaction +*/ +public X_C_JobRemuneration (Properties ctx, int C_JobRemuneration_ID, String trxName) +{ +super (ctx, C_JobRemuneration_ID, trxName); +/** if (C_JobRemuneration_ID == 0) +{ +setC_JobRemuneration_ID (0); +setC_Job_ID (0); +setC_Remuneration_ID (0); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_JobRemuneration (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=793 */ +public static final int Table_ID=793; + +/** TableName=C_JobRemuneration */ +public static final String Table_Name="C_JobRemuneration"; + +protected static KeyNamePair Model = new KeyNamePair(793,"C_JobRemuneration"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_JobRemuneration[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Position Remuneration. +@param C_JobRemuneration_ID Remuneration for the Position */ +public void setC_JobRemuneration_ID (int C_JobRemuneration_ID) +{ +if (C_JobRemuneration_ID < 1) throw new IllegalArgumentException ("C_JobRemuneration_ID is mandatory."); +set_ValueNoCheck ("C_JobRemuneration_ID", new Integer(C_JobRemuneration_ID)); +} +/** Get Position Remuneration. +@return Remuneration for the Position */ +public int getC_JobRemuneration_ID() +{ +Integer ii = (Integer)get_Value("C_JobRemuneration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Position. +@param C_Job_ID Job Position */ +public void setC_Job_ID (int C_Job_ID) +{ +if (C_Job_ID < 1) throw new IllegalArgumentException ("C_Job_ID is mandatory."); +set_ValueNoCheck ("C_Job_ID", new Integer(C_Job_ID)); +} +/** Get Position. +@return Job Position */ +public int getC_Job_ID() +{ +Integer ii = (Integer)get_Value("C_Job_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Job_ID())); +} +/** Set Remuneration. +@param C_Remuneration_ID Wage or Salary */ +public void setC_Remuneration_ID (int C_Remuneration_ID) +{ +if (C_Remuneration_ID < 1) throw new IllegalArgumentException ("C_Remuneration_ID is mandatory."); +set_ValueNoCheck ("C_Remuneration_ID", new Integer(C_Remuneration_ID)); +} +/** Get Remuneration. +@return Wage or Salary */ +public int getC_Remuneration_ID() +{ +Integer ii = (Integer)get_Value("C_Remuneration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_LandedCost.java b/dbPort/src/org/compiere/model/X_C_LandedCost.java new file mode 100644 index 0000000000..6308c2825e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_LandedCost.java @@ -0,0 +1,258 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_LandedCost + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.75 */ +public class X_C_LandedCost extends PO +{ +/** Standard Constructor +@param ctx context +@param C_LandedCost_ID id +@param trxName transaction +*/ +public X_C_LandedCost (Properties ctx, int C_LandedCost_ID, String trxName) +{ +super (ctx, C_LandedCost_ID, trxName); +/** if (C_LandedCost_ID == 0) +{ +setC_InvoiceLine_ID (0); +setC_LandedCost_ID (0); +setLandedCostDistribution (null); // Q +setM_CostElement_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_LandedCost (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=759 */ +public static final int Table_ID=759; + +/** TableName=C_LandedCost */ +public static final String Table_Name="C_LandedCost"; + +protected static KeyNamePair Model = new KeyNamePair(759,"C_LandedCost"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_LandedCost[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_InvoiceLine_ID())); +} +/** Set Landed Cost. +@param C_LandedCost_ID Landed cost to be allocated to material receipts */ +public void setC_LandedCost_ID (int C_LandedCost_ID) +{ +if (C_LandedCost_ID < 1) throw new IllegalArgumentException ("C_LandedCost_ID is mandatory."); +set_ValueNoCheck ("C_LandedCost_ID", new Integer(C_LandedCost_ID)); +} +/** Get Landed Cost. +@return Landed cost to be allocated to material receipts */ +public int getC_LandedCost_ID() +{ +Integer ii = (Integer)get_Value("C_LandedCost_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** LandedCostDistribution AD_Reference_ID=339 */ +public static final int LANDEDCOSTDISTRIBUTION_AD_Reference_ID=339; +/** Costs = C */ +public static final String LANDEDCOSTDISTRIBUTION_Costs = "C"; +/** Line = L */ +public static final String LANDEDCOSTDISTRIBUTION_Line = "L"; +/** Quantity = Q */ +public static final String LANDEDCOSTDISTRIBUTION_Quantity = "Q"; +/** Volume = V */ +public static final String LANDEDCOSTDISTRIBUTION_Volume = "V"; +/** Weight = W */ +public static final String LANDEDCOSTDISTRIBUTION_Weight = "W"; +/** Set Cost Distribution. +@param LandedCostDistribution Landed Cost Distribution */ +public void setLandedCostDistribution (String LandedCostDistribution) +{ +if (LandedCostDistribution == null) throw new IllegalArgumentException ("LandedCostDistribution is mandatory"); +if (LandedCostDistribution.equals("C") || LandedCostDistribution.equals("L") || LandedCostDistribution.equals("Q") || LandedCostDistribution.equals("V") || LandedCostDistribution.equals("W")); + else throw new IllegalArgumentException ("LandedCostDistribution Invalid value - " + LandedCostDistribution + " - Reference_ID=339 - C - L - Q - V - W"); +if (LandedCostDistribution.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LandedCostDistribution = LandedCostDistribution.substring(0,0); +} +set_Value ("LandedCostDistribution", LandedCostDistribution); +} +/** Get Cost Distribution. +@return Landed Cost Distribution */ +public String getLandedCostDistribution() +{ +return (String)get_Value("LandedCostDistribution"); +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID < 1) throw new IllegalArgumentException ("M_CostElement_ID is mandatory."); +set_Value ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_Value ("M_InOutLine_ID", null); + else +set_Value ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID <= 0) set_Value ("M_InOut_ID", null); + else +set_Value ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_LandedCostAllocation.java b/dbPort/src/org/compiere/model/X_C_LandedCostAllocation.java new file mode 100644 index 0000000000..48ebcbcbaa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_LandedCostAllocation.java @@ -0,0 +1,221 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_LandedCostAllocation + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.765 */ +public class X_C_LandedCostAllocation extends PO +{ +/** Standard Constructor +@param ctx context +@param C_LandedCostAllocation_ID id +@param trxName transaction +*/ +public X_C_LandedCostAllocation (Properties ctx, int C_LandedCostAllocation_ID, String trxName) +{ +super (ctx, C_LandedCostAllocation_ID, trxName); +/** if (C_LandedCostAllocation_ID == 0) +{ +setAmt (Env.ZERO); +setBase (Env.ZERO); +setC_InvoiceLine_ID (0); +setC_LandedCostAllocation_ID (0); +setM_CostElement_ID (0); +setM_Product_ID (0); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_LandedCostAllocation (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=760 */ +public static final int Table_ID=760; + +/** TableName=C_LandedCostAllocation */ +public static final String Table_Name="C_LandedCostAllocation"; + +protected static KeyNamePair Model = new KeyNamePair(760,"C_LandedCostAllocation"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_LandedCostAllocation[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +if (Amt == null) throw new IllegalArgumentException ("Amt is mandatory."); +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Base. +@param Base Calculation Base */ +public void setBase (BigDecimal Base) +{ +if (Base == null) throw new IllegalArgumentException ("Base is mandatory."); +set_Value ("Base", Base); +} +/** Get Base. +@return Calculation Base */ +public BigDecimal getBase() +{ +BigDecimal bd = (BigDecimal)get_Value("Base"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_InvoiceLine_ID())); +} +/** Set Landed Cost Allocation. +@param C_LandedCostAllocation_ID Allocation for Land Costs */ +public void setC_LandedCostAllocation_ID (int C_LandedCostAllocation_ID) +{ +if (C_LandedCostAllocation_ID < 1) throw new IllegalArgumentException ("C_LandedCostAllocation_ID is mandatory."); +set_ValueNoCheck ("C_LandedCostAllocation_ID", new Integer(C_LandedCostAllocation_ID)); +} +/** Get Landed Cost Allocation. +@return Allocation for Land Costs */ +public int getC_LandedCostAllocation_ID() +{ +Integer ii = (Integer)get_Value("C_LandedCostAllocation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID <= 0) set_ValueNoCheck ("M_AttributeSetInstance_ID", null); + else +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID < 1) throw new IllegalArgumentException ("M_CostElement_ID is mandatory."); +set_Value ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Location.java b/dbPort/src/org/compiere/model/X_C_Location.java new file mode 100644 index 0000000000..a4279fa0e1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Location.java @@ -0,0 +1,293 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Location + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.796 */ +public class X_C_Location extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Location_ID id +@param trxName transaction +*/ +public X_C_Location (Properties ctx, int C_Location_ID, String trxName) +{ +super (ctx, C_Location_ID, trxName); +/** if (C_Location_ID == 0) +{ +setC_Country_ID (0); +setC_Location_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Location (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=162 */ +public static final int Table_ID=162; + +/** TableName=C_Location */ +public static final String Table_Name="C_Location"; + +protected static KeyNamePair Model = new KeyNamePair(162,"C_Location"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Location[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Address 1. +@param Address1 Address line 1 for this location */ +public void setAddress1 (String Address1) +{ +if (Address1 != null && Address1.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address1 = Address1.substring(0,59); +} +set_Value ("Address1", Address1); +} +/** Get Address 1. +@return Address line 1 for this location */ +public String getAddress1() +{ +return (String)get_Value("Address1"); +} +/** Set Address 2. +@param Address2 Address line 2 for this location */ +public void setAddress2 (String Address2) +{ +if (Address2 != null && Address2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address2 = Address2.substring(0,59); +} +set_Value ("Address2", Address2); +} +/** Get Address 2. +@return Address line 2 for this location */ +public String getAddress2() +{ +return (String)get_Value("Address2"); +} +/** Set Address 3. +@param Address3 Address Line 3 for the location */ +public void setAddress3 (String Address3) +{ +if (Address3 != null && Address3.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address3 = Address3.substring(0,59); +} +set_Value ("Address3", Address3); +} +/** Get Address 3. +@return Address Line 3 for the location */ +public String getAddress3() +{ +return (String)get_Value("Address3"); +} +/** Set Address 4. +@param Address4 Address Line 4 for the location */ +public void setAddress4 (String Address4) +{ +if (Address4 != null && Address4.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address4 = Address4.substring(0,59); +} +set_Value ("Address4", Address4); +} +/** Get Address 4. +@return Address Line 4 for the location */ +public String getAddress4() +{ +return (String)get_Value("Address4"); +} +/** Set City. +@param C_City_ID City */ +public void setC_City_ID (int C_City_ID) +{ +if (C_City_ID <= 0) set_Value ("C_City_ID", null); + else +set_Value ("C_City_ID", new Integer(C_City_ID)); +} +/** Get City. +@return City */ +public int getC_City_ID() +{ +Integer ii = (Integer)get_Value("C_City_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID < 1) throw new IllegalArgumentException ("C_Country_ID is mandatory."); +set_Value ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID < 1) throw new IllegalArgumentException ("C_Location_ID is mandatory."); +set_ValueNoCheck ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set City. +@param City Identifies a City */ +public void setCity (String City) +{ +if (City != null && City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +City = City.substring(0,59); +} +set_Value ("City", City); +} +/** Get City. +@return Identifies a City */ +public String getCity() +{ +return (String)get_Value("City"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getCity()); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal != null && Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_Value ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +/** Set -. +@param Postal_Add Additional ZIP or Postal code */ +public void setPostal_Add (String Postal_Add) +{ +if (Postal_Add != null && Postal_Add.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal_Add = Postal_Add.substring(0,9); +} +set_Value ("Postal_Add", Postal_Add); +} +/** Get -. +@return Additional ZIP or Postal code */ +public String getPostal_Add() +{ +return (String)get_Value("Postal_Add"); +} +/** Set Region. +@param RegionName Name of the Region */ +public void setRegionName (String RegionName) +{ +if (RegionName != null && RegionName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +RegionName = RegionName.substring(0,39); +} +set_Value ("RegionName", RegionName); +} +/** Get Region. +@return Name of the Region */ +public String getRegionName() +{ +return (String)get_Value("RegionName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_NonBusinessDay.java b/dbPort/src/org/compiere/model/X_C_NonBusinessDay.java new file mode 100644 index 0000000000..6bcf349b66 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_NonBusinessDay.java @@ -0,0 +1,156 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_NonBusinessDay + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.812 */ +public class X_C_NonBusinessDay extends PO +{ +/** Standard Constructor +@param ctx context +@param C_NonBusinessDay_ID id +@param trxName transaction +*/ +public X_C_NonBusinessDay (Properties ctx, int C_NonBusinessDay_ID, String trxName) +{ +super (ctx, C_NonBusinessDay_ID, trxName); +/** if (C_NonBusinessDay_ID == 0) +{ +setC_Calendar_ID (0); +setC_NonBusinessDay_ID (0); +setDate1 (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_NonBusinessDay (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=163 */ +public static final int Table_ID=163; + +/** TableName=C_NonBusinessDay */ +public static final String Table_Name="C_NonBusinessDay"; + +protected static KeyNamePair Model = new KeyNamePair(163,"C_NonBusinessDay"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_NonBusinessDay[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID < 1) throw new IllegalArgumentException ("C_Calendar_ID is mandatory."); +set_ValueNoCheck ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Non Business Day. +@param C_NonBusinessDay_ID Day on which business is not transacted */ +public void setC_NonBusinessDay_ID (int C_NonBusinessDay_ID) +{ +if (C_NonBusinessDay_ID < 1) throw new IllegalArgumentException ("C_NonBusinessDay_ID is mandatory."); +set_ValueNoCheck ("C_NonBusinessDay_ID", new Integer(C_NonBusinessDay_ID)); +} +/** Get Non Business Day. +@return Day on which business is not transacted */ +public int getC_NonBusinessDay_ID() +{ +Integer ii = (Integer)get_Value("C_NonBusinessDay_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date. +@param Date1 Date when business is not conducted */ +public void setDate1 (Timestamp Date1) +{ +if (Date1 == null) throw new IllegalArgumentException ("Date1 is mandatory."); +set_Value ("Date1", Date1); +} +/** Get Date. +@return Date when business is not conducted */ +public Timestamp getDate1() +{ +return (Timestamp)get_Value("Date1"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Order.java b/dbPort/src/org/compiere/model/X_C_Order.java new file mode 100644 index 0000000000..2306429d29 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Order.java @@ -0,0 +1,1391 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Order + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.828 */ +public class X_C_Order extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Order_ID id +@param trxName transaction +*/ +public X_C_Order (Properties ctx, int C_Order_ID, String trxName) +{ +super (ctx, C_Order_ID, trxName); +/** if (C_Order_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Currency_ID (0); // @C_Currency_ID@ +setC_DocTypeTarget_ID (0); +setC_DocType_ID (0); // 0 +setC_Order_ID (0); +setC_PaymentTerm_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDateOrdered (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDatePromised (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDeliveryRule (null); // F +setDeliveryViaRule (null); // P +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setFreightAmt (Env.ZERO); +setFreightCostRule (null); // I +setGrandTotal (Env.ZERO); +setInvoiceRule (null); // I +setIsApproved (false); // @IsApproved@ +setIsCreditApproved (false); +setIsDelivered (false); +setIsDiscountPrinted (false); +setIsDropShip (false); // N +setIsInvoiced (false); +setIsPrinted (false); +setIsSOTrx (false); // @IsSOTrx@ +setIsSelected (false); +setIsSelfService (false); +setIsTaxIncluded (false); +setIsTransferred (false); +setM_PriceList_ID (0); +setM_Warehouse_ID (0); +setPaymentRule (null); // B +setPosted (false); // N +setPriorityRule (null); // 5 +setProcessed (false); +setSalesRep_ID (0); +setSendEMail (false); +setTotalLines (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Order (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=259 */ +public static final int Table_ID=259; + +/** TableName=C_Order */ +public static final String Table_Name="C_Order"; + +protected static KeyNamePair Model = new KeyNamePair(259,"C_Order"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Order[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Bill_BPartner_ID AD_Reference_ID=138 */ +public static final int BILL_BPARTNER_ID_AD_Reference_ID=138; +/** Set Invoice Partner. +@param Bill_BPartner_ID Business Partner to be invoiced */ +public void setBill_BPartner_ID (int Bill_BPartner_ID) +{ +if (Bill_BPartner_ID <= 0) set_Value ("Bill_BPartner_ID", null); + else +set_Value ("Bill_BPartner_ID", new Integer(Bill_BPartner_ID)); +} +/** Get Invoice Partner. +@return Business Partner to be invoiced */ +public int getBill_BPartner_ID() +{ +Integer ii = (Integer)get_Value("Bill_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Bill_Location_ID AD_Reference_ID=159 */ +public static final int BILL_LOCATION_ID_AD_Reference_ID=159; +/** Set Invoice Location. +@param Bill_Location_ID Business Partner Location for invoicing */ +public void setBill_Location_ID (int Bill_Location_ID) +{ +if (Bill_Location_ID <= 0) set_Value ("Bill_Location_ID", null); + else +set_Value ("Bill_Location_ID", new Integer(Bill_Location_ID)); +} +/** Get Invoice Location. +@return Business Partner Location for invoicing */ +public int getBill_Location_ID() +{ +Integer ii = (Integer)get_Value("Bill_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Bill_User_ID AD_Reference_ID=110 */ +public static final int BILL_USER_ID_AD_Reference_ID=110; +/** Set Invoice Contact. +@param Bill_User_ID Business Partner Contact for invoicing */ +public void setBill_User_ID (int Bill_User_ID) +{ +if (Bill_User_ID <= 0) set_Value ("Bill_User_ID", null); + else +set_Value ("Bill_User_ID", new Integer(Bill_User_ID)); +} +/** Get Invoice Contact. +@return Business Partner Contact for invoicing */ +public int getBill_User_ID() +{ +Integer ii = (Integer)get_Value("Bill_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Journal Line. +@param C_CashLine_ID Cash Journal Line */ +public void setC_CashLine_ID (int C_CashLine_ID) +{ +if (C_CashLine_ID <= 0) set_Value ("C_CashLine_ID", null); + else +set_Value ("C_CashLine_ID", new Integer(C_CashLine_ID)); +} +/** Get Cash Journal Line. +@return Cash Journal Line */ +public int getC_CashLine_ID() +{ +Integer ii = (Integer)get_Value("C_CashLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Charge_ID AD_Reference_ID=200 */ +public static final int C_CHARGE_ID_AD_Reference_ID=200; +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); + else +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeTarget_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; +/** Set Target Document Type. +@param C_DocTypeTarget_ID Target document type for conversing documents */ +public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) +{ +if (C_DocTypeTarget_ID < 1) throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); +set_Value ("C_DocTypeTarget_ID", new Integer(C_DocTypeTarget_ID)); +} +/** Get Target Document Type. +@return Target document type for conversing documents */ +public int getC_DocTypeTarget_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeTarget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocType_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPE_ID_AD_Reference_ID=170; +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_ValueNoCheck ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID < 1) throw new IllegalArgumentException ("C_Order_ID is mandatory."); +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Copy From. +@param CopyFrom Copy From Record */ +public void setCopyFrom (String CopyFrom) +{ +if (CopyFrom != null && CopyFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CopyFrom = CopyFrom.substring(0,0); +} +set_Value ("CopyFrom", CopyFrom); +} +/** Get Copy From. +@return Copy From Record */ +public String getCopyFrom() +{ +return (String)get_Value("CopyFrom"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Date Ordered. +@param DateOrdered Date of Order */ +public void setDateOrdered (Timestamp DateOrdered) +{ +if (DateOrdered == null) throw new IllegalArgumentException ("DateOrdered is mandatory."); +set_Value ("DateOrdered", DateOrdered); +} +/** Get Date Ordered. +@return Date of Order */ +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} +/** Set Date printed. +@param DatePrinted Date the document was printed. */ +public void setDatePrinted (Timestamp DatePrinted) +{ +set_Value ("DatePrinted", DatePrinted); +} +/** Get Date printed. +@return Date the document was printed. */ +public Timestamp getDatePrinted() +{ +return (Timestamp)get_Value("DatePrinted"); +} +/** Set Date Promised. +@param DatePromised Date Order was promised */ +public void setDatePromised (Timestamp DatePromised) +{ +if (DatePromised == null) throw new IllegalArgumentException ("DatePromised is mandatory."); +set_Value ("DatePromised", DatePromised); +} +/** Get Date Promised. +@return Date Order was promised */ +public Timestamp getDatePromised() +{ +return (Timestamp)get_Value("DatePromised"); +} + +/** DeliveryRule AD_Reference_ID=151 */ +public static final int DELIVERYRULE_AD_Reference_ID=151; +/** Availability = A */ +public static final String DELIVERYRULE_Availability = "A"; +/** Force = F */ +public static final String DELIVERYRULE_Force = "F"; +/** Complete Line = L */ +public static final String DELIVERYRULE_CompleteLine = "L"; +/** Manual = M */ +public static final String DELIVERYRULE_Manual = "M"; +/** Complete Order = O */ +public static final String DELIVERYRULE_CompleteOrder = "O"; +/** After Receipt = R */ +public static final String DELIVERYRULE_AfterReceipt = "R"; +/** Set Delivery Rule. +@param DeliveryRule Defines the timing of Delivery */ +public void setDeliveryRule (String DeliveryRule) +{ +if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); +if (DeliveryRule.equals("A") || DeliveryRule.equals("F") || DeliveryRule.equals("L") || DeliveryRule.equals("M") || DeliveryRule.equals("O") || DeliveryRule.equals("R")); + else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - A - F - L - M - O - R"); +if (DeliveryRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryRule = DeliveryRule.substring(0,0); +} +set_Value ("DeliveryRule", DeliveryRule); +} +/** Get Delivery Rule. +@return Defines the timing of Delivery */ +public String getDeliveryRule() +{ +return (String)get_Value("DeliveryRule"); +} + +/** DeliveryViaRule AD_Reference_ID=152 */ +public static final int DELIVERYVIARULE_AD_Reference_ID=152; +/** Delivery = D */ +public static final String DELIVERYVIARULE_Delivery = "D"; +/** Pickup = P */ +public static final String DELIVERYVIARULE_Pickup = "P"; +/** Shipper = S */ +public static final String DELIVERYVIARULE_Shipper = "S"; +/** Set Delivery Via. +@param DeliveryViaRule How the order will be delivered */ +public void setDeliveryViaRule (String DeliveryViaRule) +{ +if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); +if (DeliveryViaRule.equals("D") || DeliveryViaRule.equals("P") || DeliveryViaRule.equals("S")); + else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - D - P - S"); +if (DeliveryViaRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryViaRule = DeliveryViaRule.substring(0,0); +} +set_Value ("DeliveryViaRule", DeliveryViaRule); +} +/** Get Delivery Via. +@return How the order will be delivered */ +public String getDeliveryViaRule() +{ +return (String)get_Value("DeliveryViaRule"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Freight Amount. +@param FreightAmt Freight Amount */ +public void setFreightAmt (BigDecimal FreightAmt) +{ +if (FreightAmt == null) throw new IllegalArgumentException ("FreightAmt is mandatory."); +set_Value ("FreightAmt", FreightAmt); +} +/** Get Freight Amount. +@return Freight Amount */ +public BigDecimal getFreightAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** FreightCostRule AD_Reference_ID=153 */ +public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; +/** Calculated = C */ +public static final String FREIGHTCOSTRULE_Calculated = "C"; +/** Fix price = F */ +public static final String FREIGHTCOSTRULE_FixPrice = "F"; +/** Freight included = I */ +public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; +/** Line = L */ +public static final String FREIGHTCOSTRULE_Line = "L"; +/** Set Freight Cost Rule. +@param FreightCostRule Method for charging Freight */ +public void setFreightCostRule (String FreightCostRule) +{ +if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); +if (FreightCostRule.equals("C") || FreightCostRule.equals("F") || FreightCostRule.equals("I") || FreightCostRule.equals("L")); + else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - C - F - I - L"); +if (FreightCostRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FreightCostRule = FreightCostRule.substring(0,0); +} +set_Value ("FreightCostRule", FreightCostRule); +} +/** Get Freight Cost Rule. +@return Method for charging Freight */ +public String getFreightCostRule() +{ +return (String)get_Value("FreightCostRule"); +} +/** Set Grand Total. +@param GrandTotal Total amount of document */ +public void setGrandTotal (BigDecimal GrandTotal) +{ +if (GrandTotal == null) throw new IllegalArgumentException ("GrandTotal is mandatory."); +set_ValueNoCheck ("GrandTotal", GrandTotal); +} +/** Get Grand Total. +@return Total amount of document */ +public BigDecimal getGrandTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("GrandTotal"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** InvoiceRule AD_Reference_ID=150 */ +public static final int INVOICERULE_AD_Reference_ID=150; +/** After Delivery = D */ +public static final String INVOICERULE_AfterDelivery = "D"; +/** Immediate = I */ +public static final String INVOICERULE_Immediate = "I"; +/** After Order delivered = O */ +public static final String INVOICERULE_AfterOrderDelivered = "O"; +/** Customer Schedule after Delivery = S */ +public static final String INVOICERULE_CustomerScheduleAfterDelivery = "S"; +/** Set Invoice Rule. +@param InvoiceRule Frequency and method of invoicing */ +public void setInvoiceRule (String InvoiceRule) +{ +if (InvoiceRule == null) throw new IllegalArgumentException ("InvoiceRule is mandatory"); +if (InvoiceRule.equals("D") || InvoiceRule.equals("I") || InvoiceRule.equals("O") || InvoiceRule.equals("S")); + else throw new IllegalArgumentException ("InvoiceRule Invalid value - " + InvoiceRule + " - Reference_ID=150 - D - I - O - S"); +if (InvoiceRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceRule = InvoiceRule.substring(0,0); +} +set_Value ("InvoiceRule", InvoiceRule); +} +/** Get Invoice Rule. +@return Frequency and method of invoicing */ +public String getInvoiceRule() +{ +return (String)get_Value("InvoiceRule"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_ValueNoCheck ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Credit Approved. +@param IsCreditApproved Credit has been approved */ +public void setIsCreditApproved (boolean IsCreditApproved) +{ +set_ValueNoCheck ("IsCreditApproved", new Boolean(IsCreditApproved)); +} +/** Get Credit Approved. +@return Credit has been approved */ +public boolean isCreditApproved() +{ +Object oo = get_Value("IsCreditApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Delivered. +@param IsDelivered Delivered */ +public void setIsDelivered (boolean IsDelivered) +{ +set_ValueNoCheck ("IsDelivered", new Boolean(IsDelivered)); +} +/** Get Delivered. +@return Delivered */ +public boolean isDelivered() +{ +Object oo = get_Value("IsDelivered"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discount Printed. +@param IsDiscountPrinted Print Discount on Invoice and Order */ +public void setIsDiscountPrinted (boolean IsDiscountPrinted) +{ +set_Value ("IsDiscountPrinted", new Boolean(IsDiscountPrinted)); +} +/** Get Discount Printed. +@return Print Discount on Invoice and Order */ +public boolean isDiscountPrinted() +{ +Object oo = get_Value("IsDiscountPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Drop Shipment. +@param IsDropShip Drop Shipments are sent from the Vendor directly to the Customer */ +public void setIsDropShip (boolean IsDropShip) +{ +set_ValueNoCheck ("IsDropShip", new Boolean(IsDropShip)); +} +/** Get Drop Shipment. +@return Drop Shipments are sent from the Vendor directly to the Customer */ +public boolean isDropShip() +{ +Object oo = get_Value("IsDropShip"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (boolean IsInvoiced) +{ +set_ValueNoCheck ("IsInvoiced", new Boolean(IsInvoiced)); +} +/** Get Invoiced. +@return Is this invoiced? */ +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_ValueNoCheck ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Selected. +@param IsSelected Selected */ +public void setIsSelected (boolean IsSelected) +{ +set_Value ("IsSelected", new Boolean(IsSelected)); +} +/** Get Selected. +@return Selected */ +public boolean isSelected() +{ +Object oo = get_Value("IsSelected"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Transferred. +@param IsTransferred Transferred to General Ledger (i.e. accounted) */ +public void setIsTransferred (boolean IsTransferred) +{ +set_ValueNoCheck ("IsTransferred", new Boolean(IsTransferred)); +} +/** Get Transferred. +@return Transferred to General Ledger (i.e. accounted) */ +public boolean isTransferred() +{ +Object oo = get_Value("IsTransferred"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID <= 0) set_Value ("M_Shipper_ID", null); + else +set_Value ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order Reference. +@param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} +/** Get Order Reference. +@return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public String getPOReference() +{ +return (String)get_Value("POReference"); +} +/** Set Payment BPartner. +@param Pay_BPartner_ID Business Partner responsible for the payment */ +public void setPay_BPartner_ID (int Pay_BPartner_ID) +{ +if (Pay_BPartner_ID <= 0) set_Value ("Pay_BPartner_ID", null); + else +set_Value ("Pay_BPartner_ID", new Integer(Pay_BPartner_ID)); +} +/** Get Payment BPartner. +@return Business Partner responsible for the payment */ +public int getPay_BPartner_ID() +{ +Integer ii = (Integer)get_Value("Pay_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Location. +@param Pay_Location_ID Location of the Business Partner responsible for the payment */ +public void setPay_Location_ID (int Pay_Location_ID) +{ +if (Pay_Location_ID <= 0) set_Value ("Pay_Location_ID", null); + else +set_Value ("Pay_Location_ID", new Integer(Pay_Location_ID)); +} +/** Get Payment Location. +@return Location of the Business Partner responsible for the payment */ +public int getPay_Location_ID() +{ +Integer ii = (Integer)get_Value("Pay_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PriorityRule AD_Reference_ID=154 */ +public static final int PRIORITYRULE_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITYRULE_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITYRULE_High = "3"; +/** Medium = 5 */ +public static final String PRIORITYRULE_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITYRULE_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITYRULE_Minor = "9"; +/** Set Priority. +@param PriorityRule Priority of a document */ +public void setPriorityRule (String PriorityRule) +{ +if (PriorityRule == null) throw new IllegalArgumentException ("PriorityRule is mandatory"); +if (PriorityRule.equals("1") || PriorityRule.equals("3") || PriorityRule.equals("5") || PriorityRule.equals("7") || PriorityRule.equals("9")); + else throw new IllegalArgumentException ("PriorityRule Invalid value - " + PriorityRule + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (PriorityRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityRule = PriorityRule.substring(0,0); +} +set_Value ("PriorityRule", PriorityRule); +} +/** Get Priority. +@return Priority of a document */ +public String getPriorityRule() +{ +return (String)get_Value("PriorityRule"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** Ref_Order_ID AD_Reference_ID=290 */ +public static final int REF_ORDER_ID_AD_Reference_ID=290; +/** Set Referenced Order. +@param Ref_Order_ID Reference to corresponding Sales/Purchase Order */ +public void setRef_Order_ID (int Ref_Order_ID) +{ +if (Ref_Order_ID <= 0) set_Value ("Ref_Order_ID", null); + else +set_Value ("Ref_Order_ID", new Integer(Ref_Order_ID)); +} +/** Get Referenced Order. +@return Reference to corresponding Sales/Purchase Order */ +public int getRef_Order_ID() +{ +Integer ii = (Integer)get_Value("Ref_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Send EMail. +@param SendEMail Enable sending Document EMail */ +public void setSendEMail (boolean SendEMail) +{ +set_Value ("SendEMail", new Boolean(SendEMail)); +} +/** Get Send EMail. +@return Enable sending Document EMail */ +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Lines. +@param TotalLines Total of all document lines */ +public void setTotalLines (BigDecimal TotalLines) +{ +if (TotalLines == null) throw new IllegalArgumentException ("TotalLines is mandatory."); +set_ValueNoCheck ("TotalLines", TotalLines); +} +/** Get Total Lines. +@return Total of all document lines */ +public BigDecimal getTotalLines() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalLines"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Volume. +@param Volume Volume of a product */ +public void setVolume (BigDecimal Volume) +{ +set_Value ("Volume", Volume); +} +/** Get Volume. +@return Volume of a product */ +public BigDecimal getVolume() +{ +BigDecimal bd = (BigDecimal)get_Value("Volume"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Weight. +@param Weight Weight of a product */ +public void setWeight (BigDecimal Weight) +{ +set_Value ("Weight", Weight); +} +/** Get Weight. +@return Weight of a product */ +public BigDecimal getWeight() +{ +BigDecimal bd = (BigDecimal)get_Value("Weight"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_OrderLine.java b/dbPort/src/org/compiere/model/X_C_OrderLine.java new file mode 100644 index 0000000000..d0c5fcfa07 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_OrderLine.java @@ -0,0 +1,826 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_OrderLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:57.953 */ +public class X_C_OrderLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_OrderLine_ID id +@param trxName transaction +*/ +public X_C_OrderLine (Properties ctx, int C_OrderLine_ID, String trxName) +{ +super (ctx, C_OrderLine_ID, trxName); +/** if (C_OrderLine_ID == 0) +{ +setC_BPartner_Location_ID (0); // @C_BPartner_Location_ID@ +setC_Currency_ID (0); // @C_Currency_ID@ +setC_OrderLine_ID (0); +setC_Order_ID (0); +setC_Tax_ID (0); +setC_UOM_ID (0); // @#C_UOM_ID@ +setDateOrdered (new Timestamp(System.currentTimeMillis())); // @DateOrdered@ +setFreightAmt (Env.ZERO); +setIsDescription (false); // N +setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_OrderLine WHERE C_Order_ID=@C_Order_ID@ +setLineNetAmt (Env.ZERO); +setM_AttributeSetInstance_ID (0); +setM_Warehouse_ID (0); // @M_Warehouse_ID@ +setPriceActual (Env.ZERO); +setPriceEntered (Env.ZERO); +setPriceLimit (Env.ZERO); +setPriceList (Env.ZERO); +setProcessed (false); +setQtyDelivered (Env.ZERO); +setQtyEntered (Env.ZERO); // 1 +setQtyInvoiced (Env.ZERO); +setQtyLostSales (Env.ZERO); +setQtyOrdered (Env.ZERO); // 1 +setQtyReserved (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_OrderLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=260 */ +public static final int Table_ID=260; + +/** TableName=C_OrderLine */ +public static final String Table_Name="C_OrderLine"; + +protected static KeyNamePair Model = new KeyNamePair(260,"C_OrderLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_OrderLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_ValueNoCheck ("C_BPartner_ID", null); + else +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID < 1) throw new IllegalArgumentException ("C_OrderLine_ID is mandatory."); +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID < 1) throw new IllegalArgumentException ("C_Order_ID is mandatory."); +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Order_ID())); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_ValueNoCheck ("C_ProjectPhase_ID", null); + else +set_ValueNoCheck ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_ValueNoCheck ("C_ProjectTask_ID", null); + else +set_ValueNoCheck ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_Value ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_ValueNoCheck ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date Delivered. +@param DateDelivered Date when the product was delivered */ +public void setDateDelivered (Timestamp DateDelivered) +{ +set_ValueNoCheck ("DateDelivered", DateDelivered); +} +/** Get Date Delivered. +@return Date when the product was delivered */ +public Timestamp getDateDelivered() +{ +return (Timestamp)get_Value("DateDelivered"); +} +/** Set Date Invoiced. +@param DateInvoiced Date printed on Invoice */ +public void setDateInvoiced (Timestamp DateInvoiced) +{ +set_ValueNoCheck ("DateInvoiced", DateInvoiced); +} +/** Get Date Invoiced. +@return Date printed on Invoice */ +public Timestamp getDateInvoiced() +{ +return (Timestamp)get_Value("DateInvoiced"); +} +/** Set Date Ordered. +@param DateOrdered Date of Order */ +public void setDateOrdered (Timestamp DateOrdered) +{ +if (DateOrdered == null) throw new IllegalArgumentException ("DateOrdered is mandatory."); +set_Value ("DateOrdered", DateOrdered); +} +/** Get Date Ordered. +@return Date of Order */ +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} +/** Set Date Promised. +@param DatePromised Date Order was promised */ +public void setDatePromised (Timestamp DatePromised) +{ +set_Value ("DatePromised", DatePromised); +} +/** Get Date Promised. +@return Date Order was promised */ +public Timestamp getDatePromised() +{ +return (Timestamp)get_Value("DatePromised"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Discount %. +@param Discount Discount in percent */ +public void setDiscount (BigDecimal Discount) +{ +set_Value ("Discount", Discount); +} +/** Get Discount %. +@return Discount in percent */ +public BigDecimal getDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Freight Amount. +@param FreightAmt Freight Amount */ +public void setFreightAmt (BigDecimal FreightAmt) +{ +if (FreightAmt == null) throw new IllegalArgumentException ("FreightAmt is mandatory."); +set_Value ("FreightAmt", FreightAmt); +} +/** Get Freight Amount. +@return Freight Amount */ +public BigDecimal getFreightAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description Only. +@param IsDescription if true, the line is just description and no transaction */ +public void setIsDescription (boolean IsDescription) +{ +set_Value ("IsDescription", new Boolean(IsDescription)); +} +/** Get Description Only. +@return if true, the line is just description and no transaction */ +public boolean isDescription() +{ +Object oo = get_Value("IsDescription"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line Amount. +@param LineNetAmt Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public void setLineNetAmt (BigDecimal LineNetAmt) +{ +if (LineNetAmt == null) throw new IllegalArgumentException ("LineNetAmt is mandatory."); +set_ValueNoCheck ("LineNetAmt", LineNetAmt); +} +/** Get Line Amount. +@return Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public BigDecimal getLineNetAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID <= 0) set_Value ("M_Shipper_ID", null); + else +set_Value ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_Warehouse_ID AD_Reference_ID=197 */ +public static final int M_WAREHOUSE_ID_AD_Reference_ID=197; +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unit Price. +@param PriceActual Actual Price */ +public void setPriceActual (BigDecimal PriceActual) +{ +if (PriceActual == null) throw new IllegalArgumentException ("PriceActual is mandatory."); +set_ValueNoCheck ("PriceActual", PriceActual); +} +/** Get Unit Price. +@return Actual Price */ +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Cost Price. +@param PriceCost Price per Unit of Measure including all indirect costs (Freight, etc.) */ +public void setPriceCost (BigDecimal PriceCost) +{ +set_Value ("PriceCost", PriceCost); +} +/** Get Cost Price. +@return Price per Unit of Measure including all indirect costs (Freight, etc.) */ +public BigDecimal getPriceCost() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceCost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Price. +@param PriceEntered Price Entered - the price based on the selected/base UoM */ +public void setPriceEntered (BigDecimal PriceEntered) +{ +if (PriceEntered == null) throw new IllegalArgumentException ("PriceEntered is mandatory."); +set_Value ("PriceEntered", PriceEntered); +} +/** Get Price. +@return Price Entered - the price based on the selected/base UoM */ +public BigDecimal getPriceEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Limit Price. +@param PriceLimit Lowest price for a product */ +public void setPriceLimit (BigDecimal PriceLimit) +{ +if (PriceLimit == null) throw new IllegalArgumentException ("PriceLimit is mandatory."); +set_Value ("PriceLimit", PriceLimit); +} +/** Get Limit Price. +@return Lowest price for a product */ +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +if (PriceList == null) throw new IllegalArgumentException ("PriceList is mandatory."); +set_Value ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Delivered Quantity. +@param QtyDelivered Delivered Quantity */ +public void setQtyDelivered (BigDecimal QtyDelivered) +{ +if (QtyDelivered == null) throw new IllegalArgumentException ("QtyDelivered is mandatory."); +set_ValueNoCheck ("QtyDelivered", QtyDelivered); +} +/** Get Delivered Quantity. +@return Delivered Quantity */ +public BigDecimal getQtyDelivered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyDelivered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity. +@param QtyEntered The Quantity Entered is based on the selected UoM */ +public void setQtyEntered (BigDecimal QtyEntered) +{ +if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); +set_Value ("QtyEntered", QtyEntered); +} +/** Get Quantity. +@return The Quantity Entered is based on the selected UoM */ +public BigDecimal getQtyEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Invoiced. +@param QtyInvoiced Invoiced Quantity */ +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +if (QtyInvoiced == null) throw new IllegalArgumentException ("QtyInvoiced is mandatory."); +set_ValueNoCheck ("QtyInvoiced", QtyInvoiced); +} +/** Get Quantity Invoiced. +@return Invoiced Quantity */ +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Lost Sales Qty. +@param QtyLostSales Quantity of potential sales */ +public void setQtyLostSales (BigDecimal QtyLostSales) +{ +if (QtyLostSales == null) throw new IllegalArgumentException ("QtyLostSales is mandatory."); +set_Value ("QtyLostSales", QtyLostSales); +} +/** Get Lost Sales Qty. +@return Quantity of potential sales */ +public BigDecimal getQtyLostSales() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyLostSales"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ordered Quantity. +@param QtyOrdered Ordered Quantity */ +public void setQtyOrdered (BigDecimal QtyOrdered) +{ +if (QtyOrdered == null) throw new IllegalArgumentException ("QtyOrdered is mandatory."); +set_Value ("QtyOrdered", QtyOrdered); +} +/** Get Ordered Quantity. +@return Ordered Quantity */ +public BigDecimal getQtyOrdered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOrdered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reserved Quantity. +@param QtyReserved Reserved Quantity */ +public void setQtyReserved (BigDecimal QtyReserved) +{ +if (QtyReserved == null) throw new IllegalArgumentException ("QtyReserved is mandatory."); +set_ValueNoCheck ("QtyReserved", QtyReserved); +} +/** Get Reserved Quantity. +@return Reserved Quantity */ +public BigDecimal getQtyReserved() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyReserved"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revenue Recognition Amt. +@param RRAmt Revenue Recognition Amount */ +public void setRRAmt (BigDecimal RRAmt) +{ +set_Value ("RRAmt", RRAmt); +} +/** Get Revenue Recognition Amt. +@return Revenue Recognition Amount */ +public BigDecimal getRRAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RRAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revenue Recognition Start. +@param RRStartDate Revenue Recognition Start Date */ +public void setRRStartDate (Timestamp RRStartDate) +{ +set_Value ("RRStartDate", RRStartDate); +} +/** Get Revenue Recognition Start. +@return Revenue Recognition Start Date */ +public Timestamp getRRStartDate() +{ +return (Timestamp)get_Value("RRStartDate"); +} + +/** Ref_OrderLine_ID AD_Reference_ID=271 */ +public static final int REF_ORDERLINE_ID_AD_Reference_ID=271; +/** Set Referenced Order Line. +@param Ref_OrderLine_ID Reference to corresponding Sales/Purchase Order */ +public void setRef_OrderLine_ID (int Ref_OrderLine_ID) +{ +if (Ref_OrderLine_ID <= 0) set_Value ("Ref_OrderLine_ID", null); + else +set_Value ("Ref_OrderLine_ID", new Integer(Ref_OrderLine_ID)); +} +/** Get Referenced Order Line. +@return Reference to corresponding Sales/Purchase Order */ +public int getRef_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("Ref_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resource Assignment. +@param S_ResourceAssignment_ID Resource Assignment */ +public void setS_ResourceAssignment_ID (int S_ResourceAssignment_ID) +{ +if (S_ResourceAssignment_ID <= 0) set_Value ("S_ResourceAssignment_ID", null); + else +set_Value ("S_ResourceAssignment_ID", new Integer(S_ResourceAssignment_ID)); +} +/** Get Resource Assignment. +@return Resource Assignment */ +public int getS_ResourceAssignment_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_OrderTax.java b/dbPort/src/org/compiere/model/X_C_OrderTax.java new file mode 100644 index 0000000000..2ceaaa635d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_OrderTax.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_OrderTax + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.0 */ +public class X_C_OrderTax extends PO +{ +/** Standard Constructor +@param ctx context +@param C_OrderTax_ID id +@param trxName transaction +*/ +public X_C_OrderTax (Properties ctx, int C_OrderTax_ID, String trxName) +{ +super (ctx, C_OrderTax_ID, trxName); +/** if (C_OrderTax_ID == 0) +{ +setC_Order_ID (0); +setC_Tax_ID (0); +setIsTaxIncluded (false); +setProcessed (false); +setTaxAmt (Env.ZERO); +setTaxBaseAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_OrderTax (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=314 */ +public static final int Table_ID=314; + +/** TableName=C_OrderTax */ +public static final String Table_Name="C_OrderTax"; + +protected static KeyNamePair Model = new KeyNamePair(314,"C_OrderTax"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_OrderTax[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID < 1) throw new IllegalArgumentException ("C_Order_ID is mandatory."); +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +if (TaxAmt == null) throw new IllegalArgumentException ("TaxAmt is mandatory."); +set_ValueNoCheck ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tax base Amount. +@param TaxBaseAmt Base for calculating the tax amount */ +public void setTaxBaseAmt (BigDecimal TaxBaseAmt) +{ +if (TaxBaseAmt == null) throw new IllegalArgumentException ("TaxBaseAmt is mandatory."); +set_ValueNoCheck ("TaxBaseAmt", TaxBaseAmt); +} +/** Get Tax base Amount. +@return Base for calculating the tax amount */ +public BigDecimal getTaxBaseAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxBaseAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_OrgAssignment.java b/dbPort/src/org/compiere/model/X_C_OrgAssignment.java new file mode 100644 index 0000000000..7572634d01 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_OrgAssignment.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_OrgAssignment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.0 */ +public class X_C_OrgAssignment extends PO +{ +/** Standard Constructor +@param ctx context +@param C_OrgAssignment_ID id +@param trxName transaction +*/ +public X_C_OrgAssignment (Properties ctx, int C_OrgAssignment_ID, String trxName) +{ +super (ctx, C_OrgAssignment_ID, trxName); +/** if (C_OrgAssignment_ID == 0) +{ +setAD_User_ID (0); +setC_OrgAssignment_ID (0); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_OrgAssignment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=585 */ +public static final int Table_ID=585; + +/** TableName=C_OrgAssignment */ +public static final String Table_Name="C_OrgAssignment"; + +protected static KeyNamePair Model = new KeyNamePair(585,"C_OrgAssignment"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_OrgAssignment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Org Assignment. +@param C_OrgAssignment_ID Assigment to (transaction) Organization */ +public void setC_OrgAssignment_ID (int C_OrgAssignment_ID) +{ +if (C_OrgAssignment_ID < 1) throw new IllegalArgumentException ("C_OrgAssignment_ID is mandatory."); +set_ValueNoCheck ("C_OrgAssignment_ID", new Integer(C_OrgAssignment_ID)); +} +/** Get Org Assignment. +@return Assigment to (transaction) Organization */ +public int getC_OrgAssignment_ID() +{ +Integer ii = (Integer)get_Value("C_OrgAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_POS.java b/dbPort/src/org/compiere/model/X_C_POS.java new file mode 100644 index 0000000000..ab3651ba4f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_POS.java @@ -0,0 +1,316 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_POS + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.015 */ +public class X_C_POS extends PO +{ +/** Standard Constructor +@param ctx context +@param C_POS_ID id +@param trxName transaction +*/ +public X_C_POS (Properties ctx, int C_POS_ID, String trxName) +{ +super (ctx, C_POS_ID, trxName); +/** if (C_POS_ID == 0) +{ +setC_CashBook_ID (0); +setC_POS_ID (0); +setIsModifyPrice (false); // N +setM_PriceList_ID (0); +setM_Warehouse_ID (0); +setName (null); +setSalesRep_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_POS (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=748 */ +public static final int Table_ID=748; + +/** TableName=C_POS */ +public static final String Table_Name="C_POS"; + +protected static KeyNamePair Model = new KeyNamePair(748,"C_POS"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_POS[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** C_BPartnerCashTrx_ID AD_Reference_ID=173 */ +public static final int C_BPARTNERCASHTRX_ID_AD_Reference_ID=173; +/** Set Template B.Partner. +@param C_BPartnerCashTrx_ID Business Partner used for creating new Business Partners on the fly */ +public void setC_BPartnerCashTrx_ID (int C_BPartnerCashTrx_ID) +{ +if (C_BPartnerCashTrx_ID <= 0) set_Value ("C_BPartnerCashTrx_ID", null); + else +set_Value ("C_BPartnerCashTrx_ID", new Integer(C_BPartnerCashTrx_ID)); +} +/** Get Template B.Partner. +@return Business Partner used for creating new Business Partners on the fly */ +public int getC_BPartnerCashTrx_ID() +{ +Integer ii = (Integer)get_Value("C_BPartnerCashTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cash Book. +@param C_CashBook_ID Cash Book for recording petty cash transactions */ +public void setC_CashBook_ID (int C_CashBook_ID) +{ +if (C_CashBook_ID < 1) throw new IllegalArgumentException ("C_CashBook_ID is mandatory."); +set_Value ("C_CashBook_ID", new Integer(C_CashBook_ID)); +} +/** Get Cash Book. +@return Cash Book for recording petty cash transactions */ +public int getC_CashBook_ID() +{ +Integer ii = (Integer)get_Value("C_CashBook_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set POS Key Layout. +@param C_POSKeyLayout_ID POS Function Key Layout */ +public void setC_POSKeyLayout_ID (int C_POSKeyLayout_ID) +{ +if (C_POSKeyLayout_ID <= 0) set_Value ("C_POSKeyLayout_ID", null); + else +set_Value ("C_POSKeyLayout_ID", new Integer(C_POSKeyLayout_ID)); +} +/** Get POS Key Layout. +@return POS Function Key Layout */ +public int getC_POSKeyLayout_ID() +{ +Integer ii = (Integer)get_Value("C_POSKeyLayout_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set POS Terminal. +@param C_POS_ID Point of Sales Terminal */ +public void setC_POS_ID (int C_POS_ID) +{ +if (C_POS_ID < 1) throw new IllegalArgumentException ("C_POS_ID is mandatory."); +set_ValueNoCheck ("C_POS_ID", new Integer(C_POS_ID)); +} +/** Get POS Terminal. +@return Point of Sales Terminal */ +public int getC_POS_ID() +{ +Integer ii = (Integer)get_Value("C_POS_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Modify Price. +@param IsModifyPrice Allow modifying the price */ +public void setIsModifyPrice (boolean IsModifyPrice) +{ +set_Value ("IsModifyPrice", new Boolean(IsModifyPrice)); +} +/** Get Modify Price. +@return Allow modifying the price */ +public boolean isModifyPrice() +{ +Object oo = get_Value("IsModifyPrice"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Printer Name. +@param PrinterName Name of the Printer */ +public void setPrinterName (String PrinterName) +{ +if (PrinterName != null && PrinterName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PrinterName = PrinterName.substring(0,59); +} +set_Value ("PrinterName", PrinterName); +} +/** Get Printer Name. +@return Name of the Printer */ +public String getPrinterName() +{ +return (String)get_Value("PrinterName"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_POSKey.java b/dbPort/src/org/compiere/model/X_C_POSKey.java new file mode 100644 index 0000000000..22603a2a26 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_POSKey.java @@ -0,0 +1,226 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_POSKey + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.031 */ +public class X_C_POSKey extends PO +{ +/** Standard Constructor +@param ctx context +@param C_POSKey_ID id +@param trxName transaction +*/ +public X_C_POSKey (Properties ctx, int C_POSKey_ID, String trxName) +{ +super (ctx, C_POSKey_ID, trxName); +/** if (C_POSKey_ID == 0) +{ +setC_POSKeyLayout_ID (0); +setC_POSKey_ID (0); +setM_Product_ID (0); +setName (null); +setQty (Env.ZERO); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_POSKey (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=750 */ +public static final int Table_ID=750; + +/** TableName=C_POSKey */ +public static final String Table_Name="C_POSKey"; + +protected static KeyNamePair Model = new KeyNamePair(750,"C_POSKey"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_POSKey[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID <= 0) set_Value ("AD_PrintColor_ID", null); + else +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set POS Key Layout. +@param C_POSKeyLayout_ID POS Function Key Layout */ +public void setC_POSKeyLayout_ID (int C_POSKeyLayout_ID) +{ +if (C_POSKeyLayout_ID < 1) throw new IllegalArgumentException ("C_POSKeyLayout_ID is mandatory."); +set_ValueNoCheck ("C_POSKeyLayout_ID", new Integer(C_POSKeyLayout_ID)); +} +/** Get POS Key Layout. +@return POS Function Key Layout */ +public int getC_POSKeyLayout_ID() +{ +Integer ii = (Integer)get_Value("C_POSKeyLayout_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set POS Key. +@param C_POSKey_ID POS Function Key */ +public void setC_POSKey_ID (int C_POSKey_ID) +{ +if (C_POSKey_ID < 1) throw new IllegalArgumentException ("C_POSKey_ID is mandatory."); +set_ValueNoCheck ("C_POSKey_ID", new Integer(C_POSKey_ID)); +} +/** Get POS Key. +@return POS Function Key */ +public int getC_POSKey_ID() +{ +Integer ii = (Integer)get_Value("C_POSKey_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_POSKeyLayout.java b/dbPort/src/org/compiere/model/X_C_POSKeyLayout.java new file mode 100644 index 0000000000..ca4b5539d2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_POSKeyLayout.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_POSKeyLayout + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.046 */ +public class X_C_POSKeyLayout extends PO +{ +/** Standard Constructor +@param ctx context +@param C_POSKeyLayout_ID id +@param trxName transaction +*/ +public X_C_POSKeyLayout (Properties ctx, int C_POSKeyLayout_ID, String trxName) +{ +super (ctx, C_POSKeyLayout_ID, trxName); +/** if (C_POSKeyLayout_ID == 0) +{ +setC_POSKeyLayout_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_POSKeyLayout (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=749 */ +public static final int Table_ID=749; + +/** TableName=C_POSKeyLayout */ +public static final String Table_Name="C_POSKeyLayout"; + +protected static KeyNamePair Model = new KeyNamePair(749,"C_POSKeyLayout"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_POSKeyLayout[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set POS Key Layout. +@param C_POSKeyLayout_ID POS Function Key Layout */ +public void setC_POSKeyLayout_ID (int C_POSKeyLayout_ID) +{ +if (C_POSKeyLayout_ID < 1) throw new IllegalArgumentException ("C_POSKeyLayout_ID is mandatory."); +set_ValueNoCheck ("C_POSKeyLayout_ID", new Integer(C_POSKeyLayout_ID)); +} +/** Get POS Key Layout. +@return POS Function Key Layout */ +public int getC_POSKeyLayout_ID() +{ +Integer ii = (Integer)get_Value("C_POSKeyLayout_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaySchedule.java b/dbPort/src/org/compiere/model/X_C_PaySchedule.java new file mode 100644 index 0000000000..6f50e79bcf --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaySchedule.java @@ -0,0 +1,258 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaySchedule + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.046 */ +public class X_C_PaySchedule extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaySchedule_ID id +@param trxName transaction +*/ +public X_C_PaySchedule (Properties ctx, int C_PaySchedule_ID, String trxName) +{ +super (ctx, C_PaySchedule_ID, trxName); +/** if (C_PaySchedule_ID == 0) +{ +setC_PaySchedule_ID (0); +setC_PaymentTerm_ID (0); +setDiscount (Env.ZERO); +setDiscountDays (0); +setGraceDays (0); +setIsValid (false); +setNetDays (0); +setPercentage (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaySchedule (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=548 */ +public static final int Table_ID=548; + +/** TableName=C_PaySchedule */ +public static final String Table_Name="C_PaySchedule"; + +protected static KeyNamePair Model = new KeyNamePair(548,"C_PaySchedule"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaySchedule[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Payment Schedule. +@param C_PaySchedule_ID Payment Schedule Template */ +public void setC_PaySchedule_ID (int C_PaySchedule_ID) +{ +if (C_PaySchedule_ID < 1) throw new IllegalArgumentException ("C_PaySchedule_ID is mandatory."); +set_ValueNoCheck ("C_PaySchedule_ID", new Integer(C_PaySchedule_ID)); +} +/** Get Payment Schedule. +@return Payment Schedule Template */ +public int getC_PaySchedule_ID() +{ +Integer ii = (Integer)get_Value("C_PaySchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_ValueNoCheck ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_PaymentTerm_ID())); +} +/** Set Discount %. +@param Discount Discount in percent */ +public void setDiscount (BigDecimal Discount) +{ +if (Discount == null) throw new IllegalArgumentException ("Discount is mandatory."); +set_Value ("Discount", Discount); +} +/** Get Discount %. +@return Discount in percent */ +public BigDecimal getDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Discount Days. +@param DiscountDays Number of days from invoice date to be eligible for discount */ +public void setDiscountDays (int DiscountDays) +{ +set_Value ("DiscountDays", new Integer(DiscountDays)); +} +/** Get Discount Days. +@return Number of days from invoice date to be eligible for discount */ +public int getDiscountDays() +{ +Integer ii = (Integer)get_Value("DiscountDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Grace Days. +@param GraceDays Days after due date to send first dunning letter */ +public void setGraceDays (int GraceDays) +{ +set_Value ("GraceDays", new Integer(GraceDays)); +} +/** Get Grace Days. +@return Days after due date to send first dunning letter */ +public int getGraceDays() +{ +Integer ii = (Integer)get_Value("GraceDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** NetDay AD_Reference_ID=167 */ +public static final int NETDAY_AD_Reference_ID=167; +/** Monday = 1 */ +public static final String NETDAY_Monday = "1"; +/** Tuesday = 2 */ +public static final String NETDAY_Tuesday = "2"; +/** Wednesday = 3 */ +public static final String NETDAY_Wednesday = "3"; +/** Thursday = 4 */ +public static final String NETDAY_Thursday = "4"; +/** Friday = 5 */ +public static final String NETDAY_Friday = "5"; +/** Saturday = 6 */ +public static final String NETDAY_Saturday = "6"; +/** Sunday = 7 */ +public static final String NETDAY_Sunday = "7"; +/** Set Net Day. +@param NetDay Day when payment is due net */ +public void setNetDay (String NetDay) +{ +if (NetDay == null) throw new IllegalArgumentException ("NetDay is mandatory"); +if (NetDay == null || NetDay.equals("1") || NetDay.equals("2") || NetDay.equals("3") || NetDay.equals("4") || NetDay.equals("5") || NetDay.equals("6") || NetDay.equals("7")); + else throw new IllegalArgumentException ("NetDay Invalid value - " + NetDay + " - Reference_ID=167 - 1 - 2 - 3 - 4 - 5 - 6 - 7"); +if (NetDay != null && NetDay.length() > 1) +{ +log.warning("Length > 1 - truncated"); +NetDay = NetDay.substring(0,0); +} +set_Value ("NetDay", NetDay); +} +/** Get Net Day. +@return Day when payment is due net */ +public String getNetDay() +{ +return (String)get_Value("NetDay"); +} +/** Set Net Days. +@param NetDays Net Days in which payment is due */ +public void setNetDays (int NetDays) +{ +set_Value ("NetDays", new Integer(NetDays)); +} +/** Get Net Days. +@return Net Days in which payment is due */ +public int getNetDays() +{ +Integer ii = (Integer)get_Value("NetDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Percentage. +@param Percentage Percent of the entire amount */ +public void setPercentage (BigDecimal Percentage) +{ +if (Percentage == null) throw new IllegalArgumentException ("Percentage is mandatory."); +set_Value ("Percentage", Percentage); +} +/** Get Percentage. +@return Percent of the entire amount */ +public BigDecimal getPercentage() +{ +BigDecimal bd = (BigDecimal)get_Value("Percentage"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaySelection.java b/dbPort/src/org/compiere/model/X_C_PaySelection.java new file mode 100644 index 0000000000..6fc3280ab1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaySelection.java @@ -0,0 +1,265 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaySelection + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.062 */ +public class X_C_PaySelection extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaySelection_ID id +@param trxName transaction +*/ +public X_C_PaySelection (Properties ctx, int C_PaySelection_ID, String trxName) +{ +super (ctx, C_PaySelection_ID, trxName); +/** if (C_PaySelection_ID == 0) +{ +setC_BankAccount_ID (0); +setC_PaySelection_ID (0); +setIsApproved (false); +setName (null); // @#Date@ +setPayDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setProcessed (false); +setProcessing (false); +setTotalAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaySelection (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=426 */ +public static final int Table_ID=426; + +/** TableName=C_PaySelection */ +public static final String Table_Name="C_PaySelection"; + +protected static KeyNamePair Model = new KeyNamePair(426,"C_PaySelection"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaySelection[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Selection. +@param C_PaySelection_ID Payment Selection */ +public void setC_PaySelection_ID (int C_PaySelection_ID) +{ +if (C_PaySelection_ID < 1) throw new IllegalArgumentException ("C_PaySelection_ID is mandatory."); +set_ValueNoCheck ("C_PaySelection_ID", new Integer(C_PaySelection_ID)); +} +/** Get Payment Selection. +@return Payment Selection */ +public int getC_PaySelection_ID() +{ +Integer ii = (Integer)get_Value("C_PaySelection_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Create lines from. +@param CreateFrom Process which will generate a new document lines based on an existing document */ +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} +/** Get Create lines from. +@return Process which will generate a new document lines based on an existing document */ +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Payment date. +@param PayDate Date Payment made */ +public void setPayDate (Timestamp PayDate) +{ +if (PayDate == null) throw new IllegalArgumentException ("PayDate is mandatory."); +set_Value ("PayDate", PayDate); +} +/** Get Payment date. +@return Date Payment made */ +public Timestamp getPayDate() +{ +return (Timestamp)get_Value("PayDate"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Amount. +@param TotalAmt Total Amount */ +public void setTotalAmt (BigDecimal TotalAmt) +{ +if (TotalAmt == null) throw new IllegalArgumentException ("TotalAmt is mandatory."); +set_Value ("TotalAmt", TotalAmt); +} +/** Get Total Amount. +@return Total Amount */ +public BigDecimal getTotalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaySelectionCheck.java b/dbPort/src/org/compiere/model/X_C_PaySelectionCheck.java new file mode 100644 index 0000000000..d930c6dc5b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaySelectionCheck.java @@ -0,0 +1,308 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaySelectionCheck + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.078 */ +public class X_C_PaySelectionCheck extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaySelectionCheck_ID id +@param trxName transaction +*/ +public X_C_PaySelectionCheck (Properties ctx, int C_PaySelectionCheck_ID, String trxName) +{ +super (ctx, C_PaySelectionCheck_ID, trxName); +/** if (C_PaySelectionCheck_ID == 0) +{ +setC_BPartner_ID (0); +setC_PaySelectionCheck_ID (0); +setC_PaySelection_ID (0); +setDiscountAmt (Env.ZERO); +setIsPrinted (false); +setIsReceipt (false); +setPayAmt (Env.ZERO); +setPaymentRule (null); +setProcessed (false); // N +setQty (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaySelectionCheck (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=525 */ +public static final int Table_ID=525; + +/** TableName=C_PaySelectionCheck */ +public static final String Table_Name="C_PaySelectionCheck"; + +protected static KeyNamePair Model = new KeyNamePair(525,"C_PaySelectionCheck"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaySelectionCheck[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Pay Selection Check. +@param C_PaySelectionCheck_ID Payment Selection Check */ +public void setC_PaySelectionCheck_ID (int C_PaySelectionCheck_ID) +{ +if (C_PaySelectionCheck_ID < 1) throw new IllegalArgumentException ("C_PaySelectionCheck_ID is mandatory."); +set_ValueNoCheck ("C_PaySelectionCheck_ID", new Integer(C_PaySelectionCheck_ID)); +} +/** Get Pay Selection Check. +@return Payment Selection Check */ +public int getC_PaySelectionCheck_ID() +{ +Integer ii = (Integer)get_Value("C_PaySelectionCheck_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Selection. +@param C_PaySelection_ID Payment Selection */ +public void setC_PaySelection_ID (int C_PaySelection_ID) +{ +if (C_PaySelection_ID < 1) throw new IllegalArgumentException ("C_PaySelection_ID is mandatory."); +set_ValueNoCheck ("C_PaySelection_ID", new Integer(C_PaySelection_ID)); +} +/** Get Payment Selection. +@return Payment Selection */ +public int getC_PaySelection_ID() +{ +Integer ii = (Integer)get_Value("C_PaySelection_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +if (DiscountAmt == null) throw new IllegalArgumentException ("DiscountAmt is mandatory."); +set_Value ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Receipt. +@param IsReceipt This is a sales transaction (receipt) */ +public void setIsReceipt (boolean IsReceipt) +{ +set_Value ("IsReceipt", new Boolean(IsReceipt)); +} +/** Get Receipt. +@return This is a sales transaction (receipt) */ +public boolean isReceipt() +{ +Object oo = get_Value("IsReceipt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Payment amount. +@param PayAmt Amount being paid */ +public void setPayAmt (BigDecimal PayAmt) +{ +if (PayAmt == null) throw new IllegalArgumentException ("PayAmt is mandatory."); +set_Value ("PayAmt", PayAmt); +} +/** Get Payment amount. +@return Amount being paid */ +public BigDecimal getPayAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PayAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (int Qty) +{ +set_Value ("Qty", new Integer(Qty)); +} +/** Get Quantity. +@return Quantity */ +public int getQty() +{ +Integer ii = (Integer)get_Value("Qty"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaySelectionLine.java b/dbPort/src/org/compiere/model/X_C_PaySelectionLine.java new file mode 100644 index 0000000000..6ab0cea095 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaySelectionLine.java @@ -0,0 +1,346 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaySelectionLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.093 */ +public class X_C_PaySelectionLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaySelectionLine_ID id +@param trxName transaction +*/ +public X_C_PaySelectionLine (Properties ctx, int C_PaySelectionLine_ID, String trxName) +{ +super (ctx, C_PaySelectionLine_ID, trxName); +/** if (C_PaySelectionLine_ID == 0) +{ +setC_Invoice_ID (0); +setC_PaySelectionLine_ID (0); +setC_PaySelection_ID (0); +setDifferenceAmt (Env.ZERO); +setDiscountAmt (Env.ZERO); +setIsManual (false); +setIsSOTrx (false); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_PaySelectionLine WHERE C_PaySelection_ID=@C_PaySelection_ID@ +setOpenAmt (Env.ZERO); +setPayAmt (Env.ZERO); +setPaymentRule (null); // S +setProcessed (false); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaySelectionLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=427 */ +public static final int Table_ID=427; + +/** TableName=C_PaySelectionLine */ +public static final String Table_Name="C_PaySelectionLine"; + +protected static KeyNamePair Model = new KeyNamePair(427,"C_PaySelectionLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaySelectionLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Pay Selection Check. +@param C_PaySelectionCheck_ID Payment Selection Check */ +public void setC_PaySelectionCheck_ID (int C_PaySelectionCheck_ID) +{ +if (C_PaySelectionCheck_ID <= 0) set_Value ("C_PaySelectionCheck_ID", null); + else +set_Value ("C_PaySelectionCheck_ID", new Integer(C_PaySelectionCheck_ID)); +} +/** Get Pay Selection Check. +@return Payment Selection Check */ +public int getC_PaySelectionCheck_ID() +{ +Integer ii = (Integer)get_Value("C_PaySelectionCheck_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Selection Line. +@param C_PaySelectionLine_ID Payment Selection Line */ +public void setC_PaySelectionLine_ID (int C_PaySelectionLine_ID) +{ +if (C_PaySelectionLine_ID < 1) throw new IllegalArgumentException ("C_PaySelectionLine_ID is mandatory."); +set_ValueNoCheck ("C_PaySelectionLine_ID", new Integer(C_PaySelectionLine_ID)); +} +/** Get Payment Selection Line. +@return Payment Selection Line */ +public int getC_PaySelectionLine_ID() +{ +Integer ii = (Integer)get_Value("C_PaySelectionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_PaySelectionLine_ID())); +} +/** Set Payment Selection. +@param C_PaySelection_ID Payment Selection */ +public void setC_PaySelection_ID (int C_PaySelection_ID) +{ +if (C_PaySelection_ID < 1) throw new IllegalArgumentException ("C_PaySelection_ID is mandatory."); +set_ValueNoCheck ("C_PaySelection_ID", new Integer(C_PaySelection_ID)); +} +/** Get Payment Selection. +@return Payment Selection */ +public int getC_PaySelection_ID() +{ +Integer ii = (Integer)get_Value("C_PaySelection_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Difference. +@param DifferenceAmt Difference Amount */ +public void setDifferenceAmt (BigDecimal DifferenceAmt) +{ +if (DifferenceAmt == null) throw new IllegalArgumentException ("DifferenceAmt is mandatory."); +set_ValueNoCheck ("DifferenceAmt", DifferenceAmt); +} +/** Get Difference. +@return Difference Amount */ +public BigDecimal getDifferenceAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DifferenceAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +if (DiscountAmt == null) throw new IllegalArgumentException ("DiscountAmt is mandatory."); +set_ValueNoCheck ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Open Amount. +@param OpenAmt Open item amount */ +public void setOpenAmt (BigDecimal OpenAmt) +{ +if (OpenAmt == null) throw new IllegalArgumentException ("OpenAmt is mandatory."); +set_ValueNoCheck ("OpenAmt", OpenAmt); +} +/** Get Open Amount. +@return Open item amount */ +public BigDecimal getOpenAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OpenAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Payment amount. +@param PayAmt Amount being paid */ +public void setPayAmt (BigDecimal PayAmt) +{ +if (PayAmt == null) throw new IllegalArgumentException ("PayAmt is mandatory."); +set_Value ("PayAmt", PayAmt); +} +/** Get Payment amount. +@return Amount being paid */ +public BigDecimal getPayAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PayAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Payment.java b/dbPort/src/org/compiere/model/X_C_Payment.java new file mode 100644 index 0000000000..d140c8ecbe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Payment.java @@ -0,0 +1,1538 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Payment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.109 */ +public class X_C_Payment extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Payment_ID id +@param trxName transaction +*/ +public X_C_Payment (Properties ctx, int C_Payment_ID, String trxName) +{ +super (ctx, C_Payment_ID, trxName); +/** if (C_Payment_ID == 0) +{ +setC_BPartner_ID (0); +setC_BankAccount_ID (0); +setC_Currency_ID (0); +setC_DocType_ID (0); +setC_Payment_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDateTrx (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsAllocated (false); +setIsApproved (false); // N +setIsDelayedCapture (false); +setIsOnline (false); +setIsOverUnderPayment (false); // N +setIsPrepayment (false); +setIsReceipt (false); +setIsReconciled (false); +setIsSelfService (false); +setPayAmt (Env.ZERO); // 0 +setPosted (false); // N +setProcessed (false); +setTenderType (null); // K +setTrxType (null); // S +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Payment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=335 */ +public static final int Table_ID=335; + +/** TableName=C_Payment */ +public static final String Table_Name="C_Payment"; + +protected static KeyNamePair Model = new KeyNamePair(335,"C_Payment"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Payment[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account City. +@param A_City City or the Credit Card or Account Holder */ +public void setA_City (String A_City) +{ +if (A_City != null && A_City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_City = A_City.substring(0,59); +} +set_Value ("A_City", A_City); +} +/** Get Account City. +@return City or the Credit Card or Account Holder */ +public String getA_City() +{ +return (String)get_Value("A_City"); +} +/** Set Account Country. +@param A_Country Country */ +public void setA_Country (String A_Country) +{ +if (A_Country != null && A_Country.length() > 40) +{ +log.warning("Length > 40 - truncated"); +A_Country = A_Country.substring(0,39); +} +set_Value ("A_Country", A_Country); +} +/** Get Account Country. +@return Country */ +public String getA_Country() +{ +return (String)get_Value("A_Country"); +} +/** Set Account EMail. +@param A_EMail Email Address */ +public void setA_EMail (String A_EMail) +{ +if (A_EMail != null && A_EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_EMail = A_EMail.substring(0,59); +} +set_Value ("A_EMail", A_EMail); +} +/** Get Account EMail. +@return Email Address */ +public String getA_EMail() +{ +return (String)get_Value("A_EMail"); +} +/** Set Driver License. +@param A_Ident_DL Payment Identification - Driver License */ +public void setA_Ident_DL (String A_Ident_DL) +{ +if (A_Ident_DL != null && A_Ident_DL.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Ident_DL = A_Ident_DL.substring(0,19); +} +set_Value ("A_Ident_DL", A_Ident_DL); +} +/** Get Driver License. +@return Payment Identification - Driver License */ +public String getA_Ident_DL() +{ +return (String)get_Value("A_Ident_DL"); +} +/** Set Social Security No. +@param A_Ident_SSN Payment Identification - Social Security No */ +public void setA_Ident_SSN (String A_Ident_SSN) +{ +if (A_Ident_SSN != null && A_Ident_SSN.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Ident_SSN = A_Ident_SSN.substring(0,19); +} +set_Value ("A_Ident_SSN", A_Ident_SSN); +} +/** Get Social Security No. +@return Payment Identification - Social Security No */ +public String getA_Ident_SSN() +{ +return (String)get_Value("A_Ident_SSN"); +} +/** Set Account Name. +@param A_Name Name on Credit Card or Account holder */ +public void setA_Name (String A_Name) +{ +if (A_Name != null && A_Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_Name = A_Name.substring(0,59); +} +set_Value ("A_Name", A_Name); +} +/** Get Account Name. +@return Name on Credit Card or Account holder */ +public String getA_Name() +{ +return (String)get_Value("A_Name"); +} +/** Set Account State. +@param A_State State of the Credit Card or Account holder */ +public void setA_State (String A_State) +{ +if (A_State != null && A_State.length() > 40) +{ +log.warning("Length > 40 - truncated"); +A_State = A_State.substring(0,39); +} +set_Value ("A_State", A_State); +} +/** Get Account State. +@return State of the Credit Card or Account holder */ +public String getA_State() +{ +return (String)get_Value("A_State"); +} +/** Set Account Street. +@param A_Street Street address of the Credit Card or Account holder */ +public void setA_Street (String A_Street) +{ +if (A_Street != null && A_Street.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_Street = A_Street.substring(0,59); +} +set_Value ("A_Street", A_Street); +} +/** Get Account Street. +@return Street address of the Credit Card or Account holder */ +public String getA_Street() +{ +return (String)get_Value("A_Street"); +} +/** Set Account Zip/Postal. +@param A_Zip Zip Code of the Credit Card or Account Holder */ +public void setA_Zip (String A_Zip) +{ +if (A_Zip != null && A_Zip.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Zip = A_Zip.substring(0,19); +} +set_Value ("A_Zip", A_Zip); +} +/** Get Account Zip/Postal. +@return Zip Code of the Credit Card or Account Holder */ +public String getA_Zip() +{ +return (String)get_Value("A_Zip"); +} +/** Set Account No. +@param AccountNo Account Number */ +public void setAccountNo (String AccountNo) +{ +if (AccountNo != null && AccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +AccountNo = AccountNo.substring(0,19); +} +set_Value ("AccountNo", AccountNo); +} +/** Get Account No. +@return Account Number */ +public String getAccountNo() +{ +return (String)get_Value("AccountNo"); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Bank Account. +@param C_BP_BankAccount_ID Bank Account of the Business Partner */ +public void setC_BP_BankAccount_ID (int C_BP_BankAccount_ID) +{ +if (C_BP_BankAccount_ID <= 0) set_Value ("C_BP_BankAccount_ID", null); + else +set_Value ("C_BP_BankAccount_ID", new Integer(C_BP_BankAccount_ID)); +} +/** Get Partner Bank Account. +@return Bank Account of the Business Partner */ +public int getC_BP_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BP_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); + else +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Batch. +@param C_PaymentBatch_ID Payment batch for EFT */ +public void setC_PaymentBatch_ID (int C_PaymentBatch_ID) +{ +if (C_PaymentBatch_ID <= 0) set_Value ("C_PaymentBatch_ID", null); + else +set_Value ("C_PaymentBatch_ID", new Integer(C_PaymentBatch_ID)); +} +/** Get Payment Batch. +@return Payment batch for EFT */ +public int getC_PaymentBatch_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID < 1) throw new IllegalArgumentException ("C_Payment_ID is mandatory."); +set_ValueNoCheck ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Check No. +@param CheckNo Check Number */ +public void setCheckNo (String CheckNo) +{ +if (CheckNo != null && CheckNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CheckNo = CheckNo.substring(0,19); +} +set_Value ("CheckNo", CheckNo); +} +/** Get Check No. +@return Check Number */ +public String getCheckNo() +{ +return (String)get_Value("CheckNo"); +} +/** Set Exp. Month. +@param CreditCardExpMM Expiry Month */ +public void setCreditCardExpMM (int CreditCardExpMM) +{ +set_Value ("CreditCardExpMM", new Integer(CreditCardExpMM)); +} +/** Get Exp. Month. +@return Expiry Month */ +public int getCreditCardExpMM() +{ +Integer ii = (Integer)get_Value("CreditCardExpMM"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Exp. Year. +@param CreditCardExpYY Expiry Year */ +public void setCreditCardExpYY (int CreditCardExpYY) +{ +set_Value ("CreditCardExpYY", new Integer(CreditCardExpYY)); +} +/** Get Exp. Year. +@return Expiry Year */ +public int getCreditCardExpYY() +{ +Integer ii = (Integer)get_Value("CreditCardExpYY"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Number. +@param CreditCardNumber Credit Card Number */ +public void setCreditCardNumber (String CreditCardNumber) +{ +if (CreditCardNumber != null && CreditCardNumber.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CreditCardNumber = CreditCardNumber.substring(0,19); +} +set_Value ("CreditCardNumber", CreditCardNumber); +} +/** Get Number. +@return Credit Card Number */ +public String getCreditCardNumber() +{ +return (String)get_Value("CreditCardNumber"); +} + +/** CreditCardType AD_Reference_ID=149 */ +public static final int CREDITCARDTYPE_AD_Reference_ID=149; +/** Amex = A */ +public static final String CREDITCARDTYPE_Amex = "A"; +/** ATM = C */ +public static final String CREDITCARDTYPE_ATM = "C"; +/** Diners = D */ +public static final String CREDITCARDTYPE_Diners = "D"; +/** MasterCard = M */ +public static final String CREDITCARDTYPE_MasterCard = "M"; +/** Discover = N */ +public static final String CREDITCARDTYPE_Discover = "N"; +/** Purchase Card = P */ +public static final String CREDITCARDTYPE_PurchaseCard = "P"; +/** Visa = V */ +public static final String CREDITCARDTYPE_Visa = "V"; +/** Set Credit Card. +@param CreditCardType Credit Card (Visa, MC, AmEx) */ +public void setCreditCardType (String CreditCardType) +{ +if (CreditCardType == null) throw new IllegalArgumentException ("CreditCardType is mandatory"); +if (CreditCardType == null || CreditCardType.equals("A") || CreditCardType.equals("C") || CreditCardType.equals("D") || CreditCardType.equals("M") || CreditCardType.equals("N") || CreditCardType.equals("P") || CreditCardType.equals("V")); + else throw new IllegalArgumentException ("CreditCardType Invalid value - " + CreditCardType + " - Reference_ID=149 - A - C - D - M - N - P - V"); +if (CreditCardType != null && CreditCardType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreditCardType = CreditCardType.substring(0,0); +} +set_Value ("CreditCardType", CreditCardType); +} +/** Get Credit Card. +@return Credit Card (Visa, MC, AmEx) */ +public String getCreditCardType() +{ +return (String)get_Value("CreditCardType"); +} +/** Set Verification Code. +@param CreditCardVV Credit Card Verification code on credit card */ +public void setCreditCardVV (String CreditCardVV) +{ +if (CreditCardVV != null && CreditCardVV.length() > 4) +{ +log.warning("Length > 4 - truncated"); +CreditCardVV = CreditCardVV.substring(0,3); +} +set_Value ("CreditCardVV", CreditCardVV); +} +/** Get Verification Code. +@return Credit Card Verification code on credit card */ +public String getCreditCardVV() +{ +return (String)get_Value("CreditCardVV"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_Value ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +set_Value ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Allocated. +@param IsAllocated Indicates if the payment has been allocated */ +public void setIsAllocated (boolean IsAllocated) +{ +set_Value ("IsAllocated", new Boolean(IsAllocated)); +} +/** Get Allocated. +@return Indicates if the payment has been allocated */ +public boolean isAllocated() +{ +Object oo = get_Value("IsAllocated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_ValueNoCheck ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Delayed Capture. +@param IsDelayedCapture Charge after Shipment */ +public void setIsDelayedCapture (boolean IsDelayedCapture) +{ +set_Value ("IsDelayedCapture", new Boolean(IsDelayedCapture)); +} +/** Get Delayed Capture. +@return Charge after Shipment */ +public boolean isDelayedCapture() +{ +Object oo = get_Value("IsDelayedCapture"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Online Access. +@param IsOnline Can be accessed online */ +public void setIsOnline (boolean IsOnline) +{ +set_Value ("IsOnline", new Boolean(IsOnline)); +} +/** Get Online Access. +@return Can be accessed online */ +public boolean isOnline() +{ +Object oo = get_Value("IsOnline"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Over/Under Payment. +@param IsOverUnderPayment Over-Payment (unallocated) or Under-Payment (partial payment) */ +public void setIsOverUnderPayment (boolean IsOverUnderPayment) +{ +set_Value ("IsOverUnderPayment", new Boolean(IsOverUnderPayment)); +} +/** Get Over/Under Payment. +@return Over-Payment (unallocated) or Under-Payment (partial payment) */ +public boolean isOverUnderPayment() +{ +Object oo = get_Value("IsOverUnderPayment"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Prepayment. +@param IsPrepayment The Payment/Receipt is a Prepayment */ +public void setIsPrepayment (boolean IsPrepayment) +{ +set_Value ("IsPrepayment", new Boolean(IsPrepayment)); +} +/** Get Prepayment. +@return The Payment/Receipt is a Prepayment */ +public boolean isPrepayment() +{ +Object oo = get_Value("IsPrepayment"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Receipt. +@param IsReceipt This is a sales transaction (receipt) */ +public void setIsReceipt (boolean IsReceipt) +{ +set_Value ("IsReceipt", new Boolean(IsReceipt)); +} +/** Get Receipt. +@return This is a sales transaction (receipt) */ +public boolean isReceipt() +{ +Object oo = get_Value("IsReceipt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reconciled. +@param IsReconciled Payment is reconciled with bank statement */ +public void setIsReconciled (boolean IsReconciled) +{ +set_Value ("IsReconciled", new Boolean(IsReconciled)); +} +/** Get Reconciled. +@return Payment is reconciled with bank statement */ +public boolean isReconciled() +{ +Object oo = get_Value("IsReconciled"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Micr. +@param Micr Combination of routing no, account and check no */ +public void setMicr (String Micr) +{ +if (Micr != null && Micr.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Micr = Micr.substring(0,19); +} +set_Value ("Micr", Micr); +} +/** Get Micr. +@return Combination of routing no, account and check no */ +public String getMicr() +{ +return (String)get_Value("Micr"); +} +/** Set Online Processing. +@param OProcessing This payment can be processed online */ +public void setOProcessing (String OProcessing) +{ +if (OProcessing != null && OProcessing.length() > 1) +{ +log.warning("Length > 1 - truncated"); +OProcessing = OProcessing.substring(0,0); +} +set_Value ("OProcessing", OProcessing); +} +/** Get Online Processing. +@return This payment can be processed online */ +public String getOProcessing() +{ +return (String)get_Value("OProcessing"); +} +/** Set Original Transaction ID. +@param Orig_TrxID Original Transaction ID */ +public void setOrig_TrxID (String Orig_TrxID) +{ +if (Orig_TrxID != null && Orig_TrxID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Orig_TrxID = Orig_TrxID.substring(0,19); +} +set_Value ("Orig_TrxID", Orig_TrxID); +} +/** Get Original Transaction ID. +@return Original Transaction ID */ +public String getOrig_TrxID() +{ +return (String)get_Value("Orig_TrxID"); +} +/** Set Over/Under Payment. +@param OverUnderAmt Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public void setOverUnderAmt (BigDecimal OverUnderAmt) +{ +set_Value ("OverUnderAmt", OverUnderAmt); +} +/** Get Over/Under Payment. +@return Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public BigDecimal getOverUnderAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OverUnderAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set PO Number. +@param PONum Purchase Order Number */ +public void setPONum (String PONum) +{ +if (PONum != null && PONum.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PONum = PONum.substring(0,59); +} +set_Value ("PONum", PONum); +} +/** Get PO Number. +@return Purchase Order Number */ +public String getPONum() +{ +return (String)get_Value("PONum"); +} +/** Set Payment amount. +@param PayAmt Amount being paid */ +public void setPayAmt (BigDecimal PayAmt) +{ +if (PayAmt == null) throw new IllegalArgumentException ("PayAmt is mandatory."); +set_Value ("PayAmt", PayAmt); +} +/** Get Payment amount. +@return Amount being paid */ +public BigDecimal getPayAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PayAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Authorization Code. +@param R_AuthCode Authorization Code returned */ +public void setR_AuthCode (String R_AuthCode) +{ +if (R_AuthCode != null && R_AuthCode.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_AuthCode = R_AuthCode.substring(0,19); +} +set_ValueNoCheck ("R_AuthCode", R_AuthCode); +} +/** Get Authorization Code. +@return Authorization Code returned */ +public String getR_AuthCode() +{ +return (String)get_Value("R_AuthCode"); +} +/** Set Authorization Code (DC). +@param R_AuthCode_DC Authorization Code Delayed Capture returned */ +public void setR_AuthCode_DC (String R_AuthCode_DC) +{ +if (R_AuthCode_DC != null && R_AuthCode_DC.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_AuthCode_DC = R_AuthCode_DC.substring(0,19); +} +set_ValueNoCheck ("R_AuthCode_DC", R_AuthCode_DC); +} +/** Get Authorization Code (DC). +@return Authorization Code Delayed Capture returned */ +public String getR_AuthCode_DC() +{ +return (String)get_Value("R_AuthCode_DC"); +} + +/** R_AvsAddr AD_Reference_ID=213 */ +public static final int R_AVSADDR_AD_Reference_ID=213; +/** No Match = N */ +public static final String R_AVSADDR_NoMatch = "N"; +/** Unavailable = X */ +public static final String R_AVSADDR_Unavailable = "X"; +/** Match = Y */ +public static final String R_AVSADDR_Match = "Y"; +/** Set Address verified. +@param R_AvsAddr This address has been verified */ +public void setR_AvsAddr (String R_AvsAddr) +{ +if (R_AvsAddr == null) throw new IllegalArgumentException ("R_AvsAddr is mandatory"); +if (R_AvsAddr == null || R_AvsAddr.equals("N") || R_AvsAddr.equals("X") || R_AvsAddr.equals("Y")); + else throw new IllegalArgumentException ("R_AvsAddr Invalid value - " + R_AvsAddr + " - Reference_ID=213 - N - X - Y"); +if (R_AvsAddr != null && R_AvsAddr.length() > 1) +{ +log.warning("Length > 1 - truncated"); +R_AvsAddr = R_AvsAddr.substring(0,0); +} +set_ValueNoCheck ("R_AvsAddr", R_AvsAddr); +} +/** Get Address verified. +@return This address has been verified */ +public String getR_AvsAddr() +{ +return (String)get_Value("R_AvsAddr"); +} + +/** R_AvsZip AD_Reference_ID=213 */ +public static final int R_AVSZIP_AD_Reference_ID=213; +/** No Match = N */ +public static final String R_AVSZIP_NoMatch = "N"; +/** Unavailable = X */ +public static final String R_AVSZIP_Unavailable = "X"; +/** Match = Y */ +public static final String R_AVSZIP_Match = "Y"; +/** Set Zip verified. +@param R_AvsZip The Zip Code has been verified */ +public void setR_AvsZip (String R_AvsZip) +{ +if (R_AvsZip == null) throw new IllegalArgumentException ("R_AvsZip is mandatory"); +if (R_AvsZip == null || R_AvsZip.equals("N") || R_AvsZip.equals("X") || R_AvsZip.equals("Y")); + else throw new IllegalArgumentException ("R_AvsZip Invalid value - " + R_AvsZip + " - Reference_ID=213 - N - X - Y"); +if (R_AvsZip != null && R_AvsZip.length() > 1) +{ +log.warning("Length > 1 - truncated"); +R_AvsZip = R_AvsZip.substring(0,0); +} +set_ValueNoCheck ("R_AvsZip", R_AvsZip); +} +/** Get Zip verified. +@return The Zip Code has been verified */ +public String getR_AvsZip() +{ +return (String)get_Value("R_AvsZip"); +} +/** Set CVV Match. +@param R_CVV2Match Credit Card Verification Code Match */ +public void setR_CVV2Match (boolean R_CVV2Match) +{ +set_ValueNoCheck ("R_CVV2Match", new Boolean(R_CVV2Match)); +} +/** Get CVV Match. +@return Credit Card Verification Code Match */ +public boolean isR_CVV2Match() +{ +Object oo = get_Value("R_CVV2Match"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Info. +@param R_Info Response info */ +public void setR_Info (String R_Info) +{ +if (R_Info != null && R_Info.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +R_Info = R_Info.substring(0,1999); +} +set_ValueNoCheck ("R_Info", R_Info); +} +/** Get Info. +@return Response info */ +public String getR_Info() +{ +return (String)get_Value("R_Info"); +} +/** Set Reference. +@param R_PnRef Payment reference */ +public void setR_PnRef (String R_PnRef) +{ +if (R_PnRef != null && R_PnRef.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_PnRef = R_PnRef.substring(0,19); +} +set_ValueNoCheck ("R_PnRef", R_PnRef); +} +/** Get Reference. +@return Payment reference */ +public String getR_PnRef() +{ +return (String)get_Value("R_PnRef"); +} +/** Set Reference (DC). +@param R_PnRef_DC Payment Reference Delayed Capture */ +public void setR_PnRef_DC (String R_PnRef_DC) +{ +if (R_PnRef_DC != null && R_PnRef_DC.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_PnRef_DC = R_PnRef_DC.substring(0,19); +} +set_ValueNoCheck ("R_PnRef_DC", R_PnRef_DC); +} +/** Get Reference (DC). +@return Payment Reference Delayed Capture */ +public String getR_PnRef_DC() +{ +return (String)get_Value("R_PnRef_DC"); +} +/** Set Response Message. +@param R_RespMsg Response message */ +public void setR_RespMsg (String R_RespMsg) +{ +if (R_RespMsg != null && R_RespMsg.length() > 60) +{ +log.warning("Length > 60 - truncated"); +R_RespMsg = R_RespMsg.substring(0,59); +} +set_ValueNoCheck ("R_RespMsg", R_RespMsg); +} +/** Get Response Message. +@return Response message */ +public String getR_RespMsg() +{ +return (String)get_Value("R_RespMsg"); +} +/** Set Result. +@param R_Result Result of transmission */ +public void setR_Result (String R_Result) +{ +if (R_Result != null && R_Result.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_Result = R_Result.substring(0,19); +} +set_ValueNoCheck ("R_Result", R_Result); +} +/** Get Result. +@return Result of transmission */ +public String getR_Result() +{ +return (String)get_Value("R_Result"); +} + +/** Ref_Payment_ID AD_Reference_ID=343 */ +public static final int REF_PAYMENT_ID_AD_Reference_ID=343; +/** Set Referenced Payment. +@param Ref_Payment_ID Referenced Payment */ +public void setRef_Payment_ID (int Ref_Payment_ID) +{ +if (Ref_Payment_ID <= 0) set_ValueNoCheck ("Ref_Payment_ID", null); + else +set_ValueNoCheck ("Ref_Payment_ID", new Integer(Ref_Payment_ID)); +} +/** Get Referenced Payment. +@return Referenced Payment */ +public int getRef_Payment_ID() +{ +Integer ii = (Integer)get_Value("Ref_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Routing No. +@param RoutingNo Bank Routing Number */ +public void setRoutingNo (String RoutingNo) +{ +if (RoutingNo != null && RoutingNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RoutingNo = RoutingNo.substring(0,19); +} +set_Value ("RoutingNo", RoutingNo); +} +/** Get Routing No. +@return Bank Routing Number */ +public String getRoutingNo() +{ +return (String)get_Value("RoutingNo"); +} +/** Set Swipe. +@param Swipe Track 1 and 2 of the Credit Card */ +public void setSwipe (String Swipe) +{ +if (Swipe != null && Swipe.length() > 80) +{ +log.warning("Length > 80 - truncated"); +Swipe = Swipe.substring(0,79); +} +set_ValueNoCheck ("Swipe", Swipe); +} +/** Get Swipe. +@return Track 1 and 2 of the Credit Card */ +public String getSwipe() +{ +return (String)get_Value("Swipe"); +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +set_Value ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** TenderType AD_Reference_ID=214 */ +public static final int TENDERTYPE_AD_Reference_ID=214; +/** Direct Deposit = A */ +public static final String TENDERTYPE_DirectDeposit = "A"; +/** Credit Card = C */ +public static final String TENDERTYPE_CreditCard = "C"; +/** Direct Debit = D */ +public static final String TENDERTYPE_DirectDebit = "D"; +/** Check = K */ +public static final String TENDERTYPE_Check = "K"; +/** Set Tender type. +@param TenderType Method of Payment */ +public void setTenderType (String TenderType) +{ +if (TenderType == null) throw new IllegalArgumentException ("TenderType is mandatory"); +if (TenderType.equals("A") || TenderType.equals("C") || TenderType.equals("D") || TenderType.equals("K")); + else throw new IllegalArgumentException ("TenderType Invalid value - " + TenderType + " - Reference_ID=214 - A - C - D - K"); +if (TenderType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TenderType = TenderType.substring(0,0); +} +set_Value ("TenderType", TenderType); +} +/** Get Tender type. +@return Method of Payment */ +public String getTenderType() +{ +return (String)get_Value("TenderType"); +} + +/** TrxType AD_Reference_ID=215 */ +public static final int TRXTYPE_AD_Reference_ID=215; +/** Authorization = A */ +public static final String TRXTYPE_Authorization = "A"; +/** Credit (Payment) = C */ +public static final String TRXTYPE_CreditPayment = "C"; +/** Delayed Capture = D */ +public static final String TRXTYPE_DelayedCapture = "D"; +/** Voice Authorization = F */ +public static final String TRXTYPE_VoiceAuthorization = "F"; +/** Sales = S */ +public static final String TRXTYPE_Sales = "S"; +/** Void = V */ +public static final String TRXTYPE_Void = "V"; +/** Set Transaction Type. +@param TrxType Type of credit card transaction */ +public void setTrxType (String TrxType) +{ +if (TrxType == null) throw new IllegalArgumentException ("TrxType is mandatory"); +if (TrxType.equals("A") || TrxType.equals("C") || TrxType.equals("D") || TrxType.equals("F") || TrxType.equals("S") || TrxType.equals("V")); + else throw new IllegalArgumentException ("TrxType Invalid value - " + TrxType + " - Reference_ID=215 - A - C - D - F - S - V"); +if (TrxType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TrxType = TrxType.substring(0,0); +} +set_Value ("TrxType", TrxType); +} +/** Get Transaction Type. +@return Type of credit card transaction */ +public String getTrxType() +{ +return (String)get_Value("TrxType"); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Voice authorization code. +@param VoiceAuthCode Voice Authorization Code from credit card company */ +public void setVoiceAuthCode (String VoiceAuthCode) +{ +if (VoiceAuthCode != null && VoiceAuthCode.length() > 20) +{ +log.warning("Length > 20 - truncated"); +VoiceAuthCode = VoiceAuthCode.substring(0,19); +} +set_Value ("VoiceAuthCode", VoiceAuthCode); +} +/** Get Voice authorization code. +@return Voice Authorization Code from credit card company */ +public String getVoiceAuthCode() +{ +return (String)get_Value("VoiceAuthCode"); +} +/** Set Write-off Amount. +@param WriteOffAmt Amount to write-off */ +public void setWriteOffAmt (BigDecimal WriteOffAmt) +{ +set_Value ("WriteOffAmt", WriteOffAmt); +} +/** Get Write-off Amount. +@return Amount to write-off */ +public BigDecimal getWriteOffAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("WriteOffAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaymentAllocate.java b/dbPort/src/org/compiere/model/X_C_PaymentAllocate.java new file mode 100644 index 0000000000..68a095f0b7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaymentAllocate.java @@ -0,0 +1,249 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaymentAllocate + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.218 */ +public class X_C_PaymentAllocate extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaymentAllocate_ID id +@param trxName transaction +*/ +public X_C_PaymentAllocate (Properties ctx, int C_PaymentAllocate_ID, String trxName) +{ +super (ctx, C_PaymentAllocate_ID, trxName); +/** if (C_PaymentAllocate_ID == 0) +{ +setAmount (Env.ZERO); +setC_Invoice_ID (0); +setC_PaymentAllocate_ID (0); +setC_Payment_ID (0); +setDiscountAmt (Env.ZERO); +setOverUnderAmt (Env.ZERO); +setWriteOffAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaymentAllocate (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=812 */ +public static final int Table_ID=812; + +/** TableName=C_PaymentAllocate */ +public static final String Table_Name="C_PaymentAllocate"; + +protected static KeyNamePair Model = new KeyNamePair(812,"C_PaymentAllocate"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaymentAllocate[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amount Amount in a defined currency */ +public void setAmount (BigDecimal Amount) +{ +if (Amount == null) throw new IllegalArgumentException ("Amount is mandatory."); +set_Value ("Amount", Amount); +} +/** Get Amount. +@return Amount in a defined currency */ +public BigDecimal getAmount() +{ +BigDecimal bd = (BigDecimal)get_Value("Amount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Allocation Line. +@param C_AllocationLine_ID Allocation Line */ +public void setC_AllocationLine_ID (int C_AllocationLine_ID) +{ +if (C_AllocationLine_ID <= 0) set_Value ("C_AllocationLine_ID", null); + else +set_Value ("C_AllocationLine_ID", new Integer(C_AllocationLine_ID)); +} +/** Get Allocation Line. +@return Allocation Line */ +public int getC_AllocationLine_ID() +{ +Integer ii = (Integer)get_Value("C_AllocationLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); +} +/** Set Allocate Payment. +@param C_PaymentAllocate_ID Allocate Payment to Invoices */ +public void setC_PaymentAllocate_ID (int C_PaymentAllocate_ID) +{ +if (C_PaymentAllocate_ID < 1) throw new IllegalArgumentException ("C_PaymentAllocate_ID is mandatory."); +set_ValueNoCheck ("C_PaymentAllocate_ID", new Integer(C_PaymentAllocate_ID)); +} +/** Get Allocate Payment. +@return Allocate Payment to Invoices */ +public int getC_PaymentAllocate_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentAllocate_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID < 1) throw new IllegalArgumentException ("C_Payment_ID is mandatory."); +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +if (DiscountAmt == null) throw new IllegalArgumentException ("DiscountAmt is mandatory."); +set_Value ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice Amt. +@param InvoiceAmt Invoice Amt */ +public void setInvoiceAmt (BigDecimal InvoiceAmt) +{ +set_Value ("InvoiceAmt", InvoiceAmt); +} +/** Get Invoice Amt. +@return Invoice Amt */ +public BigDecimal getInvoiceAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoiceAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Over/Under Payment. +@param OverUnderAmt Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public void setOverUnderAmt (BigDecimal OverUnderAmt) +{ +if (OverUnderAmt == null) throw new IllegalArgumentException ("OverUnderAmt is mandatory."); +set_Value ("OverUnderAmt", OverUnderAmt); +} +/** Get Over/Under Payment. +@return Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public BigDecimal getOverUnderAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OverUnderAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Remaining Amt. +@param RemainingAmt Remaining Amount */ +public void setRemainingAmt (BigDecimal RemainingAmt) +{ +throw new IllegalArgumentException ("RemainingAmt is virtual column"); +} +/** Get Remaining Amt. +@return Remaining Amount */ +public BigDecimal getRemainingAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RemainingAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Write-off Amount. +@param WriteOffAmt Amount to write-off */ +public void setWriteOffAmt (BigDecimal WriteOffAmt) +{ +if (WriteOffAmt == null) throw new IllegalArgumentException ("WriteOffAmt is mandatory."); +set_Value ("WriteOffAmt", WriteOffAmt); +} +/** Get Write-off Amount. +@return Amount to write-off */ +public BigDecimal getWriteOffAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("WriteOffAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaymentBatch.java b/dbPort/src/org/compiere/model/X_C_PaymentBatch.java new file mode 100644 index 0000000000..5fa95b11f4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaymentBatch.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaymentBatch + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.218 */ +public class X_C_PaymentBatch extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaymentBatch_ID id +@param trxName transaction +*/ +public X_C_PaymentBatch (Properties ctx, int C_PaymentBatch_ID, String trxName) +{ +super (ctx, C_PaymentBatch_ID, trxName); +/** if (C_PaymentBatch_ID == 0) +{ +setC_PaymentBatch_ID (0); +setC_PaymentProcessor_ID (0); +setName (null); +setProcessed (false); +setProcessing (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaymentBatch (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=411 */ +public static final int Table_ID=411; + +/** TableName=C_PaymentBatch */ +public static final String Table_Name="C_PaymentBatch"; + +protected static KeyNamePair Model = new KeyNamePair(411,"C_PaymentBatch"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaymentBatch[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Payment Batch. +@param C_PaymentBatch_ID Payment batch for EFT */ +public void setC_PaymentBatch_ID (int C_PaymentBatch_ID) +{ +if (C_PaymentBatch_ID < 1) throw new IllegalArgumentException ("C_PaymentBatch_ID is mandatory."); +set_ValueNoCheck ("C_PaymentBatch_ID", new Integer(C_PaymentBatch_ID)); +} +/** Get Payment Batch. +@return Payment batch for EFT */ +public int getC_PaymentBatch_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Processor. +@param C_PaymentProcessor_ID Payment processor for electronic payments */ +public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID) +{ +if (C_PaymentProcessor_ID < 1) throw new IllegalArgumentException ("C_PaymentProcessor_ID is mandatory."); +set_Value ("C_PaymentProcessor_ID", new Integer(C_PaymentProcessor_ID)); +} +/** Get Payment Processor. +@return Payment processor for electronic payments */ +public int getC_PaymentProcessor_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processing date. +@param ProcessingDate Processing date */ +public void setProcessingDate (Timestamp ProcessingDate) +{ +set_Value ("ProcessingDate", ProcessingDate); +} +/** Get Processing date. +@return Processing date */ +public Timestamp getProcessingDate() +{ +return (Timestamp)get_Value("ProcessingDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaymentProcessor.java b/dbPort/src/org/compiere/model/X_C_PaymentProcessor.java new file mode 100644 index 0000000000..481433bd94 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaymentProcessor.java @@ -0,0 +1,639 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaymentProcessor + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.234 */ +public class X_C_PaymentProcessor extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaymentProcessor_ID id +@param trxName transaction +*/ +public X_C_PaymentProcessor (Properties ctx, int C_PaymentProcessor_ID, String trxName) +{ +super (ctx, C_PaymentProcessor_ID, trxName); +/** if (C_PaymentProcessor_ID == 0) +{ +setAcceptAMEX (false); +setAcceptATM (false); +setAcceptCheck (false); +setAcceptCorporate (false); +setAcceptDiners (false); +setAcceptDirectDebit (false); +setAcceptDirectDeposit (false); +setAcceptDiscover (false); +setAcceptMC (false); +setAcceptVisa (false); +setC_BankAccount_ID (0); +setC_PaymentProcessor_ID (0); +setCommission (Env.ZERO); +setCostPerTrx (Env.ZERO); +setHostAddress (null); +setHostPort (0); +setName (null); +setPassword (null); +setRequireVV (false); +setUserID (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaymentProcessor (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=398 */ +public static final int Table_ID=398; + +/** TableName=C_PaymentProcessor */ +public static final String Table_Name="C_PaymentProcessor"; + +protected static KeyNamePair Model = new KeyNamePair(398,"C_PaymentProcessor"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaymentProcessor[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Sequence_ID AD_Reference_ID=128 */ +public static final int AD_SEQUENCE_ID_AD_Reference_ID=128; +/** Set Sequence. +@param AD_Sequence_ID Document Sequence */ +public void setAD_Sequence_ID (int AD_Sequence_ID) +{ +if (AD_Sequence_ID <= 0) set_Value ("AD_Sequence_ID", null); + else +set_Value ("AD_Sequence_ID", new Integer(AD_Sequence_ID)); +} +/** Get Sequence. +@return Document Sequence */ +public int getAD_Sequence_ID() +{ +Integer ii = (Integer)get_Value("AD_Sequence_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accept AMEX. +@param AcceptAMEX Accept American Express Card */ +public void setAcceptAMEX (boolean AcceptAMEX) +{ +set_Value ("AcceptAMEX", new Boolean(AcceptAMEX)); +} +/** Get Accept AMEX. +@return Accept American Express Card */ +public boolean isAcceptAMEX() +{ +Object oo = get_Value("AcceptAMEX"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept ATM. +@param AcceptATM Accept Bank ATM Card */ +public void setAcceptATM (boolean AcceptATM) +{ +set_Value ("AcceptATM", new Boolean(AcceptATM)); +} +/** Get Accept ATM. +@return Accept Bank ATM Card */ +public boolean isAcceptATM() +{ +Object oo = get_Value("AcceptATM"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Electronic Check. +@param AcceptCheck Accept ECheck (Electronic Checks) */ +public void setAcceptCheck (boolean AcceptCheck) +{ +set_Value ("AcceptCheck", new Boolean(AcceptCheck)); +} +/** Get Accept Electronic Check. +@return Accept ECheck (Electronic Checks) */ +public boolean isAcceptCheck() +{ +Object oo = get_Value("AcceptCheck"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Corporate. +@param AcceptCorporate Accept Corporate Purchase Cards */ +public void setAcceptCorporate (boolean AcceptCorporate) +{ +set_Value ("AcceptCorporate", new Boolean(AcceptCorporate)); +} +/** Get Accept Corporate. +@return Accept Corporate Purchase Cards */ +public boolean isAcceptCorporate() +{ +Object oo = get_Value("AcceptCorporate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Diners. +@param AcceptDiners Accept Diner's Club */ +public void setAcceptDiners (boolean AcceptDiners) +{ +set_Value ("AcceptDiners", new Boolean(AcceptDiners)); +} +/** Get Accept Diners. +@return Accept Diner's Club */ +public boolean isAcceptDiners() +{ +Object oo = get_Value("AcceptDiners"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Direct Debit. +@param AcceptDirectDebit Accept Direct Debits (vendor initiated) */ +public void setAcceptDirectDebit (boolean AcceptDirectDebit) +{ +set_Value ("AcceptDirectDebit", new Boolean(AcceptDirectDebit)); +} +/** Get Accept Direct Debit. +@return Accept Direct Debits (vendor initiated) */ +public boolean isAcceptDirectDebit() +{ +Object oo = get_Value("AcceptDirectDebit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Direct Deposit. +@param AcceptDirectDeposit Accept Direct Deposit (payee initiated) */ +public void setAcceptDirectDeposit (boolean AcceptDirectDeposit) +{ +set_Value ("AcceptDirectDeposit", new Boolean(AcceptDirectDeposit)); +} +/** Get Accept Direct Deposit. +@return Accept Direct Deposit (payee initiated) */ +public boolean isAcceptDirectDeposit() +{ +Object oo = get_Value("AcceptDirectDeposit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Discover. +@param AcceptDiscover Accept Discover Card */ +public void setAcceptDiscover (boolean AcceptDiscover) +{ +set_Value ("AcceptDiscover", new Boolean(AcceptDiscover)); +} +/** Get Accept Discover. +@return Accept Discover Card */ +public boolean isAcceptDiscover() +{ +Object oo = get_Value("AcceptDiscover"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept MasterCard. +@param AcceptMC Accept Master Card */ +public void setAcceptMC (boolean AcceptMC) +{ +set_Value ("AcceptMC", new Boolean(AcceptMC)); +} +/** Get Accept MasterCard. +@return Accept Master Card */ +public boolean isAcceptMC() +{ +Object oo = get_Value("AcceptMC"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accept Visa. +@param AcceptVisa Accept Visa Cards */ +public void setAcceptVisa (boolean AcceptVisa) +{ +set_Value ("AcceptVisa", new Boolean(AcceptVisa)); +} +/** Get Accept Visa. +@return Accept Visa Cards */ +public boolean isAcceptVisa() +{ +Object oo = get_Value("AcceptVisa"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID < 1) throw new IllegalArgumentException ("C_BankAccount_ID is mandatory."); +set_ValueNoCheck ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Processor. +@param C_PaymentProcessor_ID Payment processor for electronic payments */ +public void setC_PaymentProcessor_ID (int C_PaymentProcessor_ID) +{ +if (C_PaymentProcessor_ID < 1) throw new IllegalArgumentException ("C_PaymentProcessor_ID is mandatory."); +set_ValueNoCheck ("C_PaymentProcessor_ID", new Integer(C_PaymentProcessor_ID)); +} +/** Get Payment Processor. +@return Payment processor for electronic payments */ +public int getC_PaymentProcessor_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commission %. +@param Commission Commission stated as a percentage */ +public void setCommission (BigDecimal Commission) +{ +if (Commission == null) throw new IllegalArgumentException ("Commission is mandatory."); +set_Value ("Commission", Commission); +} +/** Get Commission %. +@return Commission stated as a percentage */ +public BigDecimal getCommission() +{ +BigDecimal bd = (BigDecimal)get_Value("Commission"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Cost per transaction. +@param CostPerTrx Fixed cost per transaction */ +public void setCostPerTrx (BigDecimal CostPerTrx) +{ +if (CostPerTrx == null) throw new IllegalArgumentException ("CostPerTrx is mandatory."); +set_Value ("CostPerTrx", CostPerTrx); +} +/** Get Cost per transaction. +@return Fixed cost per transaction */ +public BigDecimal getCostPerTrx() +{ +BigDecimal bd = (BigDecimal)get_Value("CostPerTrx"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Host Address. +@param HostAddress Host Address URL or DNS */ +public void setHostAddress (String HostAddress) +{ +if (HostAddress == null) throw new IllegalArgumentException ("HostAddress is mandatory."); +if (HostAddress.length() > 60) +{ +log.warning("Length > 60 - truncated"); +HostAddress = HostAddress.substring(0,59); +} +set_Value ("HostAddress", HostAddress); +} +/** Get Host Address. +@return Host Address URL or DNS */ +public String getHostAddress() +{ +return (String)get_Value("HostAddress"); +} +/** Set Host port. +@param HostPort Host Communication Port */ +public void setHostPort (int HostPort) +{ +set_Value ("HostPort", new Integer(HostPort)); +} +/** Get Host port. +@return Host Communication Port */ +public int getHostPort() +{ +Integer ii = (Integer)get_Value("HostPort"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Minimum Amt. +@param MinimumAmt Minumum Amout in Document Currency */ +public void setMinimumAmt (BigDecimal MinimumAmt) +{ +set_Value ("MinimumAmt", MinimumAmt); +} +/** Get Minimum Amt. +@return Minumum Amout in Document Currency */ +public BigDecimal getMinimumAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("MinimumAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Partner ID. +@param PartnerID Partner ID or Account for the Payment Processor */ +public void setPartnerID (String PartnerID) +{ +if (PartnerID != null && PartnerID.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PartnerID = PartnerID.substring(0,59); +} +set_Value ("PartnerID", PartnerID); +} +/** Get Partner ID. +@return Partner ID or Account for the Payment Processor */ +public String getPartnerID() +{ +return (String)get_Value("PartnerID"); +} +/** Set Password. +@param Password Password of any length (case sensitive) */ +public void setPassword (String Password) +{ +if (Password == null) throw new IllegalArgumentException ("Password is mandatory."); +if (Password.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Password = Password.substring(0,59); +} +set_ValueE ("Password", Password); +} +/** Get Password. +@return Password of any length (case sensitive) */ +public String getPassword() +{ +return (String)get_ValueE("Password"); +} +/** Set Payment Processor Class. +@param PayProcessorClass Payment Processor Java Class */ +public void setPayProcessorClass (String PayProcessorClass) +{ +if (PayProcessorClass != null && PayProcessorClass.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PayProcessorClass = PayProcessorClass.substring(0,59); +} +set_Value ("PayProcessorClass", PayProcessorClass); +} +/** Get Payment Processor Class. +@return Payment Processor Java Class */ +public String getPayProcessorClass() +{ +return (String)get_Value("PayProcessorClass"); +} +/** Set Proxy address. +@param ProxyAddress Address of your proxy server */ +public void setProxyAddress (String ProxyAddress) +{ +if (ProxyAddress != null && ProxyAddress.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProxyAddress = ProxyAddress.substring(0,59); +} +set_Value ("ProxyAddress", ProxyAddress); +} +/** Get Proxy address. +@return Address of your proxy server */ +public String getProxyAddress() +{ +return (String)get_Value("ProxyAddress"); +} +/** Set Proxy logon. +@param ProxyLogon Logon of your proxy server */ +public void setProxyLogon (String ProxyLogon) +{ +if (ProxyLogon != null && ProxyLogon.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProxyLogon = ProxyLogon.substring(0,59); +} +set_Value ("ProxyLogon", ProxyLogon); +} +/** Get Proxy logon. +@return Logon of your proxy server */ +public String getProxyLogon() +{ +return (String)get_Value("ProxyLogon"); +} +/** Set Proxy password. +@param ProxyPassword Password of your proxy server */ +public void setProxyPassword (String ProxyPassword) +{ +if (ProxyPassword != null && ProxyPassword.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProxyPassword = ProxyPassword.substring(0,59); +} +set_ValueE ("ProxyPassword", ProxyPassword); +} +/** Get Proxy password. +@return Password of your proxy server */ +public String getProxyPassword() +{ +return (String)get_ValueE("ProxyPassword"); +} +/** Set Proxy port. +@param ProxyPort Port of your proxy server */ +public void setProxyPort (int ProxyPort) +{ +set_Value ("ProxyPort", new Integer(ProxyPort)); +} +/** Get Proxy port. +@return Port of your proxy server */ +public int getProxyPort() +{ +Integer ii = (Integer)get_Value("ProxyPort"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Require CreditCard Verification Code. +@param RequireVV Require 3/4 digit Credit Verification Code */ +public void setRequireVV (boolean RequireVV) +{ +set_Value ("RequireVV", new Boolean(RequireVV)); +} +/** Get Require CreditCard Verification Code. +@return Require 3/4 digit Credit Verification Code */ +public boolean isRequireVV() +{ +Object oo = get_Value("RequireVV"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set User ID. +@param UserID User ID or account number */ +public void setUserID (String UserID) +{ +if (UserID == null) throw new IllegalArgumentException ("UserID is mandatory."); +if (UserID.length() > 60) +{ +log.warning("Length > 60 - truncated"); +UserID = UserID.substring(0,59); +} +set_Value ("UserID", UserID); +} +/** Get User ID. +@return User ID or account number */ +public String getUserID() +{ +return (String)get_Value("UserID"); +} +/** Set Vendor ID. +@param VendorID Vendor ID for the Payment Processor */ +public void setVendorID (String VendorID) +{ +if (VendorID != null && VendorID.length() > 60) +{ +log.warning("Length > 60 - truncated"); +VendorID = VendorID.substring(0,59); +} +set_Value ("VendorID", VendorID); +} +/** Get Vendor ID. +@return Vendor ID for the Payment Processor */ +public String getVendorID() +{ +return (String)get_Value("VendorID"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PaymentTerm.java b/dbPort/src/org/compiere/model/X_C_PaymentTerm.java new file mode 100644 index 0000000000..c030ffbd88 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PaymentTerm.java @@ -0,0 +1,463 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PaymentTerm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.25 */ +public class X_C_PaymentTerm extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PaymentTerm_ID id +@param trxName transaction +*/ +public X_C_PaymentTerm (Properties ctx, int C_PaymentTerm_ID, String trxName) +{ +super (ctx, C_PaymentTerm_ID, trxName); +/** if (C_PaymentTerm_ID == 0) +{ +setAfterDelivery (false); +setC_PaymentTerm_ID (0); +setDiscount (Env.ZERO); +setDiscount2 (Env.ZERO); +setDiscountDays (0); +setDiscountDays2 (0); +setGraceDays (0); +setIsDueFixed (false); +setIsValid (false); +setName (null); +setNetDays (0); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PaymentTerm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=113 */ +public static final int Table_ID=113; + +/** TableName=C_PaymentTerm */ +public static final String Table_Name="C_PaymentTerm"; + +protected static KeyNamePair Model = new KeyNamePair(113,"C_PaymentTerm"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PaymentTerm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set After Delivery. +@param AfterDelivery Due after delivery rather than after invoicing */ +public void setAfterDelivery (boolean AfterDelivery) +{ +set_Value ("AfterDelivery", new Boolean(AfterDelivery)); +} +/** Get After Delivery. +@return Due after delivery rather than after invoicing */ +public boolean isAfterDelivery() +{ +Object oo = get_Value("AfterDelivery"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_ValueNoCheck ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Discount %. +@param Discount Discount in percent */ +public void setDiscount (BigDecimal Discount) +{ +if (Discount == null) throw new IllegalArgumentException ("Discount is mandatory."); +set_Value ("Discount", Discount); +} +/** Get Discount %. +@return Discount in percent */ +public BigDecimal getDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Discount 2 %. +@param Discount2 Discount in percent */ +public void setDiscount2 (BigDecimal Discount2) +{ +if (Discount2 == null) throw new IllegalArgumentException ("Discount2 is mandatory."); +set_Value ("Discount2", Discount2); +} +/** Get Discount 2 %. +@return Discount in percent */ +public BigDecimal getDiscount2() +{ +BigDecimal bd = (BigDecimal)get_Value("Discount2"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Discount Days. +@param DiscountDays Number of days from invoice date to be eligible for discount */ +public void setDiscountDays (int DiscountDays) +{ +set_Value ("DiscountDays", new Integer(DiscountDays)); +} +/** Get Discount Days. +@return Number of days from invoice date to be eligible for discount */ +public int getDiscountDays() +{ +Integer ii = (Integer)get_Value("DiscountDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount Days 2. +@param DiscountDays2 Number of days from invoice date to be eligible for discount */ +public void setDiscountDays2 (int DiscountDays2) +{ +set_Value ("DiscountDays2", new Integer(DiscountDays2)); +} +/** Get Discount Days 2. +@return Number of days from invoice date to be eligible for discount */ +public int getDiscountDays2() +{ +Integer ii = (Integer)get_Value("DiscountDays2"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Note. +@param DocumentNote Additional information for a Document */ +public void setDocumentNote (String DocumentNote) +{ +if (DocumentNote != null && DocumentNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DocumentNote = DocumentNote.substring(0,1999); +} +set_Value ("DocumentNote", DocumentNote); +} +/** Get Document Note. +@return Additional information for a Document */ +public String getDocumentNote() +{ +return (String)get_Value("DocumentNote"); +} +/** Set Fix month cutoff. +@param FixMonthCutoff Last day to include for next due date */ +public void setFixMonthCutoff (int FixMonthCutoff) +{ +set_Value ("FixMonthCutoff", new Integer(FixMonthCutoff)); +} +/** Get Fix month cutoff. +@return Last day to include for next due date */ +public int getFixMonthCutoff() +{ +Integer ii = (Integer)get_Value("FixMonthCutoff"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Fix month day. +@param FixMonthDay Day of the month of the due date */ +public void setFixMonthDay (int FixMonthDay) +{ +set_Value ("FixMonthDay", new Integer(FixMonthDay)); +} +/** Get Fix month day. +@return Day of the month of the due date */ +public int getFixMonthDay() +{ +Integer ii = (Integer)get_Value("FixMonthDay"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Fix month offset. +@param FixMonthOffset Number of months (0=same, 1=following) */ +public void setFixMonthOffset (int FixMonthOffset) +{ +set_Value ("FixMonthOffset", new Integer(FixMonthOffset)); +} +/** Get Fix month offset. +@return Number of months (0=same, 1=following) */ +public int getFixMonthOffset() +{ +Integer ii = (Integer)get_Value("FixMonthOffset"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Grace Days. +@param GraceDays Days after due date to send first dunning letter */ +public void setGraceDays (int GraceDays) +{ +set_Value ("GraceDays", new Integer(GraceDays)); +} +/** Get Grace Days. +@return Days after due date to send first dunning letter */ +public int getGraceDays() +{ +Integer ii = (Integer)get_Value("GraceDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Fixed due date. +@param IsDueFixed Payment is due on a fixed date */ +public void setIsDueFixed (boolean IsDueFixed) +{ +set_Value ("IsDueFixed", new Boolean(IsDueFixed)); +} +/** Get Fixed due date. +@return Payment is due on a fixed date */ +public boolean isDueFixed() +{ +Object oo = get_Value("IsDueFixed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Next Business Day. +@param IsNextBusinessDay Payment due on the next business day */ +public void setIsNextBusinessDay (boolean IsNextBusinessDay) +{ +set_Value ("IsNextBusinessDay", new Boolean(IsNextBusinessDay)); +} +/** Get Next Business Day. +@return Payment due on the next business day */ +public boolean isNextBusinessDay() +{ +Object oo = get_Value("IsNextBusinessDay"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** NetDay AD_Reference_ID=167 */ +public static final int NETDAY_AD_Reference_ID=167; +/** Monday = 1 */ +public static final String NETDAY_Monday = "1"; +/** Tuesday = 2 */ +public static final String NETDAY_Tuesday = "2"; +/** Wednesday = 3 */ +public static final String NETDAY_Wednesday = "3"; +/** Thursday = 4 */ +public static final String NETDAY_Thursday = "4"; +/** Friday = 5 */ +public static final String NETDAY_Friday = "5"; +/** Saturday = 6 */ +public static final String NETDAY_Saturday = "6"; +/** Sunday = 7 */ +public static final String NETDAY_Sunday = "7"; +/** Set Net Day. +@param NetDay Day when payment is due net */ +public void setNetDay (String NetDay) +{ +if (NetDay == null) throw new IllegalArgumentException ("NetDay is mandatory"); +if (NetDay == null || NetDay.equals("1") || NetDay.equals("2") || NetDay.equals("3") || NetDay.equals("4") || NetDay.equals("5") || NetDay.equals("6") || NetDay.equals("7")); + else throw new IllegalArgumentException ("NetDay Invalid value - " + NetDay + " - Reference_ID=167 - 1 - 2 - 3 - 4 - 5 - 6 - 7"); +if (NetDay != null && NetDay.length() > 1) +{ +log.warning("Length > 1 - truncated"); +NetDay = NetDay.substring(0,0); +} +set_Value ("NetDay", NetDay); +} +/** Get Net Day. +@return Day when payment is due net */ +public String getNetDay() +{ +return (String)get_Value("NetDay"); +} +/** Set Net Days. +@param NetDays Net Days in which payment is due */ +public void setNetDays (int NetDays) +{ +set_Value ("NetDays", new Integer(NetDays)); +} +/** Get Net Days. +@return Net Days in which payment is due */ +public int getNetDays() +{ +Integer ii = (Integer)get_Value("NetDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Period.java b/dbPort/src/org/compiere/model/X_C_Period.java new file mode 100644 index 0000000000..185b08f74f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Period.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Period + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.281 */ +public class X_C_Period extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Period_ID id +@param trxName transaction +*/ +public X_C_Period (Properties ctx, int C_Period_ID, String trxName) +{ +super (ctx, C_Period_ID, trxName); +/** if (C_Period_ID == 0) +{ +setC_Period_ID (0); +setC_Year_ID (0); +setName (null); +setPeriodNo (0); +setPeriodType (null); // S +setStartDate (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Period (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=145 */ +public static final int Table_ID=145; + +/** TableName=C_Period */ +public static final String Table_Name="C_Period"; + +protected static KeyNamePair Model = new KeyNamePair(145,"C_Period"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Period[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID < 1) throw new IllegalArgumentException ("C_Period_ID is mandatory."); +set_ValueNoCheck ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Year. +@param C_Year_ID Calendar Year */ +public void setC_Year_ID (int C_Year_ID) +{ +if (C_Year_ID < 1) throw new IllegalArgumentException ("C_Year_ID is mandatory."); +set_ValueNoCheck ("C_Year_ID", new Integer(C_Year_ID)); +} +/** Get Year. +@return Calendar Year */ +public int getC_Year_ID() +{ +Integer ii = (Integer)get_Value("C_Year_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set End Date. +@param EndDate Last effective date (inclusive) */ +public void setEndDate (Timestamp EndDate) +{ +set_Value ("EndDate", EndDate); +} +/** Get End Date. +@return Last effective date (inclusive) */ +public Timestamp getEndDate() +{ +return (Timestamp)get_Value("EndDate"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Period No. +@param PeriodNo Unique Period Number */ +public void setPeriodNo (int PeriodNo) +{ +set_Value ("PeriodNo", new Integer(PeriodNo)); +} +/** Get Period No. +@return Unique Period Number */ +public int getPeriodNo() +{ +Integer ii = (Integer)get_Value("PeriodNo"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PeriodType AD_Reference_ID=115 */ +public static final int PERIODTYPE_AD_Reference_ID=115; +/** Adjustment Period = A */ +public static final String PERIODTYPE_AdjustmentPeriod = "A"; +/** Standard Calendar Period = S */ +public static final String PERIODTYPE_StandardCalendarPeriod = "S"; +/** Set Period Type. +@param PeriodType Period Type */ +public void setPeriodType (String PeriodType) +{ +if (PeriodType == null) throw new IllegalArgumentException ("PeriodType is mandatory"); +if (PeriodType.equals("A") || PeriodType.equals("S")); + else throw new IllegalArgumentException ("PeriodType Invalid value - " + PeriodType + " - Reference_ID=115 - A - S"); +if (PeriodType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PeriodType = PeriodType.substring(0,0); +} +set_ValueNoCheck ("PeriodType", PeriodType); +} +/** Get Period Type. +@return Period Type */ +public String getPeriodType() +{ +return (String)get_Value("PeriodType"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +if (StartDate == null) throw new IllegalArgumentException ("StartDate is mandatory."); +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_PeriodControl.java b/dbPort/src/org/compiere/model/X_C_PeriodControl.java new file mode 100644 index 0000000000..4ca8a13e6c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_PeriodControl.java @@ -0,0 +1,276 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_PeriodControl + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.281 */ +public class X_C_PeriodControl extends PO +{ +/** Standard Constructor +@param ctx context +@param C_PeriodControl_ID id +@param trxName transaction +*/ +public X_C_PeriodControl (Properties ctx, int C_PeriodControl_ID, String trxName) +{ +super (ctx, C_PeriodControl_ID, trxName); +/** if (C_PeriodControl_ID == 0) +{ +setC_PeriodControl_ID (0); +setC_Period_ID (0); +setDocBaseType (null); +setPeriodAction (null); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_PeriodControl (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=229 */ +public static final int Table_ID=229; + +/** TableName=C_PeriodControl */ +public static final String Table_Name="C_PeriodControl"; + +protected static KeyNamePair Model = new KeyNamePair(229,"C_PeriodControl"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_PeriodControl[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Period Control. +@param C_PeriodControl_ID Period Control */ +public void setC_PeriodControl_ID (int C_PeriodControl_ID) +{ +if (C_PeriodControl_ID < 1) throw new IllegalArgumentException ("C_PeriodControl_ID is mandatory."); +set_ValueNoCheck ("C_PeriodControl_ID", new Integer(C_PeriodControl_ID)); +} +/** Get Period Control. +@return Period Control */ +public int getC_PeriodControl_ID() +{ +Integer ii = (Integer)get_Value("C_PeriodControl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_PeriodControl_ID())); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID < 1) throw new IllegalArgumentException ("C_Period_ID is mandatory."); +set_ValueNoCheck ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** DocBaseType AD_Reference_ID=183 */ +public static final int DOCBASETYPE_AD_Reference_ID=183; +/** AP Credit Memo = APC */ +public static final String DOCBASETYPE_APCreditMemo = "APC"; +/** AP Invoice = API */ +public static final String DOCBASETYPE_APInvoice = "API"; +/** AP Payment = APP */ +public static final String DOCBASETYPE_APPayment = "APP"; +/** AR Credit Memo = ARC */ +public static final String DOCBASETYPE_ARCreditMemo = "ARC"; +/** AR Pro Forma Invoice = ARF */ +public static final String DOCBASETYPE_ARProFormaInvoice = "ARF"; +/** AR Invoice = ARI */ +public static final String DOCBASETYPE_ARInvoice = "ARI"; +/** AR Receipt = ARR */ +public static final String DOCBASETYPE_ARReceipt = "ARR"; +/** Payment Allocation = CMA */ +public static final String DOCBASETYPE_PaymentAllocation = "CMA"; +/** Bank Statement = CMB */ +public static final String DOCBASETYPE_BankStatement = "CMB"; +/** Cash Journal = CMC */ +public static final String DOCBASETYPE_CashJournal = "CMC"; +/** GL Document = GLD */ +public static final String DOCBASETYPE_GLDocument = "GLD"; +/** GL Journal = GLJ */ +public static final String DOCBASETYPE_GLJournal = "GLJ"; +/** Material Physical Inventory = MMI */ +public static final String DOCBASETYPE_MaterialPhysicalInventory = "MMI"; +/** Material Movement = MMM */ +public static final String DOCBASETYPE_MaterialMovement = "MMM"; +/** Material Production = MMP */ +public static final String DOCBASETYPE_MaterialProduction = "MMP"; +/** Material Receipt = MMR */ +public static final String DOCBASETYPE_MaterialReceipt = "MMR"; +/** Material Delivery = MMS */ +public static final String DOCBASETYPE_MaterialDelivery = "MMS"; +/** Match Invoice = MXI */ +public static final String DOCBASETYPE_MatchInvoice = "MXI"; +/** Match PO = MXP */ +public static final String DOCBASETYPE_MatchPO = "MXP"; +/** Project Issue = PJI */ +public static final String DOCBASETYPE_ProjectIssue = "PJI"; +/** Purchase Order = POO */ +public static final String DOCBASETYPE_PurchaseOrder = "POO"; +/** Purchase Requisition = POR */ +public static final String DOCBASETYPE_PurchaseRequisition = "POR"; +/** Sales Order = SOO */ +public static final String DOCBASETYPE_SalesOrder = "SOO"; +/** Set Document BaseType. +@param DocBaseType Logical type of document */ +public void setDocBaseType (String DocBaseType) +{ +if (DocBaseType == null) throw new IllegalArgumentException ("DocBaseType is mandatory"); +if (DocBaseType.equals("APC") || DocBaseType.equals("API") || DocBaseType.equals("APP") || DocBaseType.equals("ARC") || DocBaseType.equals("ARF") || DocBaseType.equals("ARI") || DocBaseType.equals("ARR") || DocBaseType.equals("CMA") || DocBaseType.equals("CMB") || DocBaseType.equals("CMC") || DocBaseType.equals("GLD") || DocBaseType.equals("GLJ") || DocBaseType.equals("MMI") || DocBaseType.equals("MMM") || DocBaseType.equals("MMP") || DocBaseType.equals("MMR") || DocBaseType.equals("MMS") || DocBaseType.equals("MXI") || DocBaseType.equals("MXP") || DocBaseType.equals("PJI") || DocBaseType.equals("POO") || DocBaseType.equals("POR") || DocBaseType.equals("SOO")); + else throw new IllegalArgumentException ("DocBaseType Invalid value - " + DocBaseType + " - Reference_ID=183 - APC - API - APP - ARC - ARF - ARI - ARR - CMA - CMB - CMC - GLD - GLJ - MMI - MMM - MMP - MMR - MMS - MXI - MXP - PJI - POO - POR - SOO"); +if (DocBaseType.length() > 3) +{ +log.warning("Length > 3 - truncated"); +DocBaseType = DocBaseType.substring(0,2); +} +set_ValueNoCheck ("DocBaseType", DocBaseType); +} +/** Get Document BaseType. +@return Logical type of document */ +public String getDocBaseType() +{ +return (String)get_Value("DocBaseType"); +} + +/** PeriodAction AD_Reference_ID=176 */ +public static final int PERIODACTION_AD_Reference_ID=176; +/** Close Period = C */ +public static final String PERIODACTION_ClosePeriod = "C"; +/** = N */ +public static final String PERIODACTION_NoAction = "N"; +/** Open Period = O */ +public static final String PERIODACTION_OpenPeriod = "O"; +/** Permanently Close Period = P */ +public static final String PERIODACTION_PermanentlyClosePeriod = "P"; +/** Set Period Action. +@param PeriodAction Action taken for this period */ +public void setPeriodAction (String PeriodAction) +{ +if (PeriodAction == null) throw new IllegalArgumentException ("PeriodAction is mandatory"); +if (PeriodAction.equals("C") || PeriodAction.equals("N") || PeriodAction.equals("O") || PeriodAction.equals("P")); + else throw new IllegalArgumentException ("PeriodAction Invalid value - " + PeriodAction + " - Reference_ID=176 - C - N - O - P"); +if (PeriodAction.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PeriodAction = PeriodAction.substring(0,0); +} +set_Value ("PeriodAction", PeriodAction); +} +/** Get Period Action. +@return Action taken for this period */ +public String getPeriodAction() +{ +return (String)get_Value("PeriodAction"); +} + +/** PeriodStatus AD_Reference_ID=177 */ +public static final int PERIODSTATUS_AD_Reference_ID=177; +/** Closed = C */ +public static final String PERIODSTATUS_Closed = "C"; +/** Never opened = N */ +public static final String PERIODSTATUS_NeverOpened = "N"; +/** Open = O */ +public static final String PERIODSTATUS_Open = "O"; +/** Permanently closed = P */ +public static final String PERIODSTATUS_PermanentlyClosed = "P"; +/** Set Period Status. +@param PeriodStatus Current state of this period */ +public void setPeriodStatus (String PeriodStatus) +{ +if (PeriodStatus == null) throw new IllegalArgumentException ("PeriodStatus is mandatory"); +if (PeriodStatus == null || PeriodStatus.equals("C") || PeriodStatus.equals("N") || PeriodStatus.equals("O") || PeriodStatus.equals("P")); + else throw new IllegalArgumentException ("PeriodStatus Invalid value - " + PeriodStatus + " - Reference_ID=177 - C - N - O - P"); +if (PeriodStatus != null && PeriodStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PeriodStatus = PeriodStatus.substring(0,0); +} +set_ValueNoCheck ("PeriodStatus", PeriodStatus); +} +/** Get Period Status. +@return Current state of this period */ +public String getPeriodStatus() +{ +return (String)get_Value("PeriodStatus"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Phase.java b/dbPort/src/org/compiere/model/X_C_Phase.java new file mode 100644 index 0000000000..6c82af8410 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Phase.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Phase + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.296 */ +public class X_C_Phase extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Phase_ID id +@param trxName transaction +*/ +public X_C_Phase (Properties ctx, int C_Phase_ID, String trxName) +{ +super (ctx, C_Phase_ID, trxName); +/** if (C_Phase_ID == 0) +{ +setC_Phase_ID (0); +setC_ProjectType_ID (0); +setName (null); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM C_Phase WHERE C_ProjectType_ID=@C_ProjectType_ID@ +setStandardQty (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Phase (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=577 */ +public static final int Table_ID=577; + +/** TableName=C_Phase */ +public static final String Table_Name="C_Phase"; + +protected static KeyNamePair Model = new KeyNamePair(577,"C_Phase"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Phase[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Standard Phase. +@param C_Phase_ID Standard Phase of the Project Type */ +public void setC_Phase_ID (int C_Phase_ID) +{ +if (C_Phase_ID < 1) throw new IllegalArgumentException ("C_Phase_ID is mandatory."); +set_ValueNoCheck ("C_Phase_ID", new Integer(C_Phase_ID)); +} +/** Get Standard Phase. +@return Standard Phase of the Project Type */ +public int getC_Phase_ID() +{ +Integer ii = (Integer)get_Value("C_Phase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Type. +@param C_ProjectType_ID Type of the project */ +public void setC_ProjectType_ID (int C_ProjectType_ID) +{ +if (C_ProjectType_ID < 1) throw new IllegalArgumentException ("C_ProjectType_ID is mandatory."); +set_ValueNoCheck ("C_ProjectType_ID", new Integer(C_ProjectType_ID)); +} +/** Get Project Type. +@return Type of the project */ +public int getC_ProjectType_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Quantity. +@param StandardQty Standard Quantity */ +public void setStandardQty (BigDecimal StandardQty) +{ +if (StandardQty == null) throw new IllegalArgumentException ("StandardQty is mandatory."); +set_Value ("StandardQty", StandardQty); +} +/** Get Standard Quantity. +@return Standard Quantity */ +public BigDecimal getStandardQty() +{ +BigDecimal bd = (BigDecimal)get_Value("StandardQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Project.java b/dbPort/src/org/compiere/model/X_C_Project.java new file mode 100644 index 0000000000..956cca0f13 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Project.java @@ -0,0 +1,772 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Project + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.312 */ +public class X_C_Project extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Project_ID id +@param trxName transaction +*/ +public X_C_Project (Properties ctx, int C_Project_ID, String trxName) +{ +super (ctx, C_Project_ID, trxName); +/** if (C_Project_ID == 0) +{ +setC_Currency_ID (0); +setC_Project_ID (0); +setCommittedAmt (Env.ZERO); +setCommittedQty (Env.ZERO); +setInvoicedAmt (Env.ZERO); +setInvoicedQty (Env.ZERO); +setIsCommitCeiling (false); +setIsCommitment (false); +setIsSummary (false); +setName (null); +setPlannedAmt (Env.ZERO); +setPlannedMarginAmt (Env.ZERO); +setPlannedQty (Env.ZERO); +setProcessed (false); +setProjInvoiceRule (null); // - +setProjectBalanceAmt (Env.ZERO); +setProjectLineLevel (null); // P +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Project (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=203 */ +public static final int Table_ID=203; + +/** TableName=C_Project */ +public static final String Table_Name="C_Project"; + +protected static KeyNamePair Model = new KeyNamePair(203,"C_Project"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Project[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_BPartnerSR_ID AD_Reference_ID=353 */ +public static final int C_BPARTNERSR_ID_AD_Reference_ID=353; +/** Set BPartner (Agent). +@param C_BPartnerSR_ID Business Partner (Agent or Sales Rep) */ +public void setC_BPartnerSR_ID (int C_BPartnerSR_ID) +{ +if (C_BPartnerSR_ID <= 0) set_Value ("C_BPartnerSR_ID", null); + else +set_Value ("C_BPartnerSR_ID", new Integer(C_BPartnerSR_ID)); +} +/** Get BPartner (Agent). +@return Business Partner (Agent or Sales Rep) */ +public int getC_BPartnerSR_ID() +{ +Integer ii = (Integer)get_Value("C_BPartnerSR_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID <= 0) set_Value ("C_PaymentTerm_ID", null); + else +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Phase. +@param C_Phase_ID Standard Phase of the Project Type */ +public void setC_Phase_ID (int C_Phase_ID) +{ +if (C_Phase_ID <= 0) set_Value ("C_Phase_ID", null); + else +set_Value ("C_Phase_ID", new Integer(C_Phase_ID)); +} +/** Get Standard Phase. +@return Standard Phase of the Project Type */ +public int getC_Phase_ID() +{ +Integer ii = (Integer)get_Value("C_Phase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Type. +@param C_ProjectType_ID Type of the project */ +public void setC_ProjectType_ID (String C_ProjectType_ID) +{ +if (C_ProjectType_ID != null && C_ProjectType_ID.length() > 22) +{ +log.warning("Length > 22 - truncated"); +C_ProjectType_ID = C_ProjectType_ID.substring(0,21); +} +set_Value ("C_ProjectType_ID", C_ProjectType_ID); +} +/** Get Project Type. +@return Type of the project */ +public String getC_ProjectType_ID() +{ +return (String)get_Value("C_ProjectType_ID"); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID < 1) throw new IllegalArgumentException ("C_Project_ID is mandatory."); +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Committed Amount. +@param CommittedAmt The (legal) commitment amount */ +public void setCommittedAmt (BigDecimal CommittedAmt) +{ +if (CommittedAmt == null) throw new IllegalArgumentException ("CommittedAmt is mandatory."); +set_Value ("CommittedAmt", CommittedAmt); +} +/** Get Committed Amount. +@return The (legal) commitment amount */ +public BigDecimal getCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Committed Quantity. +@param CommittedQty The (legal) commitment Quantity */ +public void setCommittedQty (BigDecimal CommittedQty) +{ +if (CommittedQty == null) throw new IllegalArgumentException ("CommittedQty is mandatory."); +set_Value ("CommittedQty", CommittedQty); +} +/** Get Committed Quantity. +@return The (legal) commitment Quantity */ +public BigDecimal getCommittedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Copy From. +@param CopyFrom Copy From Record */ +public void setCopyFrom (String CopyFrom) +{ +if (CopyFrom != null && CopyFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CopyFrom = CopyFrom.substring(0,0); +} +set_Value ("CopyFrom", CopyFrom); +} +/** Get Copy From. +@return Copy From Record */ +public String getCopyFrom() +{ +return (String)get_Value("CopyFrom"); +} +/** Set Contract Date. +@param DateContract The (planned) effective date of this document. */ +public void setDateContract (Timestamp DateContract) +{ +set_Value ("DateContract", DateContract); +} +/** Get Contract Date. +@return The (planned) effective date of this document. */ +public Timestamp getDateContract() +{ +return (Timestamp)get_Value("DateContract"); +} +/** Set Finish Date. +@param DateFinish Finish or (planned) completion date */ +public void setDateFinish (Timestamp DateFinish) +{ +set_Value ("DateFinish", DateFinish); +} +/** Get Finish Date. +@return Finish or (planned) completion date */ +public Timestamp getDateFinish() +{ +return (Timestamp)get_Value("DateFinish"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Generate To. +@param GenerateTo Generate To */ +public void setGenerateTo (String GenerateTo) +{ +if (GenerateTo != null && GenerateTo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateTo = GenerateTo.substring(0,0); +} +set_Value ("GenerateTo", GenerateTo); +} +/** Get Generate To. +@return Generate To */ +public String getGenerateTo() +{ +return (String)get_Value("GenerateTo"); +} +/** Set Invoiced Amount. +@param InvoicedAmt The amount invoiced */ +public void setInvoicedAmt (BigDecimal InvoicedAmt) +{ +if (InvoicedAmt == null) throw new IllegalArgumentException ("InvoicedAmt is mandatory."); +set_ValueNoCheck ("InvoicedAmt", InvoicedAmt); +} +/** Get Invoiced Amount. +@return The amount invoiced */ +public BigDecimal getInvoicedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoicedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Invoiced . +@param InvoicedQty The quantity invoiced */ +public void setInvoicedQty (BigDecimal InvoicedQty) +{ +if (InvoicedQty == null) throw new IllegalArgumentException ("InvoicedQty is mandatory."); +set_ValueNoCheck ("InvoicedQty", InvoicedQty); +} +/** Get Quantity Invoiced . +@return The quantity invoiced */ +public BigDecimal getInvoicedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoicedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Commitment is Ceiling. +@param IsCommitCeiling The commitment amount/quantity is the chargeable ceiling */ +public void setIsCommitCeiling (boolean IsCommitCeiling) +{ +set_Value ("IsCommitCeiling", new Boolean(IsCommitCeiling)); +} +/** Get Commitment is Ceiling. +@return The commitment amount/quantity is the chargeable ceiling */ +public boolean isCommitCeiling() +{ +Object oo = get_Value("IsCommitCeiling"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Commitment. +@param IsCommitment Is this document a (legal) commitment? */ +public void setIsCommitment (boolean IsCommitment) +{ +set_Value ("IsCommitment", new Boolean(IsCommitment)); +} +/** Get Commitment. +@return Is this document a (legal) commitment? */ +public boolean isCommitment() +{ +Object oo = get_Value("IsCommitment"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List Version. +@param M_PriceList_Version_ID Identifies a unique instance of a Price List */ +public void setM_PriceList_Version_ID (int M_PriceList_Version_ID) +{ +if (M_PriceList_Version_ID <= 0) set_Value ("M_PriceList_Version_ID", null); + else +set_Value ("M_PriceList_Version_ID", new Integer(M_PriceList_Version_ID)); +} +/** Get Price List Version. +@return Identifies a unique instance of a Price List */ +public int getM_PriceList_Version_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_Version_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID <= 0) set_Value ("M_Warehouse_ID", null); + else +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Note = Note.substring(0,1999); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Order Reference. +@param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} +/** Get Order Reference. +@return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public String getPOReference() +{ +return (String)get_Value("POReference"); +} +/** Set Planned Amount. +@param PlannedAmt Planned amount for this project */ +public void setPlannedAmt (BigDecimal PlannedAmt) +{ +if (PlannedAmt == null) throw new IllegalArgumentException ("PlannedAmt is mandatory."); +set_Value ("PlannedAmt", PlannedAmt); +} +/** Get Planned Amount. +@return Planned amount for this project */ +public BigDecimal getPlannedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Planned Margin. +@param PlannedMarginAmt Project's planned margin amount */ +public void setPlannedMarginAmt (BigDecimal PlannedMarginAmt) +{ +if (PlannedMarginAmt == null) throw new IllegalArgumentException ("PlannedMarginAmt is mandatory."); +set_Value ("PlannedMarginAmt", PlannedMarginAmt); +} +/** Get Planned Margin. +@return Project's planned margin amount */ +public BigDecimal getPlannedMarginAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedMarginAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Planned Quantity. +@param PlannedQty Planned quantity for this project */ +public void setPlannedQty (BigDecimal PlannedQty) +{ +if (PlannedQty == null) throw new IllegalArgumentException ("PlannedQty is mandatory."); +set_Value ("PlannedQty", PlannedQty); +} +/** Get Planned Quantity. +@return Planned quantity for this project */ +public BigDecimal getPlannedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** ProjInvoiceRule AD_Reference_ID=383 */ +public static final int PROJINVOICERULE_AD_Reference_ID=383; +/** None = - */ +public static final String PROJINVOICERULE_None = "-"; +/** Committed Amount = C */ +public static final String PROJINVOICERULE_CommittedAmount = "C"; +/** Product Quantity = P */ +public static final String PROJINVOICERULE_ProductQuantity = "P"; +/** Time&Material = T */ +public static final String PROJINVOICERULE_TimeMaterial = "T"; +/** Time&Material max Comitted = c */ +public static final String PROJINVOICERULE_TimeMaterialMaxComitted = "c"; +/** Set Invoice Rule. +@param ProjInvoiceRule Invoice Rule for the project */ +public void setProjInvoiceRule (String ProjInvoiceRule) +{ +if (ProjInvoiceRule == null) throw new IllegalArgumentException ("ProjInvoiceRule is mandatory"); +if (ProjInvoiceRule.equals("-") || ProjInvoiceRule.equals("C") || ProjInvoiceRule.equals("P") || ProjInvoiceRule.equals("T") || ProjInvoiceRule.equals("c")); + else throw new IllegalArgumentException ("ProjInvoiceRule Invalid value - " + ProjInvoiceRule + " - Reference_ID=383 - - - C - P - T - c"); +if (ProjInvoiceRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProjInvoiceRule = ProjInvoiceRule.substring(0,0); +} +set_Value ("ProjInvoiceRule", ProjInvoiceRule); +} +/** Get Invoice Rule. +@return Invoice Rule for the project */ +public String getProjInvoiceRule() +{ +return (String)get_Value("ProjInvoiceRule"); +} +/** Set Project Balance. +@param ProjectBalanceAmt Total Project Balance */ +public void setProjectBalanceAmt (BigDecimal ProjectBalanceAmt) +{ +if (ProjectBalanceAmt == null) throw new IllegalArgumentException ("ProjectBalanceAmt is mandatory."); +set_ValueNoCheck ("ProjectBalanceAmt", ProjectBalanceAmt); +} +/** Get Project Balance. +@return Total Project Balance */ +public BigDecimal getProjectBalanceAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ProjectBalanceAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** ProjectCategory AD_Reference_ID=288 */ +public static final int PROJECTCATEGORY_AD_Reference_ID=288; +/** Asset Project = A */ +public static final String PROJECTCATEGORY_AssetProject = "A"; +/** General = N */ +public static final String PROJECTCATEGORY_General = "N"; +/** Service (Charge) Project = S */ +public static final String PROJECTCATEGORY_ServiceChargeProject = "S"; +/** Work Order (Job) = W */ +public static final String PROJECTCATEGORY_WorkOrderJob = "W"; +/** Set Project Category. +@param ProjectCategory Project Category */ +public void setProjectCategory (String ProjectCategory) +{ +if (ProjectCategory == null) throw new IllegalArgumentException ("ProjectCategory is mandatory"); +if (ProjectCategory == null || ProjectCategory.equals("A") || ProjectCategory.equals("N") || ProjectCategory.equals("S") || ProjectCategory.equals("W")); + else throw new IllegalArgumentException ("ProjectCategory Invalid value - " + ProjectCategory + " - Reference_ID=288 - A - N - S - W"); +if (ProjectCategory != null && ProjectCategory.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProjectCategory = ProjectCategory.substring(0,0); +} +set_Value ("ProjectCategory", ProjectCategory); +} +/** Get Project Category. +@return Project Category */ +public String getProjectCategory() +{ +return (String)get_Value("ProjectCategory"); +} + +/** ProjectLineLevel AD_Reference_ID=384 */ +public static final int PROJECTLINELEVEL_AD_Reference_ID=384; +/** Phase = A */ +public static final String PROJECTLINELEVEL_Phase = "A"; +/** Project = P */ +public static final String PROJECTLINELEVEL_Project = "P"; +/** Task = T */ +public static final String PROJECTLINELEVEL_Task = "T"; +/** Set Line Level. +@param ProjectLineLevel Project Line Level */ +public void setProjectLineLevel (String ProjectLineLevel) +{ +if (ProjectLineLevel == null) throw new IllegalArgumentException ("ProjectLineLevel is mandatory"); +if (ProjectLineLevel.equals("A") || ProjectLineLevel.equals("P") || ProjectLineLevel.equals("T")); + else throw new IllegalArgumentException ("ProjectLineLevel Invalid value - " + ProjectLineLevel + " - Reference_ID=384 - A - P - T"); +if (ProjectLineLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProjectLineLevel = ProjectLineLevel.substring(0,0); +} +set_Value ("ProjectLineLevel", ProjectLineLevel); +} +/** Get Line Level. +@return Project Line Level */ +public String getProjectLineLevel() +{ +return (String)get_Value("ProjectLineLevel"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ProjectIssue.java b/dbPort/src/org/compiere/model/X_C_ProjectIssue.java new file mode 100644 index 0000000000..eaf6a641d1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ProjectIssue.java @@ -0,0 +1,323 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ProjectIssue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.343 */ +public class X_C_ProjectIssue extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ProjectIssue_ID id +@param trxName transaction +*/ +public X_C_ProjectIssue (Properties ctx, int C_ProjectIssue_ID, String trxName) +{ +super (ctx, C_ProjectIssue_ID, trxName); +/** if (C_ProjectIssue_ID == 0) +{ +setC_ProjectIssue_ID (0); +setC_Project_ID (0); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_ProjectIssue WHERE C_Project_ID=@C_Project_ID@ +setM_AttributeSetInstance_ID (0); +setM_Locator_ID (0); +setM_Product_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); +setMovementQty (Env.ZERO); +setPosted (false); // N +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ProjectIssue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=623 */ +public static final int Table_ID=623; + +/** TableName=C_ProjectIssue */ +public static final String Table_Name="C_ProjectIssue"; + +protected static KeyNamePair Model = new KeyNamePair(623,"C_ProjectIssue"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ProjectIssue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Project Issue. +@param C_ProjectIssue_ID Project Issues (Material, Labor) */ +public void setC_ProjectIssue_ID (int C_ProjectIssue_ID) +{ +if (C_ProjectIssue_ID < 1) throw new IllegalArgumentException ("C_ProjectIssue_ID is mandatory."); +set_ValueNoCheck ("C_ProjectIssue_ID", new Integer(C_ProjectIssue_ID)); +} +/** Get Project Issue. +@return Project Issues (Material, Labor) */ +public int getC_ProjectIssue_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectIssue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID < 1) throw new IllegalArgumentException ("C_Project_ID is mandatory."); +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Project_ID())); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_Value ("M_InOutLine_ID", null); + else +set_Value ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Expense Line. +@param S_TimeExpenseLine_ID Time and Expense Report Line */ +public void setS_TimeExpenseLine_ID (int S_TimeExpenseLine_ID) +{ +if (S_TimeExpenseLine_ID <= 0) set_Value ("S_TimeExpenseLine_ID", null); + else +set_Value ("S_TimeExpenseLine_ID", new Integer(S_TimeExpenseLine_ID)); +} +/** Get Expense Line. +@return Time and Expense Report Line */ +public int getS_TimeExpenseLine_ID() +{ +Integer ii = (Integer)get_Value("S_TimeExpenseLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ProjectIssueMA.java b/dbPort/src/org/compiere/model/X_C_ProjectIssueMA.java new file mode 100644 index 0000000000..d8dfffdf80 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ProjectIssueMA.java @@ -0,0 +1,141 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ProjectIssueMA + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.359 */ +public class X_C_ProjectIssueMA extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ProjectIssueMA_ID id +@param trxName transaction +*/ +public X_C_ProjectIssueMA (Properties ctx, int C_ProjectIssueMA_ID, String trxName) +{ +super (ctx, C_ProjectIssueMA_ID, trxName); +/** if (C_ProjectIssueMA_ID == 0) +{ +setC_ProjectIssue_ID (0); +setM_AttributeSetInstance_ID (0); +setMovementQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ProjectIssueMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=761 */ +public static final int Table_ID=761; + +/** TableName=C_ProjectIssueMA */ +public static final String Table_Name="C_ProjectIssueMA"; + +protected static KeyNamePair Model = new KeyNamePair(761,"C_ProjectIssueMA"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ProjectIssueMA[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Project Issue. +@param C_ProjectIssue_ID Project Issues (Material, Labor) */ +public void setC_ProjectIssue_ID (int C_ProjectIssue_ID) +{ +if (C_ProjectIssue_ID < 1) throw new IllegalArgumentException ("C_ProjectIssue_ID is mandatory."); +set_ValueNoCheck ("C_ProjectIssue_ID", new Integer(C_ProjectIssue_ID)); +} +/** Get Project Issue. +@return Project Issues (Material, Labor) */ +public int getC_ProjectIssue_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectIssue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_ProjectIssue_ID())); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ProjectLine.java b/dbPort/src/org/compiere/model/X_C_ProjectLine.java new file mode 100644 index 0000000000..bbfd375ed7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ProjectLine.java @@ -0,0 +1,451 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ProjectLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.375 */ +public class X_C_ProjectLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ProjectLine_ID id +@param trxName transaction +*/ +public X_C_ProjectLine (Properties ctx, int C_ProjectLine_ID, String trxName) +{ +super (ctx, C_ProjectLine_ID, trxName); +/** if (C_ProjectLine_ID == 0) +{ +setC_ProjectLine_ID (0); +setC_Project_ID (0); +setInvoicedAmt (Env.ZERO); +setInvoicedQty (Env.ZERO); // 0 +setIsPrinted (true); // Y +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_ProjectLine WHERE C_Project_ID=@C_Project_ID@ +setPlannedAmt (Env.ZERO); +setPlannedMarginAmt (Env.ZERO); +setPlannedPrice (Env.ZERO); +setPlannedQty (Env.ZERO); // 1 +setProcessed (false); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ProjectLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=434 */ +public static final int Table_ID=434; + +/** TableName=C_ProjectLine */ +public static final String Table_Name="C_ProjectLine"; + +protected static KeyNamePair Model = new KeyNamePair(434,"C_ProjectLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ProjectLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** C_OrderPO_ID AD_Reference_ID=290 */ +public static final int C_ORDERPO_ID_AD_Reference_ID=290; +/** Set Purchase Order. +@param C_OrderPO_ID Purchase Order */ +public void setC_OrderPO_ID (int C_OrderPO_ID) +{ +if (C_OrderPO_ID <= 0) set_ValueNoCheck ("C_OrderPO_ID", null); + else +set_ValueNoCheck ("C_OrderPO_ID", new Integer(C_OrderPO_ID)); +} +/** Get Purchase Order. +@return Purchase Order */ +public int getC_OrderPO_ID() +{ +Integer ii = (Integer)get_Value("C_OrderPO_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Issue. +@param C_ProjectIssue_ID Project Issues (Material, Labor) */ +public void setC_ProjectIssue_ID (int C_ProjectIssue_ID) +{ +if (C_ProjectIssue_ID <= 0) set_ValueNoCheck ("C_ProjectIssue_ID", null); + else +set_ValueNoCheck ("C_ProjectIssue_ID", new Integer(C_ProjectIssue_ID)); +} +/** Get Project Issue. +@return Project Issues (Material, Labor) */ +public int getC_ProjectIssue_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectIssue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Line. +@param C_ProjectLine_ID Task or step in a project */ +public void setC_ProjectLine_ID (int C_ProjectLine_ID) +{ +if (C_ProjectLine_ID < 1) throw new IllegalArgumentException ("C_ProjectLine_ID is mandatory."); +set_ValueNoCheck ("C_ProjectLine_ID", new Integer(C_ProjectLine_ID)); +} +/** Get Project Line. +@return Task or step in a project */ +public int getC_ProjectLine_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_Value ("C_ProjectPhase_ID", null); + else +set_Value ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_Value ("C_ProjectTask_ID", null); + else +set_Value ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID < 1) throw new IllegalArgumentException ("C_Project_ID is mandatory."); +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Committed Amount. +@param CommittedAmt The (legal) commitment amount */ +public void setCommittedAmt (BigDecimal CommittedAmt) +{ +set_Value ("CommittedAmt", CommittedAmt); +} +/** Get Committed Amount. +@return The (legal) commitment amount */ +public BigDecimal getCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Committed Quantity. +@param CommittedQty The (legal) commitment Quantity */ +public void setCommittedQty (BigDecimal CommittedQty) +{ +set_Value ("CommittedQty", CommittedQty); +} +/** Get Committed Quantity. +@return The (legal) commitment Quantity */ +public BigDecimal getCommittedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Pricing. +@param DoPricing Pricing */ +public void setDoPricing (String DoPricing) +{ +if (DoPricing != null && DoPricing.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DoPricing = DoPricing.substring(0,0); +} +set_Value ("DoPricing", DoPricing); +} +/** Get Pricing. +@return Pricing */ +public String getDoPricing() +{ +return (String)get_Value("DoPricing"); +} +/** Set Invoiced Amount. +@param InvoicedAmt The amount invoiced */ +public void setInvoicedAmt (BigDecimal InvoicedAmt) +{ +if (InvoicedAmt == null) throw new IllegalArgumentException ("InvoicedAmt is mandatory."); +set_Value ("InvoicedAmt", InvoicedAmt); +} +/** Get Invoiced Amount. +@return The amount invoiced */ +public BigDecimal getInvoicedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoicedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Invoiced . +@param InvoicedQty The quantity invoiced */ +public void setInvoicedQty (BigDecimal InvoicedQty) +{ +if (InvoicedQty == null) throw new IllegalArgumentException ("InvoicedQty is mandatory."); +set_Value ("InvoicedQty", InvoicedQty); +} +/** Get Quantity Invoiced . +@return The quantity invoiced */ +public BigDecimal getInvoicedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoicedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Planned Amount. +@param PlannedAmt Planned amount for this project */ +public void setPlannedAmt (BigDecimal PlannedAmt) +{ +if (PlannedAmt == null) throw new IllegalArgumentException ("PlannedAmt is mandatory."); +set_Value ("PlannedAmt", PlannedAmt); +} +/** Get Planned Amount. +@return Planned amount for this project */ +public BigDecimal getPlannedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Planned Margin. +@param PlannedMarginAmt Project's planned margin amount */ +public void setPlannedMarginAmt (BigDecimal PlannedMarginAmt) +{ +if (PlannedMarginAmt == null) throw new IllegalArgumentException ("PlannedMarginAmt is mandatory."); +set_Value ("PlannedMarginAmt", PlannedMarginAmt); +} +/** Get Planned Margin. +@return Project's planned margin amount */ +public BigDecimal getPlannedMarginAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedMarginAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Planned Price. +@param PlannedPrice Planned price for this project line */ +public void setPlannedPrice (BigDecimal PlannedPrice) +{ +if (PlannedPrice == null) throw new IllegalArgumentException ("PlannedPrice is mandatory."); +set_Value ("PlannedPrice", PlannedPrice); +} +/** Get Planned Price. +@return Planned price for this project line */ +public BigDecimal getPlannedPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Planned Quantity. +@param PlannedQty Planned quantity for this project */ +public void setPlannedQty (BigDecimal PlannedQty) +{ +if (PlannedQty == null) throw new IllegalArgumentException ("PlannedQty is mandatory."); +set_Value ("PlannedQty", PlannedQty); +} +/** Get Planned Quantity. +@return Planned quantity for this project */ +public BigDecimal getPlannedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ProjectPhase.java b/dbPort/src/org/compiere/model/X_C_ProjectPhase.java new file mode 100644 index 0000000000..9e91da4596 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ProjectPhase.java @@ -0,0 +1,416 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ProjectPhase + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.39 */ +public class X_C_ProjectPhase extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ProjectPhase_ID id +@param trxName transaction +*/ +public X_C_ProjectPhase (Properties ctx, int C_ProjectPhase_ID, String trxName) +{ +super (ctx, C_ProjectPhase_ID, trxName); +/** if (C_ProjectPhase_ID == 0) +{ +setC_ProjectPhase_ID (0); +setC_Project_ID (0); +setCommittedAmt (Env.ZERO); +setIsCommitCeiling (false); +setIsComplete (false); +setName (null); +setPlannedAmt (Env.ZERO); +setProjInvoiceRule (null); // @ProjInvoiceRule@ +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM C_ProjectPhase WHERE C_Project_ID=@C_Project_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ProjectPhase (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=576 */ +public static final int Table_ID=576; + +/** TableName=C_ProjectPhase */ +public static final String Table_Name="C_ProjectPhase"; + +protected static KeyNamePair Model = new KeyNamePair(576,"C_ProjectPhase"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ProjectPhase[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Phase. +@param C_Phase_ID Standard Phase of the Project Type */ +public void setC_Phase_ID (int C_Phase_ID) +{ +if (C_Phase_ID <= 0) set_ValueNoCheck ("C_Phase_ID", null); + else +set_ValueNoCheck ("C_Phase_ID", new Integer(C_Phase_ID)); +} +/** Get Standard Phase. +@return Standard Phase of the Project Type */ +public int getC_Phase_ID() +{ +Integer ii = (Integer)get_Value("C_Phase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID < 1) throw new IllegalArgumentException ("C_ProjectPhase_ID is mandatory."); +set_ValueNoCheck ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID < 1) throw new IllegalArgumentException ("C_Project_ID is mandatory."); +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Committed Amount. +@param CommittedAmt The (legal) commitment amount */ +public void setCommittedAmt (BigDecimal CommittedAmt) +{ +if (CommittedAmt == null) throw new IllegalArgumentException ("CommittedAmt is mandatory."); +set_Value ("CommittedAmt", CommittedAmt); +} +/** Get Committed Amount. +@return The (legal) commitment amount */ +public BigDecimal getCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set End Date. +@param EndDate Last effective date (inclusive) */ +public void setEndDate (Timestamp EndDate) +{ +set_Value ("EndDate", EndDate); +} +/** Get End Date. +@return Last effective date (inclusive) */ +public Timestamp getEndDate() +{ +return (Timestamp)get_Value("EndDate"); +} +/** Set Generate Order. +@param GenerateOrder Generate Order */ +public void setGenerateOrder (String GenerateOrder) +{ +if (GenerateOrder != null && GenerateOrder.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateOrder = GenerateOrder.substring(0,0); +} +set_Value ("GenerateOrder", GenerateOrder); +} +/** Get Generate Order. +@return Generate Order */ +public String getGenerateOrder() +{ +return (String)get_Value("GenerateOrder"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Commitment is Ceiling. +@param IsCommitCeiling The commitment amount/quantity is the chargeable ceiling */ +public void setIsCommitCeiling (boolean IsCommitCeiling) +{ +set_Value ("IsCommitCeiling", new Boolean(IsCommitCeiling)); +} +/** Get Commitment is Ceiling. +@return The commitment amount/quantity is the chargeable ceiling */ +public boolean isCommitCeiling() +{ +Object oo = get_Value("IsCommitCeiling"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Complete. +@param IsComplete It is complete */ +public void setIsComplete (boolean IsComplete) +{ +set_Value ("IsComplete", new Boolean(IsComplete)); +} +/** Get Complete. +@return It is complete */ +public boolean isComplete() +{ +Object oo = get_Value("IsComplete"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Planned Amount. +@param PlannedAmt Planned amount for this project */ +public void setPlannedAmt (BigDecimal PlannedAmt) +{ +if (PlannedAmt == null) throw new IllegalArgumentException ("PlannedAmt is mandatory."); +set_Value ("PlannedAmt", PlannedAmt); +} +/** Get Planned Amount. +@return Planned amount for this project */ +public BigDecimal getPlannedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Unit Price. +@param PriceActual Actual Price */ +public void setPriceActual (BigDecimal PriceActual) +{ +set_Value ("PriceActual", PriceActual); +} +/** Get Unit Price. +@return Actual Price */ +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** ProjInvoiceRule AD_Reference_ID=383 */ +public static final int PROJINVOICERULE_AD_Reference_ID=383; +/** None = - */ +public static final String PROJINVOICERULE_None = "-"; +/** Committed Amount = C */ +public static final String PROJINVOICERULE_CommittedAmount = "C"; +/** Product Quantity = P */ +public static final String PROJINVOICERULE_ProductQuantity = "P"; +/** Time&Material = T */ +public static final String PROJINVOICERULE_TimeMaterial = "T"; +/** Time&Material max Comitted = c */ +public static final String PROJINVOICERULE_TimeMaterialMaxComitted = "c"; +/** Set Invoice Rule. +@param ProjInvoiceRule Invoice Rule for the project */ +public void setProjInvoiceRule (String ProjInvoiceRule) +{ +if (ProjInvoiceRule == null) throw new IllegalArgumentException ("ProjInvoiceRule is mandatory"); +if (ProjInvoiceRule.equals("-") || ProjInvoiceRule.equals("C") || ProjInvoiceRule.equals("P") || ProjInvoiceRule.equals("T") || ProjInvoiceRule.equals("c")); + else throw new IllegalArgumentException ("ProjInvoiceRule Invalid value - " + ProjInvoiceRule + " - Reference_ID=383 - - - C - P - T - c"); +if (ProjInvoiceRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProjInvoiceRule = ProjInvoiceRule.substring(0,0); +} +set_Value ("ProjInvoiceRule", ProjInvoiceRule); +} +/** Get Invoice Rule. +@return Invoice Rule for the project */ +public String getProjInvoiceRule() +{ +return (String)get_Value("ProjInvoiceRule"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ProjectTask.java b/dbPort/src/org/compiere/model/X_C_ProjectTask.java new file mode 100644 index 0000000000..5db684ea95 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ProjectTask.java @@ -0,0 +1,307 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ProjectTask + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.406 */ +public class X_C_ProjectTask extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ProjectTask_ID id +@param trxName transaction +*/ +public X_C_ProjectTask (Properties ctx, int C_ProjectTask_ID, String trxName) +{ +super (ctx, C_ProjectTask_ID, trxName); +/** if (C_ProjectTask_ID == 0) +{ +setC_ProjectPhase_ID (0); +setC_ProjectTask_ID (0); +setCommittedAmt (Env.ZERO); +setName (null); +setPlannedAmt (Env.ZERO); +setProjInvoiceRule (null); // @ProjInvoiceRule@ +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM C_ProjectTask WHERE C_ProjectPhase_ID=@C_ProjectPhase_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ProjectTask (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=584 */ +public static final int Table_ID=584; + +/** TableName=C_ProjectTask */ +public static final String Table_Name="C_ProjectTask"; + +protected static KeyNamePair Model = new KeyNamePair(584,"C_ProjectTask"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ProjectTask[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID < 1) throw new IllegalArgumentException ("C_ProjectPhase_ID is mandatory."); +set_ValueNoCheck ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID < 1) throw new IllegalArgumentException ("C_ProjectTask_ID is mandatory."); +set_ValueNoCheck ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Task. +@param C_Task_ID Standard Project Type Task */ +public void setC_Task_ID (int C_Task_ID) +{ +if (C_Task_ID <= 0) set_ValueNoCheck ("C_Task_ID", null); + else +set_ValueNoCheck ("C_Task_ID", new Integer(C_Task_ID)); +} +/** Get Standard Task. +@return Standard Project Type Task */ +public int getC_Task_ID() +{ +Integer ii = (Integer)get_Value("C_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Committed Amount. +@param CommittedAmt The (legal) commitment amount */ +public void setCommittedAmt (BigDecimal CommittedAmt) +{ +if (CommittedAmt == null) throw new IllegalArgumentException ("CommittedAmt is mandatory."); +set_Value ("CommittedAmt", CommittedAmt); +} +/** Get Committed Amount. +@return The (legal) commitment amount */ +public BigDecimal getCommittedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CommittedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Planned Amount. +@param PlannedAmt Planned amount for this project */ +public void setPlannedAmt (BigDecimal PlannedAmt) +{ +if (PlannedAmt == null) throw new IllegalArgumentException ("PlannedAmt is mandatory."); +set_Value ("PlannedAmt", PlannedAmt); +} +/** Get Planned Amount. +@return Planned amount for this project */ +public BigDecimal getPlannedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** ProjInvoiceRule AD_Reference_ID=383 */ +public static final int PROJINVOICERULE_AD_Reference_ID=383; +/** None = - */ +public static final String PROJINVOICERULE_None = "-"; +/** Committed Amount = C */ +public static final String PROJINVOICERULE_CommittedAmount = "C"; +/** Product Quantity = P */ +public static final String PROJINVOICERULE_ProductQuantity = "P"; +/** Time&Material = T */ +public static final String PROJINVOICERULE_TimeMaterial = "T"; +/** Time&Material max Comitted = c */ +public static final String PROJINVOICERULE_TimeMaterialMaxComitted = "c"; +/** Set Invoice Rule. +@param ProjInvoiceRule Invoice Rule for the project */ +public void setProjInvoiceRule (String ProjInvoiceRule) +{ +if (ProjInvoiceRule == null) throw new IllegalArgumentException ("ProjInvoiceRule is mandatory"); +if (ProjInvoiceRule.equals("-") || ProjInvoiceRule.equals("C") || ProjInvoiceRule.equals("P") || ProjInvoiceRule.equals("T") || ProjInvoiceRule.equals("c")); + else throw new IllegalArgumentException ("ProjInvoiceRule Invalid value - " + ProjInvoiceRule + " - Reference_ID=383 - - - C - P - T - c"); +if (ProjInvoiceRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProjInvoiceRule = ProjInvoiceRule.substring(0,0); +} +set_Value ("ProjInvoiceRule", ProjInvoiceRule); +} +/** Get Invoice Rule. +@return Invoice Rule for the project */ +public String getProjInvoiceRule() +{ +return (String)get_Value("ProjInvoiceRule"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ProjectType.java b/dbPort/src/org/compiere/model/X_C_ProjectType.java new file mode 100644 index 0000000000..3394c05a2c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ProjectType.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ProjectType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.437 */ +public class X_C_ProjectType extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ProjectType_ID id +@param trxName transaction +*/ +public X_C_ProjectType (Properties ctx, int C_ProjectType_ID, String trxName) +{ +super (ctx, C_ProjectType_ID, trxName); +/** if (C_ProjectType_ID == 0) +{ +setC_ProjectType_ID (0); +setName (null); +setProjectCategory (null); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ProjectType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=575 */ +public static final int Table_ID=575; + +/** TableName=C_ProjectType */ +public static final String Table_Name="C_ProjectType"; + +protected static KeyNamePair Model = new KeyNamePair(575,"C_ProjectType"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ProjectType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Project Type. +@param C_ProjectType_ID Type of the project */ +public void setC_ProjectType_ID (int C_ProjectType_ID) +{ +if (C_ProjectType_ID < 1) throw new IllegalArgumentException ("C_ProjectType_ID is mandatory."); +set_ValueNoCheck ("C_ProjectType_ID", new Integer(C_ProjectType_ID)); +} +/** Get Project Type. +@return Type of the project */ +public int getC_ProjectType_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** ProjectCategory AD_Reference_ID=288 */ +public static final int PROJECTCATEGORY_AD_Reference_ID=288; +/** Asset Project = A */ +public static final String PROJECTCATEGORY_AssetProject = "A"; +/** General = N */ +public static final String PROJECTCATEGORY_General = "N"; +/** Service (Charge) Project = S */ +public static final String PROJECTCATEGORY_ServiceChargeProject = "S"; +/** Work Order (Job) = W */ +public static final String PROJECTCATEGORY_WorkOrderJob = "W"; +/** Set Project Category. +@param ProjectCategory Project Category */ +public void setProjectCategory (String ProjectCategory) +{ +if (ProjectCategory == null) throw new IllegalArgumentException ("ProjectCategory is mandatory"); +if (ProjectCategory.equals("A") || ProjectCategory.equals("N") || ProjectCategory.equals("S") || ProjectCategory.equals("W")); + else throw new IllegalArgumentException ("ProjectCategory Invalid value - " + ProjectCategory + " - Reference_ID=288 - A - N - S - W"); +if (ProjectCategory.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProjectCategory = ProjectCategory.substring(0,0); +} +set_ValueNoCheck ("ProjectCategory", ProjectCategory); +} +/** Get Project Category. +@return Project Category */ +public String getProjectCategory() +{ +return (String)get_Value("ProjectCategory"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Project_Acct.java b/dbPort/src/org/compiere/model/X_C_Project_Acct.java new file mode 100644 index 0000000000..ee26062281 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Project_Acct.java @@ -0,0 +1,149 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Project_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.437 */ +public class X_C_Project_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Project_Acct_ID id +@param trxName transaction +*/ +public X_C_Project_Acct (Properties ctx, int C_Project_Acct_ID, String trxName) +{ +super (ctx, C_Project_Acct_ID, trxName); +/** if (C_Project_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Project_ID (0); +setPJ_Asset_Acct (0); +setPJ_WIP_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Project_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=204 */ +public static final int Table_ID=204; + +/** TableName=C_Project_Acct */ +public static final String Table_Name="C_Project_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(204,"C_Project_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Project_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID < 1) throw new IllegalArgumentException ("C_Project_ID is mandatory."); +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Asset. +@param PJ_Asset_Acct Project Asset Account */ +public void setPJ_Asset_Acct (int PJ_Asset_Acct) +{ +set_Value ("PJ_Asset_Acct", new Integer(PJ_Asset_Acct)); +} +/** Get Project Asset. +@return Project Asset Account */ +public int getPJ_Asset_Acct() +{ +Integer ii = (Integer)get_Value("PJ_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Work In Progress. +@param PJ_WIP_Acct Account for Work in Progress */ +public void setPJ_WIP_Acct (int PJ_WIP_Acct) +{ +set_Value ("PJ_WIP_Acct", new Integer(PJ_WIP_Acct)); +} +/** Get Work In Progress. +@return Account for Work in Progress */ +public int getPJ_WIP_Acct() +{ +Integer ii = (Integer)get_Value("PJ_WIP_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Recurring.java b/dbPort/src/org/compiere/model/X_C_Recurring.java new file mode 100644 index 0000000000..807d7bd275 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Recurring.java @@ -0,0 +1,394 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Recurring + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.453 */ +public class X_C_Recurring extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Recurring_ID id +@param trxName transaction +*/ +public X_C_Recurring (Properties ctx, int C_Recurring_ID, String trxName) +{ +super (ctx, C_Recurring_ID, trxName); +/** if (C_Recurring_ID == 0) +{ +setC_Recurring_ID (0); +setDateNextRun (new Timestamp(System.currentTimeMillis())); +setFrequencyType (null); // M +setName (null); +setRecurringType (null); +setRunsMax (0); +setRunsRemaining (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Recurring (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=574 */ +public static final int Table_ID=574; + +/** TableName=C_Recurring */ +public static final String Table_Name="C_Recurring"; + +protected static KeyNamePair Model = new KeyNamePair(574,"C_Recurring"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Recurring[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Recurring. +@param C_Recurring_ID Recurring Document */ +public void setC_Recurring_ID (int C_Recurring_ID) +{ +if (C_Recurring_ID < 1) throw new IllegalArgumentException ("C_Recurring_ID is mandatory."); +set_ValueNoCheck ("C_Recurring_ID", new Integer(C_Recurring_ID)); +} +/** Get Recurring. +@return Recurring Document */ +public int getC_Recurring_ID() +{ +Integer ii = (Integer)get_Value("C_Recurring_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_ValueNoCheck ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +if (DateNextRun == null) throw new IllegalArgumentException ("DateNextRun is mandatory."); +set_Value ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=283 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=283; +/** Daily = D */ +public static final String FREQUENCYTYPE_Daily = "D"; +/** Monthly = M */ +public static final String FREQUENCYTYPE_Monthly = "M"; +/** Quarterly = Q */ +public static final String FREQUENCYTYPE_Quarterly = "Q"; +/** Weekly = W */ +public static final String FREQUENCYTYPE_Weekly = "W"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("M") || FrequencyType.equals("Q") || FrequencyType.equals("W")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=283 - D - M - Q - W"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Journal Batch. +@param GL_JournalBatch_ID General Ledger Journal Batch */ +public void setGL_JournalBatch_ID (int GL_JournalBatch_ID) +{ +if (GL_JournalBatch_ID <= 0) set_Value ("GL_JournalBatch_ID", null); + else +set_Value ("GL_JournalBatch_ID", new Integer(GL_JournalBatch_ID)); +} +/** Get Journal Batch. +@return General Ledger Journal Batch */ +public int getGL_JournalBatch_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** RecurringType AD_Reference_ID=282 */ +public static final int RECURRINGTYPE_AD_Reference_ID=282; +/** GL Journal = G */ +public static final String RECURRINGTYPE_GLJournal = "G"; +/** Invoice = I */ +public static final String RECURRINGTYPE_Invoice = "I"; +/** Project = J */ +public static final String RECURRINGTYPE_Project = "J"; +/** Order = O */ +public static final String RECURRINGTYPE_Order = "O"; +/** Set Recurring Type. +@param RecurringType Type of Recurring Document */ +public void setRecurringType (String RecurringType) +{ +if (RecurringType == null) throw new IllegalArgumentException ("RecurringType is mandatory"); +if (RecurringType.equals("G") || RecurringType.equals("I") || RecurringType.equals("J") || RecurringType.equals("O")); + else throw new IllegalArgumentException ("RecurringType Invalid value - " + RecurringType + " - Reference_ID=282 - G - I - J - O"); +if (RecurringType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RecurringType = RecurringType.substring(0,0); +} +set_Value ("RecurringType", RecurringType); +} +/** Get Recurring Type. +@return Type of Recurring Document */ +public String getRecurringType() +{ +return (String)get_Value("RecurringType"); +} +/** Set Maximum Runs. +@param RunsMax Number of recurring runs */ +public void setRunsMax (int RunsMax) +{ +set_Value ("RunsMax", new Integer(RunsMax)); +} +/** Get Maximum Runs. +@return Number of recurring runs */ +public int getRunsMax() +{ +Integer ii = (Integer)get_Value("RunsMax"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Remaining Runs. +@param RunsRemaining Number of recurring runs remaining */ +public void setRunsRemaining (int RunsRemaining) +{ +set_ValueNoCheck ("RunsRemaining", new Integer(RunsRemaining)); +} +/** Get Remaining Runs. +@return Number of recurring runs remaining */ +public int getRunsRemaining() +{ +Integer ii = (Integer)get_Value("RunsRemaining"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Recurring_Run.java b/dbPort/src/org/compiere/model/X_C_Recurring_Run.java new file mode 100644 index 0000000000..bf74868903 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Recurring_Run.java @@ -0,0 +1,211 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Recurring_Run + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.468 */ +public class X_C_Recurring_Run extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Recurring_Run_ID id +@param trxName transaction +*/ +public X_C_Recurring_Run (Properties ctx, int C_Recurring_Run_ID, String trxName) +{ +super (ctx, C_Recurring_Run_ID, trxName); +/** if (C_Recurring_Run_ID == 0) +{ +setC_Recurring_ID (0); +setC_Recurring_Run_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Recurring_Run (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=573 */ +public static final int Table_ID=573; + +/** TableName=C_Recurring_Run */ +public static final String Table_Name="C_Recurring_Run"; + +protected static KeyNamePair Model = new KeyNamePair(573,"C_Recurring_Run"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Recurring_Run[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_ValueNoCheck ("C_Payment_ID", null); + else +set_ValueNoCheck ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_ValueNoCheck ("C_Project_ID", null); + else +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Recurring. +@param C_Recurring_ID Recurring Document */ +public void setC_Recurring_ID (int C_Recurring_ID) +{ +if (C_Recurring_ID < 1) throw new IllegalArgumentException ("C_Recurring_ID is mandatory."); +set_ValueNoCheck ("C_Recurring_ID", new Integer(C_Recurring_ID)); +} +/** Get Recurring. +@return Recurring Document */ +public int getC_Recurring_ID() +{ +Integer ii = (Integer)get_Value("C_Recurring_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Recurring Run. +@param C_Recurring_Run_ID Recurring Document Run */ +public void setC_Recurring_Run_ID (int C_Recurring_Run_ID) +{ +if (C_Recurring_Run_ID < 1) throw new IllegalArgumentException ("C_Recurring_Run_ID is mandatory."); +set_ValueNoCheck ("C_Recurring_Run_ID", new Integer(C_Recurring_Run_ID)); +} +/** Get Recurring Run. +@return Recurring Document Run */ +public int getC_Recurring_Run_ID() +{ +Integer ii = (Integer)get_Value("C_Recurring_Run_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Date. +@param DateDoc Date of the Document */ +public void setDateDoc (Timestamp DateDoc) +{ +set_Value ("DateDoc", DateDoc); +} +/** Get Document Date. +@return Date of the Document */ +public Timestamp getDateDoc() +{ +return (Timestamp)get_Value("DateDoc"); +} +/** Set Journal Batch. +@param GL_JournalBatch_ID General Ledger Journal Batch */ +public void setGL_JournalBatch_ID (int GL_JournalBatch_ID) +{ +if (GL_JournalBatch_ID <= 0) set_ValueNoCheck ("GL_JournalBatch_ID", null); + else +set_ValueNoCheck ("GL_JournalBatch_ID", new Integer(GL_JournalBatch_ID)); +} +/** Get Journal Batch. +@return General Ledger Journal Batch */ +public int getGL_JournalBatch_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Region.java b/dbPort/src/org/compiere/model/X_C_Region.java new file mode 100644 index 0000000000..2599f58a75 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Region.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Region + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.484 */ +public class X_C_Region extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Region_ID id +@param trxName transaction +*/ +public X_C_Region (Properties ctx, int C_Region_ID, String trxName) +{ +super (ctx, C_Region_ID, trxName); +/** if (C_Region_ID == 0) +{ +setC_Country_ID (0); +setC_Region_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Region (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=164 */ +public static final int Table_ID=164; + +/** TableName=C_Region */ +public static final String Table_Name="C_Region"; + +protected static KeyNamePair Model = new KeyNamePair(164,"C_Region"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Region[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID < 1) throw new IllegalArgumentException ("C_Country_ID is mandatory."); +set_ValueNoCheck ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID < 1) throw new IllegalArgumentException ("C_Region_ID is mandatory."); +set_ValueNoCheck ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Remuneration.java b/dbPort/src/org/compiere/model/X_C_Remuneration.java new file mode 100644 index 0000000000..9a15f543f2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Remuneration.java @@ -0,0 +1,277 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Remuneration + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.5 */ +public class X_C_Remuneration extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Remuneration_ID id +@param trxName transaction +*/ +public X_C_Remuneration (Properties ctx, int C_Remuneration_ID, String trxName) +{ +super (ctx, C_Remuneration_ID, trxName); +/** if (C_Remuneration_ID == 0) +{ +setC_Remuneration_ID (0); +setGrossRAmt (Env.ZERO); +setGrossRCost (Env.ZERO); +setName (null); +setOvertimeAmt (Env.ZERO); +setOvertimeCost (Env.ZERO); +setRemunerationType (null); +setStandardHours (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Remuneration (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=792 */ +public static final int Table_ID=792; + +/** TableName=C_Remuneration */ +public static final String Table_Name="C_Remuneration"; + +protected static KeyNamePair Model = new KeyNamePair(792,"C_Remuneration"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Remuneration[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Remuneration. +@param C_Remuneration_ID Wage or Salary */ +public void setC_Remuneration_ID (int C_Remuneration_ID) +{ +if (C_Remuneration_ID < 1) throw new IllegalArgumentException ("C_Remuneration_ID is mandatory."); +set_ValueNoCheck ("C_Remuneration_ID", new Integer(C_Remuneration_ID)); +} +/** Get Remuneration. +@return Wage or Salary */ +public int getC_Remuneration_ID() +{ +Integer ii = (Integer)get_Value("C_Remuneration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Gross Amount. +@param GrossRAmt Gross Remuneration Amount */ +public void setGrossRAmt (BigDecimal GrossRAmt) +{ +if (GrossRAmt == null) throw new IllegalArgumentException ("GrossRAmt is mandatory."); +set_Value ("GrossRAmt", GrossRAmt); +} +/** Get Gross Amount. +@return Gross Remuneration Amount */ +public BigDecimal getGrossRAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("GrossRAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Gross Cost. +@param GrossRCost Gross Remuneration Costs */ +public void setGrossRCost (BigDecimal GrossRCost) +{ +if (GrossRCost == null) throw new IllegalArgumentException ("GrossRCost is mandatory."); +set_Value ("GrossRCost", GrossRCost); +} +/** Get Gross Cost. +@return Gross Remuneration Costs */ +public BigDecimal getGrossRCost() +{ +BigDecimal bd = (BigDecimal)get_Value("GrossRCost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Overtime Amount. +@param OvertimeAmt Hourly Overtime Rate */ +public void setOvertimeAmt (BigDecimal OvertimeAmt) +{ +if (OvertimeAmt == null) throw new IllegalArgumentException ("OvertimeAmt is mandatory."); +set_Value ("OvertimeAmt", OvertimeAmt); +} +/** Get Overtime Amount. +@return Hourly Overtime Rate */ +public BigDecimal getOvertimeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OvertimeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Overtime Cost. +@param OvertimeCost Hourly Overtime Cost */ +public void setOvertimeCost (BigDecimal OvertimeCost) +{ +if (OvertimeCost == null) throw new IllegalArgumentException ("OvertimeCost is mandatory."); +set_Value ("OvertimeCost", OvertimeCost); +} +/** Get Overtime Cost. +@return Hourly Overtime Cost */ +public BigDecimal getOvertimeCost() +{ +BigDecimal bd = (BigDecimal)get_Value("OvertimeCost"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** RemunerationType AD_Reference_ID=346 */ +public static final int REMUNERATIONTYPE_AD_Reference_ID=346; +/** Bi-Weekly = B */ +public static final String REMUNERATIONTYPE_Bi_Weekly = "B"; +/** Daily = D */ +public static final String REMUNERATIONTYPE_Daily = "D"; +/** Hourly = H */ +public static final String REMUNERATIONTYPE_Hourly = "H"; +/** Monthly = M */ +public static final String REMUNERATIONTYPE_Monthly = "M"; +/** Twice Monthly = T */ +public static final String REMUNERATIONTYPE_TwiceMonthly = "T"; +/** Weekly = W */ +public static final String REMUNERATIONTYPE_Weekly = "W"; +/** Set Remuneration Type. +@param RemunerationType Type of Remuneration */ +public void setRemunerationType (String RemunerationType) +{ +if (RemunerationType == null) throw new IllegalArgumentException ("RemunerationType is mandatory"); +if (RemunerationType.equals("B") || RemunerationType.equals("D") || RemunerationType.equals("H") || RemunerationType.equals("M") || RemunerationType.equals("T") || RemunerationType.equals("W")); + else throw new IllegalArgumentException ("RemunerationType Invalid value - " + RemunerationType + " - Reference_ID=346 - B - D - H - M - T - W"); +if (RemunerationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RemunerationType = RemunerationType.substring(0,0); +} +set_Value ("RemunerationType", RemunerationType); +} +/** Get Remuneration Type. +@return Type of Remuneration */ +public String getRemunerationType() +{ +return (String)get_Value("RemunerationType"); +} +/** Set Standard Hours. +@param StandardHours Standard Work Hours based on Remuneration Type */ +public void setStandardHours (int StandardHours) +{ +set_Value ("StandardHours", new Integer(StandardHours)); +} +/** Get Standard Hours. +@return Standard Work Hours based on Remuneration Type */ +public int getStandardHours() +{ +Integer ii = (Integer)get_Value("StandardHours"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RevenueRecognition.java b/dbPort/src/org/compiere/model/X_C_RevenueRecognition.java new file mode 100644 index 0000000000..f1ab42b5db --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RevenueRecognition.java @@ -0,0 +1,208 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RevenueRecognition + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.515 */ +public class X_C_RevenueRecognition extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RevenueRecognition_ID id +@param trxName transaction +*/ +public X_C_RevenueRecognition (Properties ctx, int C_RevenueRecognition_ID, String trxName) +{ +super (ctx, C_RevenueRecognition_ID, trxName); +/** if (C_RevenueRecognition_ID == 0) +{ +setC_RevenueRecognition_ID (0); +setIsTimeBased (false); +setName (null); +setRecognitionFrequency (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RevenueRecognition (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=336 */ +public static final int Table_ID=336; + +/** TableName=C_RevenueRecognition */ +public static final String Table_Name="C_RevenueRecognition"; + +protected static KeyNamePair Model = new KeyNamePair(336,"C_RevenueRecognition"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RevenueRecognition[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Revenue Recognition. +@param C_RevenueRecognition_ID Method for recording revenue */ +public void setC_RevenueRecognition_ID (int C_RevenueRecognition_ID) +{ +if (C_RevenueRecognition_ID < 1) throw new IllegalArgumentException ("C_RevenueRecognition_ID is mandatory."); +set_ValueNoCheck ("C_RevenueRecognition_ID", new Integer(C_RevenueRecognition_ID)); +} +/** Get Revenue Recognition. +@return Method for recording revenue */ +public int getC_RevenueRecognition_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Time based. +@param IsTimeBased Time based Revenue Recognition rather than Service Level based */ +public void setIsTimeBased (boolean IsTimeBased) +{ +set_Value ("IsTimeBased", new Boolean(IsTimeBased)); +} +/** Get Time based. +@return Time based Revenue Recognition rather than Service Level based */ +public boolean isTimeBased() +{ +Object oo = get_Value("IsTimeBased"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Number of Months. +@param NoMonths Number of Months */ +public void setNoMonths (int NoMonths) +{ +set_Value ("NoMonths", new Integer(NoMonths)); +} +/** Get Number of Months. +@return Number of Months */ +public int getNoMonths() +{ +Integer ii = (Integer)get_Value("NoMonths"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** RecognitionFrequency AD_Reference_ID=196 */ +public static final int RECOGNITIONFREQUENCY_AD_Reference_ID=196; +/** Month = M */ +public static final String RECOGNITIONFREQUENCY_Month = "M"; +/** Quarter = Q */ +public static final String RECOGNITIONFREQUENCY_Quarter = "Q"; +/** Year = Y */ +public static final String RECOGNITIONFREQUENCY_Year = "Y"; +/** Set Recognition frequency. +@param RecognitionFrequency Recognition frequency */ +public void setRecognitionFrequency (String RecognitionFrequency) +{ +if (RecognitionFrequency == null) throw new IllegalArgumentException ("RecognitionFrequency is mandatory"); +if (RecognitionFrequency.equals("M") || RecognitionFrequency.equals("Q") || RecognitionFrequency.equals("Y")); + else throw new IllegalArgumentException ("RecognitionFrequency Invalid value - " + RecognitionFrequency + " - Reference_ID=196 - M - Q - Y"); +if (RecognitionFrequency.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RecognitionFrequency = RecognitionFrequency.substring(0,0); +} +set_Value ("RecognitionFrequency", RecognitionFrequency); +} +/** Get Recognition frequency. +@return Recognition frequency */ +public String getRecognitionFrequency() +{ +return (String)get_Value("RecognitionFrequency"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RevenueRecognition_Plan.java b/dbPort/src/org/compiere/model/X_C_RevenueRecognition_Plan.java new file mode 100644 index 0000000000..6821df40aa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RevenueRecognition_Plan.java @@ -0,0 +1,235 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RevenueRecognition_Plan + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.531 */ +public class X_C_RevenueRecognition_Plan extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RevenueRecognition_Plan_ID id +@param trxName transaction +*/ +public X_C_RevenueRecognition_Plan (Properties ctx, int C_RevenueRecognition_Plan_ID, String trxName) +{ +super (ctx, C_RevenueRecognition_Plan_ID, trxName); +/** if (C_RevenueRecognition_Plan_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Currency_ID (0); +setC_InvoiceLine_ID (0); +setC_RevenueRecognition_ID (0); +setC_RevenueRecognition_Plan_ID (0); +setP_Revenue_Acct (0); +setRecognizedAmt (Env.ZERO); +setTotalAmt (Env.ZERO); +setUnEarnedRevenue_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RevenueRecognition_Plan (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=443 */ +public static final int Table_ID=443; + +/** TableName=C_RevenueRecognition_Plan */ +public static final String Table_Name="C_RevenueRecognition_Plan"; + +protected static KeyNamePair Model = new KeyNamePair(443,"C_RevenueRecognition_Plan"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RevenueRecognition_Plan[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Revenue Recognition. +@param C_RevenueRecognition_ID Method for recording revenue */ +public void setC_RevenueRecognition_ID (int C_RevenueRecognition_ID) +{ +if (C_RevenueRecognition_ID < 1) throw new IllegalArgumentException ("C_RevenueRecognition_ID is mandatory."); +set_ValueNoCheck ("C_RevenueRecognition_ID", new Integer(C_RevenueRecognition_ID)); +} +/** Get Revenue Recognition. +@return Method for recording revenue */ +public int getC_RevenueRecognition_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_RevenueRecognition_ID())); +} +/** Set Revenue Recognition Plan. +@param C_RevenueRecognition_Plan_ID Plan for recognizing or recording revenue */ +public void setC_RevenueRecognition_Plan_ID (int C_RevenueRecognition_Plan_ID) +{ +if (C_RevenueRecognition_Plan_ID < 1) throw new IllegalArgumentException ("C_RevenueRecognition_Plan_ID is mandatory."); +set_ValueNoCheck ("C_RevenueRecognition_Plan_ID", new Integer(C_RevenueRecognition_Plan_ID)); +} +/** Get Revenue Recognition Plan. +@return Plan for recognizing or recording revenue */ +public int getC_RevenueRecognition_Plan_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_Plan_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Revenue. +@param P_Revenue_Acct Account for Product Revenue (Sales Account) */ +public void setP_Revenue_Acct (int P_Revenue_Acct) +{ +set_ValueNoCheck ("P_Revenue_Acct", new Integer(P_Revenue_Acct)); +} +/** Get Product Revenue. +@return Account for Product Revenue (Sales Account) */ +public int getP_Revenue_Acct() +{ +Integer ii = (Integer)get_Value("P_Revenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Recognized Amount. +@param RecognizedAmt Recognized Amount */ +public void setRecognizedAmt (BigDecimal RecognizedAmt) +{ +if (RecognizedAmt == null) throw new IllegalArgumentException ("RecognizedAmt is mandatory."); +set_ValueNoCheck ("RecognizedAmt", RecognizedAmt); +} +/** Get Recognized Amount. +@return Recognized Amount */ +public BigDecimal getRecognizedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RecognizedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Total Amount. +@param TotalAmt Total Amount */ +public void setTotalAmt (BigDecimal TotalAmt) +{ +if (TotalAmt == null) throw new IllegalArgumentException ("TotalAmt is mandatory."); +set_ValueNoCheck ("TotalAmt", TotalAmt); +} +/** Get Total Amount. +@return Total Amount */ +public BigDecimal getTotalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Unearned Revenue. +@param UnEarnedRevenue_Acct Account for unearned revenue */ +public void setUnEarnedRevenue_Acct (int UnEarnedRevenue_Acct) +{ +set_ValueNoCheck ("UnEarnedRevenue_Acct", new Integer(UnEarnedRevenue_Acct)); +} +/** Get Unearned Revenue. +@return Account for unearned revenue */ +public int getUnEarnedRevenue_Acct() +{ +Integer ii = (Integer)get_Value("UnEarnedRevenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RevenueRecognition_Run.java b/dbPort/src/org/compiere/model/X_C_RevenueRecognition_Run.java new file mode 100644 index 0000000000..c51d88c5ca --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RevenueRecognition_Run.java @@ -0,0 +1,157 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RevenueRecognition_Run + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.546 */ +public class X_C_RevenueRecognition_Run extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RevenueRecognition_Run_ID id +@param trxName transaction +*/ +public X_C_RevenueRecognition_Run (Properties ctx, int C_RevenueRecognition_Run_ID, String trxName) +{ +super (ctx, C_RevenueRecognition_Run_ID, trxName); +/** if (C_RevenueRecognition_Run_ID == 0) +{ +setC_RevenueRecognition_Plan_ID (0); +setC_RevenueRecognition_Run_ID (0); +setGL_Journal_ID (0); +setRecognizedAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RevenueRecognition_Run (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=444 */ +public static final int Table_ID=444; + +/** TableName=C_RevenueRecognition_Run */ +public static final String Table_Name="C_RevenueRecognition_Run"; + +protected static KeyNamePair Model = new KeyNamePair(444,"C_RevenueRecognition_Run"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RevenueRecognition_Run[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Revenue Recognition Plan. +@param C_RevenueRecognition_Plan_ID Plan for recognizing or recording revenue */ +public void setC_RevenueRecognition_Plan_ID (int C_RevenueRecognition_Plan_ID) +{ +if (C_RevenueRecognition_Plan_ID < 1) throw new IllegalArgumentException ("C_RevenueRecognition_Plan_ID is mandatory."); +set_ValueNoCheck ("C_RevenueRecognition_Plan_ID", new Integer(C_RevenueRecognition_Plan_ID)); +} +/** Get Revenue Recognition Plan. +@return Plan for recognizing or recording revenue */ +public int getC_RevenueRecognition_Plan_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_Plan_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_RevenueRecognition_Plan_ID())); +} +/** Set Revenue Recognition Run. +@param C_RevenueRecognition_Run_ID Revenue Recognition Run or Process */ +public void setC_RevenueRecognition_Run_ID (int C_RevenueRecognition_Run_ID) +{ +if (C_RevenueRecognition_Run_ID < 1) throw new IllegalArgumentException ("C_RevenueRecognition_Run_ID is mandatory."); +set_ValueNoCheck ("C_RevenueRecognition_Run_ID", new Integer(C_RevenueRecognition_Run_ID)); +} +/** Get Revenue Recognition Run. +@return Revenue Recognition Run or Process */ +public int getC_RevenueRecognition_Run_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_Run_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal. +@param GL_Journal_ID General Ledger Journal */ +public void setGL_Journal_ID (int GL_Journal_ID) +{ +if (GL_Journal_ID < 1) throw new IllegalArgumentException ("GL_Journal_ID is mandatory."); +set_ValueNoCheck ("GL_Journal_ID", new Integer(GL_Journal_ID)); +} +/** Get Journal. +@return General Ledger Journal */ +public int getGL_Journal_ID() +{ +Integer ii = (Integer)get_Value("GL_Journal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Recognized Amount. +@param RecognizedAmt Recognized Amount */ +public void setRecognizedAmt (BigDecimal RecognizedAmt) +{ +if (RecognizedAmt == null) throw new IllegalArgumentException ("RecognizedAmt is mandatory."); +set_ValueNoCheck ("RecognizedAmt", RecognizedAmt); +} +/** Get Recognized Amount. +@return Recognized Amount */ +public BigDecimal getRecognizedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RecognizedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQ.java b/dbPort/src/org/compiere/model/X_C_RfQ.java new file mode 100644 index 0000000000..4cd848df82 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQ.java @@ -0,0 +1,609 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQ + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.546 */ +public class X_C_RfQ extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQ_ID id +@param trxName transaction +*/ +public X_C_RfQ (Properties ctx, int C_RfQ_ID, String trxName) +{ +super (ctx, C_RfQ_ID, trxName); +/** if (C_RfQ_ID == 0) +{ +setC_Currency_ID (0); // @$C_Currency_ID @ +setC_RfQ_ID (0); +setC_RfQ_Topic_ID (0); +setDateResponse (new Timestamp(System.currentTimeMillis())); +setDocumentNo (null); +setIsInvitedVendorsOnly (false); +setIsQuoteAllQty (false); +setIsQuoteTotalAmt (false); +setIsRfQResponseAccepted (true); // Y +setIsSelfService (true); // Y +setName (null); +setProcessed (false); +setQuoteType (null); // S +setSalesRep_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQ (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=677 */ +public static final int Table_ID=677; + +/** TableName=C_RfQ */ +public static final String Table_Name="C_RfQ"; + +protected static KeyNamePair Model = new KeyNamePair(677,"C_RfQ"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQ[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ. +@param C_RfQ_ID Request for Quotation */ +public void setC_RfQ_ID (int C_RfQ_ID) +{ +if (C_RfQ_ID < 1) throw new IllegalArgumentException ("C_RfQ_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_ID", new Integer(C_RfQ_ID)); +} +/** Get RfQ. +@return Request for Quotation */ +public int getC_RfQ_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Topic. +@param C_RfQ_Topic_ID Topic for Request for Quotations */ +public void setC_RfQ_Topic_ID (int C_RfQ_Topic_ID) +{ +if (C_RfQ_Topic_ID < 1) throw new IllegalArgumentException ("C_RfQ_Topic_ID is mandatory."); +set_Value ("C_RfQ_Topic_ID", new Integer(C_RfQ_Topic_ID)); +} +/** Get RfQ Topic. +@return Topic for Request for Quotations */ +public int getC_RfQ_Topic_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Copy Lines. +@param CopyLines Copy Lines */ +public void setCopyLines (String CopyLines) +{ +if (CopyLines != null && CopyLines.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CopyLines = CopyLines.substring(0,0); +} +set_Value ("CopyLines", CopyLines); +} +/** Get Copy Lines. +@return Copy Lines */ +public String getCopyLines() +{ +return (String)get_Value("CopyLines"); +} +/** Set Create PO. +@param CreatePO Create Purchase Order */ +public void setCreatePO (String CreatePO) +{ +if (CreatePO != null && CreatePO.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreatePO = CreatePO.substring(0,0); +} +set_Value ("CreatePO", CreatePO); +} +/** Get Create PO. +@return Create Purchase Order */ +public String getCreatePO() +{ +return (String)get_Value("CreatePO"); +} +/** Set Create SO. +@param CreateSO Create SO */ +public void setCreateSO (String CreateSO) +{ +if (CreateSO != null && CreateSO.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateSO = CreateSO.substring(0,0); +} +set_Value ("CreateSO", CreateSO); +} +/** Get Create SO. +@return Create SO */ +public String getCreateSO() +{ +return (String)get_Value("CreateSO"); +} +/** Set Response Date. +@param DateResponse Date of the Response */ +public void setDateResponse (Timestamp DateResponse) +{ +if (DateResponse == null) throw new IllegalArgumentException ("DateResponse is mandatory."); +set_Value ("DateResponse", DateResponse); +} +/** Get Response Date. +@return Date of the Response */ +public Timestamp getDateResponse() +{ +return (Timestamp)get_Value("DateResponse"); +} +/** Set Work Complete. +@param DateWorkComplete Date when work is (planned to be) complete */ +public void setDateWorkComplete (Timestamp DateWorkComplete) +{ +set_Value ("DateWorkComplete", DateWorkComplete); +} +/** Get Work Complete. +@return Date when work is (planned to be) complete */ +public Timestamp getDateWorkComplete() +{ +return (Timestamp)get_Value("DateWorkComplete"); +} +/** Set Work Start. +@param DateWorkStart Date when work is (planned to be) started */ +public void setDateWorkStart (Timestamp DateWorkStart) +{ +set_Value ("DateWorkStart", DateWorkStart); +} +/** Get Work Start. +@return Date when work is (planned to be) started */ +public Timestamp getDateWorkStart() +{ +return (Timestamp)get_Value("DateWorkStart"); +} +/** Set Delivery Days. +@param DeliveryDays Number of Days (planned) until Delivery */ +public void setDeliveryDays (int DeliveryDays) +{ +set_Value ("DeliveryDays", new Integer(DeliveryDays)); +} +/** Get Delivery Days. +@return Number of Days (planned) until Delivery */ +public int getDeliveryDays() +{ +Integer ii = (Integer)get_Value("DeliveryDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Invited Vendors Only. +@param IsInvitedVendorsOnly Only invited vendors can respond to an RfQ */ +public void setIsInvitedVendorsOnly (boolean IsInvitedVendorsOnly) +{ +set_Value ("IsInvitedVendorsOnly", new Boolean(IsInvitedVendorsOnly)); +} +/** Get Invited Vendors Only. +@return Only invited vendors can respond to an RfQ */ +public boolean isInvitedVendorsOnly() +{ +Object oo = get_Value("IsInvitedVendorsOnly"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quote All Quantities. +@param IsQuoteAllQty Suppliers are requested to provide responses for all quantities */ +public void setIsQuoteAllQty (boolean IsQuoteAllQty) +{ +set_Value ("IsQuoteAllQty", new Boolean(IsQuoteAllQty)); +} +/** Get Quote All Quantities. +@return Suppliers are requested to provide responses for all quantities */ +public boolean isQuoteAllQty() +{ +Object oo = get_Value("IsQuoteAllQty"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quote Total Amt. +@param IsQuoteTotalAmt The respnse can have just the total amount for the RfQ */ +public void setIsQuoteTotalAmt (boolean IsQuoteTotalAmt) +{ +set_Value ("IsQuoteTotalAmt", new Boolean(IsQuoteTotalAmt)); +} +/** Get Quote Total Amt. +@return The respnse can have just the total amount for the RfQ */ +public boolean isQuoteTotalAmt() +{ +Object oo = get_Value("IsQuoteTotalAmt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Responses Accepted. +@param IsRfQResponseAccepted Are Resonses to the Request for Quotation accepted */ +public void setIsRfQResponseAccepted (boolean IsRfQResponseAccepted) +{ +set_Value ("IsRfQResponseAccepted", new Boolean(IsRfQResponseAccepted)); +} +/** Get Responses Accepted. +@return Are Resonses to the Request for Quotation accepted */ +public boolean isRfQResponseAccepted() +{ +Object oo = get_Value("IsRfQResponseAccepted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Margin %. +@param Margin Margin for a product as a percentage */ +public void setMargin (BigDecimal Margin) +{ +set_Value ("Margin", Margin); +} +/** Get Margin %. +@return Margin for a product as a percentage */ +public BigDecimal getMargin() +{ +BigDecimal bd = (BigDecimal)get_Value("Margin"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Publish RfQ. +@param PublishRfQ Publish RfQ */ +public void setPublishRfQ (String PublishRfQ) +{ +if (PublishRfQ != null && PublishRfQ.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PublishRfQ = PublishRfQ.substring(0,0); +} +set_Value ("PublishRfQ", PublishRfQ); +} +/** Get Publish RfQ. +@return Publish RfQ */ +public String getPublishRfQ() +{ +return (String)get_Value("PublishRfQ"); +} + +/** QuoteType AD_Reference_ID=314 */ +public static final int QUOTETYPE_AD_Reference_ID=314; +/** Quote All Lines = A */ +public static final String QUOTETYPE_QuoteAllLines = "A"; +/** Quote Selected Lines = S */ +public static final String QUOTETYPE_QuoteSelectedLines = "S"; +/** Quote Total only = T */ +public static final String QUOTETYPE_QuoteTotalOnly = "T"; +/** Set RfQ Type. +@param QuoteType Request for Quotation Type */ +public void setQuoteType (String QuoteType) +{ +if (QuoteType == null) throw new IllegalArgumentException ("QuoteType is mandatory"); +if (QuoteType.equals("A") || QuoteType.equals("S") || QuoteType.equals("T")); + else throw new IllegalArgumentException ("QuoteType Invalid value - " + QuoteType + " - Reference_ID=314 - A - S - T"); +if (QuoteType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +QuoteType = QuoteType.substring(0,0); +} +set_Value ("QuoteType", QuoteType); +} +/** Get RfQ Type. +@return Request for Quotation Type */ +public String getQuoteType() +{ +return (String)get_Value("QuoteType"); +} +/** Set Rank RfQ. +@param RankRfQ Rank RfQ */ +public void setRankRfQ (String RankRfQ) +{ +if (RankRfQ != null && RankRfQ.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RankRfQ = RankRfQ.substring(0,0); +} +set_Value ("RankRfQ", RankRfQ); +} +/** Get Rank RfQ. +@return Rank RfQ */ +public String getRankRfQ() +{ +return (String)get_Value("RankRfQ"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQLine.java b/dbPort/src/org/compiere/model/X_C_RfQLine.java new file mode 100644 index 0000000000..07f2f5f02f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQLine.java @@ -0,0 +1,244 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.578 */ +public class X_C_RfQLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQLine_ID id +@param trxName transaction +*/ +public X_C_RfQLine (Properties ctx, int C_RfQLine_ID, String trxName) +{ +super (ctx, C_RfQLine_ID, trxName); +/** if (C_RfQLine_ID == 0) +{ +setC_RfQLine_ID (0); +setC_RfQ_ID (0); +setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_RfQLine WHERE C_RfQ_ID=@C_RfQ_ID@ +setM_AttributeSetInstance_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=676 */ +public static final int Table_ID=676; + +/** TableName=C_RfQLine */ +public static final String Table_Name="C_RfQLine"; + +protected static KeyNamePair Model = new KeyNamePair(676,"C_RfQLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set RfQ Line. +@param C_RfQLine_ID Request for Quotation Line */ +public void setC_RfQLine_ID (int C_RfQLine_ID) +{ +if (C_RfQLine_ID < 1) throw new IllegalArgumentException ("C_RfQLine_ID is mandatory."); +set_ValueNoCheck ("C_RfQLine_ID", new Integer(C_RfQLine_ID)); +} +/** Get RfQ Line. +@return Request for Quotation Line */ +public int getC_RfQLine_ID() +{ +Integer ii = (Integer)get_Value("C_RfQLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ. +@param C_RfQ_ID Request for Quotation */ +public void setC_RfQ_ID (int C_RfQ_ID) +{ +if (C_RfQ_ID < 1) throw new IllegalArgumentException ("C_RfQ_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_ID", new Integer(C_RfQ_ID)); +} +/** Get RfQ. +@return Request for Quotation */ +public int getC_RfQ_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_RfQ_ID())); +} +/** Set Work Complete. +@param DateWorkComplete Date when work is (planned to be) complete */ +public void setDateWorkComplete (Timestamp DateWorkComplete) +{ +set_Value ("DateWorkComplete", DateWorkComplete); +} +/** Get Work Complete. +@return Date when work is (planned to be) complete */ +public Timestamp getDateWorkComplete() +{ +return (Timestamp)get_Value("DateWorkComplete"); +} +/** Set Work Start. +@param DateWorkStart Date when work is (planned to be) started */ +public void setDateWorkStart (Timestamp DateWorkStart) +{ +set_Value ("DateWorkStart", DateWorkStart); +} +/** Get Work Start. +@return Date when work is (planned to be) started */ +public Timestamp getDateWorkStart() +{ +return (Timestamp)get_Value("DateWorkStart"); +} +/** Set Delivery Days. +@param DeliveryDays Number of Days (planned) until Delivery */ +public void setDeliveryDays (int DeliveryDays) +{ +set_Value ("DeliveryDays", new Integer(DeliveryDays)); +} +/** Get Delivery Days. +@return Number of Days (planned) until Delivery */ +public int getDeliveryDays() +{ +Integer ii = (Integer)get_Value("DeliveryDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQLineQty.java b/dbPort/src/org/compiere/model/X_C_RfQLineQty.java new file mode 100644 index 0000000000..8dcd92ce29 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQLineQty.java @@ -0,0 +1,272 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQLineQty + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.593 */ +public class X_C_RfQLineQty extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQLineQty_ID id +@param trxName transaction +*/ +public X_C_RfQLineQty (Properties ctx, int C_RfQLineQty_ID, String trxName) +{ +super (ctx, C_RfQLineQty_ID, trxName); +/** if (C_RfQLineQty_ID == 0) +{ +setBenchmarkPrice (Env.ZERO); +setC_RfQLineQty_ID (0); +setC_RfQLine_ID (0); +setC_UOM_ID (0); +setIsOfferQty (false); +setIsPurchaseQty (false); +setIsRfQQty (true); // Y +setQty (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQLineQty (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=675 */ +public static final int Table_ID=675; + +/** TableName=C_RfQLineQty */ +public static final String Table_Name="C_RfQLineQty"; + +protected static KeyNamePair Model = new KeyNamePair(675,"C_RfQLineQty"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQLineQty[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Benchmark Price. +@param BenchmarkPrice Price to compare responses to */ +public void setBenchmarkPrice (BigDecimal BenchmarkPrice) +{ +if (BenchmarkPrice == null) throw new IllegalArgumentException ("BenchmarkPrice is mandatory."); +set_Value ("BenchmarkPrice", BenchmarkPrice); +} +/** Get Benchmark Price. +@return Price to compare responses to */ +public BigDecimal getBenchmarkPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("BenchmarkPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Best Response Amount. +@param BestResponseAmt Best Response Amount */ +public void setBestResponseAmt (BigDecimal BestResponseAmt) +{ +set_Value ("BestResponseAmt", BestResponseAmt); +} +/** Get Best Response Amount. +@return Best Response Amount */ +public BigDecimal getBestResponseAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("BestResponseAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set RfQ Line Quantity. +@param C_RfQLineQty_ID Request for Quotation Line Quantity */ +public void setC_RfQLineQty_ID (int C_RfQLineQty_ID) +{ +if (C_RfQLineQty_ID < 1) throw new IllegalArgumentException ("C_RfQLineQty_ID is mandatory."); +set_ValueNoCheck ("C_RfQLineQty_ID", new Integer(C_RfQLineQty_ID)); +} +/** Get RfQ Line Quantity. +@return Request for Quotation Line Quantity */ +public int getC_RfQLineQty_ID() +{ +Integer ii = (Integer)get_Value("C_RfQLineQty_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Line. +@param C_RfQLine_ID Request for Quotation Line */ +public void setC_RfQLine_ID (int C_RfQLine_ID) +{ +if (C_RfQLine_ID < 1) throw new IllegalArgumentException ("C_RfQLine_ID is mandatory."); +set_ValueNoCheck ("C_RfQLine_ID", new Integer(C_RfQLine_ID)); +} +/** Get RfQ Line. +@return Request for Quotation Line */ +public int getC_RfQLine_ID() +{ +Integer ii = (Integer)get_Value("C_RfQLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_UOM_ID())); +} +/** Set Offer Quantity. +@param IsOfferQty This quantity is used in the Offer to the Customer */ +public void setIsOfferQty (boolean IsOfferQty) +{ +set_Value ("IsOfferQty", new Boolean(IsOfferQty)); +} +/** Get Offer Quantity. +@return This quantity is used in the Offer to the Customer */ +public boolean isOfferQty() +{ +Object oo = get_Value("IsOfferQty"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Purchase Quantity. +@param IsPurchaseQty This quantity is used in the Purchase Order to the Supplier */ +public void setIsPurchaseQty (boolean IsPurchaseQty) +{ +set_Value ("IsPurchaseQty", new Boolean(IsPurchaseQty)); +} +/** Get Purchase Quantity. +@return This quantity is used in the Purchase Order to the Supplier */ +public boolean isPurchaseQty() +{ +Object oo = get_Value("IsPurchaseQty"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set RfQ Quantity. +@param IsRfQQty The quantity is used when generating RfQ Responses */ +public void setIsRfQQty (boolean IsRfQQty) +{ +set_Value ("IsRfQQty", new Boolean(IsRfQQty)); +} +/** Get RfQ Quantity. +@return The quantity is used when generating RfQ Responses */ +public boolean isRfQQty() +{ +Object oo = get_Value("IsRfQQty"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Margin %. +@param Margin Margin for a product as a percentage */ +public void setMargin (BigDecimal Margin) +{ +set_Value ("Margin", Margin); +} +/** Get Margin %. +@return Margin for a product as a percentage */ +public BigDecimal getMargin() +{ +BigDecimal bd = (BigDecimal)get_Value("Margin"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Offer Amount. +@param OfferAmt Amount of the Offer */ +public void setOfferAmt (BigDecimal OfferAmt) +{ +set_Value ("OfferAmt", OfferAmt); +} +/** Get Offer Amount. +@return Amount of the Offer */ +public BigDecimal getOfferAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OfferAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQResponse.java b/dbPort/src/org/compiere/model/X_C_RfQResponse.java new file mode 100644 index 0000000000..d2fcc74ffe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQResponse.java @@ -0,0 +1,461 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQResponse + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.609 */ +public class X_C_RfQResponse extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQResponse_ID id +@param trxName transaction +*/ +public X_C_RfQResponse (Properties ctx, int C_RfQResponse_ID, String trxName) +{ +super (ctx, C_RfQResponse_ID, trxName); +/** if (C_RfQResponse_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Currency_ID (0); // @C_Currency_ID@ +setC_RfQResponse_ID (0); +setC_RfQ_ID (0); +setIsComplete (false); +setIsSelectedWinner (false); +setIsSelfService (false); +setName (null); +setPrice (Env.ZERO); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQResponse (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=674 */ +public static final int Table_ID=674; + +/** TableName=C_RfQResponse */ +public static final String Table_Name="C_RfQResponse"; + +protected static KeyNamePair Model = new KeyNamePair(674,"C_RfQResponse"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQResponse[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_ValueNoCheck ("AD_User_ID", null); + else +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Response. +@param C_RfQResponse_ID Request for Quotation Response from a potential Vendor */ +public void setC_RfQResponse_ID (int C_RfQResponse_ID) +{ +if (C_RfQResponse_ID < 1) throw new IllegalArgumentException ("C_RfQResponse_ID is mandatory."); +set_ValueNoCheck ("C_RfQResponse_ID", new Integer(C_RfQResponse_ID)); +} +/** Get RfQ Response. +@return Request for Quotation Response from a potential Vendor */ +public int getC_RfQResponse_ID() +{ +Integer ii = (Integer)get_Value("C_RfQResponse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ. +@param C_RfQ_ID Request for Quotation */ +public void setC_RfQ_ID (int C_RfQ_ID) +{ +if (C_RfQ_ID < 1) throw new IllegalArgumentException ("C_RfQ_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_ID", new Integer(C_RfQ_ID)); +} +/** Get RfQ. +@return Request for Quotation */ +public int getC_RfQ_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Check Complete. +@param CheckComplete Check Complete */ +public void setCheckComplete (String CheckComplete) +{ +if (CheckComplete != null && CheckComplete.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CheckComplete = CheckComplete.substring(0,0); +} +set_Value ("CheckComplete", CheckComplete); +} +/** Get Check Complete. +@return Check Complete */ +public String getCheckComplete() +{ +return (String)get_Value("CheckComplete"); +} +/** Set Invited. +@param DateInvited Date when (last) invitation was sent */ +public void setDateInvited (Timestamp DateInvited) +{ +set_Value ("DateInvited", DateInvited); +} +/** Get Invited. +@return Date when (last) invitation was sent */ +public Timestamp getDateInvited() +{ +return (Timestamp)get_Value("DateInvited"); +} +/** Set Response Date. +@param DateResponse Date of the Response */ +public void setDateResponse (Timestamp DateResponse) +{ +set_Value ("DateResponse", DateResponse); +} +/** Get Response Date. +@return Date of the Response */ +public Timestamp getDateResponse() +{ +return (Timestamp)get_Value("DateResponse"); +} +/** Set Work Complete. +@param DateWorkComplete Date when work is (planned to be) complete */ +public void setDateWorkComplete (Timestamp DateWorkComplete) +{ +set_Value ("DateWorkComplete", DateWorkComplete); +} +/** Get Work Complete. +@return Date when work is (planned to be) complete */ +public Timestamp getDateWorkComplete() +{ +return (Timestamp)get_Value("DateWorkComplete"); +} +/** Set Work Start. +@param DateWorkStart Date when work is (planned to be) started */ +public void setDateWorkStart (Timestamp DateWorkStart) +{ +set_Value ("DateWorkStart", DateWorkStart); +} +/** Get Work Start. +@return Date when work is (planned to be) started */ +public Timestamp getDateWorkStart() +{ +return (Timestamp)get_Value("DateWorkStart"); +} +/** Set Delivery Days. +@param DeliveryDays Number of Days (planned) until Delivery */ +public void setDeliveryDays (int DeliveryDays) +{ +set_Value ("DeliveryDays", new Integer(DeliveryDays)); +} +/** Get Delivery Days. +@return Number of Days (planned) until Delivery */ +public int getDeliveryDays() +{ +Integer ii = (Integer)get_Value("DeliveryDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Complete. +@param IsComplete It is complete */ +public void setIsComplete (boolean IsComplete) +{ +set_Value ("IsComplete", new Boolean(IsComplete)); +} +/** Get Complete. +@return It is complete */ +public boolean isComplete() +{ +Object oo = get_Value("IsComplete"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Selected Winner. +@param IsSelectedWinner The resonse is the selected winner */ +public void setIsSelectedWinner (boolean IsSelectedWinner) +{ +set_Value ("IsSelectedWinner", new Boolean(IsSelectedWinner)); +} +/** Get Selected Winner. +@return The resonse is the selected winner */ +public boolean isSelectedWinner() +{ +Object oo = get_Value("IsSelectedWinner"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Price. +@param Price Price */ +public void setPrice (BigDecimal Price) +{ +if (Price == null) throw new IllegalArgumentException ("Price is mandatory."); +set_Value ("Price", Price); +} +/** Get Price. +@return Price */ +public BigDecimal getPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("Price"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ranking. +@param Ranking Relative Rank Number */ +public void setRanking (int Ranking) +{ +set_Value ("Ranking", new Integer(Ranking)); +} +/** Get Ranking. +@return Relative Rank Number */ +public int getRanking() +{ +Integer ii = (Integer)get_Value("Ranking"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQResponseLine.java b/dbPort/src/org/compiere/model/X_C_RfQResponseLine.java new file mode 100644 index 0000000000..a8b14ed267 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQResponseLine.java @@ -0,0 +1,245 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQResponseLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.625 */ +public class X_C_RfQResponseLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQResponseLine_ID id +@param trxName transaction +*/ +public X_C_RfQResponseLine (Properties ctx, int C_RfQResponseLine_ID, String trxName) +{ +super (ctx, C_RfQResponseLine_ID, trxName); +/** if (C_RfQResponseLine_ID == 0) +{ +setC_RfQLine_ID (0); +setC_RfQResponseLine_ID (0); +setC_RfQResponse_ID (0); +setIsSelectedWinner (false); +setIsSelfService (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQResponseLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=673 */ +public static final int Table_ID=673; + +/** TableName=C_RfQResponseLine */ +public static final String Table_Name="C_RfQResponseLine"; + +protected static KeyNamePair Model = new KeyNamePair(673,"C_RfQResponseLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQResponseLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set RfQ Line. +@param C_RfQLine_ID Request for Quotation Line */ +public void setC_RfQLine_ID (int C_RfQLine_ID) +{ +if (C_RfQLine_ID < 1) throw new IllegalArgumentException ("C_RfQLine_ID is mandatory."); +set_ValueNoCheck ("C_RfQLine_ID", new Integer(C_RfQLine_ID)); +} +/** Get RfQ Line. +@return Request for Quotation Line */ +public int getC_RfQLine_ID() +{ +Integer ii = (Integer)get_Value("C_RfQLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Response Line. +@param C_RfQResponseLine_ID Request for Quotation Response Line */ +public void setC_RfQResponseLine_ID (int C_RfQResponseLine_ID) +{ +if (C_RfQResponseLine_ID < 1) throw new IllegalArgumentException ("C_RfQResponseLine_ID is mandatory."); +set_ValueNoCheck ("C_RfQResponseLine_ID", new Integer(C_RfQResponseLine_ID)); +} +/** Get RfQ Response Line. +@return Request for Quotation Response Line */ +public int getC_RfQResponseLine_ID() +{ +Integer ii = (Integer)get_Value("C_RfQResponseLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Response. +@param C_RfQResponse_ID Request for Quotation Response from a potential Vendor */ +public void setC_RfQResponse_ID (int C_RfQResponse_ID) +{ +if (C_RfQResponse_ID < 1) throw new IllegalArgumentException ("C_RfQResponse_ID is mandatory."); +set_ValueNoCheck ("C_RfQResponse_ID", new Integer(C_RfQResponse_ID)); +} +/** Get RfQ Response. +@return Request for Quotation Response from a potential Vendor */ +public int getC_RfQResponse_ID() +{ +Integer ii = (Integer)get_Value("C_RfQResponse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Work Complete. +@param DateWorkComplete Date when work is (planned to be) complete */ +public void setDateWorkComplete (Timestamp DateWorkComplete) +{ +set_Value ("DateWorkComplete", DateWorkComplete); +} +/** Get Work Complete. +@return Date when work is (planned to be) complete */ +public Timestamp getDateWorkComplete() +{ +return (Timestamp)get_Value("DateWorkComplete"); +} +/** Set Work Start. +@param DateWorkStart Date when work is (planned to be) started */ +public void setDateWorkStart (Timestamp DateWorkStart) +{ +set_Value ("DateWorkStart", DateWorkStart); +} +/** Get Work Start. +@return Date when work is (planned to be) started */ +public Timestamp getDateWorkStart() +{ +return (Timestamp)get_Value("DateWorkStart"); +} +/** Set Delivery Days. +@param DeliveryDays Number of Days (planned) until Delivery */ +public void setDeliveryDays (int DeliveryDays) +{ +set_Value ("DeliveryDays", new Integer(DeliveryDays)); +} +/** Get Delivery Days. +@return Number of Days (planned) until Delivery */ +public int getDeliveryDays() +{ +Integer ii = (Integer)get_Value("DeliveryDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Selected Winner. +@param IsSelectedWinner The resonse is the selected winner */ +public void setIsSelectedWinner (boolean IsSelectedWinner) +{ +set_Value ("IsSelectedWinner", new Boolean(IsSelectedWinner)); +} +/** Get Selected Winner. +@return The resonse is the selected winner */ +public boolean isSelectedWinner() +{ +Object oo = get_Value("IsSelectedWinner"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQResponseLineQty.java b/dbPort/src/org/compiere/model/X_C_RfQResponseLineQty.java new file mode 100644 index 0000000000..8ea45d9606 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQResponseLineQty.java @@ -0,0 +1,185 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQResponseLineQty + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.64 */ +public class X_C_RfQResponseLineQty extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQResponseLineQty_ID id +@param trxName transaction +*/ +public X_C_RfQResponseLineQty (Properties ctx, int C_RfQResponseLineQty_ID, String trxName) +{ +super (ctx, C_RfQResponseLineQty_ID, trxName); +/** if (C_RfQResponseLineQty_ID == 0) +{ +setC_RfQLineQty_ID (0); +setC_RfQResponseLineQty_ID (0); +setC_RfQResponseLine_ID (0); +setPrice (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQResponseLineQty (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=672 */ +public static final int Table_ID=672; + +/** TableName=C_RfQResponseLineQty */ +public static final String Table_Name="C_RfQResponseLineQty"; + +protected static KeyNamePair Model = new KeyNamePair(672,"C_RfQResponseLineQty"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQResponseLineQty[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set RfQ Line Quantity. +@param C_RfQLineQty_ID Request for Quotation Line Quantity */ +public void setC_RfQLineQty_ID (int C_RfQLineQty_ID) +{ +if (C_RfQLineQty_ID < 1) throw new IllegalArgumentException ("C_RfQLineQty_ID is mandatory."); +set_ValueNoCheck ("C_RfQLineQty_ID", new Integer(C_RfQLineQty_ID)); +} +/** Get RfQ Line Quantity. +@return Request for Quotation Line Quantity */ +public int getC_RfQLineQty_ID() +{ +Integer ii = (Integer)get_Value("C_RfQLineQty_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Response Line Qty. +@param C_RfQResponseLineQty_ID Request for Quotation Response Line Quantity */ +public void setC_RfQResponseLineQty_ID (int C_RfQResponseLineQty_ID) +{ +if (C_RfQResponseLineQty_ID < 1) throw new IllegalArgumentException ("C_RfQResponseLineQty_ID is mandatory."); +set_ValueNoCheck ("C_RfQResponseLineQty_ID", new Integer(C_RfQResponseLineQty_ID)); +} +/** Get RfQ Response Line Qty. +@return Request for Quotation Response Line Quantity */ +public int getC_RfQResponseLineQty_ID() +{ +Integer ii = (Integer)get_Value("C_RfQResponseLineQty_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Response Line. +@param C_RfQResponseLine_ID Request for Quotation Response Line */ +public void setC_RfQResponseLine_ID (int C_RfQResponseLine_ID) +{ +if (C_RfQResponseLine_ID < 1) throw new IllegalArgumentException ("C_RfQResponseLine_ID is mandatory."); +set_ValueNoCheck ("C_RfQResponseLine_ID", new Integer(C_RfQResponseLine_ID)); +} +/** Get RfQ Response Line. +@return Request for Quotation Response Line */ +public int getC_RfQResponseLine_ID() +{ +Integer ii = (Integer)get_Value("C_RfQResponseLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_RfQResponseLine_ID())); +} +/** Set Discount %. +@param Discount Discount in percent */ +public void setDiscount (BigDecimal Discount) +{ +set_Value ("Discount", Discount); +} +/** Get Discount %. +@return Discount in percent */ +public BigDecimal getDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Price. +@param Price Price */ +public void setPrice (BigDecimal Price) +{ +if (Price == null) throw new IllegalArgumentException ("Price is mandatory."); +set_Value ("Price", Price); +} +/** Get Price. +@return Price */ +public BigDecimal getPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("Price"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ranking. +@param Ranking Relative Rank Number */ +public void setRanking (int Ranking) +{ +set_Value ("Ranking", new Integer(Ranking)); +} +/** Get Ranking. +@return Relative Rank Number */ +public int getRanking() +{ +Integer ii = (Integer)get_Value("Ranking"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQ_Topic.java b/dbPort/src/org/compiere/model/X_C_RfQ_Topic.java new file mode 100644 index 0000000000..f6f4b36fab --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQ_Topic.java @@ -0,0 +1,180 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQ_Topic + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.656 */ +public class X_C_RfQ_Topic extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQ_Topic_ID id +@param trxName transaction +*/ +public X_C_RfQ_Topic (Properties ctx, int C_RfQ_Topic_ID, String trxName) +{ +super (ctx, C_RfQ_Topic_ID, trxName); +/** if (C_RfQ_Topic_ID == 0) +{ +setC_RfQ_Topic_ID (0); +setIsSelfService (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQ_Topic (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=671 */ +public static final int Table_ID=671; + +/** TableName=C_RfQ_Topic */ +public static final String Table_Name="C_RfQ_Topic"; + +protected static KeyNamePair Model = new KeyNamePair(671,"C_RfQ_Topic"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQ_Topic[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID <= 0) set_Value ("AD_PrintFormat_ID", null); + else +set_Value ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Topic. +@param C_RfQ_Topic_ID Topic for Request for Quotations */ +public void setC_RfQ_Topic_ID (int C_RfQ_Topic_ID) +{ +if (C_RfQ_Topic_ID < 1) throw new IllegalArgumentException ("C_RfQ_Topic_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_Topic_ID", new Integer(C_RfQ_Topic_ID)); +} +/** Get RfQ Topic. +@return Topic for Request for Quotations */ +public int getC_RfQ_Topic_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQ_TopicSubscriber.java b/dbPort/src/org/compiere/model/X_C_RfQ_TopicSubscriber.java new file mode 100644 index 0000000000..42297ed717 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQ_TopicSubscriber.java @@ -0,0 +1,197 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQ_TopicSubscriber + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.656 */ +public class X_C_RfQ_TopicSubscriber extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQ_TopicSubscriber_ID id +@param trxName transaction +*/ +public X_C_RfQ_TopicSubscriber (Properties ctx, int C_RfQ_TopicSubscriber_ID, String trxName) +{ +super (ctx, C_RfQ_TopicSubscriber_ID, trxName); +/** if (C_RfQ_TopicSubscriber_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_RfQ_TopicSubscriber_ID (0); +setC_RfQ_Topic_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQ_TopicSubscriber (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=670 */ +public static final int Table_ID=670; + +/** TableName=C_RfQ_TopicSubscriber */ +public static final String Table_Name="C_RfQ_TopicSubscriber"; + +protected static KeyNamePair Model = new KeyNamePair(670,"C_RfQ_TopicSubscriber"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQ_TopicSubscriber[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Subscriber. +@param C_RfQ_TopicSubscriber_ID Request for Quotation Topic Subscriber */ +public void setC_RfQ_TopicSubscriber_ID (int C_RfQ_TopicSubscriber_ID) +{ +if (C_RfQ_TopicSubscriber_ID < 1) throw new IllegalArgumentException ("C_RfQ_TopicSubscriber_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_TopicSubscriber_ID", new Integer(C_RfQ_TopicSubscriber_ID)); +} +/** Get RfQ Subscriber. +@return Request for Quotation Topic Subscriber */ +public int getC_RfQ_TopicSubscriber_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_TopicSubscriber_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Topic. +@param C_RfQ_Topic_ID Topic for Request for Quotations */ +public void setC_RfQ_Topic_ID (int C_RfQ_Topic_ID) +{ +if (C_RfQ_Topic_ID < 1) throw new IllegalArgumentException ("C_RfQ_Topic_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_Topic_ID", new Integer(C_RfQ_Topic_ID)); +} +/** Get RfQ Topic. +@return Topic for Request for Quotations */ +public int getC_RfQ_Topic_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_RfQ_Topic_ID())); +} +/** Set Opt-out Date. +@param OptOutDate Date the contact opted out */ +public void setOptOutDate (Timestamp OptOutDate) +{ +set_Value ("OptOutDate", OptOutDate); +} +/** Get Opt-out Date. +@return Date the contact opted out */ +public Timestamp getOptOutDate() +{ +return (Timestamp)get_Value("OptOutDate"); +} +/** Set Subscribe Date. +@param SubscribeDate Date the contact actively subscribed */ +public void setSubscribeDate (Timestamp SubscribeDate) +{ +set_Value ("SubscribeDate", SubscribeDate); +} +/** Get Subscribe Date. +@return Date the contact actively subscribed */ +public Timestamp getSubscribeDate() +{ +return (Timestamp)get_Value("SubscribeDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_RfQ_TopicSubscriberOnly.java b/dbPort/src/org/compiere/model/X_C_RfQ_TopicSubscriberOnly.java new file mode 100644 index 0000000000..93a98ceae8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_RfQ_TopicSubscriberOnly.java @@ -0,0 +1,174 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_RfQ_TopicSubscriberOnly + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.687 */ +public class X_C_RfQ_TopicSubscriberOnly extends PO +{ +/** Standard Constructor +@param ctx context +@param C_RfQ_TopicSubscriberOnly_ID id +@param trxName transaction +*/ +public X_C_RfQ_TopicSubscriberOnly (Properties ctx, int C_RfQ_TopicSubscriberOnly_ID, String trxName) +{ +super (ctx, C_RfQ_TopicSubscriberOnly_ID, trxName); +/** if (C_RfQ_TopicSubscriberOnly_ID == 0) +{ +setC_RfQ_TopicSubscriberOnly_ID (0); +setC_RfQ_TopicSubscriber_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_RfQ_TopicSubscriberOnly (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=747 */ +public static final int Table_ID=747; + +/** TableName=C_RfQ_TopicSubscriberOnly */ +public static final String Table_Name="C_RfQ_TopicSubscriberOnly"; + +protected static KeyNamePair Model = new KeyNamePair(747,"C_RfQ_TopicSubscriberOnly"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_RfQ_TopicSubscriberOnly[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set RfQ Topic Subscriber Restriction. +@param C_RfQ_TopicSubscriberOnly_ID Include Subscriber only for certain products or product categories */ +public void setC_RfQ_TopicSubscriberOnly_ID (int C_RfQ_TopicSubscriberOnly_ID) +{ +if (C_RfQ_TopicSubscriberOnly_ID < 1) throw new IllegalArgumentException ("C_RfQ_TopicSubscriberOnly_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_TopicSubscriberOnly_ID", new Integer(C_RfQ_TopicSubscriberOnly_ID)); +} +/** Get RfQ Topic Subscriber Restriction. +@return Include Subscriber only for certain products or product categories */ +public int getC_RfQ_TopicSubscriberOnly_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_TopicSubscriberOnly_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RfQ Subscriber. +@param C_RfQ_TopicSubscriber_ID Request for Quotation Topic Subscriber */ +public void setC_RfQ_TopicSubscriber_ID (int C_RfQ_TopicSubscriber_ID) +{ +if (C_RfQ_TopicSubscriber_ID < 1) throw new IllegalArgumentException ("C_RfQ_TopicSubscriber_ID is mandatory."); +set_ValueNoCheck ("C_RfQ_TopicSubscriber_ID", new Integer(C_RfQ_TopicSubscriber_ID)); +} +/** Get RfQ Subscriber. +@return Request for Quotation Topic Subscriber */ +public int getC_RfQ_TopicSubscriber_ID() +{ +Integer ii = (Integer)get_Value("C_RfQ_TopicSubscriber_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_Product_Category_ID())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_SalesRegion.java b/dbPort/src/org/compiere/model/X_C_SalesRegion.java new file mode 100644 index 0000000000..93fab002ee --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_SalesRegion.java @@ -0,0 +1,221 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_SalesRegion + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.703 */ +public class X_C_SalesRegion extends PO +{ +/** Standard Constructor +@param ctx context +@param C_SalesRegion_ID id +@param trxName transaction +*/ +public X_C_SalesRegion (Properties ctx, int C_SalesRegion_ID, String trxName) +{ +super (ctx, C_SalesRegion_ID, trxName); +/** if (C_SalesRegion_ID == 0) +{ +setC_SalesRegion_ID (0); +setIsDefault (false); +setIsSummary (false); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_SalesRegion (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=230 */ +public static final int Table_ID=230; + +/** TableName=C_SalesRegion */ +public static final String Table_Name="C_SalesRegion"; + +protected static KeyNamePair Model = new KeyNamePair(230,"C_SalesRegion"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_SalesRegion[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID < 1) throw new IllegalArgumentException ("C_SalesRegion_ID is mandatory."); +set_ValueNoCheck ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ServiceLevel.java b/dbPort/src/org/compiere/model/X_C_ServiceLevel.java new file mode 100644 index 0000000000..40f5b9e1aa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ServiceLevel.java @@ -0,0 +1,226 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ServiceLevel + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.703 */ +public class X_C_ServiceLevel extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ServiceLevel_ID id +@param trxName transaction +*/ +public X_C_ServiceLevel (Properties ctx, int C_ServiceLevel_ID, String trxName) +{ +super (ctx, C_ServiceLevel_ID, trxName); +/** if (C_ServiceLevel_ID == 0) +{ +setC_RevenueRecognition_Plan_ID (0); +setC_ServiceLevel_ID (0); +setM_Product_ID (0); +setServiceLevelInvoiced (Env.ZERO); +setServiceLevelProvided (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ServiceLevel (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=337 */ +public static final int Table_ID=337; + +/** TableName=C_ServiceLevel */ +public static final String Table_Name="C_ServiceLevel"; + +protected static KeyNamePair Model = new KeyNamePair(337,"C_ServiceLevel"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ServiceLevel[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Revenue Recognition Plan. +@param C_RevenueRecognition_Plan_ID Plan for recognizing or recording revenue */ +public void setC_RevenueRecognition_Plan_ID (int C_RevenueRecognition_Plan_ID) +{ +if (C_RevenueRecognition_Plan_ID < 1) throw new IllegalArgumentException ("C_RevenueRecognition_Plan_ID is mandatory."); +set_ValueNoCheck ("C_RevenueRecognition_Plan_ID", new Integer(C_RevenueRecognition_Plan_ID)); +} +/** Get Revenue Recognition Plan. +@return Plan for recognizing or recording revenue */ +public int getC_RevenueRecognition_Plan_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_Plan_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Service Level. +@param C_ServiceLevel_ID Product Revenue Recognition Service Level */ +public void setC_ServiceLevel_ID (int C_ServiceLevel_ID) +{ +if (C_ServiceLevel_ID < 1) throw new IllegalArgumentException ("C_ServiceLevel_ID is mandatory."); +set_ValueNoCheck ("C_ServiceLevel_ID", new Integer(C_ServiceLevel_ID)); +} +/** Get Service Level. +@return Product Revenue Recognition Service Level */ +public int getC_ServiceLevel_ID() +{ +Integer ii = (Integer)get_Value("C_ServiceLevel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDescription()); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity Invoiced. +@param ServiceLevelInvoiced Quantity of product or service invoiced */ +public void setServiceLevelInvoiced (BigDecimal ServiceLevelInvoiced) +{ +if (ServiceLevelInvoiced == null) throw new IllegalArgumentException ("ServiceLevelInvoiced is mandatory."); +set_ValueNoCheck ("ServiceLevelInvoiced", ServiceLevelInvoiced); +} +/** Get Quantity Invoiced. +@return Quantity of product or service invoiced */ +public BigDecimal getServiceLevelInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("ServiceLevelInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Provided. +@param ServiceLevelProvided Quantity of service or product provided */ +public void setServiceLevelProvided (BigDecimal ServiceLevelProvided) +{ +if (ServiceLevelProvided == null) throw new IllegalArgumentException ("ServiceLevelProvided is mandatory."); +set_ValueNoCheck ("ServiceLevelProvided", ServiceLevelProvided); +} +/** Get Quantity Provided. +@return Quantity of service or product provided */ +public BigDecimal getServiceLevelProvided() +{ +BigDecimal bd = (BigDecimal)get_Value("ServiceLevelProvided"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ServiceLevelLine.java b/dbPort/src/org/compiere/model/X_C_ServiceLevelLine.java new file mode 100644 index 0000000000..ca7dd7e650 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ServiceLevelLine.java @@ -0,0 +1,190 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ServiceLevelLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.718 */ +public class X_C_ServiceLevelLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ServiceLevelLine_ID id +@param trxName transaction +*/ +public X_C_ServiceLevelLine (Properties ctx, int C_ServiceLevelLine_ID, String trxName) +{ +super (ctx, C_ServiceLevelLine_ID, trxName); +/** if (C_ServiceLevelLine_ID == 0) +{ +setC_ServiceLevelLine_ID (0); +setC_ServiceLevel_ID (0); +setServiceDate (new Timestamp(System.currentTimeMillis())); +setServiceLevelProvided (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ServiceLevelLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=338 */ +public static final int Table_ID=338; + +/** TableName=C_ServiceLevelLine */ +public static final String Table_Name="C_ServiceLevelLine"; + +protected static KeyNamePair Model = new KeyNamePair(338,"C_ServiceLevelLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ServiceLevelLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Service Level Line. +@param C_ServiceLevelLine_ID Product Revenue Recognition Service Level Line */ +public void setC_ServiceLevelLine_ID (int C_ServiceLevelLine_ID) +{ +if (C_ServiceLevelLine_ID < 1) throw new IllegalArgumentException ("C_ServiceLevelLine_ID is mandatory."); +set_ValueNoCheck ("C_ServiceLevelLine_ID", new Integer(C_ServiceLevelLine_ID)); +} +/** Get Service Level Line. +@return Product Revenue Recognition Service Level Line */ +public int getC_ServiceLevelLine_ID() +{ +Integer ii = (Integer)get_Value("C_ServiceLevelLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Service Level. +@param C_ServiceLevel_ID Product Revenue Recognition Service Level */ +public void setC_ServiceLevel_ID (int C_ServiceLevel_ID) +{ +if (C_ServiceLevel_ID < 1) throw new IllegalArgumentException ("C_ServiceLevel_ID is mandatory."); +set_ValueNoCheck ("C_ServiceLevel_ID", new Integer(C_ServiceLevel_ID)); +} +/** Get Service Level. +@return Product Revenue Recognition Service Level */ +public int getC_ServiceLevel_ID() +{ +Integer ii = (Integer)get_Value("C_ServiceLevel_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Service date. +@param ServiceDate Date service was provided */ +public void setServiceDate (Timestamp ServiceDate) +{ +if (ServiceDate == null) throw new IllegalArgumentException ("ServiceDate is mandatory."); +set_ValueNoCheck ("ServiceDate", ServiceDate); +} +/** Get Service date. +@return Date service was provided */ +public Timestamp getServiceDate() +{ +return (Timestamp)get_Value("ServiceDate"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getServiceDate())); +} +/** Set Quantity Provided. +@param ServiceLevelProvided Quantity of service or product provided */ +public void setServiceLevelProvided (BigDecimal ServiceLevelProvided) +{ +if (ServiceLevelProvided == null) throw new IllegalArgumentException ("ServiceLevelProvided is mandatory."); +set_ValueNoCheck ("ServiceLevelProvided", ServiceLevelProvided); +} +/** Get Quantity Provided. +@return Quantity of service or product provided */ +public BigDecimal getServiceLevelProvided() +{ +BigDecimal bd = (BigDecimal)get_Value("ServiceLevelProvided"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_SubAcct.java b/dbPort/src/org/compiere/model/X_C_SubAcct.java new file mode 100644 index 0000000000..ca2aca24de --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_SubAcct.java @@ -0,0 +1,197 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_SubAcct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.734 */ +public class X_C_SubAcct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_SubAcct_ID id +@param trxName transaction +*/ +public X_C_SubAcct (Properties ctx, int C_SubAcct_ID, String trxName) +{ +super (ctx, C_SubAcct_ID, trxName); +/** if (C_SubAcct_ID == 0) +{ +setC_ElementValue_ID (0); +setC_SubAcct_ID (0); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_SubAcct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=825 */ +public static final int Table_ID=825; + +/** TableName=C_SubAcct */ +public static final String Table_Name="C_SubAcct"; + +protected static KeyNamePair Model = new KeyNamePair(825,"C_SubAcct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_SubAcct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID < 1) throw new IllegalArgumentException ("C_ElementValue_ID is mandatory."); +set_ValueNoCheck ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sub Account. +@param C_SubAcct_ID Sub account for Element Value */ +public void setC_SubAcct_ID (int C_SubAcct_ID) +{ +if (C_SubAcct_ID < 1) throw new IllegalArgumentException ("C_SubAcct_ID is mandatory."); +set_ValueNoCheck ("C_SubAcct_ID", new Integer(C_SubAcct_ID)); +} +/** Get Sub Account. +@return Sub account for Element Value */ +public int getC_SubAcct_ID() +{ +Integer ii = (Integer)get_Value("C_SubAcct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Subscription.java b/dbPort/src/org/compiere/model/X_C_Subscription.java new file mode 100644 index 0000000000..8856774eb1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Subscription.java @@ -0,0 +1,237 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Subscription + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.734 */ +public class X_C_Subscription extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Subscription_ID id +@param trxName transaction +*/ +public X_C_Subscription (Properties ctx, int C_Subscription_ID, String trxName) +{ +super (ctx, C_Subscription_ID, trxName); +/** if (C_Subscription_ID == 0) +{ +setC_BPartner_ID (0); +setC_SubscriptionType_ID (0); +setC_Subscription_ID (0); +setIsDue (false); +setM_Product_ID (0); +setName (null); +setPaidUntilDate (new Timestamp(System.currentTimeMillis())); +setRenewalDate (new Timestamp(System.currentTimeMillis())); +setStartDate (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Subscription (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=669 */ +public static final int Table_ID=669; + +/** TableName=C_Subscription */ +public static final String Table_Name="C_Subscription"; + +protected static KeyNamePair Model = new KeyNamePair(669,"C_Subscription"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Subscription[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Subscription Type. +@param C_SubscriptionType_ID Type of subscription */ +public void setC_SubscriptionType_ID (int C_SubscriptionType_ID) +{ +if (C_SubscriptionType_ID < 1) throw new IllegalArgumentException ("C_SubscriptionType_ID is mandatory."); +set_Value ("C_SubscriptionType_ID", new Integer(C_SubscriptionType_ID)); +} +/** Get Subscription Type. +@return Type of subscription */ +public int getC_SubscriptionType_ID() +{ +Integer ii = (Integer)get_Value("C_SubscriptionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Subscription. +@param C_Subscription_ID Subscription of a Business Partner of a Product to renew */ +public void setC_Subscription_ID (int C_Subscription_ID) +{ +if (C_Subscription_ID < 1) throw new IllegalArgumentException ("C_Subscription_ID is mandatory."); +set_ValueNoCheck ("C_Subscription_ID", new Integer(C_Subscription_ID)); +} +/** Get Subscription. +@return Subscription of a Business Partner of a Product to renew */ +public int getC_Subscription_ID() +{ +Integer ii = (Integer)get_Value("C_Subscription_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Due. +@param IsDue Subscription Renewal is Due */ +public void setIsDue (boolean IsDue) +{ +set_Value ("IsDue", new Boolean(IsDue)); +} +/** Get Due. +@return Subscription Renewal is Due */ +public boolean isDue() +{ +Object oo = get_Value("IsDue"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Paid Until. +@param PaidUntilDate Subscription is paid/valid until this date */ +public void setPaidUntilDate (Timestamp PaidUntilDate) +{ +if (PaidUntilDate == null) throw new IllegalArgumentException ("PaidUntilDate is mandatory."); +set_Value ("PaidUntilDate", PaidUntilDate); +} +/** Get Paid Until. +@return Subscription is paid/valid until this date */ +public Timestamp getPaidUntilDate() +{ +return (Timestamp)get_Value("PaidUntilDate"); +} +/** Set Renewal Date. +@param RenewalDate Renewal Date */ +public void setRenewalDate (Timestamp RenewalDate) +{ +if (RenewalDate == null) throw new IllegalArgumentException ("RenewalDate is mandatory."); +set_Value ("RenewalDate", RenewalDate); +} +/** Get Renewal Date. +@return Renewal Date */ +public Timestamp getRenewalDate() +{ +return (Timestamp)get_Value("RenewalDate"); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +if (StartDate == null) throw new IllegalArgumentException ("StartDate is mandatory."); +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_SubscriptionType.java b/dbPort/src/org/compiere/model/X_C_SubscriptionType.java new file mode 100644 index 0000000000..b9cc3cc6b4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_SubscriptionType.java @@ -0,0 +1,190 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_SubscriptionType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.75 */ +public class X_C_SubscriptionType extends PO +{ +/** Standard Constructor +@param ctx context +@param C_SubscriptionType_ID id +@param trxName transaction +*/ +public X_C_SubscriptionType (Properties ctx, int C_SubscriptionType_ID, String trxName) +{ +super (ctx, C_SubscriptionType_ID, trxName); +/** if (C_SubscriptionType_ID == 0) +{ +setC_SubscriptionType_ID (0); +setFrequency (0); +setFrequencyType (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_SubscriptionType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=668 */ +public static final int Table_ID=668; + +/** TableName=C_SubscriptionType */ +public static final String Table_Name="C_SubscriptionType"; + +protected static KeyNamePair Model = new KeyNamePair(668,"C_SubscriptionType"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_SubscriptionType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Subscription Type. +@param C_SubscriptionType_ID Type of subscription */ +public void setC_SubscriptionType_ID (int C_SubscriptionType_ID) +{ +if (C_SubscriptionType_ID < 1) throw new IllegalArgumentException ("C_SubscriptionType_ID is mandatory."); +set_ValueNoCheck ("C_SubscriptionType_ID", new Integer(C_SubscriptionType_ID)); +} +/** Get Subscription Type. +@return Type of subscription */ +public int getC_SubscriptionType_ID() +{ +Integer ii = (Integer)get_Value("C_SubscriptionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=221 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=221; +/** Day = D */ +public static final String FREQUENCYTYPE_Day = "D"; +/** Hour = H */ +public static final String FREQUENCYTYPE_Hour = "H"; +/** Minute = M */ +public static final String FREQUENCYTYPE_Minute = "M"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("H") || FrequencyType.equals("M")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=221 - D - H - M"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Subscription_Delivery.java b/dbPort/src/org/compiere/model/X_C_Subscription_Delivery.java new file mode 100644 index 0000000000..0cdbef5ff6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Subscription_Delivery.java @@ -0,0 +1,125 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Subscription_Delivery + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.765 */ +public class X_C_Subscription_Delivery extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Subscription_Delivery_ID id +@param trxName transaction +*/ +public X_C_Subscription_Delivery (Properties ctx, int C_Subscription_Delivery_ID, String trxName) +{ +super (ctx, C_Subscription_Delivery_ID, trxName); +/** if (C_Subscription_Delivery_ID == 0) +{ +setC_Subscription_Delivery_ID (0); +setC_Subscription_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Subscription_Delivery (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=667 */ +public static final int Table_ID=667; + +/** TableName=C_Subscription_Delivery */ +public static final String Table_Name="C_Subscription_Delivery"; + +protected static KeyNamePair Model = new KeyNamePair(667,"C_Subscription_Delivery"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Subscription_Delivery[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Subscription Delivery. +@param C_Subscription_Delivery_ID Optional Delivery Record for a Subscription */ +public void setC_Subscription_Delivery_ID (int C_Subscription_Delivery_ID) +{ +if (C_Subscription_Delivery_ID < 1) throw new IllegalArgumentException ("C_Subscription_Delivery_ID is mandatory."); +set_ValueNoCheck ("C_Subscription_Delivery_ID", new Integer(C_Subscription_Delivery_ID)); +} +/** Get Subscription Delivery. +@return Optional Delivery Record for a Subscription */ +public int getC_Subscription_Delivery_ID() +{ +Integer ii = (Integer)get_Value("C_Subscription_Delivery_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Subscription_Delivery_ID())); +} +/** Set Subscription. +@param C_Subscription_ID Subscription of a Business Partner of a Product to renew */ +public void setC_Subscription_ID (int C_Subscription_ID) +{ +if (C_Subscription_ID < 1) throw new IllegalArgumentException ("C_Subscription_ID is mandatory."); +set_ValueNoCheck ("C_Subscription_ID", new Integer(C_Subscription_ID)); +} +/** Get Subscription. +@return Subscription of a Business Partner of a Product to renew */ +public int getC_Subscription_ID() +{ +Integer ii = (Integer)get_Value("C_Subscription_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Task.java b/dbPort/src/org/compiere/model/X_C_Task.java new file mode 100644 index 0000000000..71ad9525e3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Task.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Task + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.765 */ +public class X_C_Task extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Task_ID id +@param trxName transaction +*/ +public X_C_Task (Properties ctx, int C_Task_ID, String trxName) +{ +super (ctx, C_Task_ID, trxName); +/** if (C_Task_ID == 0) +{ +setC_Phase_ID (0); +setC_Task_ID (0); +setName (null); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM C_Task WHERE C_Phase_ID=@C_Phase_ID@ +setStandardQty (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Task (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=583 */ +public static final int Table_ID=583; + +/** TableName=C_Task */ +public static final String Table_Name="C_Task"; + +protected static KeyNamePair Model = new KeyNamePair(583,"C_Task"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Task[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Standard Phase. +@param C_Phase_ID Standard Phase of the Project Type */ +public void setC_Phase_ID (int C_Phase_ID) +{ +if (C_Phase_ID < 1) throw new IllegalArgumentException ("C_Phase_ID is mandatory."); +set_ValueNoCheck ("C_Phase_ID", new Integer(C_Phase_ID)); +} +/** Get Standard Phase. +@return Standard Phase of the Project Type */ +public int getC_Phase_ID() +{ +Integer ii = (Integer)get_Value("C_Phase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Task. +@param C_Task_ID Standard Project Type Task */ +public void setC_Task_ID (int C_Task_ID) +{ +if (C_Task_ID < 1) throw new IllegalArgumentException ("C_Task_ID is mandatory."); +set_ValueNoCheck ("C_Task_ID", new Integer(C_Task_ID)); +} +/** Get Standard Task. +@return Standard Project Type Task */ +public int getC_Task_ID() +{ +Integer ii = (Integer)get_Value("C_Task_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Quantity. +@param StandardQty Standard Quantity */ +public void setStandardQty (BigDecimal StandardQty) +{ +if (StandardQty == null) throw new IllegalArgumentException ("StandardQty is mandatory."); +set_Value ("StandardQty", StandardQty); +} +/** Get Standard Quantity. +@return Standard Quantity */ +public BigDecimal getStandardQty() +{ +BigDecimal bd = (BigDecimal)get_Value("StandardQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Tax.java b/dbPort/src/org/compiere/model/X_C_Tax.java new file mode 100644 index 0000000000..96e8d91ef3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Tax.java @@ -0,0 +1,447 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Tax + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.781 */ +public class X_C_Tax extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Tax_ID id +@param trxName transaction +*/ +public X_C_Tax (Properties ctx, int C_Tax_ID, String trxName) +{ +super (ctx, C_Tax_ID, trxName); +/** if (C_Tax_ID == 0) +{ +setC_TaxCategory_ID (0); +setC_Tax_ID (0); +setIsDefault (false); +setIsDocumentLevel (false); +setIsSalesTax (false); // N +setIsSummary (false); +setIsTaxExempt (false); +setName (null); +setRate (Env.ZERO); +setRequiresTaxCertificate (false); +setSOPOType (null); // B +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Tax (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=261 */ +public static final int Table_ID=261; + +/** TableName=C_Tax */ +public static final String Table_Name="C_Tax"; + +protected static KeyNamePair Model = new KeyNamePair(261,"C_Tax"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Tax[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** C_Country_ID AD_Reference_ID=156 */ +public static final int C_COUNTRY_ID_AD_Reference_ID=156; +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID <= 0) set_Value ("C_Country_ID", null); + else +set_Value ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Region_ID AD_Reference_ID=157 */ +public static final int C_REGION_ID_AD_Reference_ID=157; +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_Value ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Document Level. +@param IsDocumentLevel Tax is calculated on document level (rather than line by line) */ +public void setIsDocumentLevel (boolean IsDocumentLevel) +{ +set_Value ("IsDocumentLevel", new Boolean(IsDocumentLevel)); +} +/** Get Document Level. +@return Tax is calculated on document level (rather than line by line) */ +public boolean isDocumentLevel() +{ +Object oo = get_Value("IsDocumentLevel"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Tax. +@param IsSalesTax This is a sales tax (i.e. not a value added tax) */ +public void setIsSalesTax (boolean IsSalesTax) +{ +set_Value ("IsSalesTax", new Boolean(IsSalesTax)); +} +/** Get Sales Tax. +@return This is a sales tax (i.e. not a value added tax) */ +public boolean isSalesTax() +{ +Object oo = get_Value("IsSalesTax"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax exempt. +@param IsTaxExempt Business partner is exempt from tax */ +public void setIsTaxExempt (boolean IsTaxExempt) +{ +set_Value ("IsTaxExempt", new Boolean(IsTaxExempt)); +} +/** Get Tax exempt. +@return Business partner is exempt from tax */ +public boolean isTaxExempt() +{ +Object oo = get_Value("IsTaxExempt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Parent_Tax_ID AD_Reference_ID=158 */ +public static final int PARENT_TAX_ID_AD_Reference_ID=158; +/** Set Parent Tax. +@param Parent_Tax_ID Parent Tax indicates a tax that is made up of multiple taxes */ +public void setParent_Tax_ID (int Parent_Tax_ID) +{ +if (Parent_Tax_ID <= 0) set_Value ("Parent_Tax_ID", null); + else +set_Value ("Parent_Tax_ID", new Integer(Parent_Tax_ID)); +} +/** Get Parent Tax. +@return Parent Tax indicates a tax that is made up of multiple taxes */ +public int getParent_Tax_ID() +{ +Integer ii = (Integer)get_Value("Parent_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Rate. +@param Rate Rate or Tax or Exchange */ +public void setRate (BigDecimal Rate) +{ +if (Rate == null) throw new IllegalArgumentException ("Rate is mandatory."); +set_Value ("Rate", Rate); +} +/** Get Rate. +@return Rate or Tax or Exchange */ +public BigDecimal getRate() +{ +BigDecimal bd = (BigDecimal)get_Value("Rate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Requires Tax Certificate. +@param RequiresTaxCertificate This tax rate requires the Business Partner to be tax exempt */ +public void setRequiresTaxCertificate (boolean RequiresTaxCertificate) +{ +set_Value ("RequiresTaxCertificate", new Boolean(RequiresTaxCertificate)); +} +/** Get Requires Tax Certificate. +@return This tax rate requires the Business Partner to be tax exempt */ +public boolean isRequiresTaxCertificate() +{ +Object oo = get_Value("RequiresTaxCertificate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** SOPOType AD_Reference_ID=287 */ +public static final int SOPOTYPE_AD_Reference_ID=287; +/** Both = B */ +public static final String SOPOTYPE_Both = "B"; +/** Purchase Tax = P */ +public static final String SOPOTYPE_PurchaseTax = "P"; +/** Sales Tax = S */ +public static final String SOPOTYPE_SalesTax = "S"; +/** Set SO/PO Type. +@param SOPOType Sales Tax applies to sales situations, Purchase Tax to purchase situations */ +public void setSOPOType (String SOPOType) +{ +if (SOPOType == null) throw new IllegalArgumentException ("SOPOType is mandatory"); +if (SOPOType.equals("B") || SOPOType.equals("P") || SOPOType.equals("S")); + else throw new IllegalArgumentException ("SOPOType Invalid value - " + SOPOType + " - Reference_ID=287 - B - P - S"); +if (SOPOType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SOPOType = SOPOType.substring(0,0); +} +set_Value ("SOPOType", SOPOType); +} +/** Get SO/PO Type. +@return Sales Tax applies to sales situations, Purchase Tax to purchase situations */ +public String getSOPOType() +{ +return (String)get_Value("SOPOType"); +} +/** Set Tax Indicator. +@param TaxIndicator Short form for Tax to be printed on documents */ +public void setTaxIndicator (String TaxIndicator) +{ +if (TaxIndicator != null && TaxIndicator.length() > 10) +{ +log.warning("Length > 10 - truncated"); +TaxIndicator = TaxIndicator.substring(0,9); +} +set_Value ("TaxIndicator", TaxIndicator); +} +/** Get Tax Indicator. +@return Short form for Tax to be printed on documents */ +public String getTaxIndicator() +{ +return (String)get_Value("TaxIndicator"); +} + +/** To_Country_ID AD_Reference_ID=156 */ +public static final int TO_COUNTRY_ID_AD_Reference_ID=156; +/** Set To. +@param To_Country_ID Receiving Country */ +public void setTo_Country_ID (int To_Country_ID) +{ +if (To_Country_ID <= 0) set_Value ("To_Country_ID", null); + else +set_Value ("To_Country_ID", new Integer(To_Country_ID)); +} +/** Get To. +@return Receiving Country */ +public int getTo_Country_ID() +{ +Integer ii = (Integer)get_Value("To_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** To_Region_ID AD_Reference_ID=157 */ +public static final int TO_REGION_ID_AD_Reference_ID=157; +/** Set To. +@param To_Region_ID Receiving Region */ +public void setTo_Region_ID (int To_Region_ID) +{ +if (To_Region_ID <= 0) set_Value ("To_Region_ID", null); + else +set_Value ("To_Region_ID", new Integer(To_Region_ID)); +} +/** Get To. +@return Receiving Region */ +public int getTo_Region_ID() +{ +Integer ii = (Integer)get_Value("To_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_TaxCategory.java b/dbPort/src/org/compiere/model/X_C_TaxCategory.java new file mode 100644 index 0000000000..ba76d590b4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_TaxCategory.java @@ -0,0 +1,181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_TaxCategory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.812 */ +public class X_C_TaxCategory extends PO +{ +/** Standard Constructor +@param ctx context +@param C_TaxCategory_ID id +@param trxName transaction +*/ +public X_C_TaxCategory (Properties ctx, int C_TaxCategory_ID, String trxName) +{ +super (ctx, C_TaxCategory_ID, trxName); +/** if (C_TaxCategory_ID == 0) +{ +setC_TaxCategory_ID (0); +setIsDefault (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_TaxCategory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=252 */ +public static final int Table_ID=252; + +/** TableName=C_TaxCategory */ +public static final String Table_Name="C_TaxCategory"; + +protected static KeyNamePair Model = new KeyNamePair(252,"C_TaxCategory"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_TaxCategory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_ValueNoCheck ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Commodity Code. +@param CommodityCode Commodity code used for tax calculation */ +public void setCommodityCode (String CommodityCode) +{ +if (CommodityCode != null && CommodityCode.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CommodityCode = CommodityCode.substring(0,19); +} +set_Value ("CommodityCode", CommodityCode); +} +/** Get Commodity Code. +@return Commodity code used for tax calculation */ +public String getCommodityCode() +{ +return (String)get_Value("CommodityCode"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_TaxDeclaration.java b/dbPort/src/org/compiere/model/X_C_TaxDeclaration.java new file mode 100644 index 0000000000..c8fe50c37f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_TaxDeclaration.java @@ -0,0 +1,224 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_TaxDeclaration + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.812 */ +public class X_C_TaxDeclaration extends PO +{ +/** Standard Constructor +@param ctx context +@param C_TaxDeclaration_ID id +@param trxName transaction +*/ +public X_C_TaxDeclaration (Properties ctx, int C_TaxDeclaration_ID, String trxName) +{ +super (ctx, C_TaxDeclaration_ID, trxName); +/** if (C_TaxDeclaration_ID == 0) +{ +setC_TaxDeclaration_ID (0); +setDateFrom (new Timestamp(System.currentTimeMillis())); +setDateTo (new Timestamp(System.currentTimeMillis())); +setDateTrx (new Timestamp(System.currentTimeMillis())); +setName (null); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_TaxDeclaration (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=818 */ +public static final int Table_ID=818; + +/** TableName=C_TaxDeclaration */ +public static final String Table_Name="C_TaxDeclaration"; + +protected static KeyNamePair Model = new KeyNamePair(818,"C_TaxDeclaration"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_TaxDeclaration[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tax Declaration. +@param C_TaxDeclaration_ID Define the declaration to the tax authorities */ +public void setC_TaxDeclaration_ID (int C_TaxDeclaration_ID) +{ +if (C_TaxDeclaration_ID < 1) throw new IllegalArgumentException ("C_TaxDeclaration_ID is mandatory."); +set_ValueNoCheck ("C_TaxDeclaration_ID", new Integer(C_TaxDeclaration_ID)); +} +/** Get Tax Declaration. +@return Define the declaration to the tax authorities */ +public int getC_TaxDeclaration_ID() +{ +Integer ii = (Integer)get_Value("C_TaxDeclaration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date From. +@param DateFrom Starting date for a range */ +public void setDateFrom (Timestamp DateFrom) +{ +if (DateFrom == null) throw new IllegalArgumentException ("DateFrom is mandatory."); +set_Value ("DateFrom", DateFrom); +} +/** Get Date From. +@return Starting date for a range */ +public Timestamp getDateFrom() +{ +return (Timestamp)get_Value("DateFrom"); +} +/** Set Date To. +@param DateTo End date of a date range */ +public void setDateTo (Timestamp DateTo) +{ +if (DateTo == null) throw new IllegalArgumentException ("DateTo is mandatory."); +set_Value ("DateTo", DateTo); +} +/** Get Date To. +@return End date of a date range */ +public Timestamp getDateTo() +{ +return (Timestamp)get_Value("DateTo"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_Value ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_TaxDeclarationAcct.java b/dbPort/src/org/compiere/model/X_C_TaxDeclarationAcct.java new file mode 100644 index 0000000000..138a60582b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_TaxDeclarationAcct.java @@ -0,0 +1,309 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_TaxDeclarationAcct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.828 */ +public class X_C_TaxDeclarationAcct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_TaxDeclarationAcct_ID id +@param trxName transaction +*/ +public X_C_TaxDeclarationAcct (Properties ctx, int C_TaxDeclarationAcct_ID, String trxName) +{ +super (ctx, C_TaxDeclarationAcct_ID, trxName); +/** if (C_TaxDeclarationAcct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_TaxDeclarationAcct_ID (0); +setC_TaxDeclaration_ID (0); +setFact_Acct_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_TaxDeclarationAcct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=820 */ +public static final int Table_ID=820; + +/** TableName=C_TaxDeclarationAcct */ +public static final String Table_Name="C_TaxDeclarationAcct"; + +protected static KeyNamePair Model = new KeyNamePair(820,"C_TaxDeclarationAcct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_TaxDeclarationAcct[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** Account_ID AD_Reference_ID=331 */ +public static final int ACCOUNT_ID_AD_Reference_ID=331; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +throw new IllegalArgumentException ("Account_ID is virtual column"); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounted Credit. +@param AmtAcctCr Accounted Credit Amount */ +public void setAmtAcctCr (BigDecimal AmtAcctCr) +{ +throw new IllegalArgumentException ("AmtAcctCr is virtual column"); +} +/** Get Accounted Credit. +@return Accounted Credit Amount */ +public BigDecimal getAmtAcctCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounted Debit. +@param AmtAcctDr Accounted Debit Amount */ +public void setAmtAcctDr (BigDecimal AmtAcctDr) +{ +throw new IllegalArgumentException ("AmtAcctDr is virtual column"); +} +/** Get Accounted Debit. +@return Accounted Debit Amount */ +public BigDecimal getAmtAcctDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Credit. +@param AmtSourceCr Source Credit Amount */ +public void setAmtSourceCr (BigDecimal AmtSourceCr) +{ +throw new IllegalArgumentException ("AmtSourceCr is virtual column"); +} +/** Get Source Credit. +@return Source Credit Amount */ +public BigDecimal getAmtSourceCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Debit. +@param AmtSourceDr Source Debit Amount */ +public void setAmtSourceDr (BigDecimal AmtSourceDr) +{ +throw new IllegalArgumentException ("AmtSourceDr is virtual column"); +} +/** Get Source Debit. +@return Source Debit Amount */ +public BigDecimal getAmtSourceDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +throw new IllegalArgumentException ("C_BPartner_ID is virtual column"); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +throw new IllegalArgumentException ("C_Currency_ID is virtual column"); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Declaration Accounting. +@param C_TaxDeclarationAcct_ID Tax Accounting Reconciliation */ +public void setC_TaxDeclarationAcct_ID (int C_TaxDeclarationAcct_ID) +{ +if (C_TaxDeclarationAcct_ID < 1) throw new IllegalArgumentException ("C_TaxDeclarationAcct_ID is mandatory."); +set_ValueNoCheck ("C_TaxDeclarationAcct_ID", new Integer(C_TaxDeclarationAcct_ID)); +} +/** Get Tax Declaration Accounting. +@return Tax Accounting Reconciliation */ +public int getC_TaxDeclarationAcct_ID() +{ +Integer ii = (Integer)get_Value("C_TaxDeclarationAcct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Declaration. +@param C_TaxDeclaration_ID Define the declaration to the tax authorities */ +public void setC_TaxDeclaration_ID (int C_TaxDeclaration_ID) +{ +if (C_TaxDeclaration_ID < 1) throw new IllegalArgumentException ("C_TaxDeclaration_ID is mandatory."); +set_ValueNoCheck ("C_TaxDeclaration_ID", new Integer(C_TaxDeclaration_ID)); +} +/** Get Tax Declaration. +@return Define the declaration to the tax authorities */ +public int getC_TaxDeclaration_ID() +{ +Integer ii = (Integer)get_Value("C_TaxDeclaration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +throw new IllegalArgumentException ("C_Tax_ID is virtual column"); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +throw new IllegalArgumentException ("DateAcct is virtual column"); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Accounting Fact. +@param Fact_Acct_ID Accounting Fact */ +public void setFact_Acct_ID (int Fact_Acct_ID) +{ +if (Fact_Acct_ID < 1) throw new IllegalArgumentException ("Fact_Acct_ID is mandatory."); +set_ValueNoCheck ("Fact_Acct_ID", new Integer(Fact_Acct_ID)); +} +/** Get Accounting Fact. +@return Accounting Fact */ +public int getFact_Acct_ID() +{ +Integer ii = (Integer)get_Value("Fact_Acct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_TaxDeclarationLine.java b/dbPort/src/org/compiere/model/X_C_TaxDeclarationLine.java new file mode 100644 index 0000000000..77f70940a9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_TaxDeclarationLine.java @@ -0,0 +1,312 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_TaxDeclarationLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.843 */ +public class X_C_TaxDeclarationLine extends PO +{ +/** Standard Constructor +@param ctx context +@param C_TaxDeclarationLine_ID id +@param trxName transaction +*/ +public X_C_TaxDeclarationLine (Properties ctx, int C_TaxDeclarationLine_ID, String trxName) +{ +super (ctx, C_TaxDeclarationLine_ID, trxName); +/** if (C_TaxDeclarationLine_ID == 0) +{ +setC_BPartner_ID (0); +setC_Currency_ID (0); +setC_TaxDeclarationLine_ID (0); +setC_TaxDeclaration_ID (0); +setC_Tax_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setIsManual (true); // Y +setLine (0); +setTaxAmt (Env.ZERO); +setTaxBaseAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_TaxDeclarationLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=819 */ +public static final int Table_ID=819; + +/** TableName=C_TaxDeclarationLine */ +public static final String Table_Name="C_TaxDeclarationLine"; + +protected static KeyNamePair Model = new KeyNamePair(819,"C_TaxDeclarationLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_TaxDeclarationLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Allocation Line. +@param C_AllocationLine_ID Allocation Line */ +public void setC_AllocationLine_ID (int C_AllocationLine_ID) +{ +if (C_AllocationLine_ID <= 0) set_ValueNoCheck ("C_AllocationLine_ID", null); + else +set_ValueNoCheck ("C_AllocationLine_ID", new Integer(C_AllocationLine_ID)); +} +/** Get Allocation Line. +@return Allocation Line */ +public int getC_AllocationLine_ID() +{ +Integer ii = (Integer)get_Value("C_AllocationLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_ValueNoCheck ("C_InvoiceLine_ID", null); + else +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Declaration Line. +@param C_TaxDeclarationLine_ID Tax Declaration Document Information */ +public void setC_TaxDeclarationLine_ID (int C_TaxDeclarationLine_ID) +{ +if (C_TaxDeclarationLine_ID < 1) throw new IllegalArgumentException ("C_TaxDeclarationLine_ID is mandatory."); +set_ValueNoCheck ("C_TaxDeclarationLine_ID", new Integer(C_TaxDeclarationLine_ID)); +} +/** Get Tax Declaration Line. +@return Tax Declaration Document Information */ +public int getC_TaxDeclarationLine_ID() +{ +Integer ii = (Integer)get_Value("C_TaxDeclarationLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Declaration. +@param C_TaxDeclaration_ID Define the declaration to the tax authorities */ +public void setC_TaxDeclaration_ID (int C_TaxDeclaration_ID) +{ +if (C_TaxDeclaration_ID < 1) throw new IllegalArgumentException ("C_TaxDeclaration_ID is mandatory."); +set_ValueNoCheck ("C_TaxDeclaration_ID", new Integer(C_TaxDeclaration_ID)); +} +/** Get Tax Declaration. +@return Define the declaration to the tax authorities */ +public int getC_TaxDeclaration_ID() +{ +Integer ii = (Integer)get_Value("C_TaxDeclaration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_ValueNoCheck ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_ValueNoCheck ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +if (TaxAmt == null) throw new IllegalArgumentException ("TaxAmt is mandatory."); +set_ValueNoCheck ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tax base Amount. +@param TaxBaseAmt Base for calculating the tax amount */ +public void setTaxBaseAmt (BigDecimal TaxBaseAmt) +{ +if (TaxBaseAmt == null) throw new IllegalArgumentException ("TaxBaseAmt is mandatory."); +set_ValueNoCheck ("TaxBaseAmt", TaxBaseAmt); +} +/** Get Tax base Amount. +@return Base for calculating the tax amount */ +public BigDecimal getTaxBaseAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxBaseAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_TaxPostal.java b/dbPort/src/org/compiere/model/X_C_TaxPostal.java new file mode 100644 index 0000000000..8db928aec2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_TaxPostal.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_TaxPostal + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.859 */ +public class X_C_TaxPostal extends PO +{ +/** Standard Constructor +@param ctx context +@param C_TaxPostal_ID id +@param trxName transaction +*/ +public X_C_TaxPostal (Properties ctx, int C_TaxPostal_ID, String trxName) +{ +super (ctx, C_TaxPostal_ID, trxName); +/** if (C_TaxPostal_ID == 0) +{ +setC_TaxPostal_ID (0); +setC_Tax_ID (0); +setPostal (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_TaxPostal (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=701 */ +public static final int Table_ID=701; + +/** TableName=C_TaxPostal */ +public static final String Table_Name="C_TaxPostal"; + +protected static KeyNamePair Model = new KeyNamePair(701,"C_TaxPostal"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_TaxPostal[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tax ZIP. +@param C_TaxPostal_ID Tax Postal/ZIP */ +public void setC_TaxPostal_ID (int C_TaxPostal_ID) +{ +if (C_TaxPostal_ID < 1) throw new IllegalArgumentException ("C_TaxPostal_ID is mandatory."); +set_ValueNoCheck ("C_TaxPostal_ID", new Integer(C_TaxPostal_ID)); +} +/** Get Tax ZIP. +@return Tax Postal/ZIP */ +public int getC_TaxPostal_ID() +{ +Integer ii = (Integer)get_Value("C_TaxPostal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal == null) throw new IllegalArgumentException ("Postal is mandatory."); +if (Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_Value ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getPostal()); +} +/** Set ZIP To. +@param Postal_To Postal code to */ +public void setPostal_To (String Postal_To) +{ +if (Postal_To != null && Postal_To.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal_To = Postal_To.substring(0,9); +} +set_Value ("Postal_To", Postal_To); +} +/** Get ZIP To. +@return Postal code to */ +public String getPostal_To() +{ +return (String)get_Value("Postal_To"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Tax_Acct.java b/dbPort/src/org/compiere/model/X_C_Tax_Acct.java new file mode 100644 index 0000000000..05a36ed864 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Tax_Acct.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Tax_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.875 */ +public class X_C_Tax_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Tax_Acct_ID id +@param trxName transaction +*/ +public X_C_Tax_Acct (Properties ctx, int C_Tax_Acct_ID, String trxName) +{ +super (ctx, C_Tax_Acct_ID, trxName); +/** if (C_Tax_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Tax_ID (0); +setT_Credit_Acct (0); +setT_Due_Acct (0); +setT_Expense_Acct (0); +setT_Liability_Acct (0); +setT_Receivables_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Tax_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=399 */ +public static final int Table_ID=399; + +/** TableName=C_Tax_Acct */ +public static final String Table_Name="C_Tax_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(399,"C_Tax_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Tax_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Credit. +@param T_Credit_Acct Account for Tax you can reclaim */ +public void setT_Credit_Acct (int T_Credit_Acct) +{ +set_Value ("T_Credit_Acct", new Integer(T_Credit_Acct)); +} +/** Get Tax Credit. +@return Account for Tax you can reclaim */ +public int getT_Credit_Acct() +{ +Integer ii = (Integer)get_Value("T_Credit_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Due. +@param T_Due_Acct Account for Tax you have to pay */ +public void setT_Due_Acct (int T_Due_Acct) +{ +set_Value ("T_Due_Acct", new Integer(T_Due_Acct)); +} +/** Get Tax Due. +@return Account for Tax you have to pay */ +public int getT_Due_Acct() +{ +Integer ii = (Integer)get_Value("T_Due_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Expense. +@param T_Expense_Acct Account for paid tax you cannot reclaim */ +public void setT_Expense_Acct (int T_Expense_Acct) +{ +set_Value ("T_Expense_Acct", new Integer(T_Expense_Acct)); +} +/** Get Tax Expense. +@return Account for paid tax you cannot reclaim */ +public int getT_Expense_Acct() +{ +Integer ii = (Integer)get_Value("T_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Liability. +@param T_Liability_Acct Account for Tax declaration liability */ +public void setT_Liability_Acct (int T_Liability_Acct) +{ +set_Value ("T_Liability_Acct", new Integer(T_Liability_Acct)); +} +/** Get Tax Liability. +@return Account for Tax declaration liability */ +public int getT_Liability_Acct() +{ +Integer ii = (Integer)get_Value("T_Liability_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Receivables. +@param T_Receivables_Acct Account for Tax credit after tax declaration */ +public void setT_Receivables_Acct (int T_Receivables_Acct) +{ +set_Value ("T_Receivables_Acct", new Integer(T_Receivables_Acct)); +} +/** Get Tax Receivables. +@return Account for Tax credit after tax declaration */ +public int getT_Receivables_Acct() +{ +Integer ii = (Integer)get_Value("T_Receivables_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_UOM.java b/dbPort/src/org/compiere/model/X_C_UOM.java new file mode 100644 index 0000000000..581e0fdf39 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_UOM.java @@ -0,0 +1,230 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_UOM + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.89 */ +public class X_C_UOM extends PO +{ +/** Standard Constructor +@param ctx context +@param C_UOM_ID id +@param trxName transaction +*/ +public X_C_UOM (Properties ctx, int C_UOM_ID, String trxName) +{ +super (ctx, C_UOM_ID, trxName); +/** if (C_UOM_ID == 0) +{ +setC_UOM_ID (0); +setCostingPrecision (0); +setIsDefault (false); +setName (null); +setStdPrecision (0); +setX12DE355 (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_UOM (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=146 */ +public static final int Table_ID=146; + +/** TableName=C_UOM */ +public static final String Table_Name="C_UOM"; + +protected static KeyNamePair Model = new KeyNamePair(146,"C_UOM"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_UOM[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_ValueNoCheck ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Costing Precision. +@param CostingPrecision Rounding used costing calculations */ +public void setCostingPrecision (int CostingPrecision) +{ +set_Value ("CostingPrecision", new Integer(CostingPrecision)); +} +/** Get Costing Precision. +@return Rounding used costing calculations */ +public int getCostingPrecision() +{ +Integer ii = (Integer)get_Value("CostingPrecision"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Standard Precision. +@param StdPrecision Rule for rounding calculated amounts */ +public void setStdPrecision (int StdPrecision) +{ +set_Value ("StdPrecision", new Integer(StdPrecision)); +} +/** Get Standard Precision. +@return Rule for rounding calculated amounts */ +public int getStdPrecision() +{ +Integer ii = (Integer)get_Value("StdPrecision"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Symbol. +@param UOMSymbol Symbol for a Unit of Measure */ +public void setUOMSymbol (String UOMSymbol) +{ +if (UOMSymbol != null && UOMSymbol.length() > 10) +{ +log.warning("Length > 10 - truncated"); +UOMSymbol = UOMSymbol.substring(0,9); +} +set_Value ("UOMSymbol", UOMSymbol); +} +/** Get Symbol. +@return Symbol for a Unit of Measure */ +public String getUOMSymbol() +{ +return (String)get_Value("UOMSymbol"); +} +/** Set UOM Code. +@param X12DE355 UOM EDI X12 Code */ +public void setX12DE355 (String X12DE355) +{ +if (X12DE355 == null) throw new IllegalArgumentException ("X12DE355 is mandatory."); +if (X12DE355.length() > 4) +{ +log.warning("Length > 4 - truncated"); +X12DE355 = X12DE355.substring(0,3); +} +set_Value ("X12DE355", X12DE355); +} +/** Get UOM Code. +@return UOM EDI X12 Code */ +public String getX12DE355() +{ +return (String)get_Value("X12DE355"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_UOM_Conversion.java b/dbPort/src/org/compiere/model/X_C_UOM_Conversion.java new file mode 100644 index 0000000000..6cc9f3892d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_UOM_Conversion.java @@ -0,0 +1,195 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_UOM_Conversion + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.89 */ +public class X_C_UOM_Conversion extends PO +{ +/** Standard Constructor +@param ctx context +@param C_UOM_Conversion_ID id +@param trxName transaction +*/ +public X_C_UOM_Conversion (Properties ctx, int C_UOM_Conversion_ID, String trxName) +{ +super (ctx, C_UOM_Conversion_ID, trxName); +/** if (C_UOM_Conversion_ID == 0) +{ +setC_UOM_Conversion_ID (0); +setC_UOM_ID (0); +setC_UOM_To_ID (0); +setDivideRate (Env.ZERO); +setMultiplyRate (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_UOM_Conversion (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=175 */ +public static final int Table_ID=175; + +/** TableName=C_UOM_Conversion */ +public static final String Table_Name="C_UOM_Conversion"; + +protected static KeyNamePair Model = new KeyNamePair(175,"C_UOM_Conversion"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_UOM_Conversion[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set UOM Conversion. +@param C_UOM_Conversion_ID Unit of Measure Conversion */ +public void setC_UOM_Conversion_ID (int C_UOM_Conversion_ID) +{ +if (C_UOM_Conversion_ID < 1) throw new IllegalArgumentException ("C_UOM_Conversion_ID is mandatory."); +set_ValueNoCheck ("C_UOM_Conversion_ID", new Integer(C_UOM_Conversion_ID)); +} +/** Get UOM Conversion. +@return Unit of Measure Conversion */ +public int getC_UOM_Conversion_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_Conversion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_UOM_Conversion_ID())); +} + +/** C_UOM_ID AD_Reference_ID=114 */ +public static final int C_UOM_ID_AD_Reference_ID=114; +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_UOM_To_ID AD_Reference_ID=114 */ +public static final int C_UOM_TO_ID_AD_Reference_ID=114; +/** Set UoM To. +@param C_UOM_To_ID Target or destination Unit of Measure */ +public void setC_UOM_To_ID (int C_UOM_To_ID) +{ +if (C_UOM_To_ID < 1) throw new IllegalArgumentException ("C_UOM_To_ID is mandatory."); +set_Value ("C_UOM_To_ID", new Integer(C_UOM_To_ID)); +} +/** Get UoM To. +@return Target or destination Unit of Measure */ +public int getC_UOM_To_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_To_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Divide Rate. +@param DivideRate To convert Source number to Target number, the Source is divided */ +public void setDivideRate (BigDecimal DivideRate) +{ +if (DivideRate == null) throw new IllegalArgumentException ("DivideRate is mandatory."); +set_Value ("DivideRate", DivideRate); +} +/** Get Divide Rate. +@return To convert Source number to Target number, the Source is divided */ +public BigDecimal getDivideRate() +{ +BigDecimal bd = (BigDecimal)get_Value("DivideRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Multiply Rate. +@param MultiplyRate Rate to multiple the source by to calculate the target. */ +public void setMultiplyRate (BigDecimal MultiplyRate) +{ +if (MultiplyRate == null) throw new IllegalArgumentException ("MultiplyRate is mandatory."); +set_Value ("MultiplyRate", MultiplyRate); +} +/** Get Multiply Rate. +@return Rate to multiple the source by to calculate the target. */ +public BigDecimal getMultiplyRate() +{ +BigDecimal bd = (BigDecimal)get_Value("MultiplyRate"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_UserRemuneration.java b/dbPort/src/org/compiere/model/X_C_UserRemuneration.java new file mode 100644 index 0000000000..926f444139 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_UserRemuneration.java @@ -0,0 +1,248 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_UserRemuneration + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.906 */ +public class X_C_UserRemuneration extends PO +{ +/** Standard Constructor +@param ctx context +@param C_UserRemuneration_ID id +@param trxName transaction +*/ +public X_C_UserRemuneration (Properties ctx, int C_UserRemuneration_ID, String trxName) +{ +super (ctx, C_UserRemuneration_ID, trxName); +/** if (C_UserRemuneration_ID == 0) +{ +setAD_User_ID (0); +setC_Remuneration_ID (0); +setC_UserRemuneration_ID (0); +setGrossRAmt (Env.ZERO); +setGrossRCost (Env.ZERO); +setOvertimeAmt (Env.ZERO); +setOvertimeCost (Env.ZERO); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_UserRemuneration (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=794 */ +public static final int Table_ID=794; + +/** TableName=C_UserRemuneration */ +public static final String Table_Name="C_UserRemuneration"; + +protected static KeyNamePair Model = new KeyNamePair(794,"C_UserRemuneration"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_UserRemuneration[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +/** Set Remuneration. +@param C_Remuneration_ID Wage or Salary */ +public void setC_Remuneration_ID (int C_Remuneration_ID) +{ +if (C_Remuneration_ID < 1) throw new IllegalArgumentException ("C_Remuneration_ID is mandatory."); +set_ValueNoCheck ("C_Remuneration_ID", new Integer(C_Remuneration_ID)); +} +/** Get Remuneration. +@return Wage or Salary */ +public int getC_Remuneration_ID() +{ +Integer ii = (Integer)get_Value("C_Remuneration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Employee Remuneration. +@param C_UserRemuneration_ID Employee Wage or Salary Overwrite */ +public void setC_UserRemuneration_ID (int C_UserRemuneration_ID) +{ +if (C_UserRemuneration_ID < 1) throw new IllegalArgumentException ("C_UserRemuneration_ID is mandatory."); +set_ValueNoCheck ("C_UserRemuneration_ID", new Integer(C_UserRemuneration_ID)); +} +/** Get Employee Remuneration. +@return Employee Wage or Salary Overwrite */ +public int getC_UserRemuneration_ID() +{ +Integer ii = (Integer)get_Value("C_UserRemuneration_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Gross Amount. +@param GrossRAmt Gross Remuneration Amount */ +public void setGrossRAmt (BigDecimal GrossRAmt) +{ +if (GrossRAmt == null) throw new IllegalArgumentException ("GrossRAmt is mandatory."); +set_Value ("GrossRAmt", GrossRAmt); +} +/** Get Gross Amount. +@return Gross Remuneration Amount */ +public BigDecimal getGrossRAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("GrossRAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Gross Cost. +@param GrossRCost Gross Remuneration Costs */ +public void setGrossRCost (BigDecimal GrossRCost) +{ +if (GrossRCost == null) throw new IllegalArgumentException ("GrossRCost is mandatory."); +set_Value ("GrossRCost", GrossRCost); +} +/** Get Gross Cost. +@return Gross Remuneration Costs */ +public BigDecimal getGrossRCost() +{ +BigDecimal bd = (BigDecimal)get_Value("GrossRCost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Overtime Amount. +@param OvertimeAmt Hourly Overtime Rate */ +public void setOvertimeAmt (BigDecimal OvertimeAmt) +{ +if (OvertimeAmt == null) throw new IllegalArgumentException ("OvertimeAmt is mandatory."); +set_Value ("OvertimeAmt", OvertimeAmt); +} +/** Get Overtime Amount. +@return Hourly Overtime Rate */ +public BigDecimal getOvertimeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OvertimeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Overtime Cost. +@param OvertimeCost Hourly Overtime Cost */ +public void setOvertimeCost (BigDecimal OvertimeCost) +{ +if (OvertimeCost == null) throw new IllegalArgumentException ("OvertimeCost is mandatory."); +set_Value ("OvertimeCost", OvertimeCost); +} +/** Get Overtime Cost. +@return Hourly Overtime Cost */ +public BigDecimal getOvertimeCost() +{ +BigDecimal bd = (BigDecimal)get_Value("OvertimeCost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_ValidCombination.java b/dbPort/src/org/compiere/model/X_C_ValidCombination.java new file mode 100644 index 0000000000..1cf20ccf41 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_ValidCombination.java @@ -0,0 +1,471 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_ValidCombination + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.937 */ +public class X_C_ValidCombination extends PO +{ +/** Standard Constructor +@param ctx context +@param C_ValidCombination_ID id +@param trxName transaction +*/ +public X_C_ValidCombination (Properties ctx, int C_ValidCombination_ID, String trxName) +{ +super (ctx, C_ValidCombination_ID, trxName); +/** if (C_ValidCombination_ID == 0) +{ +setAccount_ID (0); +setC_AcctSchema_ID (0); +setC_ValidCombination_ID (0); +setIsFullyQualified (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_ValidCombination (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=176 */ +public static final int Table_ID=176; + +/** TableName=C_ValidCombination */ +public static final String Table_Name="C_ValidCombination"; + +protected static KeyNamePair Model = new KeyNamePair(176,"C_ValidCombination"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_ValidCombination[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_ValueNoCheck ("AD_OrgTrx_ID", null); + else +set_ValueNoCheck ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Account_ID AD_Reference_ID=362 */ +public static final int ACCOUNT_ID_AD_Reference_ID=362; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID < 1) throw new IllegalArgumentException ("Account_ID is mandatory."); +set_ValueNoCheck ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alias. +@param Alias Defines an alternate method of indicating an account combination. */ +public void setAlias (String Alias) +{ +if (Alias != null && Alias.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Alias = Alias.substring(0,39); +} +set_Value ("Alias", Alias); +} +/** Get Alias. +@return Defines an alternate method of indicating an account combination. */ +public String getAlias() +{ +return (String)get_Value("Alias"); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Activity_ID AD_Reference_ID=142 */ +public static final int C_ACTIVITY_ID_AD_Reference_ID=142; +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_ValueNoCheck ("C_Activity_ID", null); + else +set_ValueNoCheck ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_BPartner_ID AD_Reference_ID=138 */ +public static final int C_BPARTNER_ID_AD_Reference_ID=138; +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_ValueNoCheck ("C_BPartner_ID", null); + else +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Campaign_ID AD_Reference_ID=143 */ +public static final int C_CAMPAIGN_ID_AD_Reference_ID=143; +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_ValueNoCheck ("C_Campaign_ID", null); + else +set_ValueNoCheck ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocFrom_ID AD_Reference_ID=133 */ +public static final int C_LOCFROM_ID_AD_Reference_ID=133; +/** Set Location From. +@param C_LocFrom_ID Location that inventory was moved from */ +public void setC_LocFrom_ID (int C_LocFrom_ID) +{ +if (C_LocFrom_ID <= 0) set_ValueNoCheck ("C_LocFrom_ID", null); + else +set_ValueNoCheck ("C_LocFrom_ID", new Integer(C_LocFrom_ID)); +} +/** Get Location From. +@return Location that inventory was moved from */ +public int getC_LocFrom_ID() +{ +Integer ii = (Integer)get_Value("C_LocFrom_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocTo_ID AD_Reference_ID=133 */ +public static final int C_LOCTO_ID_AD_Reference_ID=133; +/** Set Location To. +@param C_LocTo_ID Location that inventory was moved to */ +public void setC_LocTo_ID (int C_LocTo_ID) +{ +if (C_LocTo_ID <= 0) set_ValueNoCheck ("C_LocTo_ID", null); + else +set_ValueNoCheck ("C_LocTo_ID", new Integer(C_LocTo_ID)); +} +/** Get Location To. +@return Location that inventory was moved to */ +public int getC_LocTo_ID() +{ +Integer ii = (Integer)get_Value("C_LocTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Project_ID AD_Reference_ID=141 */ +public static final int C_PROJECT_ID_AD_Reference_ID=141; +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_ValueNoCheck ("C_Project_ID", null); + else +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_SalesRegion_ID AD_Reference_ID=144 */ +public static final int C_SALESREGION_ID_AD_Reference_ID=144; +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_ValueNoCheck ("C_SalesRegion_ID", null); + else +set_ValueNoCheck ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sub Account. +@param C_SubAcct_ID Sub account for Element Value */ +public void setC_SubAcct_ID (int C_SubAcct_ID) +{ +if (C_SubAcct_ID <= 0) set_ValueNoCheck ("C_SubAcct_ID", null); + else +set_ValueNoCheck ("C_SubAcct_ID", new Integer(C_SubAcct_ID)); +} +/** Get Sub Account. +@return Sub account for Element Value */ +public int getC_SubAcct_ID() +{ +Integer ii = (Integer)get_Value("C_SubAcct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Combination. +@param C_ValidCombination_ID Valid Account Combination */ +public void setC_ValidCombination_ID (int C_ValidCombination_ID) +{ +if (C_ValidCombination_ID < 1) throw new IllegalArgumentException ("C_ValidCombination_ID is mandatory."); +set_ValueNoCheck ("C_ValidCombination_ID", new Integer(C_ValidCombination_ID)); +} +/** Get Combination. +@return Valid Account Combination */ +public int getC_ValidCombination_ID() +{ +Integer ii = (Integer)get_Value("C_ValidCombination_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Combination. +@param Combination Unique combination of account elements */ +public void setCombination (String Combination) +{ +if (Combination != null && Combination.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Combination = Combination.substring(0,59); +} +set_ValueNoCheck ("Combination", Combination); +} +/** Get Combination. +@return Unique combination of account elements */ +public String getCombination() +{ +return (String)get_Value("Combination"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getCombination()); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_ValueNoCheck ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Fully Qualified. +@param IsFullyQualified This account is fully qualified */ +public void setIsFullyQualified (boolean IsFullyQualified) +{ +set_ValueNoCheck ("IsFullyQualified", new Boolean(IsFullyQualified)); +} +/** Get Fully Qualified. +@return This account is fully qualified */ +public boolean isFullyQualified() +{ +Object oo = get_Value("IsFullyQualified"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** M_Product_ID AD_Reference_ID=162 */ +public static final int M_PRODUCT_ID_AD_Reference_ID=162; +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_ValueNoCheck ("M_Product_ID", null); + else +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_ValueNoCheck ("User1_ID", null); + else +set_ValueNoCheck ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_ValueNoCheck ("User2_ID", null); + else +set_ValueNoCheck ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Element 1. +@param UserElement1_ID User defined accounting Element */ +public void setUserElement1_ID (int UserElement1_ID) +{ +if (UserElement1_ID <= 0) set_Value ("UserElement1_ID", null); + else +set_Value ("UserElement1_ID", new Integer(UserElement1_ID)); +} +/** Get User Element 1. +@return User defined accounting Element */ +public int getUserElement1_ID() +{ +Integer ii = (Integer)get_Value("UserElement1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Element 2. +@param UserElement2_ID User defined accounting Element */ +public void setUserElement2_ID (int UserElement2_ID) +{ +if (UserElement2_ID <= 0) set_Value ("UserElement2_ID", null); + else +set_Value ("UserElement2_ID", new Integer(UserElement2_ID)); +} +/** Get User Element 2. +@return User defined accounting Element */ +public int getUserElement2_ID() +{ +Integer ii = (Integer)get_Value("UserElement2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Withholding.java b/dbPort/src/org/compiere/model/X_C_Withholding.java new file mode 100644 index 0000000000..bf5e0c585a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Withholding.java @@ -0,0 +1,339 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Withholding + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.968 */ +public class X_C_Withholding extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Withholding_ID id +@param trxName transaction +*/ +public X_C_Withholding (Properties ctx, int C_Withholding_ID, String trxName) +{ +super (ctx, C_Withholding_ID, trxName); +/** if (C_Withholding_ID == 0) +{ +setBeneficiary (0); +setC_PaymentTerm_ID (0); +setC_Withholding_ID (0); +setIsPaidTo3Party (false); +setIsPercentWithholding (false); +setIsTaxProrated (false); +setIsTaxWithholding (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Withholding (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=304 */ +public static final int Table_ID=304; + +/** TableName=C_Withholding */ +public static final String Table_Name="C_Withholding"; + +protected static KeyNamePair Model = new KeyNamePair(304,"C_Withholding"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Withholding[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** Beneficiary AD_Reference_ID=138 */ +public static final int BENEFICIARY_AD_Reference_ID=138; +/** Set Beneficiary. +@param Beneficiary Business Partner to whom payment is made */ +public void setBeneficiary (int Beneficiary) +{ +set_Value ("Beneficiary", new Integer(Beneficiary)); +} +/** Get Beneficiary. +@return Business Partner to whom payment is made */ +public int getBeneficiary() +{ +Integer ii = (Integer)get_Value("Beneficiary"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Withholding. +@param C_Withholding_ID Withholding type defined */ +public void setC_Withholding_ID (int C_Withholding_ID) +{ +if (C_Withholding_ID < 1) throw new IllegalArgumentException ("C_Withholding_ID is mandatory."); +set_ValueNoCheck ("C_Withholding_ID", new Integer(C_Withholding_ID)); +} +/** Get Withholding. +@return Withholding type defined */ +public int getC_Withholding_ID() +{ +Integer ii = (Integer)get_Value("C_Withholding_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Fix amount. +@param FixAmt Fix amounted amount to be levied or paid */ +public void setFixAmt (BigDecimal FixAmt) +{ +set_Value ("FixAmt", FixAmt); +} +/** Get Fix amount. +@return Fix amounted amount to be levied or paid */ +public BigDecimal getFixAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FixAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Paid to third party. +@param IsPaidTo3Party Amount paid to someone other than the Business Partner */ +public void setIsPaidTo3Party (boolean IsPaidTo3Party) +{ +set_Value ("IsPaidTo3Party", new Boolean(IsPaidTo3Party)); +} +/** Get Paid to third party. +@return Amount paid to someone other than the Business Partner */ +public boolean isPaidTo3Party() +{ +Object oo = get_Value("IsPaidTo3Party"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Percent withholding. +@param IsPercentWithholding Withholding amount is a percentage of the invoice amount */ +public void setIsPercentWithholding (boolean IsPercentWithholding) +{ +set_Value ("IsPercentWithholding", new Boolean(IsPercentWithholding)); +} +/** Get Percent withholding. +@return Withholding amount is a percentage of the invoice amount */ +public boolean isPercentWithholding() +{ +Object oo = get_Value("IsPercentWithholding"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Prorate tax. +@param IsTaxProrated Tax is Prorated */ +public void setIsTaxProrated (boolean IsTaxProrated) +{ +set_Value ("IsTaxProrated", new Boolean(IsTaxProrated)); +} +/** Get Prorate tax. +@return Tax is Prorated */ +public boolean isTaxProrated() +{ +Object oo = get_Value("IsTaxProrated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax withholding. +@param IsTaxWithholding This is a tax related withholding */ +public void setIsTaxWithholding (boolean IsTaxWithholding) +{ +set_Value ("IsTaxWithholding", new Boolean(IsTaxWithholding)); +} +/** Get Tax withholding. +@return This is a tax related withholding */ +public boolean isTaxWithholding() +{ +Object oo = get_Value("IsTaxWithholding"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Max Amount. +@param MaxAmt Maximum Amount in invoice currency */ +public void setMaxAmt (BigDecimal MaxAmt) +{ +set_Value ("MaxAmt", MaxAmt); +} +/** Get Max Amount. +@return Maximum Amount in invoice currency */ +public BigDecimal getMaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("MaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Min Amount. +@param MinAmt Minimum Amount in invoice currency */ +public void setMinAmt (BigDecimal MinAmt) +{ +set_Value ("MinAmt", MinAmt); +} +/** Get Min Amount. +@return Minimum Amount in invoice currency */ +public BigDecimal getMinAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("MinAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Percent. +@param Percent Percentage */ +public void setPercent (BigDecimal Percent) +{ +set_Value ("Percent", Percent); +} +/** Get Percent. +@return Percentage */ +public BigDecimal getPercent() +{ +BigDecimal bd = (BigDecimal)get_Value("Percent"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Threshold max. +@param ThresholdMax Maximum gross amount for withholding calculation (0=no limit) */ +public void setThresholdMax (BigDecimal ThresholdMax) +{ +set_Value ("ThresholdMax", ThresholdMax); +} +/** Get Threshold max. +@return Maximum gross amount for withholding calculation (0=no limit) */ +public BigDecimal getThresholdMax() +{ +BigDecimal bd = (BigDecimal)get_Value("ThresholdMax"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Threshold min. +@param Thresholdmin Minimum gross amount for withholding calculation */ +public void setThresholdmin (BigDecimal Thresholdmin) +{ +set_Value ("Thresholdmin", Thresholdmin); +} +/** Get Threshold min. +@return Minimum gross amount for withholding calculation */ +public BigDecimal getThresholdmin() +{ +BigDecimal bd = (BigDecimal)get_Value("Thresholdmin"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Withholding_Acct.java b/dbPort/src/org/compiere/model/X_C_Withholding_Acct.java new file mode 100644 index 0000000000..2a8b257324 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Withholding_Acct.java @@ -0,0 +1,134 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Withholding_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:58.984 */ +public class X_C_Withholding_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Withholding_Acct_ID id +@param trxName transaction +*/ +public X_C_Withholding_Acct (Properties ctx, int C_Withholding_Acct_ID, String trxName) +{ +super (ctx, C_Withholding_Acct_ID, trxName); +/** if (C_Withholding_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Withholding_ID (0); +setWithholding_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Withholding_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=400 */ +public static final int Table_ID=400; + +/** TableName=C_Withholding_Acct */ +public static final String Table_Name="C_Withholding_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(400,"C_Withholding_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Withholding_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Withholding. +@param C_Withholding_ID Withholding type defined */ +public void setC_Withholding_ID (int C_Withholding_ID) +{ +if (C_Withholding_ID < 1) throw new IllegalArgumentException ("C_Withholding_ID is mandatory."); +set_ValueNoCheck ("C_Withholding_ID", new Integer(C_Withholding_ID)); +} +/** Get Withholding. +@return Withholding type defined */ +public int getC_Withholding_ID() +{ +Integer ii = (Integer)get_Value("C_Withholding_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Withholding. +@param Withholding_Acct Account for Withholdings */ +public void setWithholding_Acct (int Withholding_Acct) +{ +set_Value ("Withholding_Acct", new Integer(Withholding_Acct)); +} +/** Get Withholding. +@return Account for Withholdings */ +public int getWithholding_Acct() +{ +Integer ii = (Integer)get_Value("Withholding_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_C_Year.java b/dbPort/src/org/compiere/model/X_C_Year.java new file mode 100644 index 0000000000..e16d093b17 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_C_Year.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for C_Year + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.0 */ +public class X_C_Year extends PO +{ +/** Standard Constructor +@param ctx context +@param C_Year_ID id +@param trxName transaction +*/ +public X_C_Year (Properties ctx, int C_Year_ID, String trxName) +{ +super (ctx, C_Year_ID, trxName); +/** if (C_Year_ID == 0) +{ +setC_Calendar_ID (0); +setC_Year_ID (0); +setFiscalYear (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_C_Year (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=177 */ +public static final int Table_ID=177; + +/** TableName=C_Year */ +public static final String Table_Name="C_Year"; + +protected static KeyNamePair Model = new KeyNamePair(177,"C_Year"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Year[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID < 1) throw new IllegalArgumentException ("C_Calendar_ID is mandatory."); +set_ValueNoCheck ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Year. +@param C_Year_ID Calendar Year */ +public void setC_Year_ID (int C_Year_ID) +{ +if (C_Year_ID < 1) throw new IllegalArgumentException ("C_Year_ID is mandatory."); +set_ValueNoCheck ("C_Year_ID", new Integer(C_Year_ID)); +} +/** Get Year. +@return Calendar Year */ +public int getC_Year_ID() +{ +Integer ii = (Integer)get_Value("C_Year_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Year. +@param FiscalYear The Fiscal Year */ +public void setFiscalYear (String FiscalYear) +{ +if (FiscalYear == null) throw new IllegalArgumentException ("FiscalYear is mandatory."); +if (FiscalYear.length() > 10) +{ +log.warning("Length > 10 - truncated"); +FiscalYear = FiscalYear.substring(0,9); +} +set_Value ("FiscalYear", FiscalYear); +} +/** Get Year. +@return The Fiscal Year */ +public String getFiscalYear() +{ +return (String)get_Value("FiscalYear"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getFiscalYear()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_Fact_Acct.java b/dbPort/src/org/compiere/model/X_Fact_Acct.java new file mode 100644 index 0000000000..d4b5504100 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_Fact_Acct.java @@ -0,0 +1,748 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for Fact_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.015 */ +public class X_Fact_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param Fact_Acct_ID id +@param trxName transaction +*/ +public X_Fact_Acct (Properties ctx, int Fact_Acct_ID, String trxName) +{ +super (ctx, Fact_Acct_ID, trxName); +/** if (Fact_Acct_ID == 0) +{ +setAD_Table_ID (0); +setAccount_ID (0); +setAmtAcctCr (Env.ZERO); +setAmtAcctDr (Env.ZERO); +setAmtSourceCr (Env.ZERO); +setAmtSourceDr (Env.ZERO); +setC_AcctSchema_ID (0); +setC_Currency_ID (0); +setC_Period_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setDateTrx (new Timestamp(System.currentTimeMillis())); +setFact_Acct_ID (0); +setGL_Category_ID (0); +setPostingType (null); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_Fact_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=270 */ +public static final int Table_ID=270; + +/** TableName=Fact_Acct */ +public static final String Table_Name="Fact_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(270,"Fact_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_Fact_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_ValueNoCheck ("AD_OrgTrx_ID", null); + else +set_ValueNoCheck ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Account_ID AD_Reference_ID=132 */ +public static final int ACCOUNT_ID_AD_Reference_ID=132; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID < 1) throw new IllegalArgumentException ("Account_ID is mandatory."); +set_ValueNoCheck ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounted Credit. +@param AmtAcctCr Accounted Credit Amount */ +public void setAmtAcctCr (BigDecimal AmtAcctCr) +{ +if (AmtAcctCr == null) throw new IllegalArgumentException ("AmtAcctCr is mandatory."); +set_ValueNoCheck ("AmtAcctCr", AmtAcctCr); +} +/** Get Accounted Credit. +@return Accounted Credit Amount */ +public BigDecimal getAmtAcctCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounted Debit. +@param AmtAcctDr Accounted Debit Amount */ +public void setAmtAcctDr (BigDecimal AmtAcctDr) +{ +if (AmtAcctDr == null) throw new IllegalArgumentException ("AmtAcctDr is mandatory."); +set_ValueNoCheck ("AmtAcctDr", AmtAcctDr); +} +/** Get Accounted Debit. +@return Accounted Debit Amount */ +public BigDecimal getAmtAcctDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Credit. +@param AmtSourceCr Source Credit Amount */ +public void setAmtSourceCr (BigDecimal AmtSourceCr) +{ +if (AmtSourceCr == null) throw new IllegalArgumentException ("AmtSourceCr is mandatory."); +set_ValueNoCheck ("AmtSourceCr", AmtSourceCr); +} +/** Get Source Credit. +@return Source Credit Amount */ +public BigDecimal getAmtSourceCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Debit. +@param AmtSourceDr Source Debit Amount */ +public void setAmtSourceDr (BigDecimal AmtSourceDr) +{ +if (AmtSourceDr == null) throw new IllegalArgumentException ("AmtSourceDr is mandatory."); +set_ValueNoCheck ("AmtSourceDr", AmtSourceDr); +} +/** Get Source Debit. +@return Source Debit Amount */ +public BigDecimal getAmtSourceDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_ValueNoCheck ("C_Activity_ID", null); + else +set_ValueNoCheck ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_ValueNoCheck ("C_BPartner_ID", null); + else +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_ValueNoCheck ("C_Campaign_ID", null); + else +set_ValueNoCheck ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocFrom_ID AD_Reference_ID=133 */ +public static final int C_LOCFROM_ID_AD_Reference_ID=133; +/** Set Location From. +@param C_LocFrom_ID Location that inventory was moved from */ +public void setC_LocFrom_ID (int C_LocFrom_ID) +{ +if (C_LocFrom_ID <= 0) set_ValueNoCheck ("C_LocFrom_ID", null); + else +set_ValueNoCheck ("C_LocFrom_ID", new Integer(C_LocFrom_ID)); +} +/** Get Location From. +@return Location that inventory was moved from */ +public int getC_LocFrom_ID() +{ +Integer ii = (Integer)get_Value("C_LocFrom_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocTo_ID AD_Reference_ID=133 */ +public static final int C_LOCTO_ID_AD_Reference_ID=133; +/** Set Location To. +@param C_LocTo_ID Location that inventory was moved to */ +public void setC_LocTo_ID (int C_LocTo_ID) +{ +if (C_LocTo_ID <= 0) set_ValueNoCheck ("C_LocTo_ID", null); + else +set_ValueNoCheck ("C_LocTo_ID", new Integer(C_LocTo_ID)); +} +/** Get Location To. +@return Location that inventory was moved to */ +public int getC_LocTo_ID() +{ +Integer ii = (Integer)get_Value("C_LocTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID < 1) throw new IllegalArgumentException ("C_Period_ID is mandatory."); +set_ValueNoCheck ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_ValueNoCheck ("C_ProjectPhase_ID", null); + else +set_ValueNoCheck ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_ValueNoCheck ("C_ProjectTask_ID", null); + else +set_ValueNoCheck ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_ValueNoCheck ("C_Project_ID", null); + else +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_ValueNoCheck ("C_SalesRegion_ID", null); + else +set_ValueNoCheck ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sub Account. +@param C_SubAcct_ID Sub account for Element Value */ +public void setC_SubAcct_ID (int C_SubAcct_ID) +{ +if (C_SubAcct_ID <= 0) set_Value ("C_SubAcct_ID", null); + else +set_Value ("C_SubAcct_ID", new Integer(C_SubAcct_ID)); +} +/** Get Sub Account. +@return Sub account for Element Value */ +public int getC_SubAcct_ID() +{ +Integer ii = (Integer)get_Value("C_SubAcct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID <= 0) set_ValueNoCheck ("C_Tax_ID", null); + else +set_ValueNoCheck ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_ValueNoCheck ("C_UOM_ID", null); + else +set_ValueNoCheck ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_ValueNoCheck ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_ValueNoCheck ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Accounting Fact. +@param Fact_Acct_ID Accounting Fact */ +public void setFact_Acct_ID (int Fact_Acct_ID) +{ +if (Fact_Acct_ID < 1) throw new IllegalArgumentException ("Fact_Acct_ID is mandatory."); +set_ValueNoCheck ("Fact_Acct_ID", new Integer(Fact_Acct_ID)); +} +/** Get Accounting Fact. +@return Accounting Fact */ +public int getFact_Acct_ID() +{ +Integer ii = (Integer)get_Value("Fact_Acct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getFact_Acct_ID())); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID <= 0) set_ValueNoCheck ("GL_Budget_ID", null); + else +set_ValueNoCheck ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set GL Category. +@param GL_Category_ID General Ledger Category */ +public void setGL_Category_ID (int GL_Category_ID) +{ +if (GL_Category_ID < 1) throw new IllegalArgumentException ("GL_Category_ID is mandatory."); +set_ValueNoCheck ("GL_Category_ID", new Integer(GL_Category_ID)); +} +/** Get GL Category. +@return General Ledger Category */ +public int getGL_Category_ID() +{ +Integer ii = (Integer)get_Value("GL_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line ID. +@param Line_ID Transaction line ID (internal) */ +public void setLine_ID (int Line_ID) +{ +if (Line_ID <= 0) set_ValueNoCheck ("Line_ID", null); + else +set_ValueNoCheck ("Line_ID", new Integer(Line_ID)); +} +/** Get Line ID. +@return Transaction line ID (internal) */ +public int getLine_ID() +{ +Integer ii = (Integer)get_Value("Line_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID <= 0) set_ValueNoCheck ("M_Locator_ID", null); + else +set_ValueNoCheck ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_ValueNoCheck ("M_Product_ID", null); + else +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_ValueNoCheck ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_ValueNoCheck ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_ValueNoCheck ("User1_ID", null); + else +set_ValueNoCheck ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_ValueNoCheck ("User2_ID", null); + else +set_ValueNoCheck ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Element 1. +@param UserElement1_ID User defined accounting Element */ +public void setUserElement1_ID (int UserElement1_ID) +{ +if (UserElement1_ID <= 0) set_ValueNoCheck ("UserElement1_ID", null); + else +set_ValueNoCheck ("UserElement1_ID", new Integer(UserElement1_ID)); +} +/** Get User Element 1. +@return User defined accounting Element */ +public int getUserElement1_ID() +{ +Integer ii = (Integer)get_Value("UserElement1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Element 2. +@param UserElement2_ID User defined accounting Element */ +public void setUserElement2_ID (int UserElement2_ID) +{ +if (UserElement2_ID <= 0) set_ValueNoCheck ("UserElement2_ID", null); + else +set_ValueNoCheck ("UserElement2_ID", new Integer(UserElement2_ID)); +} +/** Get User Element 2. +@return User defined accounting Element */ +public int getUserElement2_ID() +{ +Integer ii = (Integer)get_Value("UserElement2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_Fact_Acct_Balance.java b/dbPort/src/org/compiere/model/X_Fact_Acct_Balance.java new file mode 100644 index 0000000000..de88d9a87b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_Fact_Acct_Balance.java @@ -0,0 +1,511 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for Fact_Acct_Balance + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.046 */ +public class X_Fact_Acct_Balance extends PO +{ +/** Standard Constructor +@param ctx context +@param Fact_Acct_Balance_ID id +@param trxName transaction +*/ +public X_Fact_Acct_Balance (Properties ctx, int Fact_Acct_Balance_ID, String trxName) +{ +super (ctx, Fact_Acct_Balance_ID, trxName); +/** if (Fact_Acct_Balance_ID == 0) +{ +setAccount_ID (0); +setAmtAcctCr (Env.ZERO); +setAmtAcctDr (Env.ZERO); +setC_AcctSchema_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setPostingType (null); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_Fact_Acct_Balance (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=547 */ +public static final int Table_ID=547; + +/** TableName=Fact_Acct_Balance */ +public static final String Table_Name="Fact_Acct_Balance"; + +protected static KeyNamePair Model = new KeyNamePair(547,"Fact_Acct_Balance"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_Fact_Acct_Balance[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=276 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=276; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Account_ID AD_Reference_ID=182 */ +public static final int ACCOUNT_ID_AD_Reference_ID=182; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID < 1) throw new IllegalArgumentException ("Account_ID is mandatory."); +set_Value ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounted Credit. +@param AmtAcctCr Accounted Credit Amount */ +public void setAmtAcctCr (BigDecimal AmtAcctCr) +{ +if (AmtAcctCr == null) throw new IllegalArgumentException ("AmtAcctCr is mandatory."); +set_Value ("AmtAcctCr", AmtAcctCr); +} +/** Get Accounted Credit. +@return Accounted Credit Amount */ +public BigDecimal getAmtAcctCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounted Debit. +@param AmtAcctDr Accounted Debit Amount */ +public void setAmtAcctDr (BigDecimal AmtAcctDr) +{ +if (AmtAcctDr == null) throw new IllegalArgumentException ("AmtAcctDr is mandatory."); +set_Value ("AmtAcctDr", AmtAcctDr); +} +/** Get Accounted Debit. +@return Accounted Debit Amount */ +public BigDecimal getAmtAcctDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_AcctSchema_ID())); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocFrom_ID AD_Reference_ID=133 */ +public static final int C_LOCFROM_ID_AD_Reference_ID=133; +/** Set Location From. +@param C_LocFrom_ID Location that inventory was moved from */ +public void setC_LocFrom_ID (int C_LocFrom_ID) +{ +if (C_LocFrom_ID <= 0) set_Value ("C_LocFrom_ID", null); + else +set_Value ("C_LocFrom_ID", new Integer(C_LocFrom_ID)); +} +/** Get Location From. +@return Location that inventory was moved from */ +public int getC_LocFrom_ID() +{ +Integer ii = (Integer)get_Value("C_LocFrom_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocTo_ID AD_Reference_ID=133 */ +public static final int C_LOCTO_ID_AD_Reference_ID=133; +/** Set Location To. +@param C_LocTo_ID Location that inventory was moved to */ +public void setC_LocTo_ID (int C_LocTo_ID) +{ +if (C_LocTo_ID <= 0) set_Value ("C_LocTo_ID", null); + else +set_Value ("C_LocTo_ID", new Integer(C_LocTo_ID)); +} +/** Get Location To. +@return Location that inventory was moved to */ +public int getC_LocTo_ID() +{ +Integer ii = (Integer)get_Value("C_LocTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_ValueNoCheck ("C_ProjectPhase_ID", null); + else +set_ValueNoCheck ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_ValueNoCheck ("C_ProjectTask_ID", null); + else +set_ValueNoCheck ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sub Account. +@param C_SubAcct_ID Sub account for Element Value */ +public void setC_SubAcct_ID (int C_SubAcct_ID) +{ +if (C_SubAcct_ID <= 0) set_ValueNoCheck ("C_SubAcct_ID", null); + else +set_ValueNoCheck ("C_SubAcct_ID", new Integer(C_SubAcct_ID)); +} +/** Get Sub Account. +@return Sub account for Element Value */ +public int getC_SubAcct_ID() +{ +Integer ii = (Integer)get_Value("C_SubAcct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID <= 0) set_Value ("GL_Budget_ID", null); + else +set_Value ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Element 1. +@param UserElement1_ID User defined accounting Element */ +public void setUserElement1_ID (int UserElement1_ID) +{ +if (UserElement1_ID <= 0) set_Value ("UserElement1_ID", null); + else +set_Value ("UserElement1_ID", new Integer(UserElement1_ID)); +} +/** Get User Element 1. +@return User defined accounting Element */ +public int getUserElement1_ID() +{ +Integer ii = (Integer)get_Value("UserElement1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User Element 2. +@param UserElement2_ID User defined accounting Element */ +public void setUserElement2_ID (int UserElement2_ID) +{ +if (UserElement2_ID <= 0) set_Value ("UserElement2_ID", null); + else +set_Value ("UserElement2_ID", new Integer(UserElement2_ID)); +} +/** Get User Element 2. +@return User defined accounting Element */ +public int getUserElement2_ID() +{ +Integer ii = (Integer)get_Value("UserElement2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_Budget.java b/dbPort/src/org/compiere/model/X_GL_Budget.java new file mode 100644 index 0000000000..001b87c5b9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_Budget.java @@ -0,0 +1,191 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_Budget + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.093 */ +public class X_GL_Budget extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_Budget_ID id +@param trxName transaction +*/ +public X_GL_Budget (Properties ctx, int GL_Budget_ID, String trxName) +{ +super (ctx, GL_Budget_ID, trxName); +/** if (GL_Budget_ID == 0) +{ +setGL_Budget_ID (0); +setIsPrimary (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_Budget (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=271 */ +public static final int Table_ID=271; + +/** TableName=GL_Budget */ +public static final String Table_Name="GL_Budget"; + +protected static KeyNamePair Model = new KeyNamePair(271,"GL_Budget"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_Budget[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** BudgetStatus AD_Reference_ID=178 */ +public static final int BUDGETSTATUS_AD_Reference_ID=178; +/** Approved = A */ +public static final String BUDGETSTATUS_Approved = "A"; +/** Draft = D */ +public static final String BUDGETSTATUS_Draft = "D"; +/** Set Budget Status. +@param BudgetStatus Indicates the current status of this budget */ +public void setBudgetStatus (String BudgetStatus) +{ +if (BudgetStatus == null) throw new IllegalArgumentException ("BudgetStatus is mandatory"); +if (BudgetStatus == null || BudgetStatus.equals("A") || BudgetStatus.equals("D")); + else throw new IllegalArgumentException ("BudgetStatus Invalid value - " + BudgetStatus + " - Reference_ID=178 - A - D"); +if (BudgetStatus != null && BudgetStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BudgetStatus = BudgetStatus.substring(0,0); +} +set_Value ("BudgetStatus", BudgetStatus); +} +/** Get Budget Status. +@return Indicates the current status of this budget */ +public String getBudgetStatus() +{ +return (String)get_Value("BudgetStatus"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID < 1) throw new IllegalArgumentException ("GL_Budget_ID is mandatory."); +set_ValueNoCheck ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Primary. +@param IsPrimary Indicates if this is the primary budget */ +public void setIsPrimary (boolean IsPrimary) +{ +set_Value ("IsPrimary", new Boolean(IsPrimary)); +} +/** Get Primary. +@return Indicates if this is the primary budget */ +public boolean isPrimary() +{ +Object oo = get_Value("IsPrimary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_BudgetControl.java b/dbPort/src/org/compiere/model/X_GL_BudgetControl.java new file mode 100644 index 0000000000..fc08a6276d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_BudgetControl.java @@ -0,0 +1,273 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_BudgetControl + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.093 */ +public class X_GL_BudgetControl extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_BudgetControl_ID id +@param trxName transaction +*/ +public X_GL_BudgetControl (Properties ctx, int GL_BudgetControl_ID, String trxName) +{ +super (ctx, GL_BudgetControl_ID, trxName); +/** if (GL_BudgetControl_ID == 0) +{ +setBudgetControlScope (null); +setC_AcctSchema_ID (0); +setCommitmentType (null); // C +setGL_BudgetControl_ID (0); +setGL_Budget_ID (0); +setIsBeforeApproval (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_BudgetControl (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=822 */ +public static final int Table_ID=822; + +/** TableName=GL_BudgetControl */ +public static final String Table_Name="GL_BudgetControl"; + +protected static KeyNamePair Model = new KeyNamePair(822,"GL_BudgetControl"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_BudgetControl[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** BudgetControlScope AD_Reference_ID=361 */ +public static final int BUDGETCONTROLSCOPE_AD_Reference_ID=361; +/** Period only = P */ +public static final String BUDGETCONTROLSCOPE_PeriodOnly = "P"; +/** Total = T */ +public static final String BUDGETCONTROLSCOPE_Total = "T"; +/** Year To Date = Y */ +public static final String BUDGETCONTROLSCOPE_YearToDate = "Y"; +/** Set Control Scope. +@param BudgetControlScope Scope of the Budget Control */ +public void setBudgetControlScope (String BudgetControlScope) +{ +if (BudgetControlScope == null) throw new IllegalArgumentException ("BudgetControlScope is mandatory"); +if (BudgetControlScope.equals("P") || BudgetControlScope.equals("T") || BudgetControlScope.equals("Y")); + else throw new IllegalArgumentException ("BudgetControlScope Invalid value - " + BudgetControlScope + " - Reference_ID=361 - P - T - Y"); +if (BudgetControlScope.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BudgetControlScope = BudgetControlScope.substring(0,0); +} +set_Value ("BudgetControlScope", BudgetControlScope); +} +/** Get Control Scope. +@return Scope of the Budget Control */ +public String getBudgetControlScope() +{ +return (String)get_Value("BudgetControlScope"); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CommitmentType AD_Reference_ID=359 */ +public static final int COMMITMENTTYPE_AD_Reference_ID=359; +/** Commitment & Reservation = B */ +public static final String COMMITMENTTYPE_CommitmentReservation = "B"; +/** Commitment only = C */ +public static final String COMMITMENTTYPE_CommitmentOnly = "C"; +/** None = N */ +public static final String COMMITMENTTYPE_None = "N"; +/** Set Commitment Type. +@param CommitmentType Create Commitment and/or Reservations for Budget Control */ +public void setCommitmentType (String CommitmentType) +{ +if (CommitmentType == null) throw new IllegalArgumentException ("CommitmentType is mandatory"); +if (CommitmentType.equals("B") || CommitmentType.equals("C") || CommitmentType.equals("N")); + else throw new IllegalArgumentException ("CommitmentType Invalid value - " + CommitmentType + " - Reference_ID=359 - B - C - N"); +if (CommitmentType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CommitmentType = CommitmentType.substring(0,0); +} +set_Value ("CommitmentType", CommitmentType); +} +/** Get Commitment Type. +@return Create Commitment and/or Reservations for Budget Control */ +public String getCommitmentType() +{ +return (String)get_Value("CommitmentType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Budget Control. +@param GL_BudgetControl_ID Budget Control */ +public void setGL_BudgetControl_ID (int GL_BudgetControl_ID) +{ +if (GL_BudgetControl_ID < 1) throw new IllegalArgumentException ("GL_BudgetControl_ID is mandatory."); +set_ValueNoCheck ("GL_BudgetControl_ID", new Integer(GL_BudgetControl_ID)); +} +/** Get Budget Control. +@return Budget Control */ +public int getGL_BudgetControl_ID() +{ +Integer ii = (Integer)get_Value("GL_BudgetControl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID < 1) throw new IllegalArgumentException ("GL_Budget_ID is mandatory."); +set_Value ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Before Approval. +@param IsBeforeApproval The Check is before the (manual) approval */ +public void setIsBeforeApproval (boolean IsBeforeApproval) +{ +set_Value ("IsBeforeApproval", new Boolean(IsBeforeApproval)); +} +/** Get Before Approval. +@return The Check is before the (manual) approval */ +public boolean isBeforeApproval() +{ +Object oo = get_Value("IsBeforeApproval"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_Category.java b/dbPort/src/org/compiere/model/X_GL_Category.java new file mode 100644 index 0000000000..6c2d94aa1f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_Category.java @@ -0,0 +1,196 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_Category + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.125 */ +public class X_GL_Category extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_Category_ID id +@param trxName transaction +*/ +public X_GL_Category (Properties ctx, int GL_Category_ID, String trxName) +{ +super (ctx, GL_Category_ID, trxName); +/** if (GL_Category_ID == 0) +{ +setCategoryType (null); // M +setGL_Category_ID (0); +setIsDefault (false); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_Category (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=218 */ +public static final int Table_ID=218; + +/** TableName=GL_Category */ +public static final String Table_Name="GL_Category"; + +protected static KeyNamePair Model = new KeyNamePair(218,"GL_Category"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_Category[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** CategoryType AD_Reference_ID=207 */ +public static final int CATEGORYTYPE_AD_Reference_ID=207; +/** Document = D */ +public static final String CATEGORYTYPE_Document = "D"; +/** Import = I */ +public static final String CATEGORYTYPE_Import = "I"; +/** Manual = M */ +public static final String CATEGORYTYPE_Manual = "M"; +/** System generated = S */ +public static final String CATEGORYTYPE_SystemGenerated = "S"; +/** Set Category Type. +@param CategoryType Source of the Journal with this category */ +public void setCategoryType (String CategoryType) +{ +if (CategoryType == null) throw new IllegalArgumentException ("CategoryType is mandatory"); +if (CategoryType.equals("D") || CategoryType.equals("I") || CategoryType.equals("M") || CategoryType.equals("S")); + else throw new IllegalArgumentException ("CategoryType Invalid value - " + CategoryType + " - Reference_ID=207 - D - I - M - S"); +if (CategoryType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CategoryType = CategoryType.substring(0,0); +} +set_Value ("CategoryType", CategoryType); +} +/** Get Category Type. +@return Source of the Journal with this category */ +public String getCategoryType() +{ +return (String)get_Value("CategoryType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set GL Category. +@param GL_Category_ID General Ledger Category */ +public void setGL_Category_ID (int GL_Category_ID) +{ +if (GL_Category_ID < 1) throw new IllegalArgumentException ("GL_Category_ID is mandatory."); +set_ValueNoCheck ("GL_Category_ID", new Integer(GL_Category_ID)); +} +/** Get GL Category. +@return General Ledger Category */ +public int getGL_Category_ID() +{ +Integer ii = (Integer)get_Value("GL_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_Distribution.java b/dbPort/src/org/compiere/model/X_GL_Distribution.java new file mode 100644 index 0000000000..e5d8571068 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_Distribution.java @@ -0,0 +1,756 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_Distribution + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.14 */ +public class X_GL_Distribution extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_Distribution_ID id +@param trxName transaction +*/ +public X_GL_Distribution (Properties ctx, int GL_Distribution_ID, String trxName) +{ +super (ctx, GL_Distribution_ID, trxName); +/** if (GL_Distribution_ID == 0) +{ +setAnyAcct (true); // Y +setAnyActivity (true); // Y +setAnyBPartner (true); // Y +setAnyCampaign (true); // Y +setAnyLocFrom (true); // Y +setAnyLocTo (true); // Y +setAnyOrg (true); // Y +setAnyOrgTrx (true); // Y +setAnyProduct (true); // Y +setAnyProject (true); // Y +setAnySalesRegion (true); // Y +setAnyUser1 (true); // Y +setAnyUser2 (true); // Y +setC_AcctSchema_ID (0); +setGL_Distribution_ID (0); +setIsValid (false); // N +setName (null); +setPercentTotal (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_Distribution (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=708 */ +public static final int Table_ID=708; + +/** TableName=GL_Distribution */ +public static final String Table_Name="GL_Distribution"; + +protected static KeyNamePair Model = new KeyNamePair(708,"GL_Distribution"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_Distribution[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Account_ID AD_Reference_ID=132 */ +public static final int ACCOUNT_ID_AD_Reference_ID=132; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID <= 0) set_Value ("Account_ID", null); + else +set_Value ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Any Account. +@param AnyAcct Match any value of the Account segment */ +public void setAnyAcct (boolean AnyAcct) +{ +set_Value ("AnyAcct", new Boolean(AnyAcct)); +} +/** Get Any Account. +@return Match any value of the Account segment */ +public boolean isAnyAcct() +{ +Object oo = get_Value("AnyAcct"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Activity. +@param AnyActivity Match any value of the Activity segment */ +public void setAnyActivity (boolean AnyActivity) +{ +set_Value ("AnyActivity", new Boolean(AnyActivity)); +} +/** Get Any Activity. +@return Match any value of the Activity segment */ +public boolean isAnyActivity() +{ +Object oo = get_Value("AnyActivity"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Bus.Partner. +@param AnyBPartner Match any value of the Business Partner segment */ +public void setAnyBPartner (boolean AnyBPartner) +{ +set_Value ("AnyBPartner", new Boolean(AnyBPartner)); +} +/** Get Any Bus.Partner. +@return Match any value of the Business Partner segment */ +public boolean isAnyBPartner() +{ +Object oo = get_Value("AnyBPartner"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Campaign. +@param AnyCampaign Match any value of the Campaign segment */ +public void setAnyCampaign (boolean AnyCampaign) +{ +set_Value ("AnyCampaign", new Boolean(AnyCampaign)); +} +/** Get Any Campaign. +@return Match any value of the Campaign segment */ +public boolean isAnyCampaign() +{ +Object oo = get_Value("AnyCampaign"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Location From. +@param AnyLocFrom Match any value of the Location From segment */ +public void setAnyLocFrom (boolean AnyLocFrom) +{ +set_Value ("AnyLocFrom", new Boolean(AnyLocFrom)); +} +/** Get Any Location From. +@return Match any value of the Location From segment */ +public boolean isAnyLocFrom() +{ +Object oo = get_Value("AnyLocFrom"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Location To. +@param AnyLocTo Match any value of the Location To segment */ +public void setAnyLocTo (boolean AnyLocTo) +{ +set_Value ("AnyLocTo", new Boolean(AnyLocTo)); +} +/** Get Any Location To. +@return Match any value of the Location To segment */ +public boolean isAnyLocTo() +{ +Object oo = get_Value("AnyLocTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Organization. +@param AnyOrg Match any value of the Organization segment */ +public void setAnyOrg (boolean AnyOrg) +{ +set_Value ("AnyOrg", new Boolean(AnyOrg)); +} +/** Get Any Organization. +@return Match any value of the Organization segment */ +public boolean isAnyOrg() +{ +Object oo = get_Value("AnyOrg"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Trx Organization. +@param AnyOrgTrx Match any value of the Transaction Organization segment */ +public void setAnyOrgTrx (boolean AnyOrgTrx) +{ +set_Value ("AnyOrgTrx", new Boolean(AnyOrgTrx)); +} +/** Get Any Trx Organization. +@return Match any value of the Transaction Organization segment */ +public boolean isAnyOrgTrx() +{ +Object oo = get_Value("AnyOrgTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Product. +@param AnyProduct Match any value of the Product segment */ +public void setAnyProduct (boolean AnyProduct) +{ +set_Value ("AnyProduct", new Boolean(AnyProduct)); +} +/** Get Any Product. +@return Match any value of the Product segment */ +public boolean isAnyProduct() +{ +Object oo = get_Value("AnyProduct"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Project. +@param AnyProject Match any value of the Project segment */ +public void setAnyProject (boolean AnyProject) +{ +set_Value ("AnyProject", new Boolean(AnyProject)); +} +/** Get Any Project. +@return Match any value of the Project segment */ +public boolean isAnyProject() +{ +Object oo = get_Value("AnyProject"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any Sales Region. +@param AnySalesRegion Match any value of the Sales Region segment */ +public void setAnySalesRegion (boolean AnySalesRegion) +{ +set_Value ("AnySalesRegion", new Boolean(AnySalesRegion)); +} +/** Get Any Sales Region. +@return Match any value of the Sales Region segment */ +public boolean isAnySalesRegion() +{ +Object oo = get_Value("AnySalesRegion"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any User 1. +@param AnyUser1 Match any value of the User 1 segment */ +public void setAnyUser1 (boolean AnyUser1) +{ +set_Value ("AnyUser1", new Boolean(AnyUser1)); +} +/** Get Any User 1. +@return Match any value of the User 1 segment */ +public boolean isAnyUser1() +{ +Object oo = get_Value("AnyUser1"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Any User 2. +@param AnyUser2 Match any value of the User 2 segment */ +public void setAnyUser2 (boolean AnyUser2) +{ +set_Value ("AnyUser2", new Boolean(AnyUser2)); +} +/** Get Any User 2. +@return Match any value of the User 2 segment */ +public boolean isAnyUser2() +{ +Object oo = get_Value("AnyUser2"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocFrom_ID AD_Reference_ID=133 */ +public static final int C_LOCFROM_ID_AD_Reference_ID=133; +/** Set Location From. +@param C_LocFrom_ID Location that inventory was moved from */ +public void setC_LocFrom_ID (int C_LocFrom_ID) +{ +if (C_LocFrom_ID <= 0) set_Value ("C_LocFrom_ID", null); + else +set_Value ("C_LocFrom_ID", new Integer(C_LocFrom_ID)); +} +/** Get Location From. +@return Location that inventory was moved from */ +public int getC_LocFrom_ID() +{ +Integer ii = (Integer)get_Value("C_LocFrom_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocTo_ID AD_Reference_ID=133 */ +public static final int C_LOCTO_ID_AD_Reference_ID=133; +/** Set Location To. +@param C_LocTo_ID Location that inventory was moved to */ +public void setC_LocTo_ID (int C_LocTo_ID) +{ +if (C_LocTo_ID <= 0) set_Value ("C_LocTo_ID", null); + else +set_Value ("C_LocTo_ID", new Integer(C_LocTo_ID)); +} +/** Get Location To. +@return Location that inventory was moved to */ +public int getC_LocTo_ID() +{ +Integer ii = (Integer)get_Value("C_LocTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set GL Distribution. +@param GL_Distribution_ID General Ledger Distribution */ +public void setGL_Distribution_ID (int GL_Distribution_ID) +{ +if (GL_Distribution_ID < 1) throw new IllegalArgumentException ("GL_Distribution_ID is mandatory."); +set_ValueNoCheck ("GL_Distribution_ID", new Integer(GL_Distribution_ID)); +} +/** Get GL Distribution. +@return General Ledger Distribution */ +public int getGL_Distribution_ID() +{ +Integer ii = (Integer)get_Value("GL_Distribution_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Valid. +@param IsValid Element is valid */ +public void setIsValid (boolean IsValid) +{ +set_Value ("IsValid", new Boolean(IsValid)); +} +/** Get Valid. +@return Element is valid */ +public boolean isValid() +{ +Object oo = get_Value("IsValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Org_ID AD_Reference_ID=130 */ +public static final int ORG_ID_AD_Reference_ID=130; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID <= 0) set_Value ("Org_ID", null); + else +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Total Percent. +@param PercentTotal Sum of the Percent details */ +public void setPercentTotal (BigDecimal PercentTotal) +{ +if (PercentTotal == null) throw new IllegalArgumentException ("PercentTotal is mandatory."); +set_Value ("PercentTotal", PercentTotal); +} +/** Get Total Percent. +@return Sum of the Percent details */ +public BigDecimal getPercentTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("PercentTotal"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType == null || PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType != null && PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_DistributionLine.java b/dbPort/src/org/compiere/model/X_GL_DistributionLine.java new file mode 100644 index 0000000000..9aaff4b0cc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_DistributionLine.java @@ -0,0 +1,649 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_DistributionLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.187 */ +public class X_GL_DistributionLine extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_DistributionLine_ID id +@param trxName transaction +*/ +public X_GL_DistributionLine (Properties ctx, int GL_DistributionLine_ID, String trxName) +{ +super (ctx, GL_DistributionLine_ID, trxName); +/** if (GL_DistributionLine_ID == 0) +{ +setGL_DistributionLine_ID (0); +setGL_Distribution_ID (0); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM GL_DistributionLine WHERE GL_Distribution_ID=@GL_Distribution_ID@ +setOverwriteAcct (false); +setOverwriteActivity (false); +setOverwriteBPartner (false); +setOverwriteCampaign (false); +setOverwriteLocFrom (false); +setOverwriteLocTo (false); +setOverwriteOrg (false); +setOverwriteOrgTrx (false); +setOverwriteProduct (false); +setOverwriteProject (false); +setOverwriteSalesRegion (false); +setOverwriteUser1 (false); +setOverwriteUser2 (false); +setPercent (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_DistributionLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=707 */ +public static final int Table_ID=707; + +/** TableName=GL_DistributionLine */ +public static final String Table_Name="GL_DistributionLine"; + +protected static KeyNamePair Model = new KeyNamePair(707,"GL_DistributionLine"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_DistributionLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Account_ID AD_Reference_ID=132 */ +public static final int ACCOUNT_ID_AD_Reference_ID=132; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID <= 0) set_Value ("Account_ID", null); + else +set_Value ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocFrom_ID AD_Reference_ID=133 */ +public static final int C_LOCFROM_ID_AD_Reference_ID=133; +/** Set Location From. +@param C_LocFrom_ID Location that inventory was moved from */ +public void setC_LocFrom_ID (int C_LocFrom_ID) +{ +if (C_LocFrom_ID <= 0) set_Value ("C_LocFrom_ID", null); + else +set_Value ("C_LocFrom_ID", new Integer(C_LocFrom_ID)); +} +/** Get Location From. +@return Location that inventory was moved from */ +public int getC_LocFrom_ID() +{ +Integer ii = (Integer)get_Value("C_LocFrom_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocTo_ID AD_Reference_ID=133 */ +public static final int C_LOCTO_ID_AD_Reference_ID=133; +/** Set Location To. +@param C_LocTo_ID Location that inventory was moved to */ +public void setC_LocTo_ID (int C_LocTo_ID) +{ +if (C_LocTo_ID <= 0) set_Value ("C_LocTo_ID", null); + else +set_Value ("C_LocTo_ID", new Integer(C_LocTo_ID)); +} +/** Get Location To. +@return Location that inventory was moved to */ +public int getC_LocTo_ID() +{ +Integer ii = (Integer)get_Value("C_LocTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set GL Distribution Line. +@param GL_DistributionLine_ID General Ledger Distribution Line */ +public void setGL_DistributionLine_ID (int GL_DistributionLine_ID) +{ +if (GL_DistributionLine_ID < 1) throw new IllegalArgumentException ("GL_DistributionLine_ID is mandatory."); +set_ValueNoCheck ("GL_DistributionLine_ID", new Integer(GL_DistributionLine_ID)); +} +/** Get GL Distribution Line. +@return General Ledger Distribution Line */ +public int getGL_DistributionLine_ID() +{ +Integer ii = (Integer)get_Value("GL_DistributionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set GL Distribution. +@param GL_Distribution_ID General Ledger Distribution */ +public void setGL_Distribution_ID (int GL_Distribution_ID) +{ +if (GL_Distribution_ID < 1) throw new IllegalArgumentException ("GL_Distribution_ID is mandatory."); +set_ValueNoCheck ("GL_Distribution_ID", new Integer(GL_Distribution_ID)); +} +/** Get GL Distribution. +@return General Ledger Distribution */ +public int getGL_Distribution_ID() +{ +Integer ii = (Integer)get_Value("GL_Distribution_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Org_ID AD_Reference_ID=130 */ +public static final int ORG_ID_AD_Reference_ID=130; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID <= 0) set_Value ("Org_ID", null); + else +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Overwrite Account. +@param OverwriteAcct Overwrite the account segment Account with the value specified */ +public void setOverwriteAcct (boolean OverwriteAcct) +{ +set_Value ("OverwriteAcct", new Boolean(OverwriteAcct)); +} +/** Get Overwrite Account. +@return Overwrite the account segment Account with the value specified */ +public boolean isOverwriteAcct() +{ +Object oo = get_Value("OverwriteAcct"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Activity. +@param OverwriteActivity Overwrite the account segment Activity with the value specified */ +public void setOverwriteActivity (boolean OverwriteActivity) +{ +set_Value ("OverwriteActivity", new Boolean(OverwriteActivity)); +} +/** Get Overwrite Activity. +@return Overwrite the account segment Activity with the value specified */ +public boolean isOverwriteActivity() +{ +Object oo = get_Value("OverwriteActivity"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Bus.Partner. +@param OverwriteBPartner Overwrite the account segment Business Partner with the value specified */ +public void setOverwriteBPartner (boolean OverwriteBPartner) +{ +set_Value ("OverwriteBPartner", new Boolean(OverwriteBPartner)); +} +/** Get Overwrite Bus.Partner. +@return Overwrite the account segment Business Partner with the value specified */ +public boolean isOverwriteBPartner() +{ +Object oo = get_Value("OverwriteBPartner"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Campaign. +@param OverwriteCampaign Overwrite the account segment Campaign with the value specified */ +public void setOverwriteCampaign (boolean OverwriteCampaign) +{ +set_Value ("OverwriteCampaign", new Boolean(OverwriteCampaign)); +} +/** Get Overwrite Campaign. +@return Overwrite the account segment Campaign with the value specified */ +public boolean isOverwriteCampaign() +{ +Object oo = get_Value("OverwriteCampaign"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Location From. +@param OverwriteLocFrom Overwrite the account segment Location From with the value specified */ +public void setOverwriteLocFrom (boolean OverwriteLocFrom) +{ +set_Value ("OverwriteLocFrom", new Boolean(OverwriteLocFrom)); +} +/** Get Overwrite Location From. +@return Overwrite the account segment Location From with the value specified */ +public boolean isOverwriteLocFrom() +{ +Object oo = get_Value("OverwriteLocFrom"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Location To. +@param OverwriteLocTo Overwrite the account segment Location From with the value specified */ +public void setOverwriteLocTo (boolean OverwriteLocTo) +{ +set_Value ("OverwriteLocTo", new Boolean(OverwriteLocTo)); +} +/** Get Overwrite Location To. +@return Overwrite the account segment Location From with the value specified */ +public boolean isOverwriteLocTo() +{ +Object oo = get_Value("OverwriteLocTo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Organization. +@param OverwriteOrg Overwrite the account segment Organization with the value specified */ +public void setOverwriteOrg (boolean OverwriteOrg) +{ +set_Value ("OverwriteOrg", new Boolean(OverwriteOrg)); +} +/** Get Overwrite Organization. +@return Overwrite the account segment Organization with the value specified */ +public boolean isOverwriteOrg() +{ +Object oo = get_Value("OverwriteOrg"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Trx Organuzation. +@param OverwriteOrgTrx Overwrite the account segment Transaction Organization with the value specified */ +public void setOverwriteOrgTrx (boolean OverwriteOrgTrx) +{ +set_Value ("OverwriteOrgTrx", new Boolean(OverwriteOrgTrx)); +} +/** Get Overwrite Trx Organuzation. +@return Overwrite the account segment Transaction Organization with the value specified */ +public boolean isOverwriteOrgTrx() +{ +Object oo = get_Value("OverwriteOrgTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Product. +@param OverwriteProduct Overwrite the account segment Product with the value specified */ +public void setOverwriteProduct (boolean OverwriteProduct) +{ +set_Value ("OverwriteProduct", new Boolean(OverwriteProduct)); +} +/** Get Overwrite Product. +@return Overwrite the account segment Product with the value specified */ +public boolean isOverwriteProduct() +{ +Object oo = get_Value("OverwriteProduct"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Project. +@param OverwriteProject Overwrite the account segment Project with the value specified */ +public void setOverwriteProject (boolean OverwriteProject) +{ +set_Value ("OverwriteProject", new Boolean(OverwriteProject)); +} +/** Get Overwrite Project. +@return Overwrite the account segment Project with the value specified */ +public boolean isOverwriteProject() +{ +Object oo = get_Value("OverwriteProject"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite Sales Region. +@param OverwriteSalesRegion Overwrite the account segment Sales Region with the value specified */ +public void setOverwriteSalesRegion (boolean OverwriteSalesRegion) +{ +set_Value ("OverwriteSalesRegion", new Boolean(OverwriteSalesRegion)); +} +/** Get Overwrite Sales Region. +@return Overwrite the account segment Sales Region with the value specified */ +public boolean isOverwriteSalesRegion() +{ +Object oo = get_Value("OverwriteSalesRegion"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite User1. +@param OverwriteUser1 Overwrite the account segment User 1 with the value specified */ +public void setOverwriteUser1 (boolean OverwriteUser1) +{ +set_Value ("OverwriteUser1", new Boolean(OverwriteUser1)); +} +/** Get Overwrite User1. +@return Overwrite the account segment User 1 with the value specified */ +public boolean isOverwriteUser1() +{ +Object oo = get_Value("OverwriteUser1"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Overwrite User2. +@param OverwriteUser2 Overwrite the account segment User 2 with the value specified */ +public void setOverwriteUser2 (boolean OverwriteUser2) +{ +set_Value ("OverwriteUser2", new Boolean(OverwriteUser2)); +} +/** Get Overwrite User2. +@return Overwrite the account segment User 2 with the value specified */ +public boolean isOverwriteUser2() +{ +Object oo = get_Value("OverwriteUser2"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Percent. +@param Percent Percentage */ +public void setPercent (BigDecimal Percent) +{ +if (Percent == null) throw new IllegalArgumentException ("Percent is mandatory."); +set_Value ("Percent", Percent); +} +/** Get Percent. +@return Percentage */ +public BigDecimal getPercent() +{ +BigDecimal bd = (BigDecimal)get_Value("Percent"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_Fund.java b/dbPort/src/org/compiere/model/X_GL_Fund.java new file mode 100644 index 0000000000..d2d717a443 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_Fund.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_Fund + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.265 */ +public class X_GL_Fund extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_Fund_ID id +@param trxName transaction +*/ +public X_GL_Fund (Properties ctx, int GL_Fund_ID, String trxName) +{ +super (ctx, GL_Fund_ID, trxName); +/** if (GL_Fund_ID == 0) +{ +setAmt (Env.ZERO); +setC_AcctSchema_ID (0); +setGL_Fund_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_Fund (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=823 */ +public static final int Table_ID=823; + +/** TableName=GL_Fund */ +public static final String Table_Name="GL_Fund"; + +protected static KeyNamePair Model = new KeyNamePair(823,"GL_Fund"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_Fund[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +if (Amt == null) throw new IllegalArgumentException ("Amt is mandatory."); +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date From. +@param DateFrom Starting date for a range */ +public void setDateFrom (Timestamp DateFrom) +{ +set_Value ("DateFrom", DateFrom); +} +/** Get Date From. +@return Starting date for a range */ +public Timestamp getDateFrom() +{ +return (Timestamp)get_Value("DateFrom"); +} +/** Set Date To. +@param DateTo End date of a date range */ +public void setDateTo (Timestamp DateTo) +{ +set_Value ("DateTo", DateTo); +} +/** Get Date To. +@return End date of a date range */ +public Timestamp getDateTo() +{ +return (Timestamp)get_Value("DateTo"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set GL Fund. +@param GL_Fund_ID General Ledger Funds Control */ +public void setGL_Fund_ID (int GL_Fund_ID) +{ +if (GL_Fund_ID < 1) throw new IllegalArgumentException ("GL_Fund_ID is mandatory."); +set_ValueNoCheck ("GL_Fund_ID", new Integer(GL_Fund_ID)); +} +/** Get GL Fund. +@return General Ledger Funds Control */ +public int getGL_Fund_ID() +{ +Integer ii = (Integer)get_Value("GL_Fund_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_FundRestriction.java b/dbPort/src/org/compiere/model/X_GL_FundRestriction.java new file mode 100644 index 0000000000..26abf30f12 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_FundRestriction.java @@ -0,0 +1,177 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_FundRestriction + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.265 */ +public class X_GL_FundRestriction extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_FundRestriction_ID id +@param trxName transaction +*/ +public X_GL_FundRestriction (Properties ctx, int GL_FundRestriction_ID, String trxName) +{ +super (ctx, GL_FundRestriction_ID, trxName); +/** if (GL_FundRestriction_ID == 0) +{ +setC_ElementValue_ID (0); +setGL_FundRestriction_ID (0); +setGL_Fund_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_FundRestriction (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=824 */ +public static final int Table_ID=824; + +/** TableName=GL_FundRestriction */ +public static final String Table_Name="GL_FundRestriction"; + +protected static KeyNamePair Model = new KeyNamePair(824,"GL_FundRestriction"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_FundRestriction[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID < 1) throw new IllegalArgumentException ("C_ElementValue_ID is mandatory."); +set_Value ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Fund Restriction. +@param GL_FundRestriction_ID Restriction of Funds */ +public void setGL_FundRestriction_ID (int GL_FundRestriction_ID) +{ +if (GL_FundRestriction_ID < 1) throw new IllegalArgumentException ("GL_FundRestriction_ID is mandatory."); +set_ValueNoCheck ("GL_FundRestriction_ID", new Integer(GL_FundRestriction_ID)); +} +/** Get Fund Restriction. +@return Restriction of Funds */ +public int getGL_FundRestriction_ID() +{ +Integer ii = (Integer)get_Value("GL_FundRestriction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set GL Fund. +@param GL_Fund_ID General Ledger Funds Control */ +public void setGL_Fund_ID (int GL_Fund_ID) +{ +if (GL_Fund_ID < 1) throw new IllegalArgumentException ("GL_Fund_ID is mandatory."); +set_ValueNoCheck ("GL_Fund_ID", new Integer(GL_Fund_ID)); +} +/** Get GL Fund. +@return General Ledger Funds Control */ +public int getGL_Fund_ID() +{ +Integer ii = (Integer)get_Value("GL_Fund_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_Journal.java b/dbPort/src/org/compiere/model/X_GL_Journal.java new file mode 100644 index 0000000000..deb4f33eb2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_Journal.java @@ -0,0 +1,595 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_Journal + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.281 */ +public class X_GL_Journal extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_Journal_ID id +@param trxName transaction +*/ +public X_GL_Journal (Properties ctx, int GL_Journal_ID, String trxName) +{ +super (ctx, GL_Journal_ID, trxName); +/** if (GL_Journal_ID == 0) +{ +setC_AcctSchema_ID (0); // @$C_AcctSchema_ID@ +setC_ConversionType_ID (0); +setC_Currency_ID (0); // @C_Currency_ID@ +setC_DocType_ID (0); // @C_DocType_ID@ +setC_Period_ID (0); // @C_Period_ID@ +setCurrencyRate (Env.ZERO); // 1 +setDateAcct (new Timestamp(System.currentTimeMillis())); // @DateAcct@ +setDateDoc (new Timestamp(System.currentTimeMillis())); // @DateDoc@ +setDescription (null); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setGL_Category_ID (0); // @GL_Category_ID@ +setGL_Journal_ID (0); +setIsApproved (true); // Y +setIsPrinted (false); // N +setPosted (false); // N +setPostingType (null); // @PostingType@ +setTotalCr (Env.ZERO); // 0 +setTotalDr (Env.ZERO); // 0 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_Journal (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=224 */ +public static final int Table_ID=224; + +/** TableName=GL_Journal */ +public static final String Table_Name="GL_Journal"; + +protected static KeyNamePair Model = new KeyNamePair(224,"GL_Journal"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_Journal[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID < 1) throw new IllegalArgumentException ("C_ConversionType_ID is mandatory."); +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Period_ID AD_Reference_ID=275 */ +public static final int C_PERIOD_ID_AD_Reference_ID=275; +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID < 1) throw new IllegalArgumentException ("C_Period_ID is mandatory."); +set_Value ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Control Amount. +@param ControlAmt If not zero, the Debit amount of the document must be equal this amount */ +public void setControlAmt (BigDecimal ControlAmt) +{ +set_Value ("ControlAmt", ControlAmt); +} +/** Get Control Amount. +@return If not zero, the Debit amount of the document must be equal this amount */ +public BigDecimal getControlAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ControlAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Rate. +@param CurrencyRate Currency Conversion Rate */ +public void setCurrencyRate (BigDecimal CurrencyRate) +{ +if (CurrencyRate == null) throw new IllegalArgumentException ("CurrencyRate is mandatory."); +set_Value ("CurrencyRate", CurrencyRate); +} +/** Get Rate. +@return Currency Conversion Rate */ +public BigDecimal getCurrencyRate() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrencyRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Document Date. +@param DateDoc Date of the Document */ +public void setDateDoc (Timestamp DateDoc) +{ +if (DateDoc == null) throw new IllegalArgumentException ("DateDoc is mandatory."); +set_Value ("DateDoc", DateDoc); +} +/** Get Document Date. +@return Date of the Document */ +public Timestamp getDateDoc() +{ +return (Timestamp)get_Value("DateDoc"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description == null) throw new IllegalArgumentException ("Description is mandatory."); +if (Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID <= 0) set_Value ("GL_Budget_ID", null); + else +set_Value ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set GL Category. +@param GL_Category_ID General Ledger Category */ +public void setGL_Category_ID (int GL_Category_ID) +{ +if (GL_Category_ID < 1) throw new IllegalArgumentException ("GL_Category_ID is mandatory."); +set_Value ("GL_Category_ID", new Integer(GL_Category_ID)); +} +/** Get GL Category. +@return General Ledger Category */ +public int getGL_Category_ID() +{ +Integer ii = (Integer)get_Value("GL_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal Batch. +@param GL_JournalBatch_ID General Ledger Journal Batch */ +public void setGL_JournalBatch_ID (int GL_JournalBatch_ID) +{ +if (GL_JournalBatch_ID <= 0) set_ValueNoCheck ("GL_JournalBatch_ID", null); + else +set_ValueNoCheck ("GL_JournalBatch_ID", new Integer(GL_JournalBatch_ID)); +} +/** Get Journal Batch. +@return General Ledger Journal Batch */ +public int getGL_JournalBatch_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal. +@param GL_Journal_ID General Ledger Journal */ +public void setGL_Journal_ID (int GL_Journal_ID) +{ +if (GL_Journal_ID < 1) throw new IllegalArgumentException ("GL_Journal_ID is mandatory."); +set_ValueNoCheck ("GL_Journal_ID", new Integer(GL_Journal_ID)); +} +/** Get Journal. +@return General Ledger Journal */ +public int getGL_Journal_ID() +{ +Integer ii = (Integer)get_Value("GL_Journal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_ValueNoCheck ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_ValueNoCheck ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_ValueNoCheck ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Credit. +@param TotalCr Total Credit in document currency */ +public void setTotalCr (BigDecimal TotalCr) +{ +if (TotalCr == null) throw new IllegalArgumentException ("TotalCr is mandatory."); +set_ValueNoCheck ("TotalCr", TotalCr); +} +/** Get Total Credit. +@return Total Credit in document currency */ +public BigDecimal getTotalCr() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Total Debit. +@param TotalDr Total debit in document currency */ +public void setTotalDr (BigDecimal TotalDr) +{ +if (TotalDr == null) throw new IllegalArgumentException ("TotalDr is mandatory."); +set_ValueNoCheck ("TotalDr", TotalDr); +} +/** Get Total Debit. +@return Total debit in document currency */ +public BigDecimal getTotalDr() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalDr"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_JournalBatch.java b/dbPort/src/org/compiere/model/X_GL_JournalBatch.java new file mode 100644 index 0000000000..91d7376172 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_JournalBatch.java @@ -0,0 +1,491 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_JournalBatch + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.312 */ +public class X_GL_JournalBatch extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_JournalBatch_ID id +@param trxName transaction +*/ +public X_GL_JournalBatch (Properties ctx, int GL_JournalBatch_ID, String trxName) +{ +super (ctx, GL_JournalBatch_ID, trxName); +/** if (GL_JournalBatch_ID == 0) +{ +setC_DocType_ID (0); +setDescription (null); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setGL_JournalBatch_ID (0); +setPostingType (null); // A +setProcessed (false); +setProcessing (false); +setTotalCr (Env.ZERO); +setTotalDr (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_JournalBatch (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=225 */ +public static final int Table_ID=225; + +/** TableName=GL_JournalBatch */ +public static final String Table_Name="GL_JournalBatch"; + +protected static KeyNamePair Model = new KeyNamePair(225,"GL_JournalBatch"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_JournalBatch[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Period_ID AD_Reference_ID=275 */ +public static final int C_PERIOD_ID_AD_Reference_ID=275; +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID <= 0) set_Value ("C_Period_ID", null); + else +set_Value ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Control Amount. +@param ControlAmt If not zero, the Debit amount of the document must be equal this amount */ +public void setControlAmt (BigDecimal ControlAmt) +{ +set_Value ("ControlAmt", ControlAmt); +} +/** Get Control Amount. +@return If not zero, the Debit amount of the document must be equal this amount */ +public BigDecimal getControlAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ControlAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Copy From. +@param CopyFrom Copy From Record */ +public void setCopyFrom (String CopyFrom) +{ +if (CopyFrom != null && CopyFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CopyFrom = CopyFrom.substring(0,0); +} +set_Value ("CopyFrom", CopyFrom); +} +/** Get Copy From. +@return Copy From Record */ +public String getCopyFrom() +{ +return (String)get_Value("CopyFrom"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Document Date. +@param DateDoc Date of the Document */ +public void setDateDoc (Timestamp DateDoc) +{ +set_Value ("DateDoc", DateDoc); +} +/** Get Document Date. +@return Date of the Document */ +public Timestamp getDateDoc() +{ +return (Timestamp)get_Value("DateDoc"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description == null) throw new IllegalArgumentException ("Description is mandatory."); +if (Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set GL Category. +@param GL_Category_ID General Ledger Category */ +public void setGL_Category_ID (int GL_Category_ID) +{ +if (GL_Category_ID <= 0) set_Value ("GL_Category_ID", null); + else +set_Value ("GL_Category_ID", new Integer(GL_Category_ID)); +} +/** Get GL Category. +@return General Ledger Category */ +public int getGL_Category_ID() +{ +Integer ii = (Integer)get_Value("GL_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal Batch. +@param GL_JournalBatch_ID General Ledger Journal Batch */ +public void setGL_JournalBatch_ID (int GL_JournalBatch_ID) +{ +if (GL_JournalBatch_ID < 1) throw new IllegalArgumentException ("GL_JournalBatch_ID is mandatory."); +set_ValueNoCheck ("GL_JournalBatch_ID", new Integer(GL_JournalBatch_ID)); +} +/** Get Journal Batch. +@return General Ledger Journal Batch */ +public int getGL_JournalBatch_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Credit. +@param TotalCr Total Credit in document currency */ +public void setTotalCr (BigDecimal TotalCr) +{ +if (TotalCr == null) throw new IllegalArgumentException ("TotalCr is mandatory."); +set_ValueNoCheck ("TotalCr", TotalCr); +} +/** Get Total Credit. +@return Total Credit in document currency */ +public BigDecimal getTotalCr() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Total Debit. +@param TotalDr Total debit in document currency */ +public void setTotalDr (BigDecimal TotalDr) +{ +if (TotalDr == null) throw new IllegalArgumentException ("TotalDr is mandatory."); +set_ValueNoCheck ("TotalDr", TotalDr); +} +/** Get Total Debit. +@return Total debit in document currency */ +public BigDecimal getTotalDr() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalDr"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_GL_JournalLine.java b/dbPort/src/org/compiere/model/X_GL_JournalLine.java new file mode 100644 index 0000000000..4e1382faec --- /dev/null +++ b/dbPort/src/org/compiere/model/X_GL_JournalLine.java @@ -0,0 +1,368 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for GL_JournalLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.343 */ +public class X_GL_JournalLine extends PO +{ +/** Standard Constructor +@param ctx context +@param GL_JournalLine_ID id +@param trxName transaction +*/ +public X_GL_JournalLine (Properties ctx, int GL_JournalLine_ID, String trxName) +{ +super (ctx, GL_JournalLine_ID, trxName); +/** if (GL_JournalLine_ID == 0) +{ +setAmtAcctCr (Env.ZERO); +setAmtAcctDr (Env.ZERO); +setAmtSourceCr (Env.ZERO); +setAmtSourceDr (Env.ZERO); +setC_ConversionType_ID (0); +setC_Currency_ID (0); // @C_Currency_ID@ +setC_ValidCombination_ID (0); +setCurrencyRate (Env.ZERO); // @CurrencyRate@; +1 +setDateAcct (new Timestamp(System.currentTimeMillis())); // @DateAcct@ +setGL_JournalLine_ID (0); +setGL_Journal_ID (0); +setIsGenerated (false); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM GL_JournalLine WHERE GL_Journal_ID=@GL_Journal_ID@ +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_GL_JournalLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=226 */ +public static final int Table_ID=226; + +/** TableName=GL_JournalLine */ +public static final String Table_Name="GL_JournalLine"; + +protected static KeyNamePair Model = new KeyNamePair(226,"GL_JournalLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_GL_JournalLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounted Credit. +@param AmtAcctCr Accounted Credit Amount */ +public void setAmtAcctCr (BigDecimal AmtAcctCr) +{ +if (AmtAcctCr == null) throw new IllegalArgumentException ("AmtAcctCr is mandatory."); +set_ValueNoCheck ("AmtAcctCr", AmtAcctCr); +} +/** Get Accounted Credit. +@return Accounted Credit Amount */ +public BigDecimal getAmtAcctCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounted Debit. +@param AmtAcctDr Accounted Debit Amount */ +public void setAmtAcctDr (BigDecimal AmtAcctDr) +{ +if (AmtAcctDr == null) throw new IllegalArgumentException ("AmtAcctDr is mandatory."); +set_ValueNoCheck ("AmtAcctDr", AmtAcctDr); +} +/** Get Accounted Debit. +@return Accounted Debit Amount */ +public BigDecimal getAmtAcctDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Credit. +@param AmtSourceCr Source Credit Amount */ +public void setAmtSourceCr (BigDecimal AmtSourceCr) +{ +if (AmtSourceCr == null) throw new IllegalArgumentException ("AmtSourceCr is mandatory."); +set_Value ("AmtSourceCr", AmtSourceCr); +} +/** Get Source Credit. +@return Source Credit Amount */ +public BigDecimal getAmtSourceCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Debit. +@param AmtSourceDr Source Debit Amount */ +public void setAmtSourceDr (BigDecimal AmtSourceDr) +{ +if (AmtSourceDr == null) throw new IllegalArgumentException ("AmtSourceDr is mandatory."); +set_Value ("AmtSourceDr", AmtSourceDr); +} +/** Get Source Debit. +@return Source Debit Amount */ +public BigDecimal getAmtSourceDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID < 1) throw new IllegalArgumentException ("C_ConversionType_ID is mandatory."); +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Combination. +@param C_ValidCombination_ID Valid Account Combination */ +public void setC_ValidCombination_ID (int C_ValidCombination_ID) +{ +if (C_ValidCombination_ID < 1) throw new IllegalArgumentException ("C_ValidCombination_ID is mandatory."); +set_Value ("C_ValidCombination_ID", new Integer(C_ValidCombination_ID)); +} +/** Get Combination. +@return Valid Account Combination */ +public int getC_ValidCombination_ID() +{ +Integer ii = (Integer)get_Value("C_ValidCombination_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Rate. +@param CurrencyRate Currency Conversion Rate */ +public void setCurrencyRate (BigDecimal CurrencyRate) +{ +if (CurrencyRate == null) throw new IllegalArgumentException ("CurrencyRate is mandatory."); +set_ValueNoCheck ("CurrencyRate", CurrencyRate); +} +/** Get Rate. +@return Currency Conversion Rate */ +public BigDecimal getCurrencyRate() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrencyRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Journal Line. +@param GL_JournalLine_ID General Ledger Journal Line */ +public void setGL_JournalLine_ID (int GL_JournalLine_ID) +{ +if (GL_JournalLine_ID < 1) throw new IllegalArgumentException ("GL_JournalLine_ID is mandatory."); +set_ValueNoCheck ("GL_JournalLine_ID", new Integer(GL_JournalLine_ID)); +} +/** Get Journal Line. +@return General Ledger Journal Line */ +public int getGL_JournalLine_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal. +@param GL_Journal_ID General Ledger Journal */ +public void setGL_Journal_ID (int GL_Journal_ID) +{ +if (GL_Journal_ID < 1) throw new IllegalArgumentException ("GL_Journal_ID is mandatory."); +set_ValueNoCheck ("GL_Journal_ID", new Integer(GL_Journal_ID)); +} +/** Get Journal. +@return General Ledger Journal */ +public int getGL_Journal_ID() +{ +Integer ii = (Integer)get_Value("GL_Journal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Generated. +@param IsGenerated This Line is generated */ +public void setIsGenerated (boolean IsGenerated) +{ +set_ValueNoCheck ("IsGenerated", new Boolean(IsGenerated)); +} +/** Get Generated. +@return This Line is generated */ +public boolean isGenerated() +{ +Object oo = get_Value("IsGenerated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_I_BPartner.java b/dbPort/src/org/compiere/model/X_I_BPartner.java new file mode 100644 index 0000000000..8946fc74d0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_BPartner.java @@ -0,0 +1,763 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_BPartner + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.671 */ +public class X_I_BPartner extends PO +{ +/** Standard Constructor +@param ctx context +@param I_BPartner_ID id +@param trxName transaction +*/ +public X_I_BPartner (Properties ctx, int I_BPartner_ID, String trxName) +{ +super (ctx, I_BPartner_ID, trxName); +/** if (I_BPartner_ID == 0) +{ +setI_BPartner_ID (0); +setI_IsImported (false); // N +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_BPartner (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=533 */ +public static final int Table_ID=533; + +/** TableName=I_BPartner */ +public static final String Table_Name="I_BPartner"; + +protected static KeyNamePair Model = new KeyNamePair(533,"I_BPartner"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_BPartner[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address 1. +@param Address1 Address line 1 for this location */ +public void setAddress1 (String Address1) +{ +if (Address1 != null && Address1.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address1 = Address1.substring(0,59); +} +set_Value ("Address1", Address1); +} +/** Get Address 1. +@return Address line 1 for this location */ +public String getAddress1() +{ +return (String)get_Value("Address1"); +} +/** Set Address 2. +@param Address2 Address line 2 for this location */ +public void setAddress2 (String Address2) +{ +if (Address2 != null && Address2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address2 = Address2.substring(0,59); +} +set_Value ("Address2", Address2); +} +/** Get Address 2. +@return Address line 2 for this location */ +public String getAddress2() +{ +return (String)get_Value("Address2"); +} +/** Set BP Contact Greeting. +@param BPContactGreeting Greeting for Business Partner Contact */ +public void setBPContactGreeting (String BPContactGreeting) +{ +if (BPContactGreeting != null && BPContactGreeting.length() > 60) +{ +log.warning("Length > 60 - truncated"); +BPContactGreeting = BPContactGreeting.substring(0,59); +} +set_Value ("BPContactGreeting", BPContactGreeting); +} +/** Get BP Contact Greeting. +@return Greeting for Business Partner Contact */ +public String getBPContactGreeting() +{ +return (String)get_Value("BPContactGreeting"); +} +/** Set Birthday. +@param Birthday Birthday or Anniversary day */ +public void setBirthday (Timestamp Birthday) +{ +set_Value ("Birthday", Birthday); +} +/** Get Birthday. +@return Birthday or Anniversary day */ +public Timestamp getBirthday() +{ +return (Timestamp)get_Value("Birthday"); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID <= 0) set_Value ("C_BP_Group_ID", null); + else +set_Value ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID <= 0) set_Value ("C_Country_ID", null); + else +set_Value ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Greeting. +@param C_Greeting_ID Greeting to print on correspondence */ +public void setC_Greeting_ID (int C_Greeting_ID) +{ +if (C_Greeting_ID <= 0) set_Value ("C_Greeting_ID", null); + else +set_Value ("C_Greeting_ID", new Integer(C_Greeting_ID)); +} +/** Get Greeting. +@return Greeting to print on correspondence */ +public int getC_Greeting_ID() +{ +Integer ii = (Integer)get_Value("C_Greeting_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set City. +@param City Identifies a City */ +public void setCity (String City) +{ +if (City != null && City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +City = City.substring(0,59); +} +set_Value ("City", City); +} +/** Get City. +@return Identifies a City */ +public String getCity() +{ +return (String)get_Value("City"); +} +/** Set Comments. +@param Comments Comments or additional information */ +public void setComments (String Comments) +{ +if (Comments != null && Comments.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Comments = Comments.substring(0,1999); +} +set_Value ("Comments", Comments); +} +/** Get Comments. +@return Comments or additional information */ +public String getComments() +{ +return (String)get_Value("Comments"); +} +/** Set Contact Description. +@param ContactDescription Description of Contact */ +public void setContactDescription (String ContactDescription) +{ +if (ContactDescription != null && ContactDescription.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ContactDescription = ContactDescription.substring(0,254); +} +set_Value ("ContactDescription", ContactDescription); +} +/** Get Contact Description. +@return Description of Contact */ +public String getContactDescription() +{ +return (String)get_Value("ContactDescription"); +} +/** Set Contact Name. +@param ContactName Business Partner Contact Name */ +public void setContactName (String ContactName) +{ +if (ContactName != null && ContactName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ContactName = ContactName.substring(0,59); +} +set_Value ("ContactName", ContactName); +} +/** Get Contact Name. +@return Business Partner Contact Name */ +public String getContactName() +{ +return (String)get_Value("ContactName"); +} +/** Set ISO Country Code. +@param CountryCode Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public void setCountryCode (String CountryCode) +{ +if (CountryCode != null && CountryCode.length() > 2) +{ +log.warning("Length > 2 - truncated"); +CountryCode = CountryCode.substring(0,1); +} +set_Value ("CountryCode", CountryCode); +} +/** Get ISO Country Code. +@return Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public String getCountryCode() +{ +return (String)get_Value("CountryCode"); +} +/** Set D-U-N-S. +@param DUNS Dun & Bradstreet Number */ +public void setDUNS (String DUNS) +{ +if (DUNS != null && DUNS.length() > 11) +{ +log.warning("Length > 11 - truncated"); +DUNS = DUNS.substring(0,10); +} +set_Value ("DUNS", DUNS); +} +/** Get D-U-N-S. +@return Dun & Bradstreet Number */ +public String getDUNS() +{ +return (String)get_Value("DUNS"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Fax. +@param Fax Facsimile number */ +public void setFax (String Fax) +{ +if (Fax != null && Fax.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Fax = Fax.substring(0,39); +} +set_Value ("Fax", Fax); +} +/** Get Fax. +@return Facsimile number */ +public String getFax() +{ +return (String)get_Value("Fax"); +} +/** Set Group Key. +@param GroupValue Business Partner Group Key */ +public void setGroupValue (String GroupValue) +{ +if (GroupValue != null && GroupValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +GroupValue = GroupValue.substring(0,39); +} +set_Value ("GroupValue", GroupValue); +} +/** Get Group Key. +@return Business Partner Group Key */ +public String getGroupValue() +{ +return (String)get_Value("GroupValue"); +} +/** Set Import Business Partner. +@param I_BPartner_ID Import Business Partner */ +public void setI_BPartner_ID (int I_BPartner_ID) +{ +if (I_BPartner_ID < 1) throw new IllegalArgumentException ("I_BPartner_ID is mandatory."); +set_ValueNoCheck ("I_BPartner_ID", new Integer(I_BPartner_ID)); +} +/** Get Import Business Partner. +@return Import Business Partner */ +public int getI_BPartner_ID() +{ +Integer ii = (Integer)get_Value("I_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Interest Area. +@param InterestAreaName Name of the Interest Area */ +public void setInterestAreaName (String InterestAreaName) +{ +if (InterestAreaName != null && InterestAreaName.length() > 40) +{ +log.warning("Length > 40 - truncated"); +InterestAreaName = InterestAreaName.substring(0,39); +} +set_Value ("InterestAreaName", InterestAreaName); +} +/** Get Interest Area. +@return Name of the Interest Area */ +public String getInterestAreaName() +{ +return (String)get_Value("InterestAreaName"); +} +/** Set NAICS/SIC. +@param NAICS Standard Industry Code or its successor NAIC - http://www.osha.gov/oshstats/sicser.html */ +public void setNAICS (String NAICS) +{ +if (NAICS != null && NAICS.length() > 6) +{ +log.warning("Length > 6 - truncated"); +NAICS = NAICS.substring(0,5); +} +set_Value ("NAICS", NAICS); +} +/** Get NAICS/SIC. +@return Standard Industry Code or its successor NAIC - http://www.osha.gov/oshstats/sicser.html */ +public String getNAICS() +{ +return (String)get_Value("NAICS"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Name 2. +@param Name2 Additional Name */ +public void setName2 (String Name2) +{ +if (Name2 != null && Name2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name2 = Name2.substring(0,59); +} +set_Value ("Name2", Name2); +} +/** Get Name 2. +@return Additional Name */ +public String getName2() +{ +return (String)get_Value("Name2"); +} +/** Set Password. +@param Password Password of any length (case sensitive) */ +public void setPassword (String Password) +{ +if (Password != null && Password.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Password = Password.substring(0,19); +} +set_Value ("Password", Password); +} +/** Get Password. +@return Password of any length (case sensitive) */ +public String getPassword() +{ +return (String)get_Value("Password"); +} +/** Set Phone. +@param Phone Identifies a telephone number */ +public void setPhone (String Phone) +{ +if (Phone != null && Phone.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone = Phone.substring(0,39); +} +set_Value ("Phone", Phone); +} +/** Get Phone. +@return Identifies a telephone number */ +public String getPhone() +{ +return (String)get_Value("Phone"); +} +/** Set 2nd Phone. +@param Phone2 Identifies an alternate telephone number. */ +public void setPhone2 (String Phone2) +{ +if (Phone2 != null && Phone2.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone2 = Phone2.substring(0,39); +} +set_Value ("Phone2", Phone2); +} +/** Get 2nd Phone. +@return Identifies an alternate telephone number. */ +public String getPhone2() +{ +return (String)get_Value("Phone2"); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal != null && Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_Value ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +/** Set -. +@param Postal_Add Additional ZIP or Postal code */ +public void setPostal_Add (String Postal_Add) +{ +if (Postal_Add != null && Postal_Add.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal_Add = Postal_Add.substring(0,9); +} +set_Value ("Postal_Add", Postal_Add); +} +/** Get -. +@return Additional ZIP or Postal code */ +public String getPostal_Add() +{ +return (String)get_Value("Postal_Add"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Interest Area. +@param R_InterestArea_ID Interest Area or Topic */ +public void setR_InterestArea_ID (int R_InterestArea_ID) +{ +if (R_InterestArea_ID <= 0) set_Value ("R_InterestArea_ID", null); + else +set_Value ("R_InterestArea_ID", new Integer(R_InterestArea_ID)); +} +/** Get Interest Area. +@return Interest Area or Topic */ +public int getR_InterestArea_ID() +{ +Integer ii = (Integer)get_Value("R_InterestArea_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param RegionName Name of the Region */ +public void setRegionName (String RegionName) +{ +if (RegionName != null && RegionName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RegionName = RegionName.substring(0,59); +} +set_Value ("RegionName", RegionName); +} +/** Get Region. +@return Name of the Region */ +public String getRegionName() +{ +return (String)get_Value("RegionName"); +} +/** Set Tax ID. +@param TaxID Tax Identification */ +public void setTaxID (String TaxID) +{ +if (TaxID != null && TaxID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TaxID = TaxID.substring(0,19); +} +set_Value ("TaxID", TaxID); +} +/** Get Tax ID. +@return Tax Identification */ +public String getTaxID() +{ +return (String)get_Value("TaxID"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title != null && Title.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Title = Title.substring(0,39); +} +set_Value ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value != null && Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_BankStatement.java b/dbPort/src/org/compiere/model/X_I_BankStatement.java new file mode 100644 index 0000000000..c206b7f286 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_BankStatement.java @@ -0,0 +1,915 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_BankStatement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.734 */ +public class X_I_BankStatement extends PO +{ +/** Standard Constructor +@param ctx context +@param I_BankStatement_ID id +@param trxName transaction +*/ +public X_I_BankStatement (Properties ctx, int I_BankStatement_ID, String trxName) +{ +super (ctx, I_BankStatement_ID, trxName); +/** if (I_BankStatement_ID == 0) +{ +setI_BankStatement_ID (0); +setI_IsImported (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_BankStatement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=600 */ +public static final int Table_ID=600; + +/** TableName=I_BankStatement */ +public static final String Table_Name="I_BankStatement"; + +protected static KeyNamePair Model = new KeyNamePair(600,"I_BankStatement"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_BankStatement[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner Key. +@param BPartnerValue Key of the Business Partner */ +public void setBPartnerValue (String BPartnerValue) +{ +if (BPartnerValue != null && BPartnerValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BPartnerValue = BPartnerValue.substring(0,39); +} +set_Value ("BPartnerValue", BPartnerValue); +} +/** Get Business Partner Key. +@return Key of the Business Partner */ +public String getBPartnerValue() +{ +return (String)get_Value("BPartnerValue"); +} +/** Set Bank Account No. +@param BankAccountNo Bank Account Number */ +public void setBankAccountNo (String BankAccountNo) +{ +if (BankAccountNo != null && BankAccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +BankAccountNo = BankAccountNo.substring(0,19); +} +set_Value ("BankAccountNo", BankAccountNo); +} +/** Get Bank Account No. +@return Bank Account Number */ +public String getBankAccountNo() +{ +return (String)get_Value("BankAccountNo"); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID <= 0) set_Value ("C_BankAccount_ID", null); + else +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank statement line. +@param C_BankStatementLine_ID Line on a statement from this Bank */ +public void setC_BankStatementLine_ID (int C_BankStatementLine_ID) +{ +if (C_BankStatementLine_ID <= 0) set_Value ("C_BankStatementLine_ID", null); + else +set_Value ("C_BankStatementLine_ID", new Integer(C_BankStatementLine_ID)); +} +/** Get Bank statement line. +@return Line on a statement from this Bank */ +public int getC_BankStatementLine_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Statement. +@param C_BankStatement_ID Bank Statement of account */ +public void setC_BankStatement_ID (int C_BankStatement_ID) +{ +if (C_BankStatement_ID <= 0) set_Value ("C_BankStatement_ID", null); + else +set_Value ("C_BankStatement_ID", new Integer(C_BankStatement_ID)); +} +/** Get Bank Statement. +@return Bank Statement of account */ +public int getC_BankStatement_ID() +{ +Integer ii = (Integer)get_Value("C_BankStatement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Charge Name. +@param ChargeName Name of the Charge */ +public void setChargeName (String ChargeName) +{ +if (ChargeName != null && ChargeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ChargeName = ChargeName.substring(0,59); +} +set_Value ("ChargeName", ChargeName); +} +/** Get Charge Name. +@return Name of the Charge */ +public String getChargeName() +{ +return (String)get_Value("ChargeName"); +} +/** Set Create Payment. +@param CreatePayment Create Payment */ +public void setCreatePayment (String CreatePayment) +{ +if (CreatePayment != null && CreatePayment.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreatePayment = CreatePayment.substring(0,0); +} +set_Value ("CreatePayment", CreatePayment); +} +/** Get Create Payment. +@return Create Payment */ +public String getCreatePayment() +{ +return (String)get_Value("CreatePayment"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EFT Amount. +@param EftAmt Electronic Funds Transfer Amount */ +public void setEftAmt (BigDecimal EftAmt) +{ +set_Value ("EftAmt", EftAmt); +} +/** Get EFT Amount. +@return Electronic Funds Transfer Amount */ +public BigDecimal getEftAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("EftAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set EFT Check No. +@param EftCheckNo Electronic Funds Transfer Check No */ +public void setEftCheckNo (String EftCheckNo) +{ +if (EftCheckNo != null && EftCheckNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EftCheckNo = EftCheckNo.substring(0,19); +} +set_Value ("EftCheckNo", EftCheckNo); +} +/** Get EFT Check No. +@return Electronic Funds Transfer Check No */ +public String getEftCheckNo() +{ +return (String)get_Value("EftCheckNo"); +} +/** Set EFT Currency. +@param EftCurrency Electronic Funds Transfer Currency */ +public void setEftCurrency (String EftCurrency) +{ +if (EftCurrency != null && EftCurrency.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EftCurrency = EftCurrency.substring(0,19); +} +set_Value ("EftCurrency", EftCurrency); +} +/** Get EFT Currency. +@return Electronic Funds Transfer Currency */ +public String getEftCurrency() +{ +return (String)get_Value("EftCurrency"); +} +/** Set EFT Memo. +@param EftMemo Electronic Funds Transfer Memo */ +public void setEftMemo (String EftMemo) +{ +if (EftMemo != null && EftMemo.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +EftMemo = EftMemo.substring(0,1999); +} +set_Value ("EftMemo", EftMemo); +} +/** Get EFT Memo. +@return Electronic Funds Transfer Memo */ +public String getEftMemo() +{ +return (String)get_Value("EftMemo"); +} +/** Set EFT Payee. +@param EftPayee Electronic Funds Transfer Payee information */ +public void setEftPayee (String EftPayee) +{ +if (EftPayee != null && EftPayee.length() > 255) +{ +log.warning("Length > 255 - truncated"); +EftPayee = EftPayee.substring(0,254); +} +set_Value ("EftPayee", EftPayee); +} +/** Get EFT Payee. +@return Electronic Funds Transfer Payee information */ +public String getEftPayee() +{ +return (String)get_Value("EftPayee"); +} +/** Set EFT Payee Account. +@param EftPayeeAccount Electronic Funds Transfer Payyee Account Information */ +public void setEftPayeeAccount (String EftPayeeAccount) +{ +if (EftPayeeAccount != null && EftPayeeAccount.length() > 40) +{ +log.warning("Length > 40 - truncated"); +EftPayeeAccount = EftPayeeAccount.substring(0,39); +} +set_Value ("EftPayeeAccount", EftPayeeAccount); +} +/** Get EFT Payee Account. +@return Electronic Funds Transfer Payyee Account Information */ +public String getEftPayeeAccount() +{ +return (String)get_Value("EftPayeeAccount"); +} +/** Set EFT Reference. +@param EftReference Electronic Funds Transfer Reference */ +public void setEftReference (String EftReference) +{ +if (EftReference != null && EftReference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EftReference = EftReference.substring(0,59); +} +set_Value ("EftReference", EftReference); +} +/** Get EFT Reference. +@return Electronic Funds Transfer Reference */ +public String getEftReference() +{ +return (String)get_Value("EftReference"); +} +/** Set EFT Statement Date. +@param EftStatementDate Electronic Funds Transfer Statement Date */ +public void setEftStatementDate (Timestamp EftStatementDate) +{ +set_Value ("EftStatementDate", EftStatementDate); +} +/** Get EFT Statement Date. +@return Electronic Funds Transfer Statement Date */ +public Timestamp getEftStatementDate() +{ +return (Timestamp)get_Value("EftStatementDate"); +} +/** Set EFT Statement Line Date. +@param EftStatementLineDate Electronic Funds Transfer Statement Line Date */ +public void setEftStatementLineDate (Timestamp EftStatementLineDate) +{ +set_Value ("EftStatementLineDate", EftStatementLineDate); +} +/** Get EFT Statement Line Date. +@return Electronic Funds Transfer Statement Line Date */ +public Timestamp getEftStatementLineDate() +{ +return (Timestamp)get_Value("EftStatementLineDate"); +} +/** Set EFT Statement Reference. +@param EftStatementReference Electronic Funds Transfer Statement Reference */ +public void setEftStatementReference (String EftStatementReference) +{ +if (EftStatementReference != null && EftStatementReference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EftStatementReference = EftStatementReference.substring(0,59); +} +set_Value ("EftStatementReference", EftStatementReference); +} +/** Get EFT Statement Reference. +@return Electronic Funds Transfer Statement Reference */ +public String getEftStatementReference() +{ +return (String)get_Value("EftStatementReference"); +} +/** Set EFT Trx ID. +@param EftTrxID Electronic Funds Transfer Transaction ID */ +public void setEftTrxID (String EftTrxID) +{ +if (EftTrxID != null && EftTrxID.length() > 40) +{ +log.warning("Length > 40 - truncated"); +EftTrxID = EftTrxID.substring(0,39); +} +set_Value ("EftTrxID", EftTrxID); +} +/** Get EFT Trx ID. +@return Electronic Funds Transfer Transaction ID */ +public String getEftTrxID() +{ +return (String)get_Value("EftTrxID"); +} +/** Set EFT Trx Type. +@param EftTrxType Electronic Funds Transfer Transaction Type */ +public void setEftTrxType (String EftTrxType) +{ +if (EftTrxType != null && EftTrxType.length() > 20) +{ +log.warning("Length > 20 - truncated"); +EftTrxType = EftTrxType.substring(0,19); +} +set_Value ("EftTrxType", EftTrxType); +} +/** Get EFT Trx Type. +@return Electronic Funds Transfer Transaction Type */ +public String getEftTrxType() +{ +return (String)get_Value("EftTrxType"); +} +/** Set EFT Effective Date. +@param EftValutaDate Electronic Funds Transfer Valuta (effective) Date */ +public void setEftValutaDate (Timestamp EftValutaDate) +{ +set_Value ("EftValutaDate", EftValutaDate); +} +/** Get EFT Effective Date. +@return Electronic Funds Transfer Valuta (effective) Date */ +public Timestamp getEftValutaDate() +{ +return (Timestamp)get_Value("EftValutaDate"); +} +/** Set ISO Currency Code. +@param ISO_Code Three letter ISO 4217 Code of the Currency */ +public void setISO_Code (String ISO_Code) +{ +if (ISO_Code != null && ISO_Code.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code = ISO_Code.substring(0,2); +} +set_Value ("ISO_Code", ISO_Code); +} +/** Get ISO Currency Code. +@return Three letter ISO 4217 Code of the Currency */ +public String getISO_Code() +{ +return (String)get_Value("ISO_Code"); +} +/** Set Import Bank Statement. +@param I_BankStatement_ID Import of the Bank Statement */ +public void setI_BankStatement_ID (int I_BankStatement_ID) +{ +if (I_BankStatement_ID < 1) throw new IllegalArgumentException ("I_BankStatement_ID is mandatory."); +set_ValueNoCheck ("I_BankStatement_ID", new Integer(I_BankStatement_ID)); +} +/** Get Import Bank Statement. +@return Import of the Bank Statement */ +public int getI_BankStatement_ID() +{ +Integer ii = (Integer)get_Value("I_BankStatement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Interest Amount. +@param InterestAmt Interest Amount */ +public void setInterestAmt (BigDecimal InterestAmt) +{ +set_Value ("InterestAmt", InterestAmt); +} +/** Get Interest Amount. +@return Interest Amount */ +public BigDecimal getInterestAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InterestAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice Document No. +@param InvoiceDocumentNo Document Number of the Invoice */ +public void setInvoiceDocumentNo (String InvoiceDocumentNo) +{ +if (InvoiceDocumentNo != null && InvoiceDocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +InvoiceDocumentNo = InvoiceDocumentNo.substring(0,29); +} +set_Value ("InvoiceDocumentNo", InvoiceDocumentNo); +} +/** Get Invoice Document No. +@return Document Number of the Invoice */ +public String getInvoiceDocumentNo() +{ +return (String)get_Value("InvoiceDocumentNo"); +} +/** Set Reversal. +@param IsReversal This is a reversing transaction */ +public void setIsReversal (boolean IsReversal) +{ +set_Value ("IsReversal", new Boolean(IsReversal)); +} +/** Get Reversal. +@return This is a reversing transaction */ +public boolean isReversal() +{ +Object oo = get_Value("IsReversal"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line Description. +@param LineDescription Description of the Line */ +public void setLineDescription (String LineDescription) +{ +if (LineDescription != null && LineDescription.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LineDescription = LineDescription.substring(0,254); +} +set_Value ("LineDescription", LineDescription); +} +/** Get Line Description. +@return Description of the Line */ +public String getLineDescription() +{ +return (String)get_Value("LineDescription"); +} +/** Set Match Statement. +@param MatchStatement Match Statement */ +public void setMatchStatement (String MatchStatement) +{ +if (MatchStatement != null && MatchStatement.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MatchStatement = MatchStatement.substring(0,0); +} +set_Value ("MatchStatement", MatchStatement); +} +/** Get Match Statement. +@return Match Statement */ +public String getMatchStatement() +{ +return (String)get_Value("MatchStatement"); +} +/** Set Memo. +@param Memo Memo Text */ +public void setMemo (String Memo) +{ +if (Memo != null && Memo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Memo = Memo.substring(0,254); +} +set_Value ("Memo", Memo); +} +/** Get Memo. +@return Memo Text */ +public String getMemo() +{ +return (String)get_Value("Memo"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Payment Document No. +@param PaymentDocumentNo Document number of the Payment */ +public void setPaymentDocumentNo (String PaymentDocumentNo) +{ +if (PaymentDocumentNo != null && PaymentDocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +PaymentDocumentNo = PaymentDocumentNo.substring(0,29); +} +set_Value ("PaymentDocumentNo", PaymentDocumentNo); +} +/** Get Payment Document No. +@return Document number of the Payment */ +public String getPaymentDocumentNo() +{ +return (String)get_Value("PaymentDocumentNo"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reference No. +@param ReferenceNo Your customer or vendor number at the Business Partner's site */ +public void setReferenceNo (String ReferenceNo) +{ +if (ReferenceNo != null && ReferenceNo.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ReferenceNo = ReferenceNo.substring(0,39); +} +set_Value ("ReferenceNo", ReferenceNo); +} +/** Get Reference No. +@return Your customer or vendor number at the Business Partner's site */ +public String getReferenceNo() +{ +return (String)get_Value("ReferenceNo"); +} +/** Set Routing No. +@param RoutingNo Bank Routing Number */ +public void setRoutingNo (String RoutingNo) +{ +if (RoutingNo != null && RoutingNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RoutingNo = RoutingNo.substring(0,19); +} +set_Value ("RoutingNo", RoutingNo); +} +/** Get Routing No. +@return Bank Routing Number */ +public String getRoutingNo() +{ +return (String)get_Value("RoutingNo"); +} +/** Set Statement date. +@param StatementDate Date of the statement */ +public void setStatementDate (Timestamp StatementDate) +{ +set_Value ("StatementDate", StatementDate); +} +/** Get Statement date. +@return Date of the statement */ +public Timestamp getStatementDate() +{ +return (Timestamp)get_Value("StatementDate"); +} +/** Set Statement Line Date. +@param StatementLineDate Date of the Statement Line */ +public void setStatementLineDate (Timestamp StatementLineDate) +{ +set_Value ("StatementLineDate", StatementLineDate); +} +/** Get Statement Line Date. +@return Date of the Statement Line */ +public Timestamp getStatementLineDate() +{ +return (Timestamp)get_Value("StatementLineDate"); +} +/** Set Statement amount. +@param StmtAmt Statement Amount */ +public void setStmtAmt (BigDecimal StmtAmt) +{ +set_Value ("StmtAmt", StmtAmt); +} +/** Get Statement amount. +@return Statement Amount */ +public BigDecimal getStmtAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("StmtAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Transaction Amount. +@param TrxAmt Amount of a transaction */ +public void setTrxAmt (BigDecimal TrxAmt) +{ +set_Value ("TrxAmt", TrxAmt); +} +/** Get Transaction Amount. +@return Amount of a transaction */ +public BigDecimal getTrxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TrxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** TrxType AD_Reference_ID=215 */ +public static final int TRXTYPE_AD_Reference_ID=215; +/** Authorization = A */ +public static final String TRXTYPE_Authorization = "A"; +/** Credit (Payment) = C */ +public static final String TRXTYPE_CreditPayment = "C"; +/** Delayed Capture = D */ +public static final String TRXTYPE_DelayedCapture = "D"; +/** Voice Authorization = F */ +public static final String TRXTYPE_VoiceAuthorization = "F"; +/** Sales = S */ +public static final String TRXTYPE_Sales = "S"; +/** Void = V */ +public static final String TRXTYPE_Void = "V"; +/** Set Transaction Type. +@param TrxType Type of credit card transaction */ +public void setTrxType (String TrxType) +{ +if (TrxType == null) throw new IllegalArgumentException ("TrxType is mandatory"); +if (TrxType == null || TrxType.equals("A") || TrxType.equals("C") || TrxType.equals("D") || TrxType.equals("F") || TrxType.equals("S") || TrxType.equals("V")); + else throw new IllegalArgumentException ("TrxType Invalid value - " + TrxType + " - Reference_ID=215 - A - C - D - F - S - V"); +if (TrxType != null && TrxType.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TrxType = TrxType.substring(0,19); +} +set_Value ("TrxType", TrxType); +} +/** Get Transaction Type. +@return Type of credit card transaction */ +public String getTrxType() +{ +return (String)get_Value("TrxType"); +} +/** Set Effective date. +@param ValutaDate Date when money is available */ +public void setValutaDate (Timestamp ValutaDate) +{ +set_Value ("ValutaDate", ValutaDate); +} +/** Get Effective date. +@return Date when money is available */ +public Timestamp getValutaDate() +{ +return (Timestamp)get_Value("ValutaDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_Conversion_Rate.java b/dbPort/src/org/compiere/model/X_I_Conversion_Rate.java new file mode 100644 index 0000000000..7168935fd8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_Conversion_Rate.java @@ -0,0 +1,366 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_Conversion_Rate + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.875 */ +public class X_I_Conversion_Rate extends PO +{ +/** Standard Constructor +@param ctx context +@param I_Conversion_Rate_ID id +@param trxName transaction +*/ +public X_I_Conversion_Rate (Properties ctx, int I_Conversion_Rate_ID, String trxName) +{ +super (ctx, I_Conversion_Rate_ID, trxName); +/** if (I_Conversion_Rate_ID == 0) +{ +setI_Conversion_Rate_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_Conversion_Rate (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=641 */ +public static final int Table_ID=641; + +/** TableName=I_Conversion_Rate */ +public static final String Table_Name="I_Conversion_Rate"; + +protected static KeyNamePair Model = new KeyNamePair(641,"I_Conversion_Rate"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_Conversion_Rate[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); + else +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Conversion Rate. +@param C_Conversion_Rate_ID Rate used for converting currencies */ +public void setC_Conversion_Rate_ID (int C_Conversion_Rate_ID) +{ +if (C_Conversion_Rate_ID <= 0) set_Value ("C_Conversion_Rate_ID", null); + else +set_Value ("C_Conversion_Rate_ID", new Integer(C_Conversion_Rate_ID)); +} +/** Get Conversion Rate. +@return Rate used for converting currencies */ +public int getC_Conversion_Rate_ID() +{ +Integer ii = (Integer)get_Value("C_Conversion_Rate_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Currency_ID_To AD_Reference_ID=112 */ +public static final int C_CURRENCY_ID_TO_AD_Reference_ID=112; +/** Set Currency To. +@param C_Currency_ID_To Target currency */ +public void setC_Currency_ID_To (int C_Currency_ID_To) +{ +set_Value ("C_Currency_ID_To", new Integer(C_Currency_ID_To)); +} +/** Get Currency To. +@return Target currency */ +public int getC_Currency_ID_To() +{ +Integer ii = (Integer)get_Value("C_Currency_ID_To"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type Key. +@param ConversionTypeValue Key value for the Currency Conversion Rate Type */ +public void setConversionTypeValue (String ConversionTypeValue) +{ +if (ConversionTypeValue != null && ConversionTypeValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ConversionTypeValue = ConversionTypeValue.substring(0,39); +} +set_Value ("ConversionTypeValue", ConversionTypeValue); +} +/** Get Currency Type Key. +@return Key value for the Currency Conversion Rate Type */ +public String getConversionTypeValue() +{ +return (String)get_Value("ConversionTypeValue"); +} +/** Set Create Reciprocal Rate. +@param CreateReciprocalRate Create Reciprocal Rate from current information */ +public void setCreateReciprocalRate (boolean CreateReciprocalRate) +{ +set_Value ("CreateReciprocalRate", new Boolean(CreateReciprocalRate)); +} +/** Get Create Reciprocal Rate. +@return Create Reciprocal Rate from current information */ +public boolean isCreateReciprocalRate() +{ +Object oo = get_Value("CreateReciprocalRate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Divide Rate. +@param DivideRate To convert Source number to Target number, the Source is divided */ +public void setDivideRate (BigDecimal DivideRate) +{ +set_Value ("DivideRate", DivideRate); +} +/** Get Divide Rate. +@return To convert Source number to Target number, the Source is divided */ +public BigDecimal getDivideRate() +{ +BigDecimal bd = (BigDecimal)get_Value("DivideRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set ISO Currency Code. +@param ISO_Code Three letter ISO 4217 Code of the Currency */ +public void setISO_Code (String ISO_Code) +{ +if (ISO_Code != null && ISO_Code.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code = ISO_Code.substring(0,2); +} +set_Value ("ISO_Code", ISO_Code); +} +/** Get ISO Currency Code. +@return Three letter ISO 4217 Code of the Currency */ +public String getISO_Code() +{ +return (String)get_Value("ISO_Code"); +} +/** Set ISO Currency To Code. +@param ISO_Code_To Three letter ISO 4217 Code of the To Currency */ +public void setISO_Code_To (String ISO_Code_To) +{ +if (ISO_Code_To != null && ISO_Code_To.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code_To = ISO_Code_To.substring(0,2); +} +set_Value ("ISO_Code_To", ISO_Code_To); +} +/** Get ISO Currency To Code. +@return Three letter ISO 4217 Code of the To Currency */ +public String getISO_Code_To() +{ +return (String)get_Value("ISO_Code_To"); +} +/** Set Import Conversion Rate. +@param I_Conversion_Rate_ID Import Currency Conversion Rate */ +public void setI_Conversion_Rate_ID (int I_Conversion_Rate_ID) +{ +if (I_Conversion_Rate_ID < 1) throw new IllegalArgumentException ("I_Conversion_Rate_ID is mandatory."); +set_ValueNoCheck ("I_Conversion_Rate_ID", new Integer(I_Conversion_Rate_ID)); +} +/** Get Import Conversion Rate. +@return Import Currency Conversion Rate */ +public int getI_Conversion_Rate_ID() +{ +Integer ii = (Integer)get_Value("I_Conversion_Rate_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getI_Conversion_Rate_ID())); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Multiply Rate. +@param MultiplyRate Rate to multiple the source by to calculate the target. */ +public void setMultiplyRate (BigDecimal MultiplyRate) +{ +set_Value ("MultiplyRate", MultiplyRate); +} +/** Get Multiply Rate. +@return Rate to multiple the source by to calculate the target. */ +public BigDecimal getMultiplyRate() +{ +BigDecimal bd = (BigDecimal)get_Value("MultiplyRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_ElementValue.java b/dbPort/src/org/compiere/model/X_I_ElementValue.java new file mode 100644 index 0000000000..80e4119b97 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_ElementValue.java @@ -0,0 +1,525 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_ElementValue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.89 */ +public class X_I_ElementValue extends PO +{ +/** Standard Constructor +@param ctx context +@param I_ElementValue_ID id +@param trxName transaction +*/ +public X_I_ElementValue (Properties ctx, int I_ElementValue_ID, String trxName) +{ +super (ctx, I_ElementValue_ID, trxName); +/** if (I_ElementValue_ID == 0) +{ +setI_ElementValue_ID (0); +setI_IsImported (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_ElementValue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=534 */ +public static final int Table_ID=534; + +/** TableName=I_ElementValue */ +public static final String Table_Name="I_ElementValue"; + +protected static KeyNamePair Model = new KeyNamePair(534,"I_ElementValue"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_ElementValue[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Column_ID AD_Reference_ID=272 */ +public static final int AD_COLUMN_ID_AD_Reference_ID=272; +/** Set Column. +@param AD_Column_ID Column in the table */ +public void setAD_Column_ID (int AD_Column_ID) +{ +if (AD_Column_ID <= 0) set_Value ("AD_Column_ID", null); + else +set_Value ("AD_Column_ID", new Integer(AD_Column_ID)); +} +/** Get Column. +@return Column in the table */ +public int getAD_Column_ID() +{ +Integer ii = (Integer)get_Value("AD_Column_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AccountSign AD_Reference_ID=118 */ +public static final int ACCOUNTSIGN_AD_Reference_ID=118; +/** Credit = C */ +public static final String ACCOUNTSIGN_Credit = "C"; +/** Debit = D */ +public static final String ACCOUNTSIGN_Debit = "D"; +/** Natural = N */ +public static final String ACCOUNTSIGN_Natural = "N"; +/** Set Account Sign. +@param AccountSign Indicates the Natural Sign of the Account as a Debit or Credit */ +public void setAccountSign (String AccountSign) +{ +if (AccountSign == null) throw new IllegalArgumentException ("AccountSign is mandatory"); +if (AccountSign == null || AccountSign.equals("C") || AccountSign.equals("D") || AccountSign.equals("N")); + else throw new IllegalArgumentException ("AccountSign Invalid value - " + AccountSign + " - Reference_ID=118 - C - D - N"); +if (AccountSign != null && AccountSign.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccountSign = AccountSign.substring(0,0); +} +set_Value ("AccountSign", AccountSign); +} +/** Get Account Sign. +@return Indicates the Natural Sign of the Account as a Debit or Credit */ +public String getAccountSign() +{ +return (String)get_Value("AccountSign"); +} + +/** AccountType AD_Reference_ID=117 */ +public static final int ACCOUNTTYPE_AD_Reference_ID=117; +/** Asset = A */ +public static final String ACCOUNTTYPE_Asset = "A"; +/** Expense = E */ +public static final String ACCOUNTTYPE_Expense = "E"; +/** Liability = L */ +public static final String ACCOUNTTYPE_Liability = "L"; +/** Memo = M */ +public static final String ACCOUNTTYPE_Memo = "M"; +/** Owner's Equity = O */ +public static final String ACCOUNTTYPE_OwnerSEquity = "O"; +/** Revenue = R */ +public static final String ACCOUNTTYPE_Revenue = "R"; +/** Set Account Type. +@param AccountType Indicates the type of account */ +public void setAccountType (String AccountType) +{ +if (AccountType == null) throw new IllegalArgumentException ("AccountType is mandatory"); +if (AccountType == null || AccountType.equals("A") || AccountType.equals("E") || AccountType.equals("L") || AccountType.equals("M") || AccountType.equals("O") || AccountType.equals("R")); + else throw new IllegalArgumentException ("AccountType Invalid value - " + AccountType + " - Reference_ID=117 - A - E - L - M - O - R"); +if (AccountType != null && AccountType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccountType = AccountType.substring(0,0); +} +set_Value ("AccountType", AccountType); +} +/** Get Account Type. +@return Indicates the type of account */ +public String getAccountType() +{ +return (String)get_Value("AccountType"); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID <= 0) set_Value ("C_ElementValue_ID", null); + else +set_Value ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Element. +@param C_Element_ID Accounting Element */ +public void setC_Element_ID (int C_Element_ID) +{ +if (C_Element_ID <= 0) set_Value ("C_Element_ID", null); + else +set_Value ("C_Element_ID", new Integer(C_Element_ID)); +} +/** Get Element. +@return Accounting Element */ +public int getC_Element_ID() +{ +Integer ii = (Integer)get_Value("C_Element_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Default Account. +@param Default_Account Name of the Default Account Column */ +public void setDefault_Account (String Default_Account) +{ +if (Default_Account != null && Default_Account.length() > 30) +{ +log.warning("Length > 30 - truncated"); +Default_Account = Default_Account.substring(0,29); +} +set_Value ("Default_Account", Default_Account); +} +/** Get Default Account. +@return Name of the Default Account Column */ +public String getDefault_Account() +{ +return (String)get_Value("Default_Account"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Element Name. +@param ElementName Name of the Element */ +public void setElementName (String ElementName) +{ +if (ElementName != null && ElementName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ElementName = ElementName.substring(0,59); +} +set_Value ("ElementName", ElementName); +} +/** Get Element Name. +@return Name of the Element */ +public String getElementName() +{ +return (String)get_Value("ElementName"); +} +/** Set Import Account. +@param I_ElementValue_ID Import Account Value */ +public void setI_ElementValue_ID (int I_ElementValue_ID) +{ +if (I_ElementValue_ID < 1) throw new IllegalArgumentException ("I_ElementValue_ID is mandatory."); +set_ValueNoCheck ("I_ElementValue_ID", new Integer(I_ElementValue_ID)); +} +/** Get Import Account. +@return Import Account Value */ +public int getI_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("I_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Document Controlled. +@param IsDocControlled Control account - If an account is controlled by a document, you cannot post manually to it */ +public void setIsDocControlled (boolean IsDocControlled) +{ +set_Value ("IsDocControlled", new Boolean(IsDocControlled)); +} +/** Get Document Controlled. +@return Control account - If an account is controlled by a document, you cannot post manually to it */ +public boolean isDocControlled() +{ +Object oo = get_Value("IsDocControlled"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} + +/** ParentElementValue_ID AD_Reference_ID=362 */ +public static final int PARENTELEMENTVALUE_ID_AD_Reference_ID=362; +/** Set Parent Account. +@param ParentElementValue_ID The parent (summary) account */ +public void setParentElementValue_ID (int ParentElementValue_ID) +{ +if (ParentElementValue_ID <= 0) set_Value ("ParentElementValue_ID", null); + else +set_Value ("ParentElementValue_ID", new Integer(ParentElementValue_ID)); +} +/** Get Parent Account. +@return The parent (summary) account */ +public int getParentElementValue_ID() +{ +Integer ii = (Integer)get_Value("ParentElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Parent Key. +@param ParentValue Key if the Parent */ +public void setParentValue (String ParentValue) +{ +if (ParentValue != null && ParentValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ParentValue = ParentValue.substring(0,39); +} +set_Value ("ParentValue", ParentValue); +} +/** Get Parent Key. +@return Key if the Parent */ +public String getParentValue() +{ +return (String)get_Value("ParentValue"); +} +/** Set Post Actual. +@param PostActual Actual Values can be posted */ +public void setPostActual (boolean PostActual) +{ +set_Value ("PostActual", new Boolean(PostActual)); +} +/** Get Post Actual. +@return Actual Values can be posted */ +public boolean isPostActual() +{ +Object oo = get_Value("PostActual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Budget. +@param PostBudget Budget values can be posted */ +public void setPostBudget (boolean PostBudget) +{ +set_Value ("PostBudget", new Boolean(PostBudget)); +} +/** Get Post Budget. +@return Budget values can be posted */ +public boolean isPostBudget() +{ +Object oo = get_Value("PostBudget"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Encumbrance. +@param PostEncumbrance Post commitments to this account */ +public void setPostEncumbrance (boolean PostEncumbrance) +{ +set_Value ("PostEncumbrance", new Boolean(PostEncumbrance)); +} +/** Get Post Encumbrance. +@return Post commitments to this account */ +public boolean isPostEncumbrance() +{ +Object oo = get_Value("PostEncumbrance"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Post Statistical. +@param PostStatistical Post statistical quantities to this account? */ +public void setPostStatistical (boolean PostStatistical) +{ +set_Value ("PostStatistical", new Boolean(PostStatistical)); +} +/** Get Post Statistical. +@return Post statistical quantities to this account? */ +public boolean isPostStatistical() +{ +Object oo = get_Value("PostStatistical"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value != null && Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_GLJournal.java b/dbPort/src/org/compiere/model/X_I_GLJournal.java new file mode 100644 index 0000000000..2159b275d4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_GLJournal.java @@ -0,0 +1,1087 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_GLJournal + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:55:59.953 */ +public class X_I_GLJournal extends PO +{ +/** Standard Constructor +@param ctx context +@param I_GLJournal_ID id +@param trxName transaction +*/ +public X_I_GLJournal (Properties ctx, int I_GLJournal_ID, String trxName) +{ +super (ctx, I_GLJournal_ID, trxName); +/** if (I_GLJournal_ID == 0) +{ +setI_GLJournal_ID (0); +setI_IsImported (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_GLJournal (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=599 */ +public static final int Table_ID=599; + +/** TableName=I_GLJournal */ +public static final String Table_Name="I_GLJournal"; + +protected static KeyNamePair Model = new KeyNamePair(599,"I_GLJournal"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_GLJournal[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgDoc_ID AD_Reference_ID=130 */ +public static final int AD_ORGDOC_ID_AD_Reference_ID=130; +/** Set Document Org. +@param AD_OrgDoc_ID Document Organization (independent from account organization) */ +public void setAD_OrgDoc_ID (int AD_OrgDoc_ID) +{ +if (AD_OrgDoc_ID <= 0) set_Value ("AD_OrgDoc_ID", null); + else +set_Value ("AD_OrgDoc_ID", new Integer(AD_OrgDoc_ID)); +} +/** Get Document Org. +@return Document Organization (independent from account organization) */ +public int getAD_OrgDoc_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgDoc_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Key. +@param AccountValue Key of Account Element */ +public void setAccountValue (String AccountValue) +{ +if (AccountValue != null && AccountValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +AccountValue = AccountValue.substring(0,39); +} +set_Value ("AccountValue", AccountValue); +} +/** Get Account Key. +@return Key of Account Element */ +public String getAccountValue() +{ +return (String)get_Value("AccountValue"); +} + +/** Account_ID AD_Reference_ID=132 */ +public static final int ACCOUNT_ID_AD_Reference_ID=132; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID <= 0) set_Value ("Account_ID", null); + else +set_Value ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Schema Name. +@param AcctSchemaName Name of the Accounting Schema */ +public void setAcctSchemaName (String AcctSchemaName) +{ +if (AcctSchemaName != null && AcctSchemaName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AcctSchemaName = AcctSchemaName.substring(0,59); +} +set_Value ("AcctSchemaName", AcctSchemaName); +} +/** Get Account Schema Name. +@return Name of the Accounting Schema */ +public String getAcctSchemaName() +{ +return (String)get_Value("AcctSchemaName"); +} +/** Set Accounted Credit. +@param AmtAcctCr Accounted Credit Amount */ +public void setAmtAcctCr (BigDecimal AmtAcctCr) +{ +set_Value ("AmtAcctCr", AmtAcctCr); +} +/** Get Accounted Credit. +@return Accounted Credit Amount */ +public BigDecimal getAmtAcctCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounted Debit. +@param AmtAcctDr Accounted Debit Amount */ +public void setAmtAcctDr (BigDecimal AmtAcctDr) +{ +set_Value ("AmtAcctDr", AmtAcctDr); +} +/** Get Accounted Debit. +@return Accounted Debit Amount */ +public BigDecimal getAmtAcctDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Credit. +@param AmtSourceCr Source Credit Amount */ +public void setAmtSourceCr (BigDecimal AmtSourceCr) +{ +set_Value ("AmtSourceCr", AmtSourceCr); +} +/** Get Source Credit. +@return Source Credit Amount */ +public BigDecimal getAmtSourceCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Debit. +@param AmtSourceDr Source Debit Amount */ +public void setAmtSourceDr (BigDecimal AmtSourceDr) +{ +set_Value ("AmtSourceDr", AmtSourceDr); +} +/** Get Source Debit. +@return Source Debit Amount */ +public BigDecimal getAmtSourceDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Business Partner Key. +@param BPartnerValue Key of the Business Partner */ +public void setBPartnerValue (String BPartnerValue) +{ +if (BPartnerValue != null && BPartnerValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BPartnerValue = BPartnerValue.substring(0,39); +} +set_Value ("BPartnerValue", BPartnerValue); +} +/** Get Business Partner Key. +@return Key of the Business Partner */ +public String getBPartnerValue() +{ +return (String)get_Value("BPartnerValue"); +} +/** Set Batch Description. +@param BatchDescription Description of the Batch */ +public void setBatchDescription (String BatchDescription) +{ +if (BatchDescription != null && BatchDescription.length() > 255) +{ +log.warning("Length > 255 - truncated"); +BatchDescription = BatchDescription.substring(0,254); +} +set_Value ("BatchDescription", BatchDescription); +} +/** Get Batch Description. +@return Description of the Batch */ +public String getBatchDescription() +{ +return (String)get_Value("BatchDescription"); +} +/** Set Batch Document No. +@param BatchDocumentNo Document Number of the Batch */ +public void setBatchDocumentNo (String BatchDocumentNo) +{ +if (BatchDocumentNo != null && BatchDocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +BatchDocumentNo = BatchDocumentNo.substring(0,29); +} +set_Value ("BatchDocumentNo", BatchDocumentNo); +} +/** Get Batch Document No. +@return Document Number of the Batch */ +public String getBatchDocumentNo() +{ +return (String)get_Value("BatchDocumentNo"); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID <= 0) set_Value ("C_AcctSchema_ID", null); + else +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); + else +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocFrom_ID AD_Reference_ID=133 */ +public static final int C_LOCFROM_ID_AD_Reference_ID=133; +/** Set Location From. +@param C_LocFrom_ID Location that inventory was moved from */ +public void setC_LocFrom_ID (int C_LocFrom_ID) +{ +if (C_LocFrom_ID <= 0) set_Value ("C_LocFrom_ID", null); + else +set_Value ("C_LocFrom_ID", new Integer(C_LocFrom_ID)); +} +/** Get Location From. +@return Location that inventory was moved from */ +public int getC_LocFrom_ID() +{ +Integer ii = (Integer)get_Value("C_LocFrom_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_LocTo_ID AD_Reference_ID=133 */ +public static final int C_LOCTO_ID_AD_Reference_ID=133; +/** Set Location To. +@param C_LocTo_ID Location that inventory was moved to */ +public void setC_LocTo_ID (int C_LocTo_ID) +{ +if (C_LocTo_ID <= 0) set_Value ("C_LocTo_ID", null); + else +set_Value ("C_LocTo_ID", new Integer(C_LocTo_ID)); +} +/** Get Location To. +@return Location that inventory was moved to */ +public int getC_LocTo_ID() +{ +Integer ii = (Integer)get_Value("C_LocTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID <= 0) set_Value ("C_Period_ID", null); + else +set_Value ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Combination. +@param C_ValidCombination_ID Valid Account Combination */ +public void setC_ValidCombination_ID (int C_ValidCombination_ID) +{ +if (C_ValidCombination_ID <= 0) set_Value ("C_ValidCombination_ID", null); + else +set_Value ("C_ValidCombination_ID", new Integer(C_ValidCombination_ID)); +} +/** Get Combination. +@return Valid Account Combination */ +public int getC_ValidCombination_ID() +{ +Integer ii = (Integer)get_Value("C_ValidCombination_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Category Name. +@param CategoryName Name of the Category */ +public void setCategoryName (String CategoryName) +{ +if (CategoryName != null && CategoryName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +CategoryName = CategoryName.substring(0,59); +} +set_Value ("CategoryName", CategoryName); +} +/** Get Category Name. +@return Name of the Category */ +public String getCategoryName() +{ +return (String)get_Value("CategoryName"); +} +/** Set Client Key. +@param ClientValue Key of the Client */ +public void setClientValue (String ClientValue) +{ +if (ClientValue != null && ClientValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ClientValue = ClientValue.substring(0,39); +} +set_Value ("ClientValue", ClientValue); +} +/** Get Client Key. +@return Key of the Client */ +public String getClientValue() +{ +return (String)get_Value("ClientValue"); +} +/** Set Currency Type Key. +@param ConversionTypeValue Key value for the Currency Conversion Rate Type */ +public void setConversionTypeValue (String ConversionTypeValue) +{ +if (ConversionTypeValue != null && ConversionTypeValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ConversionTypeValue = ConversionTypeValue.substring(0,39); +} +set_Value ("ConversionTypeValue", ConversionTypeValue); +} +/** Get Currency Type Key. +@return Key value for the Currency Conversion Rate Type */ +public String getConversionTypeValue() +{ +return (String)get_Value("ConversionTypeValue"); +} +/** Set Rate. +@param CurrencyRate Currency Conversion Rate */ +public void setCurrencyRate (BigDecimal CurrencyRate) +{ +set_Value ("CurrencyRate", CurrencyRate); +} +/** Get Rate. +@return Currency Conversion Rate */ +public BigDecimal getCurrencyRate() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrencyRate"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Type Name. +@param DocTypeName Name of the Document Type */ +public void setDocTypeName (String DocTypeName) +{ +if (DocTypeName != null && DocTypeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DocTypeName = DocTypeName.substring(0,59); +} +set_Value ("DocTypeName", DocTypeName); +} +/** Get Document Type Name. +@return Name of the Document Type */ +public String getDocTypeName() +{ +return (String)get_Value("DocTypeName"); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID <= 0) set_Value ("GL_Budget_ID", null); + else +set_Value ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set GL Category. +@param GL_Category_ID General Ledger Category */ +public void setGL_Category_ID (int GL_Category_ID) +{ +if (GL_Category_ID <= 0) set_Value ("GL_Category_ID", null); + else +set_Value ("GL_Category_ID", new Integer(GL_Category_ID)); +} +/** Get GL Category. +@return General Ledger Category */ +public int getGL_Category_ID() +{ +Integer ii = (Integer)get_Value("GL_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal Batch. +@param GL_JournalBatch_ID General Ledger Journal Batch */ +public void setGL_JournalBatch_ID (int GL_JournalBatch_ID) +{ +if (GL_JournalBatch_ID <= 0) set_Value ("GL_JournalBatch_ID", null); + else +set_Value ("GL_JournalBatch_ID", new Integer(GL_JournalBatch_ID)); +} +/** Get Journal Batch. +@return General Ledger Journal Batch */ +public int getGL_JournalBatch_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalBatch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal Line. +@param GL_JournalLine_ID General Ledger Journal Line */ +public void setGL_JournalLine_ID (int GL_JournalLine_ID) +{ +if (GL_JournalLine_ID <= 0) set_Value ("GL_JournalLine_ID", null); + else +set_Value ("GL_JournalLine_ID", new Integer(GL_JournalLine_ID)); +} +/** Get Journal Line. +@return General Ledger Journal Line */ +public int getGL_JournalLine_ID() +{ +Integer ii = (Integer)get_Value("GL_JournalLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Journal. +@param GL_Journal_ID General Ledger Journal */ +public void setGL_Journal_ID (int GL_Journal_ID) +{ +if (GL_Journal_ID <= 0) set_Value ("GL_Journal_ID", null); + else +set_Value ("GL_Journal_ID", new Integer(GL_Journal_ID)); +} +/** Get Journal. +@return General Ledger Journal */ +public int getGL_Journal_ID() +{ +Integer ii = (Integer)get_Value("GL_Journal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set ISO Currency Code. +@param ISO_Code Three letter ISO 4217 Code of the Currency */ +public void setISO_Code (String ISO_Code) +{ +if (ISO_Code != null && ISO_Code.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code = ISO_Code.substring(0,2); +} +set_Value ("ISO_Code", ISO_Code); +} +/** Get ISO Currency Code. +@return Three letter ISO 4217 Code of the Currency */ +public String getISO_Code() +{ +return (String)get_Value("ISO_Code"); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Import GL Journal. +@param I_GLJournal_ID Import General Ledger Journal */ +public void setI_GLJournal_ID (int I_GLJournal_ID) +{ +if (I_GLJournal_ID < 1) throw new IllegalArgumentException ("I_GLJournal_ID is mandatory."); +set_ValueNoCheck ("I_GLJournal_ID", new Integer(I_GLJournal_ID)); +} +/** Get Import GL Journal. +@return Import General Ledger Journal */ +public int getI_GLJournal_ID() +{ +Integer ii = (Integer)get_Value("I_GLJournal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getI_GLJournal_ID())); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Create New Batch. +@param IsCreateNewBatch If selected a new batch is created */ +public void setIsCreateNewBatch (boolean IsCreateNewBatch) +{ +set_Value ("IsCreateNewBatch", new Boolean(IsCreateNewBatch)); +} +/** Get Create New Batch. +@return If selected a new batch is created */ +public boolean isCreateNewBatch() +{ +Object oo = get_Value("IsCreateNewBatch"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Create New Journal. +@param IsCreateNewJournal If selected a new journal within the batch is created */ +public void setIsCreateNewJournal (boolean IsCreateNewJournal) +{ +set_Value ("IsCreateNewJournal", new Boolean(IsCreateNewJournal)); +} +/** Get Create New Journal. +@return If selected a new journal within the batch is created */ +public boolean isCreateNewJournal() +{ +Object oo = get_Value("IsCreateNewJournal"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Journal Document No. +@param JournalDocumentNo Document number of the Journal */ +public void setJournalDocumentNo (String JournalDocumentNo) +{ +if (JournalDocumentNo != null && JournalDocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +JournalDocumentNo = JournalDocumentNo.substring(0,29); +} +set_Value ("JournalDocumentNo", JournalDocumentNo); +} +/** Get Journal Document No. +@return Document number of the Journal */ +public String getJournalDocumentNo() +{ +return (String)get_Value("JournalDocumentNo"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trx Org Key. +@param OrgTrxValue Key of the Transaction Organization */ +public void setOrgTrxValue (String OrgTrxValue) +{ +if (OrgTrxValue != null && OrgTrxValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +OrgTrxValue = OrgTrxValue.substring(0,39); +} +set_Value ("OrgTrxValue", OrgTrxValue); +} +/** Get Trx Org Key. +@return Key of the Transaction Organization */ +public String getOrgTrxValue() +{ +return (String)get_Value("OrgTrxValue"); +} +/** Set Org Key. +@param OrgValue Key of the Organization */ +public void setOrgValue (String OrgValue) +{ +if (OrgValue != null && OrgValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +OrgValue = OrgValue.substring(0,39); +} +set_Value ("OrgValue", OrgValue); +} +/** Get Org Key. +@return Key of the Organization */ +public String getOrgValue() +{ +return (String)get_Value("OrgValue"); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType == null || PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType != null && PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product Key. +@param ProductValue Key of the Product */ +public void setProductValue (String ProductValue) +{ +if (ProductValue != null && ProductValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ProductValue = ProductValue.substring(0,39); +} +set_Value ("ProductValue", ProductValue); +} +/** Get Product Key. +@return Key of the Product */ +public String getProductValue() +{ +return (String)get_Value("ProductValue"); +} +/** Set Project Key. +@param ProjectValue Key of the Project */ +public void setProjectValue (String ProjectValue) +{ +if (ProjectValue != null && ProjectValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ProjectValue = ProjectValue.substring(0,39); +} +set_Value ("ProjectValue", ProjectValue); +} +/** Get Project Key. +@return Key of the Project */ +public String getProjectValue() +{ +return (String)get_Value("ProjectValue"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set SKU. +@param SKU Stock Keeping Unit */ +public void setSKU (String SKU) +{ +if (SKU != null && SKU.length() > 30) +{ +log.warning("Length > 30 - truncated"); +SKU = SKU.substring(0,29); +} +set_Value ("SKU", SKU); +} +/** Get SKU. +@return Stock Keeping Unit */ +public String getSKU() +{ +return (String)get_Value("SKU"); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_InOutLineConfirm.java b/dbPort/src/org/compiere/model/X_I_InOutLineConfirm.java new file mode 100644 index 0000000000..4c64b5eaef --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_InOutLineConfirm.java @@ -0,0 +1,281 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_InOutLineConfirm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.015 */ +public class X_I_InOutLineConfirm extends PO +{ +/** Standard Constructor +@param ctx context +@param I_InOutLineConfirm_ID id +@param trxName transaction +*/ +public X_I_InOutLineConfirm (Properties ctx, int I_InOutLineConfirm_ID, String trxName) +{ +super (ctx, I_InOutLineConfirm_ID, trxName); +/** if (I_InOutLineConfirm_ID == 0) +{ +setConfirmationNo (null); +setConfirmedQty (Env.ZERO); +setDifferenceQty (Env.ZERO); +setI_InOutLineConfirm_ID (0); +setI_IsImported (false); +setM_InOutLineConfirm_ID (0); +setScrappedQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_InOutLineConfirm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=740 */ +public static final int Table_ID=740; + +/** TableName=I_InOutLineConfirm */ +public static final String Table_Name="I_InOutLineConfirm"; + +protected static KeyNamePair Model = new KeyNamePair(740,"I_InOutLineConfirm"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_InOutLineConfirm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Confirmation No. +@param ConfirmationNo Confirmation Number */ +public void setConfirmationNo (String ConfirmationNo) +{ +if (ConfirmationNo == null) throw new IllegalArgumentException ("ConfirmationNo is mandatory."); +if (ConfirmationNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ConfirmationNo = ConfirmationNo.substring(0,19); +} +set_Value ("ConfirmationNo", ConfirmationNo); +} +/** Get Confirmation No. +@return Confirmation Number */ +public String getConfirmationNo() +{ +return (String)get_Value("ConfirmationNo"); +} +/** Set Confirmed Quantity. +@param ConfirmedQty Confirmation of a received quantity */ +public void setConfirmedQty (BigDecimal ConfirmedQty) +{ +if (ConfirmedQty == null) throw new IllegalArgumentException ("ConfirmedQty is mandatory."); +set_Value ("ConfirmedQty", ConfirmedQty); +} +/** Get Confirmed Quantity. +@return Confirmation of a received quantity */ +public BigDecimal getConfirmedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Difference. +@param DifferenceQty Difference Quantity */ +public void setDifferenceQty (BigDecimal DifferenceQty) +{ +if (DifferenceQty == null) throw new IllegalArgumentException ("DifferenceQty is mandatory."); +set_Value ("DifferenceQty", DifferenceQty); +} +/** Get Difference. +@return Difference Quantity */ +public BigDecimal getDifferenceQty() +{ +BigDecimal bd = (BigDecimal)get_Value("DifferenceQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Ship/Receipt Confirmation Import Line. +@param I_InOutLineConfirm_ID Material Shipment or Receipt Confirmation Import Line */ +public void setI_InOutLineConfirm_ID (int I_InOutLineConfirm_ID) +{ +if (I_InOutLineConfirm_ID < 1) throw new IllegalArgumentException ("I_InOutLineConfirm_ID is mandatory."); +set_ValueNoCheck ("I_InOutLineConfirm_ID", new Integer(I_InOutLineConfirm_ID)); +} +/** Get Ship/Receipt Confirmation Import Line. +@return Material Shipment or Receipt Confirmation Import Line */ +public int getI_InOutLineConfirm_ID() +{ +Integer ii = (Integer)get_Value("I_InOutLineConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getI_InOutLineConfirm_ID())); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ship/Receipt Confirmation Line. +@param M_InOutLineConfirm_ID Material Shipment or Receipt Confirmation Line */ +public void setM_InOutLineConfirm_ID (int M_InOutLineConfirm_ID) +{ +if (M_InOutLineConfirm_ID < 1) throw new IllegalArgumentException ("M_InOutLineConfirm_ID is mandatory."); +set_Value ("M_InOutLineConfirm_ID", new Integer(M_InOutLineConfirm_ID)); +} +/** Get Ship/Receipt Confirmation Line. +@return Material Shipment or Receipt Confirmation Line */ +public int getM_InOutLineConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLineConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Scrapped Quantity. +@param ScrappedQty The Quantity scrapped due to QA issues */ +public void setScrappedQty (BigDecimal ScrappedQty) +{ +if (ScrappedQty == null) throw new IllegalArgumentException ("ScrappedQty is mandatory."); +set_Value ("ScrappedQty", ScrappedQty); +} +/** Get Scrapped Quantity. +@return The Quantity scrapped due to QA issues */ +public BigDecimal getScrappedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_I_Inventory.java b/dbPort/src/org/compiere/model/X_I_Inventory.java new file mode 100644 index 0000000000..36c4aa2c41 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_Inventory.java @@ -0,0 +1,471 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_Inventory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.015 */ +public class X_I_Inventory extends PO +{ +/** Standard Constructor +@param ctx context +@param I_Inventory_ID id +@param trxName transaction +*/ +public X_I_Inventory (Properties ctx, int I_Inventory_ID, String trxName) +{ +super (ctx, I_Inventory_ID, trxName); +/** if (I_Inventory_ID == 0) +{ +setI_Inventory_ID (0); +setI_IsImported (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_Inventory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=572 */ +public static final int Table_ID=572; + +/** TableName=I_Inventory */ +public static final String Table_Name="I_Inventory"; + +protected static KeyNamePair Model = new KeyNamePair(572,"I_Inventory"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_Inventory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Import Inventory. +@param I_Inventory_ID Import Inventory Transactions */ +public void setI_Inventory_ID (int I_Inventory_ID) +{ +if (I_Inventory_ID < 1) throw new IllegalArgumentException ("I_Inventory_ID is mandatory."); +set_ValueNoCheck ("I_Inventory_ID", new Integer(I_Inventory_ID)); +} +/** Get Import Inventory. +@return Import Inventory Transactions */ +public int getI_Inventory_ID() +{ +Integer ii = (Integer)get_Value("I_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getI_Inventory_ID())); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Locator Key. +@param LocatorValue Key of the Warehouse Locator */ +public void setLocatorValue (String LocatorValue) +{ +if (LocatorValue != null && LocatorValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +LocatorValue = LocatorValue.substring(0,39); +} +set_Value ("LocatorValue", LocatorValue); +} +/** Get Locator Key. +@return Key of the Warehouse Locator */ +public String getLocatorValue() +{ +return (String)get_Value("LocatorValue"); +} +/** Set Lot No. +@param Lot Lot number (alphanumeric) */ +public void setLot (String Lot) +{ +if (Lot != null && Lot.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Lot = Lot.substring(0,19); +} +set_Value ("Lot", Lot); +} +/** Get Lot No. +@return Lot number (alphanumeric) */ +public String getLot() +{ +return (String)get_Value("Lot"); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_Value ("M_InventoryLine_ID", null); + else +set_Value ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory. +@param M_Inventory_ID Parameters for a Physical Inventory */ +public void setM_Inventory_ID (int M_Inventory_ID) +{ +if (M_Inventory_ID <= 0) set_Value ("M_Inventory_ID", null); + else +set_Value ("M_Inventory_ID", new Integer(M_Inventory_ID)); +} +/** Get Phys.Inventory. +@return Parameters for a Physical Inventory */ +public int getM_Inventory_ID() +{ +Integer ii = (Integer)get_Value("M_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID <= 0) set_Value ("M_Locator_ID", null); + else +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID <= 0) set_Value ("M_Warehouse_ID", null); + else +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity book. +@param QtyBook Book Quantity */ +public void setQtyBook (BigDecimal QtyBook) +{ +set_Value ("QtyBook", QtyBook); +} +/** Get Quantity book. +@return Book Quantity */ +public BigDecimal getQtyBook() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyBook"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity count. +@param QtyCount Counted Quantity */ +public void setQtyCount (BigDecimal QtyCount) +{ +set_Value ("QtyCount", QtyCount); +} +/** Get Quantity count. +@return Counted Quantity */ +public BigDecimal getQtyCount() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyCount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Serial No. +@param SerNo Product Serial Number */ +public void setSerNo (String SerNo) +{ +if (SerNo != null && SerNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +SerNo = SerNo.substring(0,19); +} +set_Value ("SerNo", SerNo); +} +/** Get Serial No. +@return Product Serial Number */ +public String getSerNo() +{ +return (String)get_Value("SerNo"); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value != null && Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Warehouse Key. +@param WarehouseValue Key of the Warehouse */ +public void setWarehouseValue (String WarehouseValue) +{ +if (WarehouseValue != null && WarehouseValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +WarehouseValue = WarehouseValue.substring(0,39); +} +set_Value ("WarehouseValue", WarehouseValue); +} +/** Get Warehouse Key. +@return Key of the Warehouse */ +public String getWarehouseValue() +{ +return (String)get_Value("WarehouseValue"); +} +/** Set Aisle (X). +@param X X dimension, e.g., Aisle */ +public void setX (String X) +{ +if (X != null && X.length() > 60) +{ +log.warning("Length > 60 - truncated"); +X = X.substring(0,59); +} +set_Value ("X", X); +} +/** Get Aisle (X). +@return X dimension, e.g., Aisle */ +public String getX() +{ +return (String)get_Value("X"); +} +/** Set Bin (Y). +@param Y Y dimension, e.g., Bin */ +public void setY (String Y) +{ +if (Y != null && Y.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Y = Y.substring(0,59); +} +set_Value ("Y", Y); +} +/** Get Bin (Y). +@return Y dimension, e.g., Bin */ +public String getY() +{ +return (String)get_Value("Y"); +} +/** Set Level (Z). +@param Z Z dimension, e.g., Level */ +public void setZ (String Z) +{ +if (Z != null && Z.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Z = Z.substring(0,59); +} +set_Value ("Z", Z); +} +/** Get Level (Z). +@return Z dimension, e.g., Level */ +public String getZ() +{ +return (String)get_Value("Z"); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_Invoice.java b/dbPort/src/org/compiere/model/X_I_Invoice.java new file mode 100644 index 0000000000..d33b03851b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_Invoice.java @@ -0,0 +1,910 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_Invoice + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.031 */ +public class X_I_Invoice extends PO +{ +/** Standard Constructor +@param ctx context +@param I_Invoice_ID id +@param trxName transaction +*/ +public X_I_Invoice (Properties ctx, int I_Invoice_ID, String trxName) +{ +super (ctx, I_Invoice_ID, trxName); +/** if (I_Invoice_ID == 0) +{ +setI_Invoice_ID (0); +setI_IsImported (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_Invoice (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=598 */ +public static final int Table_ID=598; + +/** TableName=I_Invoice */ +public static final String Table_Name="I_Invoice"; + +protected static KeyNamePair Model = new KeyNamePair(598,"I_Invoice"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_Invoice[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address 1. +@param Address1 Address line 1 for this location */ +public void setAddress1 (String Address1) +{ +if (Address1 != null && Address1.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address1 = Address1.substring(0,59); +} +set_Value ("Address1", Address1); +} +/** Get Address 1. +@return Address line 1 for this location */ +public String getAddress1() +{ +return (String)get_Value("Address1"); +} +/** Set Address 2. +@param Address2 Address line 2 for this location */ +public void setAddress2 (String Address2) +{ +if (Address2 != null && Address2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address2 = Address2.substring(0,59); +} +set_Value ("Address2", Address2); +} +/** Get Address 2. +@return Address line 2 for this location */ +public String getAddress2() +{ +return (String)get_Value("Address2"); +} +/** Set Business Partner Key. +@param BPartnerValue Key of the Business Partner */ +public void setBPartnerValue (String BPartnerValue) +{ +if (BPartnerValue != null && BPartnerValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BPartnerValue = BPartnerValue.substring(0,39); +} +set_Value ("BPartnerValue", BPartnerValue); +} +/** Get Business Partner Key. +@return Key of the Business Partner */ +public String getBPartnerValue() +{ +return (String)get_Value("BPartnerValue"); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID <= 0) set_Value ("C_Country_ID", null); + else +set_Value ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_Value ("C_InvoiceLine_ID", null); + else +set_Value ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID <= 0) set_Value ("C_PaymentTerm_ID", null); + else +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID <= 0) set_Value ("C_Tax_ID", null); + else +set_Value ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set City. +@param City Identifies a City */ +public void setCity (String City) +{ +if (City != null && City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +City = City.substring(0,59); +} +set_Value ("City", City); +} +/** Get City. +@return Identifies a City */ +public String getCity() +{ +return (String)get_Value("City"); +} +/** Set Contact Name. +@param ContactName Business Partner Contact Name */ +public void setContactName (String ContactName) +{ +if (ContactName != null && ContactName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ContactName = ContactName.substring(0,59); +} +set_Value ("ContactName", ContactName); +} +/** Get Contact Name. +@return Business Partner Contact Name */ +public String getContactName() +{ +return (String)get_Value("ContactName"); +} +/** Set ISO Country Code. +@param CountryCode Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public void setCountryCode (boolean CountryCode) +{ +set_Value ("CountryCode", new Boolean(CountryCode)); +} +/** Get ISO Country Code. +@return Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public boolean isCountryCode() +{ +Object oo = get_Value("CountryCode"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Date Invoiced. +@param DateInvoiced Date printed on Invoice */ +public void setDateInvoiced (Timestamp DateInvoiced) +{ +set_Value ("DateInvoiced", DateInvoiced); +} +/** Get Date Invoiced. +@return Date printed on Invoice */ +public Timestamp getDateInvoiced() +{ +return (Timestamp)get_Value("DateInvoiced"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Type Name. +@param DocTypeName Name of the Document Type */ +public void setDocTypeName (String DocTypeName) +{ +if (DocTypeName != null && DocTypeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DocTypeName = DocTypeName.substring(0,59); +} +set_Value ("DocTypeName", DocTypeName); +} +/** Get Document Type Name. +@return Name of the Document Type */ +public String getDocTypeName() +{ +return (String)get_Value("DocTypeName"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Import Invoice. +@param I_Invoice_ID Import Invoice */ +public void setI_Invoice_ID (int I_Invoice_ID) +{ +if (I_Invoice_ID < 1) throw new IllegalArgumentException ("I_Invoice_ID is mandatory."); +set_ValueNoCheck ("I_Invoice_ID", new Integer(I_Invoice_ID)); +} +/** Get Import Invoice. +@return Import Invoice */ +public int getI_Invoice_ID() +{ +Integer ii = (Integer)get_Value("I_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line Description. +@param LineDescription Description of the Line */ +public void setLineDescription (String LineDescription) +{ +if (LineDescription != null && LineDescription.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LineDescription = LineDescription.substring(0,254); +} +set_Value ("LineDescription", LineDescription); +} +/** Get Line Description. +@return Description of the Line */ +public String getLineDescription() +{ +return (String)get_Value("LineDescription"); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID <= 0) set_Value ("M_PriceList_ID", null); + else +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Payment Term Key. +@param PaymentTermValue Key of the Payment Term */ +public void setPaymentTermValue (String PaymentTermValue) +{ +if (PaymentTermValue != null && PaymentTermValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +PaymentTermValue = PaymentTermValue.substring(0,39); +} +set_Value ("PaymentTermValue", PaymentTermValue); +} +/** Get Payment Term Key. +@return Key of the Payment Term */ +public String getPaymentTermValue() +{ +return (String)get_Value("PaymentTermValue"); +} +/** Set Phone. +@param Phone Identifies a telephone number */ +public void setPhone (String Phone) +{ +if (Phone != null && Phone.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone = Phone.substring(0,39); +} +set_Value ("Phone", Phone); +} +/** Get Phone. +@return Identifies a telephone number */ +public String getPhone() +{ +return (String)get_Value("Phone"); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal != null && Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_Value ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +/** Set Unit Price. +@param PriceActual Actual Price */ +public void setPriceActual (BigDecimal PriceActual) +{ +set_Value ("PriceActual", PriceActual); +} +/** Get Unit Price. +@return Actual Price */ +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product Key. +@param ProductValue Key of the Product */ +public void setProductValue (String ProductValue) +{ +if (ProductValue != null && ProductValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ProductValue = ProductValue.substring(0,39); +} +set_Value ("ProductValue", ProductValue); +} +/** Get Product Key. +@return Key of the Product */ +public String getProductValue() +{ +return (String)get_Value("ProductValue"); +} +/** Set Ordered Quantity. +@param QtyOrdered Ordered Quantity */ +public void setQtyOrdered (BigDecimal QtyOrdered) +{ +set_Value ("QtyOrdered", QtyOrdered); +} +/** Get Ordered Quantity. +@return Ordered Quantity */ +public BigDecimal getQtyOrdered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOrdered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Region. +@param RegionName Name of the Region */ +public void setRegionName (String RegionName) +{ +if (RegionName != null && RegionName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RegionName = RegionName.substring(0,59); +} +set_Value ("RegionName", RegionName); +} +/** Get Region. +@return Name of the Region */ +public String getRegionName() +{ +return (String)get_Value("RegionName"); +} +/** Set SKU. +@param SKU Stock Keeping Unit */ +public void setSKU (String SKU) +{ +if (SKU != null && SKU.length() > 30) +{ +log.warning("Length > 30 - truncated"); +SKU = SKU.substring(0,29); +} +set_Value ("SKU", SKU); +} +/** Get SKU. +@return Stock Keeping Unit */ +public String getSKU() +{ +return (String)get_Value("SKU"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +set_Value ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tax Indicator. +@param TaxIndicator Short form for Tax to be printed on documents */ +public void setTaxIndicator (String TaxIndicator) +{ +if (TaxIndicator != null && TaxIndicator.length() > 5) +{ +log.warning("Length > 5 - truncated"); +TaxIndicator = TaxIndicator.substring(0,4); +} +set_Value ("TaxIndicator", TaxIndicator); +} +/** Get Tax Indicator. +@return Short form for Tax to be printed on documents */ +public String getTaxIndicator() +{ +return (String)get_Value("TaxIndicator"); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_Order.java b/dbPort/src/org/compiere/model/X_I_Order.java new file mode 100644 index 0000000000..e68df90755 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_Order.java @@ -0,0 +1,990 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_Order + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.078 */ +public class X_I_Order extends PO +{ +/** Standard Constructor +@param ctx context +@param I_Order_ID id +@param trxName transaction +*/ +public X_I_Order (Properties ctx, int I_Order_ID, String trxName) +{ +super (ctx, I_Order_ID, trxName); +/** if (I_Order_ID == 0) +{ +setI_IsImported (false); +setI_Order_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_Order (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=591 */ +public static final int Table_ID=591; + +/** TableName=I_Order */ +public static final String Table_Name="I_Order"; + +protected static KeyNamePair Model = new KeyNamePair(591,"I_Order"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_Order[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address 1. +@param Address1 Address line 1 for this location */ +public void setAddress1 (String Address1) +{ +if (Address1 != null && Address1.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address1 = Address1.substring(0,59); +} +set_Value ("Address1", Address1); +} +/** Get Address 1. +@return Address line 1 for this location */ +public String getAddress1() +{ +return (String)get_Value("Address1"); +} +/** Set Address 2. +@param Address2 Address line 2 for this location */ +public void setAddress2 (String Address2) +{ +if (Address2 != null && Address2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address2 = Address2.substring(0,59); +} +set_Value ("Address2", Address2); +} +/** Get Address 2. +@return Address line 2 for this location */ +public String getAddress2() +{ +return (String)get_Value("Address2"); +} +/** Set Business Partner Key. +@param BPartnerValue Key of the Business Partner */ +public void setBPartnerValue (String BPartnerValue) +{ +if (BPartnerValue != null && BPartnerValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BPartnerValue = BPartnerValue.substring(0,39); +} +set_Value ("BPartnerValue", BPartnerValue); +} +/** Get Business Partner Key. +@return Key of the Business Partner */ +public String getBPartnerValue() +{ +return (String)get_Value("BPartnerValue"); +} + +/** BillTo_ID AD_Reference_ID=159 */ +public static final int BILLTO_ID_AD_Reference_ID=159; +/** Set Invoice To. +@param BillTo_ID Bill to Address */ +public void setBillTo_ID (int BillTo_ID) +{ +if (BillTo_ID <= 0) set_Value ("BillTo_ID", null); + else +set_Value ("BillTo_ID", new Integer(BillTo_ID)); +} +/** Get Invoice To. +@return Bill to Address */ +public int getBillTo_ID() +{ +Integer ii = (Integer)get_Value("BillTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID <= 0) set_Value ("C_Country_ID", null); + else +set_Value ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_Value ("C_OrderLine_ID", null); + else +set_Value ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID <= 0) set_Value ("C_PaymentTerm_ID", null); + else +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax. +@param C_Tax_ID Tax identifier */ +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID <= 0) set_Value ("C_Tax_ID", null); + else +set_Value ("C_Tax_ID", new Integer(C_Tax_ID)); +} +/** Get Tax. +@return Tax identifier */ +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set City. +@param City Identifies a City */ +public void setCity (String City) +{ +if (City != null && City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +City = City.substring(0,59); +} +set_Value ("City", City); +} +/** Get City. +@return Identifies a City */ +public String getCity() +{ +return (String)get_Value("City"); +} +/** Set Contact Name. +@param ContactName Business Partner Contact Name */ +public void setContactName (String ContactName) +{ +if (ContactName != null && ContactName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ContactName = ContactName.substring(0,59); +} +set_Value ("ContactName", ContactName); +} +/** Get Contact Name. +@return Business Partner Contact Name */ +public String getContactName() +{ +return (String)get_Value("ContactName"); +} +/** Set ISO Country Code. +@param CountryCode Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public void setCountryCode (String CountryCode) +{ +if (CountryCode != null && CountryCode.length() > 2) +{ +log.warning("Length > 2 - truncated"); +CountryCode = CountryCode.substring(0,1); +} +set_Value ("CountryCode", CountryCode); +} +/** Get ISO Country Code. +@return Upper-case two-letter alphanumeric ISO Country code according to ISO 3166-1 - http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html */ +public String getCountryCode() +{ +return (String)get_Value("CountryCode"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Date Ordered. +@param DateOrdered Date of Order */ +public void setDateOrdered (Timestamp DateOrdered) +{ +set_Value ("DateOrdered", DateOrdered); +} +/** Get Date Ordered. +@return Date of Order */ +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Type Name. +@param DocTypeName Name of the Document Type */ +public void setDocTypeName (String DocTypeName) +{ +if (DocTypeName != null && DocTypeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DocTypeName = DocTypeName.substring(0,59); +} +set_Value ("DocTypeName", DocTypeName); +} +/** Get Document Type Name. +@return Name of the Document Type */ +public String getDocTypeName() +{ +return (String)get_Value("DocTypeName"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Freight Amount. +@param FreightAmt Freight Amount */ +public void setFreightAmt (BigDecimal FreightAmt) +{ +set_Value ("FreightAmt", FreightAmt); +} +/** Get Freight Amount. +@return Freight Amount */ +public BigDecimal getFreightAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Import Order. +@param I_Order_ID Import Orders */ +public void setI_Order_ID (int I_Order_ID) +{ +if (I_Order_ID < 1) throw new IllegalArgumentException ("I_Order_ID is mandatory."); +set_ValueNoCheck ("I_Order_ID", new Integer(I_Order_ID)); +} +/** Get Import Order. +@return Import Orders */ +public int getI_Order_ID() +{ +Integer ii = (Integer)get_Value("I_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line Description. +@param LineDescription Description of the Line */ +public void setLineDescription (String LineDescription) +{ +if (LineDescription != null && LineDescription.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LineDescription = LineDescription.substring(0,254); +} +set_Value ("LineDescription", LineDescription); +} +/** Get Line Description. +@return Description of the Line */ +public String getLineDescription() +{ +return (String)get_Value("LineDescription"); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID <= 0) set_Value ("M_PriceList_ID", null); + else +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID <= 0) set_Value ("M_Shipper_ID", null); + else +set_Value ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID <= 0) set_Value ("M_Warehouse_ID", null); + else +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Payment Term Key. +@param PaymentTermValue Key of the Payment Term */ +public void setPaymentTermValue (String PaymentTermValue) +{ +if (PaymentTermValue != null && PaymentTermValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +PaymentTermValue = PaymentTermValue.substring(0,39); +} +set_Value ("PaymentTermValue", PaymentTermValue); +} +/** Get Payment Term Key. +@return Key of the Payment Term */ +public String getPaymentTermValue() +{ +return (String)get_Value("PaymentTermValue"); +} +/** Set Phone. +@param Phone Identifies a telephone number */ +public void setPhone (String Phone) +{ +if (Phone != null && Phone.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone = Phone.substring(0,39); +} +set_Value ("Phone", Phone); +} +/** Get Phone. +@return Identifies a telephone number */ +public String getPhone() +{ +return (String)get_Value("Phone"); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal != null && Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_Value ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +/** Set Unit Price. +@param PriceActual Actual Price */ +public void setPriceActual (BigDecimal PriceActual) +{ +set_Value ("PriceActual", PriceActual); +} +/** Get Unit Price. +@return Actual Price */ +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product Key. +@param ProductValue Key of the Product */ +public void setProductValue (String ProductValue) +{ +if (ProductValue != null && ProductValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ProductValue = ProductValue.substring(0,39); +} +set_Value ("ProductValue", ProductValue); +} +/** Get Product Key. +@return Key of the Product */ +public String getProductValue() +{ +return (String)get_Value("ProductValue"); +} +/** Set Ordered Quantity. +@param QtyOrdered Ordered Quantity */ +public void setQtyOrdered (BigDecimal QtyOrdered) +{ +set_Value ("QtyOrdered", QtyOrdered); +} +/** Get Ordered Quantity. +@return Ordered Quantity */ +public BigDecimal getQtyOrdered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOrdered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Region. +@param RegionName Name of the Region */ +public void setRegionName (String RegionName) +{ +if (RegionName != null && RegionName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RegionName = RegionName.substring(0,59); +} +set_Value ("RegionName", RegionName); +} +/** Get Region. +@return Name of the Region */ +public String getRegionName() +{ +return (String)get_Value("RegionName"); +} +/** Set SKU. +@param SKU Stock Keeping Unit */ +public void setSKU (String SKU) +{ +if (SKU != null && SKU.length() > 30) +{ +log.warning("Length > 30 - truncated"); +SKU = SKU.substring(0,29); +} +set_Value ("SKU", SKU); +} +/** Get SKU. +@return Stock Keeping Unit */ +public String getSKU() +{ +return (String)get_Value("SKU"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +set_Value ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Tax Indicator. +@param TaxIndicator Short form for Tax to be printed on documents */ +public void setTaxIndicator (String TaxIndicator) +{ +if (TaxIndicator != null && TaxIndicator.length() > 5) +{ +log.warning("Length > 5 - truncated"); +TaxIndicator = TaxIndicator.substring(0,4); +} +set_Value ("TaxIndicator", TaxIndicator); +} +/** Get Tax Indicator. +@return Short form for Tax to be printed on documents */ +public String getTaxIndicator() +{ +return (String)get_Value("TaxIndicator"); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_Payment.java b/dbPort/src/org/compiere/model/X_I_Payment.java new file mode 100644 index 0000000000..170b810bbc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_Payment.java @@ -0,0 +1,1143 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_Payment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.109 */ +public class X_I_Payment extends PO +{ +/** Standard Constructor +@param ctx context +@param I_Payment_ID id +@param trxName transaction +*/ +public X_I_Payment (Properties ctx, int I_Payment_ID, String trxName) +{ +super (ctx, I_Payment_ID, trxName); +/** if (I_Payment_ID == 0) +{ +setI_IsImported (false); +setI_Payment_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_Payment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=597 */ +public static final int Table_ID=597; + +/** TableName=I_Payment */ +public static final String Table_Name="I_Payment"; + +protected static KeyNamePair Model = new KeyNamePair(597,"I_Payment"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_Payment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Account City. +@param A_City City or the Credit Card or Account Holder */ +public void setA_City (String A_City) +{ +if (A_City != null && A_City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_City = A_City.substring(0,59); +} +set_Value ("A_City", A_City); +} +/** Get Account City. +@return City or the Credit Card or Account Holder */ +public String getA_City() +{ +return (String)get_Value("A_City"); +} +/** Set Account Country. +@param A_Country Country */ +public void setA_Country (String A_Country) +{ +if (A_Country != null && A_Country.length() > 40) +{ +log.warning("Length > 40 - truncated"); +A_Country = A_Country.substring(0,39); +} +set_Value ("A_Country", A_Country); +} +/** Get Account Country. +@return Country */ +public String getA_Country() +{ +return (String)get_Value("A_Country"); +} +/** Set Account EMail. +@param A_EMail Email Address */ +public void setA_EMail (String A_EMail) +{ +if (A_EMail != null && A_EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_EMail = A_EMail.substring(0,59); +} +set_Value ("A_EMail", A_EMail); +} +/** Get Account EMail. +@return Email Address */ +public String getA_EMail() +{ +return (String)get_Value("A_EMail"); +} +/** Set Driver License. +@param A_Ident_DL Payment Identification - Driver License */ +public void setA_Ident_DL (String A_Ident_DL) +{ +if (A_Ident_DL != null && A_Ident_DL.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Ident_DL = A_Ident_DL.substring(0,19); +} +set_Value ("A_Ident_DL", A_Ident_DL); +} +/** Get Driver License. +@return Payment Identification - Driver License */ +public String getA_Ident_DL() +{ +return (String)get_Value("A_Ident_DL"); +} +/** Set Social Security No. +@param A_Ident_SSN Payment Identification - Social Security No */ +public void setA_Ident_SSN (String A_Ident_SSN) +{ +if (A_Ident_SSN != null && A_Ident_SSN.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Ident_SSN = A_Ident_SSN.substring(0,19); +} +set_Value ("A_Ident_SSN", A_Ident_SSN); +} +/** Get Social Security No. +@return Payment Identification - Social Security No */ +public String getA_Ident_SSN() +{ +return (String)get_Value("A_Ident_SSN"); +} +/** Set Account Name. +@param A_Name Name on Credit Card or Account holder */ +public void setA_Name (String A_Name) +{ +if (A_Name != null && A_Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_Name = A_Name.substring(0,59); +} +set_Value ("A_Name", A_Name); +} +/** Get Account Name. +@return Name on Credit Card or Account holder */ +public String getA_Name() +{ +return (String)get_Value("A_Name"); +} +/** Set Account State. +@param A_State State of the Credit Card or Account holder */ +public void setA_State (String A_State) +{ +if (A_State != null && A_State.length() > 40) +{ +log.warning("Length > 40 - truncated"); +A_State = A_State.substring(0,39); +} +set_Value ("A_State", A_State); +} +/** Get Account State. +@return State of the Credit Card or Account holder */ +public String getA_State() +{ +return (String)get_Value("A_State"); +} +/** Set Account Street. +@param A_Street Street address of the Credit Card or Account holder */ +public void setA_Street (String A_Street) +{ +if (A_Street != null && A_Street.length() > 60) +{ +log.warning("Length > 60 - truncated"); +A_Street = A_Street.substring(0,59); +} +set_Value ("A_Street", A_Street); +} +/** Get Account Street. +@return Street address of the Credit Card or Account holder */ +public String getA_Street() +{ +return (String)get_Value("A_Street"); +} +/** Set Account Zip/Postal. +@param A_Zip Zip Code of the Credit Card or Account Holder */ +public void setA_Zip (String A_Zip) +{ +if (A_Zip != null && A_Zip.length() > 20) +{ +log.warning("Length > 20 - truncated"); +A_Zip = A_Zip.substring(0,19); +} +set_Value ("A_Zip", A_Zip); +} +/** Get Account Zip/Postal. +@return Zip Code of the Credit Card or Account Holder */ +public String getA_Zip() +{ +return (String)get_Value("A_Zip"); +} +/** Set Account No. +@param AccountNo Account Number */ +public void setAccountNo (String AccountNo) +{ +if (AccountNo != null && AccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +AccountNo = AccountNo.substring(0,19); +} +set_Value ("AccountNo", AccountNo); +} +/** Get Account No. +@return Account Number */ +public String getAccountNo() +{ +return (String)get_Value("AccountNo"); +} +/** Set Business Partner Key. +@param BPartnerValue Key of the Business Partner */ +public void setBPartnerValue (String BPartnerValue) +{ +if (BPartnerValue != null && BPartnerValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BPartnerValue = BPartnerValue.substring(0,39); +} +set_Value ("BPartnerValue", BPartnerValue); +} +/** Get Business Partner Key. +@return Key of the Business Partner */ +public String getBPartnerValue() +{ +return (String)get_Value("BPartnerValue"); +} +/** Set Bank Account No. +@param BankAccountNo Bank Account Number */ +public void setBankAccountNo (String BankAccountNo) +{ +if (BankAccountNo != null && BankAccountNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +BankAccountNo = BankAccountNo.substring(0,19); +} +set_Value ("BankAccountNo", BankAccountNo); +} +/** Get Bank Account No. +@return Bank Account Number */ +public String getBankAccountNo() +{ +return (String)get_Value("BankAccountNo"); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Bank Account. +@param C_BankAccount_ID Account at the Bank */ +public void setC_BankAccount_ID (int C_BankAccount_ID) +{ +if (C_BankAccount_ID <= 0) set_Value ("C_BankAccount_ID", null); + else +set_Value ("C_BankAccount_ID", new Integer(C_BankAccount_ID)); +} +/** Get Bank Account. +@return Account at the Bank */ +public int getC_BankAccount_ID() +{ +Integer ii = (Integer)get_Value("C_BankAccount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Charge Name. +@param ChargeName Name of the Charge */ +public void setChargeName (String ChargeName) +{ +if (ChargeName != null && ChargeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ChargeName = ChargeName.substring(0,59); +} +set_Value ("ChargeName", ChargeName); +} +/** Get Charge Name. +@return Name of the Charge */ +public String getChargeName() +{ +return (String)get_Value("ChargeName"); +} +/** Set Check No. +@param CheckNo Check Number */ +public void setCheckNo (String CheckNo) +{ +if (CheckNo != null && CheckNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CheckNo = CheckNo.substring(0,19); +} +set_Value ("CheckNo", CheckNo); +} +/** Get Check No. +@return Check Number */ +public String getCheckNo() +{ +return (String)get_Value("CheckNo"); +} +/** Set Exp. Month. +@param CreditCardExpMM Expiry Month */ +public void setCreditCardExpMM (int CreditCardExpMM) +{ +set_Value ("CreditCardExpMM", new Integer(CreditCardExpMM)); +} +/** Get Exp. Month. +@return Expiry Month */ +public int getCreditCardExpMM() +{ +Integer ii = (Integer)get_Value("CreditCardExpMM"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Exp. Year. +@param CreditCardExpYY Expiry Year */ +public void setCreditCardExpYY (int CreditCardExpYY) +{ +set_Value ("CreditCardExpYY", new Integer(CreditCardExpYY)); +} +/** Get Exp. Year. +@return Expiry Year */ +public int getCreditCardExpYY() +{ +Integer ii = (Integer)get_Value("CreditCardExpYY"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Number. +@param CreditCardNumber Credit Card Number */ +public void setCreditCardNumber (String CreditCardNumber) +{ +if (CreditCardNumber != null && CreditCardNumber.length() > 20) +{ +log.warning("Length > 20 - truncated"); +CreditCardNumber = CreditCardNumber.substring(0,19); +} +set_Value ("CreditCardNumber", CreditCardNumber); +} +/** Get Number. +@return Credit Card Number */ +public String getCreditCardNumber() +{ +return (String)get_Value("CreditCardNumber"); +} + +/** CreditCardType AD_Reference_ID=149 */ +public static final int CREDITCARDTYPE_AD_Reference_ID=149; +/** Amex = A */ +public static final String CREDITCARDTYPE_Amex = "A"; +/** ATM = C */ +public static final String CREDITCARDTYPE_ATM = "C"; +/** Diners = D */ +public static final String CREDITCARDTYPE_Diners = "D"; +/** MasterCard = M */ +public static final String CREDITCARDTYPE_MasterCard = "M"; +/** Discover = N */ +public static final String CREDITCARDTYPE_Discover = "N"; +/** Purchase Card = P */ +public static final String CREDITCARDTYPE_PurchaseCard = "P"; +/** Visa = V */ +public static final String CREDITCARDTYPE_Visa = "V"; +/** Set Credit Card. +@param CreditCardType Credit Card (Visa, MC, AmEx) */ +public void setCreditCardType (String CreditCardType) +{ +if (CreditCardType == null) throw new IllegalArgumentException ("CreditCardType is mandatory"); +if (CreditCardType == null || CreditCardType.equals("A") || CreditCardType.equals("C") || CreditCardType.equals("D") || CreditCardType.equals("M") || CreditCardType.equals("N") || CreditCardType.equals("P") || CreditCardType.equals("V")); + else throw new IllegalArgumentException ("CreditCardType Invalid value - " + CreditCardType + " - Reference_ID=149 - A - C - D - M - N - P - V"); +if (CreditCardType != null && CreditCardType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreditCardType = CreditCardType.substring(0,0); +} +set_Value ("CreditCardType", CreditCardType); +} +/** Get Credit Card. +@return Credit Card (Visa, MC, AmEx) */ +public String getCreditCardType() +{ +return (String)get_Value("CreditCardType"); +} +/** Set Verification Code. +@param CreditCardVV Credit Card Verification code on credit card */ +public void setCreditCardVV (String CreditCardVV) +{ +if (CreditCardVV != null && CreditCardVV.length() > 4) +{ +log.warning("Length > 4 - truncated"); +CreditCardVV = CreditCardVV.substring(0,3); +} +set_Value ("CreditCardVV", CreditCardVV); +} +/** Get Verification Code. +@return Credit Card Verification code on credit card */ +public String getCreditCardVV() +{ +return (String)get_Value("CreditCardVV"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +set_Value ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Discount Amount. +@param DiscountAmt Calculated amount of discount */ +public void setDiscountAmt (BigDecimal DiscountAmt) +{ +set_Value ("DiscountAmt", DiscountAmt); +} +/** Get Discount Amount. +@return Calculated amount of discount */ +public BigDecimal getDiscountAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DiscountAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Document Type Name. +@param DocTypeName Name of the Document Type */ +public void setDocTypeName (String DocTypeName) +{ +if (DocTypeName != null && DocTypeName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DocTypeName = DocTypeName.substring(0,59); +} +set_Value ("DocTypeName", DocTypeName); +} +/** Get Document Type Name. +@return Name of the Document Type */ +public String getDocTypeName() +{ +return (String)get_Value("DocTypeName"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set ISO Currency Code. +@param ISO_Code Three letter ISO 4217 Code of the Currency */ +public void setISO_Code (String ISO_Code) +{ +if (ISO_Code != null && ISO_Code.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code = ISO_Code.substring(0,2); +} +set_Value ("ISO_Code", ISO_Code); +} +/** Get ISO Currency Code. +@return Three letter ISO 4217 Code of the Currency */ +public String getISO_Code() +{ +return (String)get_Value("ISO_Code"); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Import Payment. +@param I_Payment_ID Import Payment */ +public void setI_Payment_ID (int I_Payment_ID) +{ +if (I_Payment_ID < 1) throw new IllegalArgumentException ("I_Payment_ID is mandatory."); +set_ValueNoCheck ("I_Payment_ID", new Integer(I_Payment_ID)); +} +/** Get Import Payment. +@return Import Payment */ +public int getI_Payment_ID() +{ +Integer ii = (Integer)get_Value("I_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Document No. +@param InvoiceDocumentNo Document Number of the Invoice */ +public void setInvoiceDocumentNo (String InvoiceDocumentNo) +{ +if (InvoiceDocumentNo != null && InvoiceDocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +InvoiceDocumentNo = InvoiceDocumentNo.substring(0,29); +} +set_Value ("InvoiceDocumentNo", InvoiceDocumentNo); +} +/** Get Invoice Document No. +@return Document Number of the Invoice */ +public String getInvoiceDocumentNo() +{ +return (String)get_Value("InvoiceDocumentNo"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Delayed Capture. +@param IsDelayedCapture Charge after Shipment */ +public void setIsDelayedCapture (boolean IsDelayedCapture) +{ +set_Value ("IsDelayedCapture", new Boolean(IsDelayedCapture)); +} +/** Get Delayed Capture. +@return Charge after Shipment */ +public boolean isDelayedCapture() +{ +Object oo = get_Value("IsDelayedCapture"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Over/Under Payment. +@param IsOverUnderPayment Over-Payment (unallocated) or Under-Payment (partial payment) */ +public void setIsOverUnderPayment (boolean IsOverUnderPayment) +{ +set_Value ("IsOverUnderPayment", new Boolean(IsOverUnderPayment)); +} +/** Get Over/Under Payment. +@return Over-Payment (unallocated) or Under-Payment (partial payment) */ +public boolean isOverUnderPayment() +{ +Object oo = get_Value("IsOverUnderPayment"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Receipt. +@param IsReceipt This is a sales transaction (receipt) */ +public void setIsReceipt (boolean IsReceipt) +{ +set_Value ("IsReceipt", new Boolean(IsReceipt)); +} +/** Get Receipt. +@return This is a sales transaction (receipt) */ +public boolean isReceipt() +{ +Object oo = get_Value("IsReceipt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Micr. +@param Micr Combination of routing no, account and check no */ +public void setMicr (String Micr) +{ +if (Micr != null && Micr.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Micr = Micr.substring(0,19); +} +set_Value ("Micr", Micr); +} +/** Get Micr. +@return Combination of routing no, account and check no */ +public String getMicr() +{ +return (String)get_Value("Micr"); +} +/** Set Original Transaction ID. +@param Orig_TrxID Original Transaction ID */ +public void setOrig_TrxID (String Orig_TrxID) +{ +if (Orig_TrxID != null && Orig_TrxID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Orig_TrxID = Orig_TrxID.substring(0,19); +} +set_Value ("Orig_TrxID", Orig_TrxID); +} +/** Get Original Transaction ID. +@return Original Transaction ID */ +public String getOrig_TrxID() +{ +return (String)get_Value("Orig_TrxID"); +} +/** Set Over/Under Payment. +@param OverUnderAmt Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public void setOverUnderAmt (BigDecimal OverUnderAmt) +{ +set_Value ("OverUnderAmt", OverUnderAmt); +} +/** Get Over/Under Payment. +@return Over-Payment (unallocated) or Under-Payment (partial payment) Amount */ +public BigDecimal getOverUnderAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OverUnderAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set PO Number. +@param PONum Purchase Order Number */ +public void setPONum (String PONum) +{ +if (PONum != null && PONum.length() > 60) +{ +log.warning("Length > 60 - truncated"); +PONum = PONum.substring(0,59); +} +set_Value ("PONum", PONum); +} +/** Get PO Number. +@return Purchase Order Number */ +public String getPONum() +{ +return (String)get_Value("PONum"); +} +/** Set Payment amount. +@param PayAmt Amount being paid */ +public void setPayAmt (BigDecimal PayAmt) +{ +set_Value ("PayAmt", PayAmt); +} +/** Get Payment amount. +@return Amount being paid */ +public BigDecimal getPayAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PayAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Authorization Code. +@param R_AuthCode Authorization Code returned */ +public void setR_AuthCode (String R_AuthCode) +{ +if (R_AuthCode != null && R_AuthCode.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_AuthCode = R_AuthCode.substring(0,19); +} +set_Value ("R_AuthCode", R_AuthCode); +} +/** Get Authorization Code. +@return Authorization Code returned */ +public String getR_AuthCode() +{ +return (String)get_Value("R_AuthCode"); +} +/** Set Info. +@param R_Info Response info */ +public void setR_Info (String R_Info) +{ +if (R_Info != null && R_Info.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +R_Info = R_Info.substring(0,1999); +} +set_Value ("R_Info", R_Info); +} +/** Get Info. +@return Response info */ +public String getR_Info() +{ +return (String)get_Value("R_Info"); +} +/** Set Reference. +@param R_PnRef Payment reference */ +public void setR_PnRef (String R_PnRef) +{ +if (R_PnRef != null && R_PnRef.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_PnRef = R_PnRef.substring(0,19); +} +set_Value ("R_PnRef", R_PnRef); +} +/** Get Reference. +@return Payment reference */ +public String getR_PnRef() +{ +return (String)get_Value("R_PnRef"); +} +/** Set Response Message. +@param R_RespMsg Response message */ +public void setR_RespMsg (String R_RespMsg) +{ +if (R_RespMsg != null && R_RespMsg.length() > 60) +{ +log.warning("Length > 60 - truncated"); +R_RespMsg = R_RespMsg.substring(0,59); +} +set_Value ("R_RespMsg", R_RespMsg); +} +/** Get Response Message. +@return Response message */ +public String getR_RespMsg() +{ +return (String)get_Value("R_RespMsg"); +} +/** Set Result. +@param R_Result Result of transmission */ +public void setR_Result (String R_Result) +{ +if (R_Result != null && R_Result.length() > 20) +{ +log.warning("Length > 20 - truncated"); +R_Result = R_Result.substring(0,19); +} +set_Value ("R_Result", R_Result); +} +/** Get Result. +@return Result of transmission */ +public String getR_Result() +{ +return (String)get_Value("R_Result"); +} +/** Set Routing No. +@param RoutingNo Bank Routing Number */ +public void setRoutingNo (String RoutingNo) +{ +if (RoutingNo != null && RoutingNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +RoutingNo = RoutingNo.substring(0,19); +} +set_Value ("RoutingNo", RoutingNo); +} +/** Get Routing No. +@return Bank Routing Number */ +public String getRoutingNo() +{ +return (String)get_Value("RoutingNo"); +} +/** Set Swipe. +@param Swipe Track 1 and 2 of the Credit Card */ +public void setSwipe (String Swipe) +{ +if (Swipe != null && Swipe.length() > 80) +{ +log.warning("Length > 80 - truncated"); +Swipe = Swipe.substring(0,79); +} +set_Value ("Swipe", Swipe); +} +/** Get Swipe. +@return Track 1 and 2 of the Credit Card */ +public String getSwipe() +{ +return (String)get_Value("Swipe"); +} +/** Set Tax Amount. +@param TaxAmt Tax Amount for a document */ +public void setTaxAmt (BigDecimal TaxAmt) +{ +set_Value ("TaxAmt", TaxAmt); +} +/** Get Tax Amount. +@return Tax Amount for a document */ +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** TenderType AD_Reference_ID=214 */ +public static final int TENDERTYPE_AD_Reference_ID=214; +/** Direct Deposit = A */ +public static final String TENDERTYPE_DirectDeposit = "A"; +/** Credit Card = C */ +public static final String TENDERTYPE_CreditCard = "C"; +/** Direct Debit = D */ +public static final String TENDERTYPE_DirectDebit = "D"; +/** Check = K */ +public static final String TENDERTYPE_Check = "K"; +/** Set Tender type. +@param TenderType Method of Payment */ +public void setTenderType (String TenderType) +{ +if (TenderType == null) throw new IllegalArgumentException ("TenderType is mandatory"); +if (TenderType == null || TenderType.equals("A") || TenderType.equals("C") || TenderType.equals("D") || TenderType.equals("K")); + else throw new IllegalArgumentException ("TenderType Invalid value - " + TenderType + " - Reference_ID=214 - A - C - D - K"); +if (TenderType != null && TenderType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TenderType = TenderType.substring(0,0); +} +set_Value ("TenderType", TenderType); +} +/** Get Tender type. +@return Method of Payment */ +public String getTenderType() +{ +return (String)get_Value("TenderType"); +} + +/** TrxType AD_Reference_ID=215 */ +public static final int TRXTYPE_AD_Reference_ID=215; +/** Authorization = A */ +public static final String TRXTYPE_Authorization = "A"; +/** Credit (Payment) = C */ +public static final String TRXTYPE_CreditPayment = "C"; +/** Delayed Capture = D */ +public static final String TRXTYPE_DelayedCapture = "D"; +/** Voice Authorization = F */ +public static final String TRXTYPE_VoiceAuthorization = "F"; +/** Sales = S */ +public static final String TRXTYPE_Sales = "S"; +/** Void = V */ +public static final String TRXTYPE_Void = "V"; +/** Set Transaction Type. +@param TrxType Type of credit card transaction */ +public void setTrxType (String TrxType) +{ +if (TrxType == null) throw new IllegalArgumentException ("TrxType is mandatory"); +if (TrxType == null || TrxType.equals("A") || TrxType.equals("C") || TrxType.equals("D") || TrxType.equals("F") || TrxType.equals("S") || TrxType.equals("V")); + else throw new IllegalArgumentException ("TrxType Invalid value - " + TrxType + " - Reference_ID=215 - A - C - D - F - S - V"); +if (TrxType != null && TrxType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TrxType = TrxType.substring(0,0); +} +set_Value ("TrxType", TrxType); +} +/** Get Transaction Type. +@return Type of credit card transaction */ +public String getTrxType() +{ +return (String)get_Value("TrxType"); +} +/** Set Voice authorization code. +@param VoiceAuthCode Voice Authorization Code from credit card company */ +public void setVoiceAuthCode (String VoiceAuthCode) +{ +if (VoiceAuthCode != null && VoiceAuthCode.length() > 20) +{ +log.warning("Length > 20 - truncated"); +VoiceAuthCode = VoiceAuthCode.substring(0,19); +} +set_Value ("VoiceAuthCode", VoiceAuthCode); +} +/** Get Voice authorization code. +@return Voice Authorization Code from credit card company */ +public String getVoiceAuthCode() +{ +return (String)get_Value("VoiceAuthCode"); +} +/** Set Write-off Amount. +@param WriteOffAmt Amount to write-off */ +public void setWriteOffAmt (BigDecimal WriteOffAmt) +{ +set_Value ("WriteOffAmt", WriteOffAmt); +} +/** Get Write-off Amount. +@return Amount to write-off */ +public BigDecimal getWriteOffAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("WriteOffAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_I_Product.java b/dbPort/src/org/compiere/model/X_I_Product.java new file mode 100644 index 0000000000..abe463e5b3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_Product.java @@ -0,0 +1,835 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_Product + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.156 */ +public class X_I_Product extends PO +{ +/** Standard Constructor +@param ctx context +@param I_Product_ID id +@param trxName transaction +*/ +public X_I_Product (Properties ctx, int I_Product_ID, String trxName) +{ +super (ctx, I_Product_ID, trxName); +/** if (I_Product_ID == 0) +{ +setI_IsImported (false); +setI_Product_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_Product (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=532 */ +public static final int Table_ID=532; + +/** TableName=I_Product */ +public static final String Table_Name="I_Product"; + +protected static KeyNamePair Model = new KeyNamePair(532,"I_Product"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_Product[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner Key. +@param BPartner_Value The Key of the Business Partner */ +public void setBPartner_Value (String BPartner_Value) +{ +if (BPartner_Value != null && BPartner_Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +BPartner_Value = BPartner_Value.substring(0,39); +} +set_Value ("BPartner_Value", BPartner_Value); +} +/** Get Business Partner Key. +@return The Key of the Business Partner */ +public String getBPartner_Value() +{ +return (String)get_Value("BPartner_Value"); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Classification. +@param Classification Classification for grouping */ +public void setClassification (String Classification) +{ +if (Classification != null && Classification.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Classification = Classification.substring(0,0); +} +set_Value ("Classification", Classification); +} +/** Get Classification. +@return Classification for grouping */ +public String getClassification() +{ +return (String)get_Value("Classification"); +} +/** Set Cost per Order. +@param CostPerOrder Fixed Cost Per Order */ +public void setCostPerOrder (BigDecimal CostPerOrder) +{ +set_Value ("CostPerOrder", CostPerOrder); +} +/** Get Cost per Order. +@return Fixed Cost Per Order */ +public BigDecimal getCostPerOrder() +{ +BigDecimal bd = (BigDecimal)get_Value("CostPerOrder"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Promised Delivery Time. +@param DeliveryTime_Promised Promised days between order and delivery */ +public void setDeliveryTime_Promised (int DeliveryTime_Promised) +{ +set_Value ("DeliveryTime_Promised", new Integer(DeliveryTime_Promised)); +} +/** Get Promised Delivery Time. +@return Promised days between order and delivery */ +public int getDeliveryTime_Promised() +{ +Integer ii = (Integer)get_Value("DeliveryTime_Promised"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Description URL. +@param DescriptionURL URL for the description */ +public void setDescriptionURL (String DescriptionURL) +{ +if (DescriptionURL != null && DescriptionURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DescriptionURL = DescriptionURL.substring(0,119); +} +set_Value ("DescriptionURL", DescriptionURL); +} +/** Get Description URL. +@return URL for the description */ +public String getDescriptionURL() +{ +return (String)get_Value("DescriptionURL"); +} +/** Set Discontinued. +@param Discontinued This product is no longer available */ +public void setDiscontinued (boolean Discontinued) +{ +set_Value ("Discontinued", new Boolean(Discontinued)); +} +/** Get Discontinued. +@return This product is no longer available */ +public boolean isDiscontinued() +{ +Object oo = get_Value("Discontinued"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discontinued by. +@param DiscontinuedBy Discontinued By */ +public void setDiscontinuedBy (Timestamp DiscontinuedBy) +{ +set_Value ("DiscontinuedBy", DiscontinuedBy); +} +/** Get Discontinued by. +@return Discontinued By */ +public Timestamp getDiscontinuedBy() +{ +return (Timestamp)get_Value("DiscontinuedBy"); +} +/** Set Document Note. +@param DocumentNote Additional information for a Document */ +public void setDocumentNote (String DocumentNote) +{ +if (DocumentNote != null && DocumentNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DocumentNote = DocumentNote.substring(0,1999); +} +set_Value ("DocumentNote", DocumentNote); +} +/** Get Document Note. +@return Additional information for a Document */ +public String getDocumentNote() +{ +return (String)get_Value("DocumentNote"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set ISO Currency Code. +@param ISO_Code Three letter ISO 4217 Code of the Currency */ +public void setISO_Code (String ISO_Code) +{ +if (ISO_Code != null && ISO_Code.length() > 3) +{ +log.warning("Length > 3 - truncated"); +ISO_Code = ISO_Code.substring(0,2); +} +set_Value ("ISO_Code", ISO_Code); +} +/** Get ISO Currency Code. +@return Three letter ISO 4217 Code of the Currency */ +public String getISO_Code() +{ +return (String)get_Value("ISO_Code"); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Import Product. +@param I_Product_ID Import Item or Service */ +public void setI_Product_ID (int I_Product_ID) +{ +if (I_Product_ID < 1) throw new IllegalArgumentException ("I_Product_ID is mandatory."); +set_ValueNoCheck ("I_Product_ID", new Integer(I_Product_ID)); +} +/** Get Import Product. +@return Import Item or Service */ +public int getI_Product_ID() +{ +Integer ii = (Integer)get_Value("I_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Manufacturer. +@param Manufacturer Manufacturer of the Product */ +public void setManufacturer (String Manufacturer) +{ +if (Manufacturer != null && Manufacturer.length() > 30) +{ +log.warning("Length > 30 - truncated"); +Manufacturer = Manufacturer.substring(0,29); +} +set_Value ("Manufacturer", Manufacturer); +} +/** Get Manufacturer. +@return Manufacturer of the Product */ +public String getManufacturer() +{ +return (String)get_Value("Manufacturer"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Minimum Order Qty. +@param Order_Min Minimum order quantity in UOM */ +public void setOrder_Min (int Order_Min) +{ +set_Value ("Order_Min", new Integer(Order_Min)); +} +/** Get Minimum Order Qty. +@return Minimum order quantity in UOM */ +public int getOrder_Min() +{ +Integer ii = (Integer)get_Value("Order_Min"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order Pack Qty. +@param Order_Pack Package order size in UOM (e.g. order set of 5 units) */ +public void setOrder_Pack (int Order_Pack) +{ +set_Value ("Order_Pack", new Integer(Order_Pack)); +} +/** Get Order Pack Qty. +@return Package order size in UOM (e.g. order set of 5 units) */ +public int getOrder_Pack() +{ +Integer ii = (Integer)get_Value("Order_Pack"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price effective. +@param PriceEffective Effective Date of Price */ +public void setPriceEffective (Timestamp PriceEffective) +{ +set_Value ("PriceEffective", PriceEffective); +} +/** Get Price effective. +@return Effective Date of Price */ +public Timestamp getPriceEffective() +{ +return (Timestamp)get_Value("PriceEffective"); +} +/** Set Limit Price. +@param PriceLimit Lowest price for a product */ +public void setPriceLimit (BigDecimal PriceLimit) +{ +set_Value ("PriceLimit", PriceLimit); +} +/** Get Limit Price. +@return Lowest price for a product */ +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +set_Value ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set PO Price. +@param PricePO Price based on a purchase order */ +public void setPricePO (BigDecimal PricePO) +{ +set_Value ("PricePO", PricePO); +} +/** Get PO Price. +@return Price based on a purchase order */ +public BigDecimal getPricePO() +{ +BigDecimal bd = (BigDecimal)get_Value("PricePO"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Price. +@param PriceStd Standard Price */ +public void setPriceStd (BigDecimal PriceStd) +{ +set_Value ("PriceStd", PriceStd); +} +/** Get Standard Price. +@return Standard Price */ +public BigDecimal getPriceStd() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceStd"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product Category Key. +@param ProductCategory_Value Product Category Key */ +public void setProductCategory_Value (String ProductCategory_Value) +{ +if (ProductCategory_Value != null && ProductCategory_Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ProductCategory_Value = ProductCategory_Value.substring(0,39); +} +set_Value ("ProductCategory_Value", ProductCategory_Value); +} +/** Get Product Category Key. +@return Product Category Key */ +public String getProductCategory_Value() +{ +return (String)get_Value("ProductCategory_Value"); +} + +/** ProductType AD_Reference_ID=270 */ +public static final int PRODUCTTYPE_AD_Reference_ID=270; +/** Expense type = E */ +public static final String PRODUCTTYPE_ExpenseType = "E"; +/** Item = I */ +public static final String PRODUCTTYPE_Item = "I"; +/** Online = O */ +public static final String PRODUCTTYPE_Online = "O"; +/** Resource = R */ +public static final String PRODUCTTYPE_Resource = "R"; +/** Service = S */ +public static final String PRODUCTTYPE_Service = "S"; +/** Set Product Type. +@param ProductType Type of product */ +public void setProductType (String ProductType) +{ +if (ProductType == null) throw new IllegalArgumentException ("ProductType is mandatory"); +if (ProductType == null || ProductType.equals("E") || ProductType.equals("I") || ProductType.equals("O") || ProductType.equals("R") || ProductType.equals("S")); + else throw new IllegalArgumentException ("ProductType Invalid value - " + ProductType + " - Reference_ID=270 - E - I - O - R - S"); +if (ProductType != null && ProductType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProductType = ProductType.substring(0,0); +} +set_Value ("ProductType", ProductType); +} +/** Get Product Type. +@return Type of product */ +public String getProductType() +{ +return (String)get_Value("ProductType"); +} +/** Set Royalty Amount. +@param RoyaltyAmt (Included) Amount for copyright, etc. */ +public void setRoyaltyAmt (BigDecimal RoyaltyAmt) +{ +set_Value ("RoyaltyAmt", RoyaltyAmt); +} +/** Get Royalty Amount. +@return (Included) Amount for copyright, etc. */ +public BigDecimal getRoyaltyAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RoyaltyAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set SKU. +@param SKU Stock Keeping Unit */ +public void setSKU (String SKU) +{ +if (SKU != null && SKU.length() > 30) +{ +log.warning("Length > 30 - truncated"); +SKU = SKU.substring(0,29); +} +set_Value ("SKU", SKU); +} +/** Get SKU. +@return Stock Keeping Unit */ +public String getSKU() +{ +return (String)get_Value("SKU"); +} +/** Set Shelf Depth. +@param ShelfDepth Shelf depth required */ +public void setShelfDepth (int ShelfDepth) +{ +set_Value ("ShelfDepth", new Integer(ShelfDepth)); +} +/** Get Shelf Depth. +@return Shelf depth required */ +public int getShelfDepth() +{ +Integer ii = (Integer)get_Value("ShelfDepth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shelf Height. +@param ShelfHeight Shelf height required */ +public void setShelfHeight (int ShelfHeight) +{ +set_Value ("ShelfHeight", new Integer(ShelfHeight)); +} +/** Get Shelf Height. +@return Shelf height required */ +public int getShelfHeight() +{ +Integer ii = (Integer)get_Value("ShelfHeight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shelf Width. +@param ShelfWidth Shelf width required */ +public void setShelfWidth (int ShelfWidth) +{ +set_Value ("ShelfWidth", new Integer(ShelfWidth)); +} +/** Get Shelf Width. +@return Shelf width required */ +public int getShelfWidth() +{ +Integer ii = (Integer)get_Value("ShelfWidth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +/** Set Units Per Pallet. +@param UnitsPerPallet Units Per Pallet */ +public void setUnitsPerPallet (int UnitsPerPallet) +{ +set_Value ("UnitsPerPallet", new Integer(UnitsPerPallet)); +} +/** Get Units Per Pallet. +@return Units Per Pallet */ +public int getUnitsPerPallet() +{ +Integer ii = (Integer)get_Value("UnitsPerPallet"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value != null && Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +/** Set Partner Category. +@param VendorCategory Product Category of the Business Partner */ +public void setVendorCategory (String VendorCategory) +{ +if (VendorCategory != null && VendorCategory.length() > 30) +{ +log.warning("Length > 30 - truncated"); +VendorCategory = VendorCategory.substring(0,29); +} +set_Value ("VendorCategory", VendorCategory); +} +/** Get Partner Category. +@return Product Category of the Business Partner */ +public String getVendorCategory() +{ +return (String)get_Value("VendorCategory"); +} +/** Set Partner Product Key. +@param VendorProductNo Product Key of the Business Partner */ +public void setVendorProductNo (String VendorProductNo) +{ +if (VendorProductNo != null && VendorProductNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +VendorProductNo = VendorProductNo.substring(0,29); +} +set_Value ("VendorProductNo", VendorProductNo); +} +/** Get Partner Product Key. +@return Product Key of the Business Partner */ +public String getVendorProductNo() +{ +return (String)get_Value("VendorProductNo"); +} +/** Set Volume. +@param Volume Volume of a product */ +public void setVolume (int Volume) +{ +set_Value ("Volume", new Integer(Volume)); +} +/** Get Volume. +@return Volume of a product */ +public int getVolume() +{ +Integer ii = (Integer)get_Value("Volume"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Weight. +@param Weight Weight of a product */ +public void setWeight (int Weight) +{ +set_Value ("Weight", new Integer(Weight)); +} +/** Get Weight. +@return Weight of a product */ +public int getWeight() +{ +Integer ii = (Integer)get_Value("Weight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM Code. +@param X12DE355 UOM EDI X12 Code */ +public void setX12DE355 (String X12DE355) +{ +if (X12DE355 != null && X12DE355.length() > 2) +{ +log.warning("Length > 2 - truncated"); +X12DE355 = X12DE355.substring(0,1); +} +set_Value ("X12DE355", X12DE355); +} +/** Get UOM Code. +@return UOM EDI X12 Code */ +public String getX12DE355() +{ +return (String)get_Value("X12DE355"); +} +} diff --git a/dbPort/src/org/compiere/model/X_I_ReportLine.java b/dbPort/src/org/compiere/model/X_I_ReportLine.java new file mode 100644 index 0000000000..6628e915af --- /dev/null +++ b/dbPort/src/org/compiere/model/X_I_ReportLine.java @@ -0,0 +1,503 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for I_ReportLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.203 */ +public class X_I_ReportLine extends PO +{ +/** Standard Constructor +@param ctx context +@param I_ReportLine_ID id +@param trxName transaction +*/ +public X_I_ReportLine (Properties ctx, int I_ReportLine_ID, String trxName) +{ +super (ctx, I_ReportLine_ID, trxName); +/** if (I_ReportLine_ID == 0) +{ +setI_IsImported (false); +setI_ReportLine_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_I_ReportLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=535 */ +public static final int Table_ID=535; + +/** TableName=I_ReportLine */ +public static final String Table_Name="I_ReportLine"; + +protected static KeyNamePair Model = new KeyNamePair(535,"I_ReportLine"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_I_ReportLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AmountType AD_Reference_ID=235 */ +public static final int AMOUNTTYPE_AD_Reference_ID=235; +/** Period Balance = BP */ +public static final String AMOUNTTYPE_PeriodBalance = "BP"; +/** Total Balance = BT */ +public static final String AMOUNTTYPE_TotalBalance = "BT"; +/** Year Balance = BY */ +public static final String AMOUNTTYPE_YearBalance = "BY"; +/** Period Credit Only = CP */ +public static final String AMOUNTTYPE_PeriodCreditOnly = "CP"; +/** Total Credit Only = CT */ +public static final String AMOUNTTYPE_TotalCreditOnly = "CT"; +/** Year Credit Only = CY */ +public static final String AMOUNTTYPE_YearCreditOnly = "CY"; +/** Period Debit Only = DP */ +public static final String AMOUNTTYPE_PeriodDebitOnly = "DP"; +/** Total Debit Only = DT */ +public static final String AMOUNTTYPE_TotalDebitOnly = "DT"; +/** Year Debit Only = DY */ +public static final String AMOUNTTYPE_YearDebitOnly = "DY"; +/** Period Quantity = QP */ +public static final String AMOUNTTYPE_PeriodQuantity = "QP"; +/** Total Quantity = QT */ +public static final String AMOUNTTYPE_TotalQuantity = "QT"; +/** Year Quantity = QY */ +public static final String AMOUNTTYPE_YearQuantity = "QY"; +/** Set Amount Type. +@param AmountType Type of amount to report */ +public void setAmountType (String AmountType) +{ +if (AmountType == null) throw new IllegalArgumentException ("AmountType is mandatory"); +if (AmountType == null || AmountType.equals("BP") || AmountType.equals("BT") || AmountType.equals("BY") || AmountType.equals("CP") || AmountType.equals("CT") || AmountType.equals("CY") || AmountType.equals("DP") || AmountType.equals("DT") || AmountType.equals("DY") || AmountType.equals("QP") || AmountType.equals("QT") || AmountType.equals("QY")); + else throw new IllegalArgumentException ("AmountType Invalid value - " + AmountType + " - Reference_ID=235 - BP - BT - BY - CP - CT - CY - DP - DT - DY - QP - QT - QY"); +if (AmountType != null && AmountType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +AmountType = AmountType.substring(0,1); +} +set_Value ("AmountType", AmountType); +} +/** Get Amount Type. +@return Type of amount to report */ +public String getAmountType() +{ +return (String)get_Value("AmountType"); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID <= 0) set_Value ("C_ElementValue_ID", null); + else +set_Value ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CalculationType AD_Reference_ID=236 */ +public static final int CALCULATIONTYPE_AD_Reference_ID=236; +/** Add (Op1+Op2) = A */ +public static final String CALCULATIONTYPE_AddOp1PlusOp2 = "A"; +/** Percentage (Op1 of Op2) = P */ +public static final String CALCULATIONTYPE_PercentageOp1OfOp2 = "P"; +/** Add Range (Op1 to Op2) = R */ +public static final String CALCULATIONTYPE_AddRangeOp1ToOp2 = "R"; +/** Subtract (Op1-Op2) = S */ +public static final String CALCULATIONTYPE_SubtractOp1_Op2 = "S"; +/** Set Calculation. +@param CalculationType Calculation */ +public void setCalculationType (String CalculationType) +{ +if (CalculationType == null) throw new IllegalArgumentException ("CalculationType is mandatory"); +if (CalculationType == null || CalculationType.equals("A") || CalculationType.equals("P") || CalculationType.equals("R") || CalculationType.equals("S")); + else throw new IllegalArgumentException ("CalculationType Invalid value - " + CalculationType + " - Reference_ID=236 - A - P - R - S"); +if (CalculationType != null && CalculationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CalculationType = CalculationType.substring(0,0); +} +set_Value ("CalculationType", CalculationType); +} +/** Get Calculation. +@return Calculation */ +public String getCalculationType() +{ +return (String)get_Value("CalculationType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Element Key. +@param ElementValue Key of the element */ +public void setElementValue (String ElementValue) +{ +if (ElementValue != null && ElementValue.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ElementValue = ElementValue.substring(0,39); +} +set_Value ("ElementValue", ElementValue); +} +/** Get Element Key. +@return Key of the element */ +public String getElementValue() +{ +return (String)get_Value("ElementValue"); +} +/** Set Import Error Message. +@param I_ErrorMsg Messages generated from import process */ +public void setI_ErrorMsg (String I_ErrorMsg) +{ +if (I_ErrorMsg != null && I_ErrorMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +I_ErrorMsg = I_ErrorMsg.substring(0,1999); +} +set_Value ("I_ErrorMsg", I_ErrorMsg); +} +/** Get Import Error Message. +@return Messages generated from import process */ +public String getI_ErrorMsg() +{ +return (String)get_Value("I_ErrorMsg"); +} +/** Set Imported. +@param I_IsImported Has this import been processed */ +public void setI_IsImported (boolean I_IsImported) +{ +set_Value ("I_IsImported", new Boolean(I_IsImported)); +} +/** Get Imported. +@return Has this import been processed */ +public boolean isI_IsImported() +{ +Object oo = get_Value("I_IsImported"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Import Report Line Set. +@param I_ReportLine_ID Import Report Line Set values */ +public void setI_ReportLine_ID (int I_ReportLine_ID) +{ +if (I_ReportLine_ID < 1) throw new IllegalArgumentException ("I_ReportLine_ID is mandatory."); +set_ValueNoCheck ("I_ReportLine_ID", new Integer(I_ReportLine_ID)); +} +/** Get Import Report Line Set. +@return Import Report Line Set values */ +public int getI_ReportLine_ID() +{ +Integer ii = (Integer)get_Value("I_ReportLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** LineType AD_Reference_ID=241 */ +public static final int LINETYPE_AD_Reference_ID=241; +/** Calculation = C */ +public static final String LINETYPE_Calculation = "C"; +/** Segment Value = S */ +public static final String LINETYPE_SegmentValue = "S"; +/** Set Line Type. +@param LineType Line Type */ +public void setLineType (String LineType) +{ +if (LineType == null) throw new IllegalArgumentException ("LineType is mandatory"); +if (LineType == null || LineType.equals("C") || LineType.equals("S")); + else throw new IllegalArgumentException ("LineType Invalid value - " + LineType + " - Reference_ID=241 - C - S"); +if (LineType != null && LineType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LineType = LineType.substring(0,0); +} +set_Value ("LineType", LineType); +} +/** Get Line Type. +@return Line Type */ +public String getLineType() +{ +return (String)get_Value("LineType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Report Line Set. +@param PA_ReportLineSet_ID Report Line Set */ +public void setPA_ReportLineSet_ID (int PA_ReportLineSet_ID) +{ +if (PA_ReportLineSet_ID <= 0) set_Value ("PA_ReportLineSet_ID", null); + else +set_Value ("PA_ReportLineSet_ID", new Integer(PA_ReportLineSet_ID)); +} +/** Get Report Line Set. +@return Report Line Set */ +public int getPA_ReportLineSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLineSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Line. +@param PA_ReportLine_ID Report Line */ +public void setPA_ReportLine_ID (int PA_ReportLine_ID) +{ +if (PA_ReportLine_ID <= 0) set_Value ("PA_ReportLine_ID", null); + else +set_Value ("PA_ReportLine_ID", new Integer(PA_ReportLine_ID)); +} +/** Get Report Line. +@return Report Line */ +public int getPA_ReportLine_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Source. +@param PA_ReportSource_ID Restriction of what will be shown in Report Line */ +public void setPA_ReportSource_ID (int PA_ReportSource_ID) +{ +if (PA_ReportSource_ID <= 0) set_Value ("PA_ReportSource_ID", null); + else +set_Value ("PA_ReportSource_ID", new Integer(PA_ReportSource_ID)); +} +/** Get Report Source. +@return Restriction of what will be shown in Report Line */ +public int getPA_ReportSource_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportSource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType == null || PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType != null && PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Report Line Set Name. +@param ReportLineSetName Name of the Report Line Set */ +public void setReportLineSetName (String ReportLineSetName) +{ +if (ReportLineSetName != null && ReportLineSetName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ReportLineSetName = ReportLineSetName.substring(0,59); +} +set_Value ("ReportLineSetName", ReportLineSetName); +} +/** Get Report Line Set Name. +@return Name of the Report Line Set */ +public String getReportLineSetName() +{ +return (String)get_Value("ReportLineSetName"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Category.java b/dbPort/src/org/compiere/model/X_K_Category.java new file mode 100644 index 0000000000..daf2f07e46 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Category.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Category + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.39 */ +public class X_K_Category extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Category_ID id +@param trxName transaction +*/ +public X_K_Category (Properties ctx, int K_Category_ID, String trxName) +{ +super (ctx, K_Category_ID, trxName); +/** if (K_Category_ID == 0) +{ +setK_Category_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Category (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=615 */ +public static final int Table_ID=615; + +/** TableName=K_Category */ +public static final String Table_Name="K_Category"; + +protected static KeyNamePair Model = new KeyNamePair(615,"K_Category"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Category[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Knowledge Category. +@param K_Category_ID Knowledge Category */ +public void setK_Category_ID (int K_Category_ID) +{ +if (K_Category_ID < 1) throw new IllegalArgumentException ("K_Category_ID is mandatory."); +set_ValueNoCheck ("K_Category_ID", new Integer(K_Category_ID)); +} +/** Get Knowledge Category. +@return Knowledge Category */ +public int getK_Category_ID() +{ +Integer ii = (Integer)get_Value("K_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_CategoryValue.java b/dbPort/src/org/compiere/model/X_K_CategoryValue.java new file mode 100644 index 0000000000..9efb8dacb7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_CategoryValue.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_CategoryValue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.406 */ +public class X_K_CategoryValue extends PO +{ +/** Standard Constructor +@param ctx context +@param K_CategoryValue_ID id +@param trxName transaction +*/ +public X_K_CategoryValue (Properties ctx, int K_CategoryValue_ID, String trxName) +{ +super (ctx, K_CategoryValue_ID, trxName); +/** if (K_CategoryValue_ID == 0) +{ +setK_CategoryValue_ID (0); +setK_Category_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_CategoryValue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=614 */ +public static final int Table_ID=614; + +/** TableName=K_CategoryValue */ +public static final String Table_Name="K_CategoryValue"; + +protected static KeyNamePair Model = new KeyNamePair(614,"K_CategoryValue"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_CategoryValue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Category Value. +@param K_CategoryValue_ID The value of the category */ +public void setK_CategoryValue_ID (int K_CategoryValue_ID) +{ +if (K_CategoryValue_ID < 1) throw new IllegalArgumentException ("K_CategoryValue_ID is mandatory."); +set_ValueNoCheck ("K_CategoryValue_ID", new Integer(K_CategoryValue_ID)); +} +/** Get Category Value. +@return The value of the category */ +public int getK_CategoryValue_ID() +{ +Integer ii = (Integer)get_Value("K_CategoryValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Knowledge Category. +@param K_Category_ID Knowledge Category */ +public void setK_Category_ID (int K_Category_ID) +{ +if (K_Category_ID < 1) throw new IllegalArgumentException ("K_Category_ID is mandatory."); +set_ValueNoCheck ("K_Category_ID", new Integer(K_Category_ID)); +} +/** Get Knowledge Category. +@return Knowledge Category */ +public int getK_Category_ID() +{ +Integer ii = (Integer)get_Value("K_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Comment.java b/dbPort/src/org/compiere/model/X_K_Comment.java new file mode 100644 index 0000000000..cb7fa2ae13 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Comment.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Comment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.406 */ +public class X_K_Comment extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Comment_ID id +@param trxName transaction +*/ +public X_K_Comment (Properties ctx, int K_Comment_ID, String trxName) +{ +super (ctx, K_Comment_ID, trxName); +/** if (K_Comment_ID == 0) +{ +setIsPublic (true); // Y +setK_Comment_ID (0); +setK_Entry_ID (0); +setRating (0); +setTextMsg (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Comment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=613 */ +public static final int Table_ID=613; + +/** TableName=K_Comment */ +public static final String Table_Name="K_Comment"; + +protected static KeyNamePair Model = new KeyNamePair(613,"K_Comment"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Comment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Session. +@param AD_Session_ID User Session Online or Web */ +public void setAD_Session_ID (int AD_Session_ID) +{ +if (AD_Session_ID <= 0) set_ValueNoCheck ("AD_Session_ID", null); + else +set_ValueNoCheck ("AD_Session_ID", new Integer(AD_Session_ID)); +} +/** Get Session. +@return User Session Online or Web */ +public int getAD_Session_ID() +{ +Integer ii = (Integer)get_Value("AD_Session_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Public. +@param IsPublic Public can read entry */ +public void setIsPublic (boolean IsPublic) +{ +set_Value ("IsPublic", new Boolean(IsPublic)); +} +/** Get Public. +@return Public can read entry */ +public boolean isPublic() +{ +Object oo = get_Value("IsPublic"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Entry Comment. +@param K_Comment_ID Knowledge Entry Comment */ +public void setK_Comment_ID (int K_Comment_ID) +{ +if (K_Comment_ID < 1) throw new IllegalArgumentException ("K_Comment_ID is mandatory."); +set_ValueNoCheck ("K_Comment_ID", new Integer(K_Comment_ID)); +} +/** Get Entry Comment. +@return Knowledge Entry Comment */ +public int getK_Comment_ID() +{ +Integer ii = (Integer)get_Value("K_Comment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getK_Comment_ID())); +} +/** Set Entry. +@param K_Entry_ID Knowledge Entry */ +public void setK_Entry_ID (int K_Entry_ID) +{ +if (K_Entry_ID < 1) throw new IllegalArgumentException ("K_Entry_ID is mandatory."); +set_ValueNoCheck ("K_Entry_ID", new Integer(K_Entry_ID)); +} +/** Get Entry. +@return Knowledge Entry */ +public int getK_Entry_ID() +{ +Integer ii = (Integer)get_Value("K_Entry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Rating. +@param Rating Classification or Importance */ +public void setRating (int Rating) +{ +set_Value ("Rating", new Integer(Rating)); +} +/** Get Rating. +@return Classification or Importance */ +public int getRating() +{ +Integer ii = (Integer)get_Value("Rating"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg == null) throw new IllegalArgumentException ("TextMsg is mandatory."); +if (TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Entry.java b/dbPort/src/org/compiere/model/X_K_Entry.java new file mode 100644 index 0000000000..5a377cda1f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Entry.java @@ -0,0 +1,275 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Entry + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.421 */ +public class X_K_Entry extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Entry_ID id +@param trxName transaction +*/ +public X_K_Entry (Properties ctx, int K_Entry_ID, String trxName) +{ +super (ctx, K_Entry_ID, trxName); +/** if (K_Entry_ID == 0) +{ +setIsPublic (true); // Y +setK_Entry_ID (0); +setK_Topic_ID (0); +setName (null); +setRating (0); +setTextMsg (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Entry (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=612 */ +public static final int Table_ID=612; + +/** TableName=K_Entry */ +public static final String Table_Name="K_Entry"; + +protected static KeyNamePair Model = new KeyNamePair(612,"K_Entry"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Entry[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Session. +@param AD_Session_ID User Session Online or Web */ +public void setAD_Session_ID (int AD_Session_ID) +{ +if (AD_Session_ID <= 0) set_ValueNoCheck ("AD_Session_ID", null); + else +set_ValueNoCheck ("AD_Session_ID", new Integer(AD_Session_ID)); +} +/** Get Session. +@return User Session Online or Web */ +public int getAD_Session_ID() +{ +Integer ii = (Integer)get_Value("AD_Session_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description URL. +@param DescriptionURL URL for the description */ +public void setDescriptionURL (String DescriptionURL) +{ +if (DescriptionURL != null && DescriptionURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DescriptionURL = DescriptionURL.substring(0,119); +} +set_Value ("DescriptionURL", DescriptionURL); +} +/** Get Description URL. +@return URL for the description */ +public String getDescriptionURL() +{ +return (String)get_Value("DescriptionURL"); +} +/** Set Public. +@param IsPublic Public can read entry */ +public void setIsPublic (boolean IsPublic) +{ +set_Value ("IsPublic", new Boolean(IsPublic)); +} +/** Get Public. +@return Public can read entry */ +public boolean isPublic() +{ +Object oo = get_Value("IsPublic"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Entry. +@param K_Entry_ID Knowledge Entry */ +public void setK_Entry_ID (int K_Entry_ID) +{ +if (K_Entry_ID < 1) throw new IllegalArgumentException ("K_Entry_ID is mandatory."); +set_ValueNoCheck ("K_Entry_ID", new Integer(K_Entry_ID)); +} +/** Get Entry. +@return Knowledge Entry */ +public int getK_Entry_ID() +{ +Integer ii = (Integer)get_Value("K_Entry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Knowledge Source. +@param K_Source_ID Source of a Knowledge Entry */ +public void setK_Source_ID (int K_Source_ID) +{ +if (K_Source_ID <= 0) set_Value ("K_Source_ID", null); + else +set_Value ("K_Source_ID", new Integer(K_Source_ID)); +} +/** Get Knowledge Source. +@return Source of a Knowledge Entry */ +public int getK_Source_ID() +{ +Integer ii = (Integer)get_Value("K_Source_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Knowledge Topic. +@param K_Topic_ID Knowledge Topic */ +public void setK_Topic_ID (int K_Topic_ID) +{ +if (K_Topic_ID < 1) throw new IllegalArgumentException ("K_Topic_ID is mandatory."); +set_ValueNoCheck ("K_Topic_ID", new Integer(K_Topic_ID)); +} +/** Get Knowledge Topic. +@return Knowledge Topic */ +public int getK_Topic_ID() +{ +Integer ii = (Integer)get_Value("K_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Keywords. +@param Keywords List of Keywords - separated by space, comma or semicolon */ +public void setKeywords (String Keywords) +{ +if (Keywords != null && Keywords.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Keywords = Keywords.substring(0,254); +} +set_Value ("Keywords", Keywords); +} +/** Get Keywords. +@return List of Keywords - separated by space, comma or semicolon */ +public String getKeywords() +{ +return (String)get_Value("Keywords"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Rating. +@param Rating Classification or Importance */ +public void setRating (int Rating) +{ +set_Value ("Rating", new Integer(Rating)); +} +/** Get Rating. +@return Classification or Importance */ +public int getRating() +{ +Integer ii = (Integer)get_Value("Rating"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg == null) throw new IllegalArgumentException ("TextMsg is mandatory."); +if (TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_EntryCategory.java b/dbPort/src/org/compiere/model/X_K_EntryCategory.java new file mode 100644 index 0000000000..d59b177a68 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_EntryCategory.java @@ -0,0 +1,141 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_EntryCategory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.453 */ +public class X_K_EntryCategory extends PO +{ +/** Standard Constructor +@param ctx context +@param K_EntryCategory_ID id +@param trxName transaction +*/ +public X_K_EntryCategory (Properties ctx, int K_EntryCategory_ID, String trxName) +{ +super (ctx, K_EntryCategory_ID, trxName); +/** if (K_EntryCategory_ID == 0) +{ +setK_CategoryValue_ID (0); +setK_Category_ID (0); +setK_Entry_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_EntryCategory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=611 */ +public static final int Table_ID=611; + +/** TableName=K_EntryCategory */ +public static final String Table_Name="K_EntryCategory"; + +protected static KeyNamePair Model = new KeyNamePair(611,"K_EntryCategory"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_EntryCategory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Category Value. +@param K_CategoryValue_ID The value of the category */ +public void setK_CategoryValue_ID (int K_CategoryValue_ID) +{ +if (K_CategoryValue_ID < 1) throw new IllegalArgumentException ("K_CategoryValue_ID is mandatory."); +set_Value ("K_CategoryValue_ID", new Integer(K_CategoryValue_ID)); +} +/** Get Category Value. +@return The value of the category */ +public int getK_CategoryValue_ID() +{ +Integer ii = (Integer)get_Value("K_CategoryValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getK_CategoryValue_ID())); +} +/** Set Knowledge Category. +@param K_Category_ID Knowledge Category */ +public void setK_Category_ID (int K_Category_ID) +{ +if (K_Category_ID < 1) throw new IllegalArgumentException ("K_Category_ID is mandatory."); +set_Value ("K_Category_ID", new Integer(K_Category_ID)); +} +/** Get Knowledge Category. +@return Knowledge Category */ +public int getK_Category_ID() +{ +Integer ii = (Integer)get_Value("K_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Entry. +@param K_Entry_ID Knowledge Entry */ +public void setK_Entry_ID (int K_Entry_ID) +{ +if (K_Entry_ID < 1) throw new IllegalArgumentException ("K_Entry_ID is mandatory."); +set_ValueNoCheck ("K_Entry_ID", new Integer(K_Entry_ID)); +} +/** Get Entry. +@return Knowledge Entry */ +public int getK_Entry_ID() +{ +Integer ii = (Integer)get_Value("K_Entry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_EntryRelated.java b/dbPort/src/org/compiere/model/X_K_EntryRelated.java new file mode 100644 index 0000000000..90ea3be8b4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_EntryRelated.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_EntryRelated + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.453 */ +public class X_K_EntryRelated extends PO +{ +/** Standard Constructor +@param ctx context +@param K_EntryRelated_ID id +@param trxName transaction +*/ +public X_K_EntryRelated (Properties ctx, int K_EntryRelated_ID, String trxName) +{ +super (ctx, K_EntryRelated_ID, trxName); +/** if (K_EntryRelated_ID == 0) +{ +setK_EntryRelated_ID (0); +setK_Entry_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_EntryRelated (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=610 */ +public static final int Table_ID=610; + +/** TableName=K_EntryRelated */ +public static final String Table_Name="K_EntryRelated"; + +protected static KeyNamePair Model = new KeyNamePair(610,"K_EntryRelated"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_EntryRelated[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** K_EntryRelated_ID AD_Reference_ID=285 */ +public static final int K_ENTRYRELATED_ID_AD_Reference_ID=285; +/** Set Related Entry. +@param K_EntryRelated_ID Related Entry for this Enntry */ +public void setK_EntryRelated_ID (int K_EntryRelated_ID) +{ +if (K_EntryRelated_ID < 1) throw new IllegalArgumentException ("K_EntryRelated_ID is mandatory."); +set_ValueNoCheck ("K_EntryRelated_ID", new Integer(K_EntryRelated_ID)); +} +/** Get Related Entry. +@return Related Entry for this Enntry */ +public int getK_EntryRelated_ID() +{ +Integer ii = (Integer)get_Value("K_EntryRelated_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getK_EntryRelated_ID())); +} +/** Set Entry. +@param K_Entry_ID Knowledge Entry */ +public void setK_Entry_ID (int K_Entry_ID) +{ +if (K_Entry_ID < 1) throw new IllegalArgumentException ("K_Entry_ID is mandatory."); +set_ValueNoCheck ("K_Entry_ID", new Integer(K_Entry_ID)); +} +/** Get Entry. +@return Knowledge Entry */ +public int getK_Entry_ID() +{ +Integer ii = (Integer)get_Value("K_Entry_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Index.java b/dbPort/src/org/compiere/model/X_K_Index.java new file mode 100644 index 0000000000..11ff25b198 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Index.java @@ -0,0 +1,239 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Index + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.468 */ +public class X_K_Index extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Index_ID id +@param trxName transaction +*/ +public X_K_Index (Properties ctx, int K_Index_ID, String trxName) +{ +super (ctx, K_Index_ID, trxName); +/** if (K_Index_ID == 0) +{ +setAD_Table_ID (0); +setK_INDEX_ID (0); +setKeyword (null); +setRecord_ID (0); +setSourceUpdated (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Index (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=900 */ +public static final int Table_ID=900; + +/** TableName=K_Index */ +public static final String Table_Name="K_Index"; + +protected static KeyNamePair Model = new KeyNamePair(900,"K_Index"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Index[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID <= 0) set_ValueNoCheck ("CM_WebProject_ID", null); + else +set_ValueNoCheck ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_ValueNoCheck ("C_DocType_ID", null); + else +set_ValueNoCheck ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Excerpt. +@param Excerpt Surrounding text of the keyword */ +public void setExcerpt (String Excerpt) +{ +if (Excerpt != null && Excerpt.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Excerpt = Excerpt.substring(0,1999); +} +set_ValueNoCheck ("Excerpt", Excerpt); +} +/** Get Excerpt. +@return Surrounding text of the keyword */ +public String getExcerpt() +{ +return (String)get_Value("Excerpt"); +} +/** Set Index. +@param K_INDEX_ID Text Search Index */ +public void setK_INDEX_ID (int K_INDEX_ID) +{ +if (K_INDEX_ID < 1) throw new IllegalArgumentException ("K_INDEX_ID is mandatory."); +set_ValueNoCheck ("K_INDEX_ID", new Integer(K_INDEX_ID)); +} +/** Get Index. +@return Text Search Index */ +public int getK_INDEX_ID() +{ +Integer ii = (Integer)get_Value("K_INDEX_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Keyword. +@param Keyword Case insensitive keyword */ +public void setKeyword (String Keyword) +{ +if (Keyword == null) throw new IllegalArgumentException ("Keyword is mandatory."); +if (Keyword.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Keyword = Keyword.substring(0,254); +} +set_ValueNoCheck ("Keyword", Keyword); +} +/** Get Keyword. +@return Case insensitive keyword */ +public String getKeyword() +{ +return (String)get_Value("Keyword"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getKeyword()); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_ValueNoCheck ("R_RequestType_ID", null); + else +set_ValueNoCheck ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Source Updated. +@param SourceUpdated Date the source document was updated */ +public void setSourceUpdated (Timestamp SourceUpdated) +{ +if (SourceUpdated == null) throw new IllegalArgumentException ("SourceUpdated is mandatory."); +set_Value ("SourceUpdated", SourceUpdated); +} +/** Get Source Updated. +@return Date the source document was updated */ +public Timestamp getSourceUpdated() +{ +return (Timestamp)get_Value("SourceUpdated"); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_IndexLog.java b/dbPort/src/org/compiere/model/X_K_IndexLog.java new file mode 100644 index 0000000000..da4d50667d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_IndexLog.java @@ -0,0 +1,175 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_IndexLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.484 */ +public class X_K_IndexLog extends PO +{ +/** Standard Constructor +@param ctx context +@param K_IndexLog_ID id +@param trxName transaction +*/ +public X_K_IndexLog (Properties ctx, int K_IndexLog_ID, String trxName) +{ +super (ctx, K_IndexLog_ID, trxName); +/** if (K_IndexLog_ID == 0) +{ +setIndexQuery (null); +setIndexQueryResult (0); +setK_IndexLog_ID (0); +setQuerySource (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_IndexLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=899 */ +public static final int Table_ID=899; + +/** TableName=K_IndexLog */ +public static final String Table_Name="K_IndexLog"; + +protected static KeyNamePair Model = new KeyNamePair(899,"K_IndexLog"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_IndexLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Index Query. +@param IndexQuery Text Search Query */ +public void setIndexQuery (String IndexQuery) +{ +if (IndexQuery == null) throw new IllegalArgumentException ("IndexQuery is mandatory."); +if (IndexQuery.length() > 255) +{ +log.warning("Length > 255 - truncated"); +IndexQuery = IndexQuery.substring(0,254); +} +set_ValueNoCheck ("IndexQuery", IndexQuery); +} +/** Get Index Query. +@return Text Search Query */ +public String getIndexQuery() +{ +return (String)get_Value("IndexQuery"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getIndexQuery()); +} +/** Set Query Result. +@param IndexQueryResult Result of the text query */ +public void setIndexQueryResult (int IndexQueryResult) +{ +set_ValueNoCheck ("IndexQueryResult", new Integer(IndexQueryResult)); +} +/** Get Query Result. +@return Result of the text query */ +public int getIndexQueryResult() +{ +Integer ii = (Integer)get_Value("IndexQueryResult"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Index Log. +@param K_IndexLog_ID Text search log */ +public void setK_IndexLog_ID (int K_IndexLog_ID) +{ +if (K_IndexLog_ID < 1) throw new IllegalArgumentException ("K_IndexLog_ID is mandatory."); +set_ValueNoCheck ("K_IndexLog_ID", new Integer(K_IndexLog_ID)); +} +/** Get Index Log. +@return Text search log */ +public int getK_IndexLog_ID() +{ +Integer ii = (Integer)get_Value("K_IndexLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** QuerySource AD_Reference_ID=391 */ +public static final int QUERYSOURCE_AD_Reference_ID=391; +/** Collaboration Management = C */ +public static final String QUERYSOURCE_CollaborationManagement = "C"; +/** HTML Client = H */ +public static final String QUERYSOURCE_HTMLClient = "H"; +/** Java Client = J */ +public static final String QUERYSOURCE_JavaClient = "J"; +/** Self Service = W */ +public static final String QUERYSOURCE_SelfService = "W"; +/** Set Query Source. +@param QuerySource Source of the Query */ +public void setQuerySource (String QuerySource) +{ +if (QuerySource == null) throw new IllegalArgumentException ("QuerySource is mandatory"); +if (QuerySource.equals("C") || QuerySource.equals("H") || QuerySource.equals("J") || QuerySource.equals("W")); + else throw new IllegalArgumentException ("QuerySource Invalid value - " + QuerySource + " - Reference_ID=391 - C - H - J - W"); +if (QuerySource.length() > 1) +{ +log.warning("Length > 1 - truncated"); +QuerySource = QuerySource.substring(0,0); +} +set_Value ("QuerySource", QuerySource); +} +/** Get Query Source. +@return Source of the Query */ +public String getQuerySource() +{ +return (String)get_Value("QuerySource"); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_IndexStop.java b/dbPort/src/org/compiere/model/X_K_IndexStop.java new file mode 100644 index 0000000000..f15088c8b8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_IndexStop.java @@ -0,0 +1,195 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_IndexStop + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.484 */ +public class X_K_IndexStop extends PO +{ +/** Standard Constructor +@param ctx context +@param K_IndexStop_ID id +@param trxName transaction +*/ +public X_K_IndexStop (Properties ctx, int K_IndexStop_ID, String trxName) +{ +super (ctx, K_IndexStop_ID, trxName); +/** if (K_IndexStop_ID == 0) +{ +setIsManual (true); // Y +setK_IndexStop_ID (0); +setKeyword (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_IndexStop (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=901 */ +public static final int Table_ID=901; + +/** TableName=K_IndexStop */ +public static final String Table_Name="K_IndexStop"; + +protected static KeyNamePair Model = new KeyNamePair(901,"K_IndexStop"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_IndexStop[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Web Project. +@param CM_WebProject_ID A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public void setCM_WebProject_ID (int CM_WebProject_ID) +{ +if (CM_WebProject_ID <= 0) set_Value ("CM_WebProject_ID", null); + else +set_Value ("CM_WebProject_ID", new Integer(CM_WebProject_ID)); +} +/** Get Web Project. +@return A web project is the main data container for Containers, URLs, Ads, Media etc. */ +public int getCM_WebProject_ID() +{ +Integer ii = (Integer)get_Value("CM_WebProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Index Stop. +@param K_IndexStop_ID Keyword not to be indexed */ +public void setK_IndexStop_ID (int K_IndexStop_ID) +{ +if (K_IndexStop_ID < 1) throw new IllegalArgumentException ("K_IndexStop_ID is mandatory."); +set_ValueNoCheck ("K_IndexStop_ID", new Integer(K_IndexStop_ID)); +} +/** Get Index Stop. +@return Keyword not to be indexed */ +public int getK_IndexStop_ID() +{ +Integer ii = (Integer)get_Value("K_IndexStop_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Keyword. +@param Keyword Case insensitive keyword */ +public void setKeyword (String Keyword) +{ +if (Keyword == null) throw new IllegalArgumentException ("Keyword is mandatory."); +if (Keyword.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Keyword = Keyword.substring(0,254); +} +set_Value ("Keyword", Keyword); +} +/** Get Keyword. +@return Case insensitive keyword */ +public String getKeyword() +{ +return (String)get_Value("Keyword"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getKeyword()); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_Value ("R_RequestType_ID", null); + else +set_Value ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Source.java b/dbPort/src/org/compiere/model/X_K_Source.java new file mode 100644 index 0000000000..ea6a7118ab --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Source.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Source + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.5 */ +public class X_K_Source extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Source_ID id +@param trxName transaction +*/ +public X_K_Source (Properties ctx, int K_Source_ID, String trxName) +{ +super (ctx, K_Source_ID, trxName); +/** if (K_Source_ID == 0) +{ +setK_Source_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Source (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=609 */ +public static final int Table_ID=609; + +/** TableName=K_Source */ +public static final String Table_Name="K_Source"; + +protected static KeyNamePair Model = new KeyNamePair(609,"K_Source"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Source[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description URL. +@param DescriptionURL URL for the description */ +public void setDescriptionURL (String DescriptionURL) +{ +if (DescriptionURL != null && DescriptionURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DescriptionURL = DescriptionURL.substring(0,119); +} +set_Value ("DescriptionURL", DescriptionURL); +} +/** Get Description URL. +@return URL for the description */ +public String getDescriptionURL() +{ +return (String)get_Value("DescriptionURL"); +} +/** Set Knowledge Source. +@param K_Source_ID Source of a Knowledge Entry */ +public void setK_Source_ID (int K_Source_ID) +{ +if (K_Source_ID < 1) throw new IllegalArgumentException ("K_Source_ID is mandatory."); +set_ValueNoCheck ("K_Source_ID", new Integer(K_Source_ID)); +} +/** Get Knowledge Source. +@return Source of a Knowledge Entry */ +public int getK_Source_ID() +{ +Integer ii = (Integer)get_Value("K_Source_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Synonym.java b/dbPort/src/org/compiere/model/X_K_Synonym.java new file mode 100644 index 0000000000..5e85d96611 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Synonym.java @@ -0,0 +1,168 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Synonym + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.515 */ +public class X_K_Synonym extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Synonym_ID id +@param trxName transaction +*/ +public X_K_Synonym (Properties ctx, int K_Synonym_ID, String trxName) +{ +super (ctx, K_Synonym_ID, trxName); +/** if (K_Synonym_ID == 0) +{ +setAD_Language (null); +setK_Synonym_ID (0); +setName (null); +setSynonymName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Synonym (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=608 */ +public static final int Table_ID=608; + +/** TableName=K_Synonym */ +public static final String Table_Name="K_Synonym"; + +protected static KeyNamePair Model = new KeyNamePair(608,"K_Synonym"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Synonym[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=106 */ +public static final int AD_LANGUAGE_AD_Reference_ID=106; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_Value ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} +/** Set Knowledge Synonym. +@param K_Synonym_ID Knowlege Keyword Synonym */ +public void setK_Synonym_ID (int K_Synonym_ID) +{ +if (K_Synonym_ID < 1) throw new IllegalArgumentException ("K_Synonym_ID is mandatory."); +set_ValueNoCheck ("K_Synonym_ID", new Integer(K_Synonym_ID)); +} +/** Get Knowledge Synonym. +@return Knowlege Keyword Synonym */ +public int getK_Synonym_ID() +{ +Integer ii = (Integer)get_Value("K_Synonym_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Synonym Name. +@param SynonymName The synonym for the name */ +public void setSynonymName (String SynonymName) +{ +if (SynonymName == null) throw new IllegalArgumentException ("SynonymName is mandatory."); +if (SynonymName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SynonymName = SynonymName.substring(0,59); +} +set_Value ("SynonymName", SynonymName); +} +/** Get Synonym Name. +@return The synonym for the name */ +public String getSynonymName() +{ +return (String)get_Value("SynonymName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Topic.java b/dbPort/src/org/compiere/model/X_K_Topic.java new file mode 100644 index 0000000000..f9894b721e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Topic.java @@ -0,0 +1,216 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Topic + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.515 */ +public class X_K_Topic extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Topic_ID id +@param trxName transaction +*/ +public X_K_Topic (Properties ctx, int K_Topic_ID, String trxName) +{ +super (ctx, K_Topic_ID, trxName); +/** if (K_Topic_ID == 0) +{ +setIsPublic (true); // Y +setIsPublicWrite (true); // Y +setK_Topic_ID (0); +setK_Type_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Topic (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=607 */ +public static final int Table_ID=607; + +/** TableName=K_Topic */ +public static final String Table_Name="K_Topic"; + +protected static KeyNamePair Model = new KeyNamePair(607,"K_Topic"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Topic[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Public. +@param IsPublic Public can read entry */ +public void setIsPublic (boolean IsPublic) +{ +set_Value ("IsPublic", new Boolean(IsPublic)); +} +/** Get Public. +@return Public can read entry */ +public boolean isPublic() +{ +Object oo = get_Value("IsPublic"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Public Write. +@param IsPublicWrite Public can write entries */ +public void setIsPublicWrite (boolean IsPublicWrite) +{ +set_Value ("IsPublicWrite", new Boolean(IsPublicWrite)); +} +/** Get Public Write. +@return Public can write entries */ +public boolean isPublicWrite() +{ +Object oo = get_Value("IsPublicWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Knowledge Topic. +@param K_Topic_ID Knowledge Topic */ +public void setK_Topic_ID (int K_Topic_ID) +{ +if (K_Topic_ID < 1) throw new IllegalArgumentException ("K_Topic_ID is mandatory."); +set_ValueNoCheck ("K_Topic_ID", new Integer(K_Topic_ID)); +} +/** Get Knowledge Topic. +@return Knowledge Topic */ +public int getK_Topic_ID() +{ +Integer ii = (Integer)get_Value("K_Topic_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Knowldge Type. +@param K_Type_ID Knowledge Type */ +public void setK_Type_ID (int K_Type_ID) +{ +if (K_Type_ID < 1) throw new IllegalArgumentException ("K_Type_ID is mandatory."); +set_ValueNoCheck ("K_Type_ID", new Integer(K_Type_ID)); +} +/** Get Knowldge Type. +@return Knowledge Type */ +public int getK_Type_ID() +{ +Integer ii = (Integer)get_Value("K_Type_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_K_Type.java b/dbPort/src/org/compiere/model/X_K_Type.java new file mode 100644 index 0000000000..94e922f056 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_K_Type.java @@ -0,0 +1,200 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for K_Type + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.531 */ +public class X_K_Type extends PO +{ +/** Standard Constructor +@param ctx context +@param K_Type_ID id +@param trxName transaction +*/ +public X_K_Type (Properties ctx, int K_Type_ID, String trxName) +{ +super (ctx, K_Type_ID, trxName); +/** if (K_Type_ID == 0) +{ +setIsPublic (true); // Y +setIsPublicWrite (true); // Y +setK_Type_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_K_Type (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=606 */ +public static final int Table_ID=606; + +/** TableName=K_Type */ +public static final String Table_Name="K_Type"; + +protected static KeyNamePair Model = new KeyNamePair(606,"K_Type"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_K_Type[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Public. +@param IsPublic Public can read entry */ +public void setIsPublic (boolean IsPublic) +{ +set_Value ("IsPublic", new Boolean(IsPublic)); +} +/** Get Public. +@return Public can read entry */ +public boolean isPublic() +{ +Object oo = get_Value("IsPublic"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Public Write. +@param IsPublicWrite Public can write entries */ +public void setIsPublicWrite (boolean IsPublicWrite) +{ +set_Value ("IsPublicWrite", new Boolean(IsPublicWrite)); +} +/** Get Public Write. +@return Public can write entries */ +public boolean isPublicWrite() +{ +Object oo = get_Value("IsPublicWrite"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Knowldge Type. +@param K_Type_ID Knowledge Type */ +public void setK_Type_ID (int K_Type_ID) +{ +if (K_Type_ID < 1) throw new IllegalArgumentException ("K_Type_ID is mandatory."); +set_ValueNoCheck ("K_Type_ID", new Integer(K_Type_ID)); +} +/** Get Knowldge Type. +@return Knowledge Type */ +public int getK_Type_ID() +{ +Integer ii = (Integer)get_Value("K_Type_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Attribute.java b/dbPort/src/org/compiere/model/X_M_Attribute.java new file mode 100644 index 0000000000..1c0f609d30 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Attribute.java @@ -0,0 +1,229 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Attribute + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.531 */ +public class X_M_Attribute extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Attribute_ID id +@param trxName transaction +*/ +public X_M_Attribute (Properties ctx, int M_Attribute_ID, String trxName) +{ +super (ctx, M_Attribute_ID, trxName); +/** if (M_Attribute_ID == 0) +{ +setAttributeValueType (null); // S +setIsInstanceAttribute (false); +setIsMandatory (false); +setM_Attribute_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Attribute (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=562 */ +public static final int Table_ID=562; + +/** TableName=M_Attribute */ +public static final String Table_Name="M_Attribute"; + +protected static KeyNamePair Model = new KeyNamePair(562,"M_Attribute"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Attribute[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AttributeValueType AD_Reference_ID=326 */ +public static final int ATTRIBUTEVALUETYPE_AD_Reference_ID=326; +/** List = L */ +public static final String ATTRIBUTEVALUETYPE_List = "L"; +/** Number = N */ +public static final String ATTRIBUTEVALUETYPE_Number = "N"; +/** String (max 40) = S */ +public static final String ATTRIBUTEVALUETYPE_StringMax40 = "S"; +/** Set Attribute Value Type. +@param AttributeValueType Type of Attribute Value */ +public void setAttributeValueType (String AttributeValueType) +{ +if (AttributeValueType == null) throw new IllegalArgumentException ("AttributeValueType is mandatory"); +if (AttributeValueType.equals("L") || AttributeValueType.equals("N") || AttributeValueType.equals("S")); + else throw new IllegalArgumentException ("AttributeValueType Invalid value - " + AttributeValueType + " - Reference_ID=326 - L - N - S"); +if (AttributeValueType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AttributeValueType = AttributeValueType.substring(0,0); +} +set_Value ("AttributeValueType", AttributeValueType); +} +/** Get Attribute Value Type. +@return Type of Attribute Value */ +public String getAttributeValueType() +{ +return (String)get_Value("AttributeValueType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Instance Attribute. +@param IsInstanceAttribute The product attribute is specific to the instance (like Serial No, Lot or Guarantee Date) */ +public void setIsInstanceAttribute (boolean IsInstanceAttribute) +{ +set_Value ("IsInstanceAttribute", new Boolean(IsInstanceAttribute)); +} +/** Get Instance Attribute. +@return The product attribute is specific to the instance (like Serial No, Lot or Guarantee Date) */ +public boolean isInstanceAttribute() +{ +Object oo = get_Value("IsInstanceAttribute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory. +@param IsMandatory Data entry is required in this column */ +public void setIsMandatory (boolean IsMandatory) +{ +set_Value ("IsMandatory", new Boolean(IsMandatory)); +} +/** Get Mandatory. +@return Data entry is required in this column */ +public boolean isMandatory() +{ +Object oo = get_Value("IsMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Attribute Search. +@param M_AttributeSearch_ID Common Search Attribute */ +public void setM_AttributeSearch_ID (int M_AttributeSearch_ID) +{ +if (M_AttributeSearch_ID <= 0) set_Value ("M_AttributeSearch_ID", null); + else +set_Value ("M_AttributeSearch_ID", new Integer(M_AttributeSearch_ID)); +} +/** Get Attribute Search. +@return Common Search Attribute */ +public int getM_AttributeSearch_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSearch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute. +@param M_Attribute_ID Product Attribute */ +public void setM_Attribute_ID (int M_Attribute_ID) +{ +if (M_Attribute_ID < 1) throw new IllegalArgumentException ("M_Attribute_ID is mandatory."); +set_ValueNoCheck ("M_Attribute_ID", new Integer(M_Attribute_ID)); +} +/** Get Attribute. +@return Product Attribute */ +public int getM_Attribute_ID() +{ +Integer ii = (Integer)get_Value("M_Attribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeInstance.java b/dbPort/src/org/compiere/model/X_M_AttributeInstance.java new file mode 100644 index 0000000000..8e5c0565cf --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeInstance.java @@ -0,0 +1,172 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeInstance + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.546 */ +public class X_M_AttributeInstance extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeInstance_ID id +@param trxName transaction +*/ +public X_M_AttributeInstance (Properties ctx, int M_AttributeInstance_ID, String trxName) +{ +super (ctx, M_AttributeInstance_ID, trxName); +/** if (M_AttributeInstance_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_Attribute_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeInstance (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=561 */ +public static final int Table_ID=561; + +/** TableName=M_AttributeInstance */ +public static final String Table_Name="M_AttributeInstance"; + +protected static KeyNamePair Model = new KeyNamePair(561,"M_AttributeInstance"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeInstance[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Value. +@param M_AttributeValue_ID Product Attribute Value */ +public void setM_AttributeValue_ID (int M_AttributeValue_ID) +{ +if (M_AttributeValue_ID <= 0) set_Value ("M_AttributeValue_ID", null); + else +set_Value ("M_AttributeValue_ID", new Integer(M_AttributeValue_ID)); +} +/** Get Attribute Value. +@return Product Attribute Value */ +public int getM_AttributeValue_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_AttributeValue_ID())); +} +/** Set Attribute. +@param M_Attribute_ID Product Attribute */ +public void setM_Attribute_ID (int M_Attribute_ID) +{ +if (M_Attribute_ID < 1) throw new IllegalArgumentException ("M_Attribute_ID is mandatory."); +set_ValueNoCheck ("M_Attribute_ID", new Integer(M_Attribute_ID)); +} +/** Get Attribute. +@return Product Attribute */ +public int getM_Attribute_ID() +{ +Integer ii = (Integer)get_Value("M_Attribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value != null && Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Value. +@param ValueNumber Numeric Value */ +public void setValueNumber (BigDecimal ValueNumber) +{ +set_Value ("ValueNumber", ValueNumber); +} +/** Get Value. +@return Numeric Value */ +public BigDecimal getValueNumber() +{ +BigDecimal bd = (BigDecimal)get_Value("ValueNumber"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeSearch.java b/dbPort/src/org/compiere/model/X_M_AttributeSearch.java new file mode 100644 index 0000000000..5727e8118e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeSearch.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeSearch + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.562 */ +public class X_M_AttributeSearch extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeSearch_ID id +@param trxName transaction +*/ +public X_M_AttributeSearch (Properties ctx, int M_AttributeSearch_ID, String trxName) +{ +super (ctx, M_AttributeSearch_ID, trxName); +/** if (M_AttributeSearch_ID == 0) +{ +setM_AttributeSearch_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeSearch (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=564 */ +public static final int Table_ID=564; + +/** TableName=M_AttributeSearch */ +public static final String Table_Name="M_AttributeSearch"; + +protected static KeyNamePair Model = new KeyNamePair(564,"M_AttributeSearch"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeSearch[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Attribute Search. +@param M_AttributeSearch_ID Common Search Attribute */ +public void setM_AttributeSearch_ID (int M_AttributeSearch_ID) +{ +if (M_AttributeSearch_ID < 1) throw new IllegalArgumentException ("M_AttributeSearch_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSearch_ID", new Integer(M_AttributeSearch_ID)); +} +/** Get Attribute Search. +@return Common Search Attribute */ +public int getM_AttributeSearch_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSearch_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeSet.java b/dbPort/src/org/compiere/model/X_M_AttributeSet.java new file mode 100644 index 0000000000..b0b844542d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeSet.java @@ -0,0 +1,422 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeSet + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.562 */ +public class X_M_AttributeSet extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeSet_ID id +@param trxName transaction +*/ +public X_M_AttributeSet (Properties ctx, int M_AttributeSet_ID, String trxName) +{ +super (ctx, M_AttributeSet_ID, trxName); +/** if (M_AttributeSet_ID == 0) +{ +setIsGuaranteeDate (false); +setIsGuaranteeDateMandatory (false); +setIsInstanceAttribute (false); +setIsLot (false); +setIsLotMandatory (false); +setIsSerNo (false); +setIsSerNoMandatory (false); +setM_AttributeSet_ID (0); +setMandatoryType (null); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeSet (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=560 */ +public static final int Table_ID=560; + +/** TableName=M_AttributeSet */ +public static final String Table_Name="M_AttributeSet"; + +protected static KeyNamePair Model = new KeyNamePair(560,"M_AttributeSet"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeSet[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Guarantee Days. +@param GuaranteeDays Number of days the product is guaranteed or available */ +public void setGuaranteeDays (int GuaranteeDays) +{ +set_Value ("GuaranteeDays", new Integer(GuaranteeDays)); +} +/** Get Guarantee Days. +@return Number of days the product is guaranteed or available */ +public int getGuaranteeDays() +{ +Integer ii = (Integer)get_Value("GuaranteeDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Guarantee Date. +@param IsGuaranteeDate Product has Guarantee or Expiry Date */ +public void setIsGuaranteeDate (boolean IsGuaranteeDate) +{ +set_Value ("IsGuaranteeDate", new Boolean(IsGuaranteeDate)); +} +/** Get Guarantee Date. +@return Product has Guarantee or Expiry Date */ +public boolean isGuaranteeDate() +{ +Object oo = get_Value("IsGuaranteeDate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory Guarantee Date. +@param IsGuaranteeDateMandatory The entry of a Guarantee Date is mandatory when creating a Product Instance */ +public void setIsGuaranteeDateMandatory (boolean IsGuaranteeDateMandatory) +{ +set_Value ("IsGuaranteeDateMandatory", new Boolean(IsGuaranteeDateMandatory)); +} +/** Get Mandatory Guarantee Date. +@return The entry of a Guarantee Date is mandatory when creating a Product Instance */ +public boolean isGuaranteeDateMandatory() +{ +Object oo = get_Value("IsGuaranteeDateMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Instance Attribute. +@param IsInstanceAttribute The product attribute is specific to the instance (like Serial No, Lot or Guarantee Date) */ +public void setIsInstanceAttribute (boolean IsInstanceAttribute) +{ +set_Value ("IsInstanceAttribute", new Boolean(IsInstanceAttribute)); +} +/** Get Instance Attribute. +@return The product attribute is specific to the instance (like Serial No, Lot or Guarantee Date) */ +public boolean isInstanceAttribute() +{ +Object oo = get_Value("IsInstanceAttribute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Lot. +@param IsLot The product instances have a Lot Number */ +public void setIsLot (boolean IsLot) +{ +set_Value ("IsLot", new Boolean(IsLot)); +} +/** Get Lot. +@return The product instances have a Lot Number */ +public boolean isLot() +{ +Object oo = get_Value("IsLot"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory Lot. +@param IsLotMandatory The entry of Lot info is mandatory when creating a Product Instance */ +public void setIsLotMandatory (boolean IsLotMandatory) +{ +set_Value ("IsLotMandatory", new Boolean(IsLotMandatory)); +} +/** Get Mandatory Lot. +@return The entry of Lot info is mandatory when creating a Product Instance */ +public boolean isLotMandatory() +{ +Object oo = get_Value("IsLotMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Serial No. +@param IsSerNo The product instances have Serial Numbers */ +public void setIsSerNo (boolean IsSerNo) +{ +set_Value ("IsSerNo", new Boolean(IsSerNo)); +} +/** Get Serial No. +@return The product instances have Serial Numbers */ +public boolean isSerNo() +{ +Object oo = get_Value("IsSerNo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Mandatory Serial No. +@param IsSerNoMandatory The entry of a Serial No is mandatory when creating a Product Instance */ +public void setIsSerNoMandatory (boolean IsSerNoMandatory) +{ +set_Value ("IsSerNoMandatory", new Boolean(IsSerNoMandatory)); +} +/** Get Mandatory Serial No. +@return The entry of a Serial No is mandatory when creating a Product Instance */ +public boolean isSerNoMandatory() +{ +Object oo = get_Value("IsSerNoMandatory"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Lot Char End Overwrite. +@param LotCharEOverwrite Lot/Batch End Indicator overwrite - default ïŋ― */ +public void setLotCharEOverwrite (String LotCharEOverwrite) +{ +if (LotCharEOverwrite != null && LotCharEOverwrite.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LotCharEOverwrite = LotCharEOverwrite.substring(0,0); +} +set_Value ("LotCharEOverwrite", LotCharEOverwrite); +} +/** Get Lot Char End Overwrite. +@return Lot/Batch End Indicator overwrite - default ïŋ― */ +public String getLotCharEOverwrite() +{ +return (String)get_Value("LotCharEOverwrite"); +} +/** Set Lot Char Start Overwrite. +@param LotCharSOverwrite Lot/Batch Start Indicator overwrite - default ïŋ― */ +public void setLotCharSOverwrite (String LotCharSOverwrite) +{ +if (LotCharSOverwrite != null && LotCharSOverwrite.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LotCharSOverwrite = LotCharSOverwrite.substring(0,0); +} +set_Value ("LotCharSOverwrite", LotCharSOverwrite); +} +/** Get Lot Char Start Overwrite. +@return Lot/Batch Start Indicator overwrite - default ïŋ― */ +public String getLotCharSOverwrite() +{ +return (String)get_Value("LotCharSOverwrite"); +} +/** Set Attribute Set. +@param M_AttributeSet_ID Product Attribute Set */ +public void setM_AttributeSet_ID (int M_AttributeSet_ID) +{ +if (M_AttributeSet_ID < 0) throw new IllegalArgumentException ("M_AttributeSet_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSet_ID", new Integer(M_AttributeSet_ID)); +} +/** Get Attribute Set. +@return Product Attribute Set */ +public int getM_AttributeSet_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Lot Control. +@param M_LotCtl_ID Product Lot Control */ +public void setM_LotCtl_ID (int M_LotCtl_ID) +{ +if (M_LotCtl_ID <= 0) set_Value ("M_LotCtl_ID", null); + else +set_Value ("M_LotCtl_ID", new Integer(M_LotCtl_ID)); +} +/** Get Lot Control. +@return Product Lot Control */ +public int getM_LotCtl_ID() +{ +Integer ii = (Integer)get_Value("M_LotCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Serial No Control. +@param M_SerNoCtl_ID Product Serial Number Control */ +public void setM_SerNoCtl_ID (int M_SerNoCtl_ID) +{ +if (M_SerNoCtl_ID <= 0) set_Value ("M_SerNoCtl_ID", null); + else +set_Value ("M_SerNoCtl_ID", new Integer(M_SerNoCtl_ID)); +} +/** Get Serial No Control. +@return Product Serial Number Control */ +public int getM_SerNoCtl_ID() +{ +Integer ii = (Integer)get_Value("M_SerNoCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** MandatoryType AD_Reference_ID=324 */ +public static final int MANDATORYTYPE_AD_Reference_ID=324; +/** Not Mandatary = N */ +public static final String MANDATORYTYPE_NotMandatary = "N"; +/** When Shipping = S */ +public static final String MANDATORYTYPE_WhenShipping = "S"; +/** Always Mandatory = Y */ +public static final String MANDATORYTYPE_AlwaysMandatory = "Y"; +/** Set Mandatory Type. +@param MandatoryType The specification of a Product Attribute Instance is mandatory */ +public void setMandatoryType (String MandatoryType) +{ +if (MandatoryType == null) throw new IllegalArgumentException ("MandatoryType is mandatory"); +if (MandatoryType.equals("N") || MandatoryType.equals("S") || MandatoryType.equals("Y")); + else throw new IllegalArgumentException ("MandatoryType Invalid value - " + MandatoryType + " - Reference_ID=324 - N - S - Y"); +if (MandatoryType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MandatoryType = MandatoryType.substring(0,0); +} +set_Value ("MandatoryType", MandatoryType); +} +/** Get Mandatory Type. +@return The specification of a Product Attribute Instance is mandatory */ +public String getMandatoryType() +{ +return (String)get_Value("MandatoryType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set SerNo Char End Overwrite. +@param SerNoCharEOverwrite Serial Number End Indicator overwrite - default empty */ +public void setSerNoCharEOverwrite (String SerNoCharEOverwrite) +{ +if (SerNoCharEOverwrite != null && SerNoCharEOverwrite.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SerNoCharEOverwrite = SerNoCharEOverwrite.substring(0,0); +} +set_Value ("SerNoCharEOverwrite", SerNoCharEOverwrite); +} +/** Get SerNo Char End Overwrite. +@return Serial Number End Indicator overwrite - default empty */ +public String getSerNoCharEOverwrite() +{ +return (String)get_Value("SerNoCharEOverwrite"); +} +/** Set SerNo Char Start Overwrite. +@param SerNoCharSOverwrite Serial Number Start Indicator overwrite - default # */ +public void setSerNoCharSOverwrite (String SerNoCharSOverwrite) +{ +if (SerNoCharSOverwrite != null && SerNoCharSOverwrite.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SerNoCharSOverwrite = SerNoCharSOverwrite.substring(0,0); +} +set_Value ("SerNoCharSOverwrite", SerNoCharSOverwrite); +} +/** Get SerNo Char Start Overwrite. +@return Serial Number Start Indicator overwrite - default # */ +public String getSerNoCharSOverwrite() +{ +return (String)get_Value("SerNoCharSOverwrite"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeSetExclude.java b/dbPort/src/org/compiere/model/X_M_AttributeSetExclude.java new file mode 100644 index 0000000000..cf29536a23 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeSetExclude.java @@ -0,0 +1,154 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeSetExclude + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.578 */ +public class X_M_AttributeSetExclude extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeSetExclude_ID id +@param trxName transaction +*/ +public X_M_AttributeSetExclude (Properties ctx, int M_AttributeSetExclude_ID, String trxName) +{ +super (ctx, M_AttributeSetExclude_ID, trxName); +/** if (M_AttributeSetExclude_ID == 0) +{ +setAD_Table_ID (0); +setIsSOTrx (false); +setM_AttributeSetExclude_ID (0); +setM_AttributeSet_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeSetExclude (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=809 */ +public static final int Table_ID=809; + +/** TableName=M_AttributeSetExclude */ +public static final String Table_Name="M_AttributeSetExclude"; + +protected static KeyNamePair Model = new KeyNamePair(809,"M_AttributeSetExclude"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeSetExclude[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Exclude Attribute Set. +@param M_AttributeSetExclude_ID Exclude the ability to enter Attribute Sets */ +public void setM_AttributeSetExclude_ID (int M_AttributeSetExclude_ID) +{ +if (M_AttributeSetExclude_ID < 1) throw new IllegalArgumentException ("M_AttributeSetExclude_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetExclude_ID", new Integer(M_AttributeSetExclude_ID)); +} +/** Get Exclude Attribute Set. +@return Exclude the ability to enter Attribute Sets */ +public int getM_AttributeSetExclude_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetExclude_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set. +@param M_AttributeSet_ID Product Attribute Set */ +public void setM_AttributeSet_ID (int M_AttributeSet_ID) +{ +if (M_AttributeSet_ID < 0) throw new IllegalArgumentException ("M_AttributeSet_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSet_ID", new Integer(M_AttributeSet_ID)); +} +/** Get Attribute Set. +@return Product Attribute Set */ +public int getM_AttributeSet_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeSetInstance.java b/dbPort/src/org/compiere/model/X_M_AttributeSetInstance.java new file mode 100644 index 0000000000..64f6b7f24b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeSetInstance.java @@ -0,0 +1,204 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeSetInstance + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.593 */ +public class X_M_AttributeSetInstance extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeSetInstance_ID id +@param trxName transaction +*/ +public X_M_AttributeSetInstance (Properties ctx, int M_AttributeSetInstance_ID, String trxName) +{ +super (ctx, M_AttributeSetInstance_ID, trxName); +/** if (M_AttributeSetInstance_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_AttributeSet_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeSetInstance (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=559 */ +public static final int Table_ID=559; + +/** TableName=M_AttributeSetInstance */ +public static final String Table_Name="M_AttributeSetInstance"; + +protected static KeyNamePair Model = new KeyNamePair(559,"M_AttributeSetInstance"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeSetInstance[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Guarantee Date. +@param GuaranteeDate Date when guarantee expires */ +public void setGuaranteeDate (Timestamp GuaranteeDate) +{ +set_Value ("GuaranteeDate", GuaranteeDate); +} +/** Get Guarantee Date. +@return Date when guarantee expires */ +public Timestamp getGuaranteeDate() +{ +return (Timestamp)get_Value("GuaranteeDate"); +} +/** Set Lot No. +@param Lot Lot number (alphanumeric) */ +public void setLot (String Lot) +{ +if (Lot != null && Lot.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Lot = Lot.substring(0,39); +} +set_Value ("Lot", Lot); +} +/** Get Lot No. +@return Lot number (alphanumeric) */ +public String getLot() +{ +return (String)get_Value("Lot"); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_AttributeSetInstance_ID())); +} +/** Set Attribute Set. +@param M_AttributeSet_ID Product Attribute Set */ +public void setM_AttributeSet_ID (int M_AttributeSet_ID) +{ +if (M_AttributeSet_ID < 0) throw new IllegalArgumentException ("M_AttributeSet_ID is mandatory."); +set_Value ("M_AttributeSet_ID", new Integer(M_AttributeSet_ID)); +} +/** Get Attribute Set. +@return Product Attribute Set */ +public int getM_AttributeSet_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Lot. +@param M_Lot_ID Product Lot Definition */ +public void setM_Lot_ID (int M_Lot_ID) +{ +if (M_Lot_ID <= 0) set_Value ("M_Lot_ID", null); + else +set_Value ("M_Lot_ID", new Integer(M_Lot_ID)); +} +/** Get Lot. +@return Product Lot Definition */ +public int getM_Lot_ID() +{ +Integer ii = (Integer)get_Value("M_Lot_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Serial No. +@param SerNo Product Serial Number */ +public void setSerNo (String SerNo) +{ +if (SerNo != null && SerNo.length() > 40) +{ +log.warning("Length > 40 - truncated"); +SerNo = SerNo.substring(0,39); +} +set_Value ("SerNo", SerNo); +} +/** Get Serial No. +@return Product Serial Number */ +public String getSerNo() +{ +return (String)get_Value("SerNo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeUse.java b/dbPort/src/org/compiere/model/X_M_AttributeUse.java new file mode 100644 index 0000000000..93f6122cb9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeUse.java @@ -0,0 +1,142 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeUse + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.609 */ +public class X_M_AttributeUse extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeUse_ID id +@param trxName transaction +*/ +public X_M_AttributeUse (Properties ctx, int M_AttributeUse_ID, String trxName) +{ +super (ctx, M_AttributeUse_ID, trxName); +/** if (M_AttributeUse_ID == 0) +{ +setM_AttributeSet_ID (0); +setM_Attribute_ID (0); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM M_AttributeUse WHERE M_AttributeSet_ID=@M_AttributeSet_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeUse (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=563 */ +public static final int Table_ID=563; + +/** TableName=M_AttributeUse */ +public static final String Table_Name="M_AttributeUse"; + +protected static KeyNamePair Model = new KeyNamePair(563,"M_AttributeUse"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeUse[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attribute Set. +@param M_AttributeSet_ID Product Attribute Set */ +public void setM_AttributeSet_ID (int M_AttributeSet_ID) +{ +if (M_AttributeSet_ID < 0) throw new IllegalArgumentException ("M_AttributeSet_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSet_ID", new Integer(M_AttributeSet_ID)); +} +/** Get Attribute Set. +@return Product Attribute Set */ +public int getM_AttributeSet_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_AttributeSet_ID())); +} +/** Set Attribute. +@param M_Attribute_ID Product Attribute */ +public void setM_Attribute_ID (int M_Attribute_ID) +{ +if (M_Attribute_ID < 1) throw new IllegalArgumentException ("M_Attribute_ID is mandatory."); +set_ValueNoCheck ("M_Attribute_ID", new Integer(M_Attribute_ID)); +} +/** Get Attribute. +@return Product Attribute */ +public int getM_Attribute_ID() +{ +Integer ii = (Integer)get_Value("M_Attribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_AttributeValue.java b/dbPort/src/org/compiere/model/X_M_AttributeValue.java new file mode 100644 index 0000000000..77deec89ab --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_AttributeValue.java @@ -0,0 +1,180 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_AttributeValue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.609 */ +public class X_M_AttributeValue extends PO +{ +/** Standard Constructor +@param ctx context +@param M_AttributeValue_ID id +@param trxName transaction +*/ +public X_M_AttributeValue (Properties ctx, int M_AttributeValue_ID, String trxName) +{ +super (ctx, M_AttributeValue_ID, trxName); +/** if (M_AttributeValue_ID == 0) +{ +setM_AttributeValue_ID (0); +setM_Attribute_ID (0); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_AttributeValue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=558 */ +public static final int Table_ID=558; + +/** TableName=M_AttributeValue */ +public static final String Table_Name="M_AttributeValue"; + +protected static KeyNamePair Model = new KeyNamePair(558,"M_AttributeValue"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_AttributeValue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Attribute Value. +@param M_AttributeValue_ID Product Attribute Value */ +public void setM_AttributeValue_ID (int M_AttributeValue_ID) +{ +if (M_AttributeValue_ID < 1) throw new IllegalArgumentException ("M_AttributeValue_ID is mandatory."); +set_ValueNoCheck ("M_AttributeValue_ID", new Integer(M_AttributeValue_ID)); +} +/** Get Attribute Value. +@return Product Attribute Value */ +public int getM_AttributeValue_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute. +@param M_Attribute_ID Product Attribute */ +public void setM_Attribute_ID (int M_Attribute_ID) +{ +if (M_Attribute_ID < 1) throw new IllegalArgumentException ("M_Attribute_ID is mandatory."); +set_ValueNoCheck ("M_Attribute_ID", new Integer(M_Attribute_ID)); +} +/** Get Attribute. +@return Product Attribute */ +public int getM_Attribute_ID() +{ +Integer ii = (Integer)get_Value("M_Attribute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_BOM.java b/dbPort/src/org/compiere/model/X_M_BOM.java new file mode 100644 index 0000000000..f4a03238bd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_BOM.java @@ -0,0 +1,282 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_BOM + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.625 */ +public class X_M_BOM extends PO +{ +/** Standard Constructor +@param ctx context +@param M_BOM_ID id +@param trxName transaction +*/ +public X_M_BOM (Properties ctx, int M_BOM_ID, String trxName) +{ +super (ctx, M_BOM_ID, trxName); +/** if (M_BOM_ID == 0) +{ +setBOMType (null); // A +setBOMUse (null); // A +setM_BOM_ID (0); +setM_Product_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_BOM (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=798 */ +public static final int Table_ID=798; + +/** TableName=M_BOM */ +public static final String Table_Name="M_BOM"; + +protected static KeyNamePair Model = new KeyNamePair(798,"M_BOM"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_BOM[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** BOMType AD_Reference_ID=347 */ +public static final int BOMTYPE_AD_Reference_ID=347; +/** Current Active = A */ +public static final String BOMTYPE_CurrentActive = "A"; +/** Future = F */ +public static final String BOMTYPE_Future = "F"; +/** Maintenance = M */ +public static final String BOMTYPE_Maintenance = "M"; +/** Make-To-Order = O */ +public static final String BOMTYPE_Make_To_Order = "O"; +/** Previous = P */ +public static final String BOMTYPE_Previous = "P"; +/** Repair = R */ +public static final String BOMTYPE_Repair = "R"; +/** Previous, Spare = S */ +public static final String BOMTYPE_PreviousSpare = "S"; +/** Set BOM Type. +@param BOMType Type of BOM */ +public void setBOMType (String BOMType) +{ +if (BOMType == null) throw new IllegalArgumentException ("BOMType is mandatory"); +if (BOMType.equals("A") || BOMType.equals("F") || BOMType.equals("M") || BOMType.equals("O") || BOMType.equals("P") || BOMType.equals("R") || BOMType.equals("S")); + else throw new IllegalArgumentException ("BOMType Invalid value - " + BOMType + " - Reference_ID=347 - A - F - M - O - P - R - S"); +if (BOMType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BOMType = BOMType.substring(0,0); +} +set_Value ("BOMType", BOMType); +} +/** Get BOM Type. +@return Type of BOM */ +public String getBOMType() +{ +return (String)get_Value("BOMType"); +} + +/** BOMUse AD_Reference_ID=348 */ +public static final int BOMUSE_AD_Reference_ID=348; +/** Master = A */ +public static final String BOMUSE_Master = "A"; +/** Engineering = E */ +public static final String BOMUSE_Engineering = "E"; +/** Manufacturing = M */ +public static final String BOMUSE_Manufacturing = "M"; +/** Planning = P */ +public static final String BOMUSE_Planning = "P"; +/** Set BOM Use. +@param BOMUse The use of the Bill of Material */ +public void setBOMUse (String BOMUse) +{ +if (BOMUse == null) throw new IllegalArgumentException ("BOMUse is mandatory"); +if (BOMUse.equals("A") || BOMUse.equals("E") || BOMUse.equals("M") || BOMUse.equals("P")); + else throw new IllegalArgumentException ("BOMUse Invalid value - " + BOMUse + " - Reference_ID=348 - A - E - M - P"); +if (BOMUse.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BOMUse = BOMUse.substring(0,0); +} +set_Value ("BOMUse", BOMUse); +} +/** Get BOM Use. +@return The use of the Bill of Material */ +public String getBOMUse() +{ +return (String)get_Value("BOMUse"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set BOM. +@param M_BOM_ID Bill of Material */ +public void setM_BOM_ID (int M_BOM_ID) +{ +if (M_BOM_ID < 1) throw new IllegalArgumentException ("M_BOM_ID is mandatory."); +set_ValueNoCheck ("M_BOM_ID", new Integer(M_BOM_ID)); +} +/** Get BOM. +@return Bill of Material */ +public int getM_BOM_ID() +{ +Integer ii = (Integer)get_Value("M_BOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Change Notice. +@param M_ChangeNotice_ID Bill of Materials (Engineering) Change Notice (Version) */ +public void setM_ChangeNotice_ID (int M_ChangeNotice_ID) +{ +if (M_ChangeNotice_ID <= 0) set_Value ("M_ChangeNotice_ID", null); + else +set_Value ("M_ChangeNotice_ID", new Integer(M_ChangeNotice_ID)); +} +/** Get Change Notice. +@return Bill of Materials (Engineering) Change Notice (Version) */ +public int getM_ChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_BOMAlternative.java b/dbPort/src/org/compiere/model/X_M_BOMAlternative.java new file mode 100644 index 0000000000..0dfc97894b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_BOMAlternative.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_BOMAlternative + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.64 */ +public class X_M_BOMAlternative extends PO +{ +/** Standard Constructor +@param ctx context +@param M_BOMAlternative_ID id +@param trxName transaction +*/ +public X_M_BOMAlternative (Properties ctx, int M_BOMAlternative_ID, String trxName) +{ +super (ctx, M_BOMAlternative_ID, trxName); +/** if (M_BOMAlternative_ID == 0) +{ +setM_BOMAlternative_ID (0); +setM_Product_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_BOMAlternative (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=795 */ +public static final int Table_ID=795; + +/** TableName=M_BOMAlternative */ +public static final String Table_Name="M_BOMAlternative"; + +protected static KeyNamePair Model = new KeyNamePair(795,"M_BOMAlternative"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_BOMAlternative[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Alternative Group. +@param M_BOMAlternative_ID Product BOM Alternative Group */ +public void setM_BOMAlternative_ID (int M_BOMAlternative_ID) +{ +if (M_BOMAlternative_ID < 1) throw new IllegalArgumentException ("M_BOMAlternative_ID is mandatory."); +set_ValueNoCheck ("M_BOMAlternative_ID", new Integer(M_BOMAlternative_ID)); +} +/** Get Alternative Group. +@return Product BOM Alternative Group */ +public int getM_BOMAlternative_ID() +{ +Integer ii = (Integer)get_Value("M_BOMAlternative_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_BOMProduct.java b/dbPort/src/org/compiere/model/X_M_BOMProduct.java new file mode 100644 index 0000000000..44c216ea03 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_BOMProduct.java @@ -0,0 +1,357 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_BOMProduct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.64 */ +public class X_M_BOMProduct extends PO +{ +/** Standard Constructor +@param ctx context +@param M_BOMProduct_ID id +@param trxName transaction +*/ +public X_M_BOMProduct (Properties ctx, int M_BOMProduct_ID, String trxName) +{ +super (ctx, M_BOMProduct_ID, trxName); +/** if (M_BOMProduct_ID == 0) +{ +setBOMProductType (null); // S +setBOMQty (Env.ZERO); // 1 +setIsPhantom (false); +setLeadTimeOffset (0); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_BOMProduct WHERE M_BOM_ID=@M_BOM_ID@ +setM_BOMProduct_ID (0); +setM_BOM_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_BOMProduct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=801 */ +public static final int Table_ID=801; + +/** TableName=M_BOMProduct */ +public static final String Table_Name="M_BOMProduct"; + +protected static KeyNamePair Model = new KeyNamePair(801,"M_BOMProduct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_BOMProduct[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** BOMProductType AD_Reference_ID=349 */ +public static final int BOMPRODUCTTYPE_AD_Reference_ID=349; +/** Alternative = A */ +public static final String BOMPRODUCTTYPE_Alternative = "A"; +/** Alternative (Default) = D */ +public static final String BOMPRODUCTTYPE_AlternativeDefault = "D"; +/** Optional Product = O */ +public static final String BOMPRODUCTTYPE_OptionalProduct = "O"; +/** Standard Product = S */ +public static final String BOMPRODUCTTYPE_StandardProduct = "S"; +/** Outside Processing = X */ +public static final String BOMPRODUCTTYPE_OutsideProcessing = "X"; +/** Set Component Type. +@param BOMProductType BOM Product Type */ +public void setBOMProductType (String BOMProductType) +{ +if (BOMProductType == null) throw new IllegalArgumentException ("BOMProductType is mandatory"); +if (BOMProductType.equals("A") || BOMProductType.equals("D") || BOMProductType.equals("O") || BOMProductType.equals("S") || BOMProductType.equals("X")); + else throw new IllegalArgumentException ("BOMProductType Invalid value - " + BOMProductType + " - Reference_ID=349 - A - D - O - S - X"); +if (BOMProductType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BOMProductType = BOMProductType.substring(0,0); +} +set_Value ("BOMProductType", BOMProductType); +} +/** Get Component Type. +@return BOM Product Type */ +public String getBOMProductType() +{ +return (String)get_Value("BOMProductType"); +} +/** Set BOM Quantity. +@param BOMQty Bill of Materials Quantity */ +public void setBOMQty (BigDecimal BOMQty) +{ +if (BOMQty == null) throw new IllegalArgumentException ("BOMQty is mandatory."); +set_Value ("BOMQty", BOMQty); +} +/** Get BOM Quantity. +@return Bill of Materials Quantity */ +public BigDecimal getBOMQty() +{ +BigDecimal bd = (BigDecimal)get_Value("BOMQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Phantom. +@param IsPhantom Phantom Component */ +public void setIsPhantom (boolean IsPhantom) +{ +set_Value ("IsPhantom", new Boolean(IsPhantom)); +} +/** Get Phantom. +@return Phantom Component */ +public boolean isPhantom() +{ +Object oo = get_Value("IsPhantom"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Lead Time Offset. +@param LeadTimeOffset Optional Lead Time offest before starting production */ +public void setLeadTimeOffset (int LeadTimeOffset) +{ +set_Value ("LeadTimeOffset", new Integer(LeadTimeOffset)); +} +/** Get Lead Time Offset. +@return Optional Lead Time offest before starting production */ +public int getLeadTimeOffset() +{ +Integer ii = (Integer)get_Value("LeadTimeOffset"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID <= 0) set_Value ("M_AttributeSetInstance_ID", null); + else +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Alternative Group. +@param M_BOMAlternative_ID Product BOM Alternative Group */ +public void setM_BOMAlternative_ID (int M_BOMAlternative_ID) +{ +if (M_BOMAlternative_ID <= 0) set_Value ("M_BOMAlternative_ID", null); + else +set_Value ("M_BOMAlternative_ID", new Integer(M_BOMAlternative_ID)); +} +/** Get Alternative Group. +@return Product BOM Alternative Group */ +public int getM_BOMAlternative_ID() +{ +Integer ii = (Integer)get_Value("M_BOMAlternative_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BOM Component. +@param M_BOMProduct_ID Bill of Material Component (Product) */ +public void setM_BOMProduct_ID (int M_BOMProduct_ID) +{ +if (M_BOMProduct_ID < 1) throw new IllegalArgumentException ("M_BOMProduct_ID is mandatory."); +set_ValueNoCheck ("M_BOMProduct_ID", new Integer(M_BOMProduct_ID)); +} +/** Get BOM Component. +@return Bill of Material Component (Product) */ +public int getM_BOMProduct_ID() +{ +Integer ii = (Integer)get_Value("M_BOMProduct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BOM. +@param M_BOM_ID Bill of Material */ +public void setM_BOM_ID (int M_BOM_ID) +{ +if (M_BOM_ID < 1) throw new IllegalArgumentException ("M_BOM_ID is mandatory."); +set_ValueNoCheck ("M_BOM_ID", new Integer(M_BOM_ID)); +} +/** Get BOM. +@return Bill of Material */ +public int getM_BOM_ID() +{ +Integer ii = (Integer)get_Value("M_BOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Change Notice. +@param M_ChangeNotice_ID Bill of Materials (Engineering) Change Notice (Version) */ +public void setM_ChangeNotice_ID (int M_ChangeNotice_ID) +{ +if (M_ChangeNotice_ID <= 0) set_Value ("M_ChangeNotice_ID", null); + else +set_Value ("M_ChangeNotice_ID", new Integer(M_ChangeNotice_ID)); +} +/** Get Change Notice. +@return Bill of Materials (Engineering) Change Notice (Version) */ +public int getM_ChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_ProductBOM_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTBOM_ID_AD_Reference_ID=162; +/** Set BOM Product. +@param M_ProductBOM_ID Bill of Material Component Product */ +public void setM_ProductBOM_ID (int M_ProductBOM_ID) +{ +if (M_ProductBOM_ID <= 0) set_Value ("M_ProductBOM_ID", null); + else +set_Value ("M_ProductBOM_ID", new Integer(M_ProductBOM_ID)); +} +/** Get BOM Product. +@return Bill of Material Component Product */ +public int getM_ProductBOM_ID() +{ +Integer ii = (Integer)get_Value("M_ProductBOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Operation. +@param M_ProductOperation_ID Product Manufacturing Operation */ +public void setM_ProductOperation_ID (int M_ProductOperation_ID) +{ +if (M_ProductOperation_ID <= 0) set_Value ("M_ProductOperation_ID", null); + else +set_Value ("M_ProductOperation_ID", new Integer(M_ProductOperation_ID)); +} +/** Get Product Operation. +@return Product Manufacturing Operation */ +public int getM_ProductOperation_ID() +{ +Integer ii = (Integer)get_Value("M_ProductOperation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ChangeNotice.java b/dbPort/src/org/compiere/model/X_M_ChangeNotice.java new file mode 100644 index 0000000000..3c795c6ee3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ChangeNotice.java @@ -0,0 +1,230 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ChangeNotice + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.656 */ +public class X_M_ChangeNotice extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ChangeNotice_ID id +@param trxName transaction +*/ +public X_M_ChangeNotice (Properties ctx, int M_ChangeNotice_ID, String trxName) +{ +super (ctx, M_ChangeNotice_ID, trxName); +/** if (M_ChangeNotice_ID == 0) +{ +setIsApproved (false); // N +setM_ChangeNotice_ID (0); +setName (null); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ChangeNotice (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=799 */ +public static final int Table_ID=799; + +/** TableName=M_ChangeNotice */ +public static final String Table_Name="M_ChangeNotice"; + +protected static KeyNamePair Model = new KeyNamePair(799,"M_ChangeNotice"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ChangeNotice[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Detail Information. +@param DetailInfo Additional Detail Information */ +public void setDetailInfo (String DetailInfo) +{ +set_Value ("DetailInfo", DetailInfo); +} +/** Get Detail Information. +@return Additional Detail Information */ +public String getDetailInfo() +{ +return (String)get_Value("DetailInfo"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Change Notice. +@param M_ChangeNotice_ID Bill of Materials (Engineering) Change Notice (Version) */ +public void setM_ChangeNotice_ID (int M_ChangeNotice_ID) +{ +if (M_ChangeNotice_ID < 1) throw new IllegalArgumentException ("M_ChangeNotice_ID is mandatory."); +set_ValueNoCheck ("M_ChangeNotice_ID", new Integer(M_ChangeNotice_ID)); +} +/** Get Change Notice. +@return Bill of Materials (Engineering) Change Notice (Version) */ +public int getM_ChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ChangeRequest.java b/dbPort/src/org/compiere/model/X_M_ChangeRequest.java new file mode 100644 index 0000000000..cf0324aeee --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ChangeRequest.java @@ -0,0 +1,282 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ChangeRequest + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.671 */ +public class X_M_ChangeRequest extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ChangeRequest_ID id +@param trxName transaction +*/ +public X_M_ChangeRequest (Properties ctx, int M_ChangeRequest_ID, String trxName) +{ +super (ctx, M_ChangeRequest_ID, trxName); +/** if (M_ChangeRequest_ID == 0) +{ +setDocumentNo (null); +setIsApproved (false); // N +setM_ChangeRequest_ID (0); +setName (null); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ChangeRequest (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=800 */ +public static final int Table_ID=800; + +/** TableName=M_ChangeRequest */ +public static final String Table_Name="M_ChangeRequest"; + +protected static KeyNamePair Model = new KeyNamePair(800,"M_ChangeRequest"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ChangeRequest[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Detail Information. +@param DetailInfo Additional Detail Information */ +public void setDetailInfo (String DetailInfo) +{ +set_Value ("DetailInfo", DetailInfo); +} +/** Get Detail Information. +@return Additional Detail Information */ +public String getDetailInfo() +{ +return (String)get_Value("DetailInfo"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set BOM. +@param M_BOM_ID Bill of Material */ +public void setM_BOM_ID (int M_BOM_ID) +{ +if (M_BOM_ID <= 0) set_ValueNoCheck ("M_BOM_ID", null); + else +set_ValueNoCheck ("M_BOM_ID", new Integer(M_BOM_ID)); +} +/** Get BOM. +@return Bill of Material */ +public int getM_BOM_ID() +{ +Integer ii = (Integer)get_Value("M_BOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Change Notice. +@param M_ChangeNotice_ID Bill of Materials (Engineering) Change Notice (Version) */ +public void setM_ChangeNotice_ID (int M_ChangeNotice_ID) +{ +if (M_ChangeNotice_ID <= 0) set_ValueNoCheck ("M_ChangeNotice_ID", null); + else +set_ValueNoCheck ("M_ChangeNotice_ID", new Integer(M_ChangeNotice_ID)); +} +/** Get Change Notice. +@return Bill of Materials (Engineering) Change Notice (Version) */ +public int getM_ChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Change Request. +@param M_ChangeRequest_ID BOM (Engineering) Change Request */ +public void setM_ChangeRequest_ID (int M_ChangeRequest_ID) +{ +if (M_ChangeRequest_ID < 1) throw new IllegalArgumentException ("M_ChangeRequest_ID is mandatory."); +set_ValueNoCheck ("M_ChangeRequest_ID", new Integer(M_ChangeRequest_ID)); +} +/** Get Change Request. +@return BOM (Engineering) Change Request */ +public int getM_ChangeRequest_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeRequest_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_FixChangeNotice_ID AD_Reference_ID=351 */ +public static final int M_FIXCHANGENOTICE_ID_AD_Reference_ID=351; +/** Set Fixed in. +@param M_FixChangeNotice_ID Fixed in Change Notice */ +public void setM_FixChangeNotice_ID (int M_FixChangeNotice_ID) +{ +if (M_FixChangeNotice_ID <= 0) set_ValueNoCheck ("M_FixChangeNotice_ID", null); + else +set_ValueNoCheck ("M_FixChangeNotice_ID", new Integer(M_FixChangeNotice_ID)); +} +/** Get Fixed in. +@return Fixed in Change Notice */ +public int getM_FixChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_FixChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Cost.java b/dbPort/src/org/compiere/model/X_M_Cost.java new file mode 100644 index 0000000000..aa2a5a32f8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Cost.java @@ -0,0 +1,328 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Cost + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.687 */ +public class X_M_Cost extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Cost_ID id +@param trxName transaction +*/ +public X_M_Cost (Properties ctx, int M_Cost_ID, String trxName) +{ +super (ctx, M_Cost_ID, trxName); +/** if (M_Cost_ID == 0) +{ +setC_AcctSchema_ID (0); +setCurrentCostPrice (Env.ZERO); +setCurrentQty (Env.ZERO); +setFutureCostPrice (Env.ZERO); +setM_AttributeSetInstance_ID (0); +setM_CostElement_ID (0); +setM_CostType_ID (0); +setM_Product_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Cost (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=771 */ +public static final int Table_ID=771; + +/** TableName=M_Cost */ +public static final String Table_Name="M_Cost"; + +protected static KeyNamePair Model = new KeyNamePair(771,"M_Cost"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Cost[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CostingMethod AD_Reference_ID=122 */ +public static final int COSTINGMETHOD_AD_Reference_ID=122; +/** Average PO = A */ +public static final String COSTINGMETHOD_AveragePO = "A"; +/** Fifo = F */ +public static final String COSTINGMETHOD_Fifo = "F"; +/** Average Invoice = I */ +public static final String COSTINGMETHOD_AverageInvoice = "I"; +/** Lifo = L */ +public static final String COSTINGMETHOD_Lifo = "L"; +/** Standard Costing = S */ +public static final String COSTINGMETHOD_StandardCosting = "S"; +/** User Defined = U */ +public static final String COSTINGMETHOD_UserDefined = "U"; +/** Last Invoice = i */ +public static final String COSTINGMETHOD_LastInvoice = "i"; +/** Last PO Price = p */ +public static final String COSTINGMETHOD_LastPOPrice = "p"; +/** _ = x */ +public static final String COSTINGMETHOD__ = "x"; +/** Set Costing Method. +@param CostingMethod Indicates how Costs will be calculated */ +public void setCostingMethod (String CostingMethod) +{ +if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory"); +if (CostingMethod == null || CostingMethod.equals("A") || CostingMethod.equals("F") || CostingMethod.equals("I") || CostingMethod.equals("L") || CostingMethod.equals("S") || CostingMethod.equals("U") || CostingMethod.equals("i") || CostingMethod.equals("p") || CostingMethod.equals("x")); + else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - A - F - I - L - S - U - i - p - x"); +throw new IllegalArgumentException ("CostingMethod is virtual column"); +} +/** Get Costing Method. +@return Indicates how Costs will be calculated */ +public String getCostingMethod() +{ +return (String)get_Value("CostingMethod"); +} +/** Set Accumulated Amt. +@param CumulatedAmt Total Amount */ +public void setCumulatedAmt (BigDecimal CumulatedAmt) +{ +set_ValueNoCheck ("CumulatedAmt", CumulatedAmt); +} +/** Get Accumulated Amt. +@return Total Amount */ +public BigDecimal getCumulatedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CumulatedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accumulated Qty. +@param CumulatedQty Total Quantity */ +public void setCumulatedQty (BigDecimal CumulatedQty) +{ +set_ValueNoCheck ("CumulatedQty", CumulatedQty); +} +/** Get Accumulated Qty. +@return Total Quantity */ +public BigDecimal getCumulatedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CumulatedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Current Cost Price. +@param CurrentCostPrice The currently used cost price */ +public void setCurrentCostPrice (BigDecimal CurrentCostPrice) +{ +if (CurrentCostPrice == null) throw new IllegalArgumentException ("CurrentCostPrice is mandatory."); +set_Value ("CurrentCostPrice", CurrentCostPrice); +} +/** Get Current Cost Price. +@return The currently used cost price */ +public BigDecimal getCurrentCostPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrentCostPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Current Quantity. +@param CurrentQty Current Quantity */ +public void setCurrentQty (BigDecimal CurrentQty) +{ +if (CurrentQty == null) throw new IllegalArgumentException ("CurrentQty is mandatory."); +set_Value ("CurrentQty", CurrentQty); +} +/** Get Current Quantity. +@return Current Quantity */ +public BigDecimal getCurrentQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrentQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Future Cost Price. +@param FutureCostPrice Future Cost Price */ +public void setFutureCostPrice (BigDecimal FutureCostPrice) +{ +if (FutureCostPrice == null) throw new IllegalArgumentException ("FutureCostPrice is mandatory."); +set_Value ("FutureCostPrice", FutureCostPrice); +} +/** Get Future Cost Price. +@return Future Cost Price */ +public BigDecimal getFutureCostPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("FutureCostPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID < 1) throw new IllegalArgumentException ("M_CostElement_ID is mandatory."); +set_ValueNoCheck ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Type. +@param M_CostType_ID Type of Cost (e.g. Current, Plan, Future) */ +public void setM_CostType_ID (int M_CostType_ID) +{ +if (M_CostType_ID < 1) throw new IllegalArgumentException ("M_CostType_ID is mandatory."); +set_ValueNoCheck ("M_CostType_ID", new Integer(M_CostType_ID)); +} +/** Get Cost Type. +@return Type of Cost (e.g. Current, Plan, Future) */ +public int getM_CostType_ID() +{ +Integer ii = (Integer)get_Value("M_CostType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Percent. +@param Percent Percentage */ +public void setPercent (int Percent) +{ +set_Value ("Percent", new Integer(Percent)); +} +/** Get Percent. +@return Percentage */ +public int getPercent() +{ +Integer ii = (Integer)get_Value("Percent"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +throw new IllegalArgumentException ("Processed is virtual column"); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_CostDetail.java b/dbPort/src/org/compiere/model/X_M_CostDetail.java new file mode 100644 index 0000000000..bd5e77abc0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_CostDetail.java @@ -0,0 +1,408 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_CostDetail + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.718 */ +public class X_M_CostDetail extends PO +{ +/** Standard Constructor +@param ctx context +@param M_CostDetail_ID id +@param trxName transaction +*/ +public X_M_CostDetail (Properties ctx, int M_CostDetail_ID, String trxName) +{ +super (ctx, M_CostDetail_ID, trxName); +/** if (M_CostDetail_ID == 0) +{ +setAmt (Env.ZERO); +setC_AcctSchema_ID (0); +setIsSOTrx (false); +setM_AttributeSetInstance_ID (0); +setM_CostDetail_ID (0); +setM_Product_ID (0); +setProcessed (false); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_CostDetail (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=808 */ +public static final int Table_ID=808; + +/** TableName=M_CostDetail */ +public static final String Table_Name="M_CostDetail"; + +protected static KeyNamePair Model = new KeyNamePair(808,"M_CostDetail"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_CostDetail[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +if (Amt == null) throw new IllegalArgumentException ("Amt is mandatory."); +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_ValueNoCheck ("C_InvoiceLine_ID", null); + else +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); + else +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Issue. +@param C_ProjectIssue_ID Project Issues (Material, Labor) */ +public void setC_ProjectIssue_ID (int C_ProjectIssue_ID) +{ +if (C_ProjectIssue_ID <= 0) set_Value ("C_ProjectIssue_ID", null); + else +set_Value ("C_ProjectIssue_ID", new Integer(C_ProjectIssue_ID)); +} +/** Get Project Issue. +@return Project Issues (Material, Labor) */ +public int getC_ProjectIssue_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectIssue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Delta Amount. +@param DeltaAmt Difference Amount */ +public void setDeltaAmt (BigDecimal DeltaAmt) +{ +set_Value ("DeltaAmt", DeltaAmt); +} +/** Get Delta Amount. +@return Difference Amount */ +public BigDecimal getDeltaAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DeltaAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Delta Quantity. +@param DeltaQty Quantity Difference */ +public void setDeltaQty (BigDecimal DeltaQty) +{ +set_Value ("DeltaQty", DeltaQty); +} +/** Get Delta Quantity. +@return Quantity Difference */ +public BigDecimal getDeltaQty() +{ +BigDecimal bd = (BigDecimal)get_Value("DeltaQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Detail. +@param M_CostDetail_ID Cost Detail Information */ +public void setM_CostDetail_ID (int M_CostDetail_ID) +{ +if (M_CostDetail_ID < 1) throw new IllegalArgumentException ("M_CostDetail_ID is mandatory."); +set_ValueNoCheck ("M_CostDetail_ID", new Integer(M_CostDetail_ID)); +} +/** Get Cost Detail. +@return Cost Detail Information */ +public int getM_CostDetail_ID() +{ +Integer ii = (Integer)get_Value("M_CostDetail_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID <= 0) set_ValueNoCheck ("M_CostElement_ID", null); + else +set_ValueNoCheck ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_ValueNoCheck ("M_InOutLine_ID", null); + else +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_Value ("M_InventoryLine_ID", null); + else +set_Value ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Line. +@param M_MovementLine_ID Inventory Move document Line */ +public void setM_MovementLine_ID (int M_MovementLine_ID) +{ +if (M_MovementLine_ID <= 0) set_Value ("M_MovementLine_ID", null); + else +set_Value ("M_MovementLine_ID", new Integer(M_MovementLine_ID)); +} +/** Get Move Line. +@return Inventory Move document Line */ +public int getM_MovementLine_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Line. +@param M_ProductionLine_ID Document Line representing a production */ +public void setM_ProductionLine_ID (int M_ProductionLine_ID) +{ +if (M_ProductionLine_ID <= 0) set_Value ("M_ProductionLine_ID", null); + else +set_Value ("M_ProductionLine_ID", new Integer(M_ProductionLine_ID)); +} +/** Get Production Line. +@return Document Line representing a production */ +public int getM_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price. +@param Price Price */ +public void setPrice (BigDecimal Price) +{ +throw new IllegalArgumentException ("Price is virtual column"); +} +/** Get Price. +@return Price */ +public BigDecimal getPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("Price"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_CostElement.java b/dbPort/src/org/compiere/model/X_M_CostElement.java new file mode 100644 index 0000000000..25e0d029fa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_CostElement.java @@ -0,0 +1,239 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_CostElement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.734 */ +public class X_M_CostElement extends PO +{ +/** Standard Constructor +@param ctx context +@param M_CostElement_ID id +@param trxName transaction +*/ +public X_M_CostElement (Properties ctx, int M_CostElement_ID, String trxName) +{ +super (ctx, M_CostElement_ID, trxName); +/** if (M_CostElement_ID == 0) +{ +setCostElementType (null); +setIsCalculated (false); +setM_CostElement_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_CostElement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=770 */ +public static final int Table_ID=770; + +/** TableName=M_CostElement */ +public static final String Table_Name="M_CostElement"; + +protected static KeyNamePair Model = new KeyNamePair(770,"M_CostElement"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_CostElement[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** CostElementType AD_Reference_ID=338 */ +public static final int COSTELEMENTTYPE_AD_Reference_ID=338; +/** Burden (M.Overhead) = B */ +public static final String COSTELEMENTTYPE_BurdenMOverhead = "B"; +/** Material = M */ +public static final String COSTELEMENTTYPE_Material = "M"; +/** Overhead = O */ +public static final String COSTELEMENTTYPE_Overhead = "O"; +/** Resource = R */ +public static final String COSTELEMENTTYPE_Resource = "R"; +/** Outside Processing = X */ +public static final String COSTELEMENTTYPE_OutsideProcessing = "X"; +/** Set Cost Element Type. +@param CostElementType Type of Cost Element */ +public void setCostElementType (String CostElementType) +{ +if (CostElementType == null) throw new IllegalArgumentException ("CostElementType is mandatory"); +if (CostElementType.equals("B") || CostElementType.equals("M") || CostElementType.equals("O") || CostElementType.equals("R") || CostElementType.equals("X")); + else throw new IllegalArgumentException ("CostElementType Invalid value - " + CostElementType + " - Reference_ID=338 - B - M - O - R - X"); +if (CostElementType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CostElementType = CostElementType.substring(0,0); +} +set_Value ("CostElementType", CostElementType); +} +/** Get Cost Element Type. +@return Type of Cost Element */ +public String getCostElementType() +{ +return (String)get_Value("CostElementType"); +} + +/** CostingMethod AD_Reference_ID=122 */ +public static final int COSTINGMETHOD_AD_Reference_ID=122; +/** Average PO = A */ +public static final String COSTINGMETHOD_AveragePO = "A"; +/** Fifo = F */ +public static final String COSTINGMETHOD_Fifo = "F"; +/** Average Invoice = I */ +public static final String COSTINGMETHOD_AverageInvoice = "I"; +/** Lifo = L */ +public static final String COSTINGMETHOD_Lifo = "L"; +/** Standard Costing = S */ +public static final String COSTINGMETHOD_StandardCosting = "S"; +/** User Defined = U */ +public static final String COSTINGMETHOD_UserDefined = "U"; +/** Last Invoice = i */ +public static final String COSTINGMETHOD_LastInvoice = "i"; +/** Last PO Price = p */ +public static final String COSTINGMETHOD_LastPOPrice = "p"; +/** _ = x */ +public static final String COSTINGMETHOD__ = "x"; +/** Set Costing Method. +@param CostingMethod Indicates how Costs will be calculated */ +public void setCostingMethod (String CostingMethod) +{ +if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory"); +if (CostingMethod == null || CostingMethod.equals("A") || CostingMethod.equals("F") || CostingMethod.equals("I") || CostingMethod.equals("L") || CostingMethod.equals("S") || CostingMethod.equals("U") || CostingMethod.equals("i") || CostingMethod.equals("p") || CostingMethod.equals("x")); + else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - A - F - I - L - S - U - i - p - x"); +if (CostingMethod != null && CostingMethod.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CostingMethod = CostingMethod.substring(0,0); +} +set_Value ("CostingMethod", CostingMethod); +} +/** Get Costing Method. +@return Indicates how Costs will be calculated */ +public String getCostingMethod() +{ +return (String)get_Value("CostingMethod"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Calculated. +@param IsCalculated The value is calculated by the system */ +public void setIsCalculated (boolean IsCalculated) +{ +set_Value ("IsCalculated", new Boolean(IsCalculated)); +} +/** Get Calculated. +@return The value is calculated by the system */ +public boolean isCalculated() +{ +Object oo = get_Value("IsCalculated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID < 1) throw new IllegalArgumentException ("M_CostElement_ID is mandatory."); +set_ValueNoCheck ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_CostQueue.java b/dbPort/src/org/compiere/model/X_M_CostQueue.java new file mode 100644 index 0000000000..67516f6f79 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_CostQueue.java @@ -0,0 +1,215 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_CostQueue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.734 */ +public class X_M_CostQueue extends PO +{ +/** Standard Constructor +@param ctx context +@param M_CostQueue_ID id +@param trxName transaction +*/ +public X_M_CostQueue (Properties ctx, int M_CostQueue_ID, String trxName) +{ +super (ctx, M_CostQueue_ID, trxName); +/** if (M_CostQueue_ID == 0) +{ +setC_AcctSchema_ID (0); +setCurrentCostPrice (Env.ZERO); +setCurrentQty (Env.ZERO); +setM_AttributeSetInstance_ID (0); +setM_CostElement_ID (0); +setM_CostQueue_ID (0); +setM_CostType_ID (0); +setM_Product_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_CostQueue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=817 */ +public static final int Table_ID=817; + +/** TableName=M_CostQueue */ +public static final String Table_Name="M_CostQueue"; + +protected static KeyNamePair Model = new KeyNamePair(817,"M_CostQueue"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_CostQueue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Current Cost Price. +@param CurrentCostPrice The currently used cost price */ +public void setCurrentCostPrice (BigDecimal CurrentCostPrice) +{ +if (CurrentCostPrice == null) throw new IllegalArgumentException ("CurrentCostPrice is mandatory."); +set_Value ("CurrentCostPrice", CurrentCostPrice); +} +/** Get Current Cost Price. +@return The currently used cost price */ +public BigDecimal getCurrentCostPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrentCostPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Current Quantity. +@param CurrentQty Current Quantity */ +public void setCurrentQty (BigDecimal CurrentQty) +{ +if (CurrentQty == null) throw new IllegalArgumentException ("CurrentQty is mandatory."); +set_Value ("CurrentQty", CurrentQty); +} +/** Get Current Quantity. +@return Current Quantity */ +public BigDecimal getCurrentQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrentQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID < 1) throw new IllegalArgumentException ("M_CostElement_ID is mandatory."); +set_ValueNoCheck ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Queue. +@param M_CostQueue_ID FiFo/LiFo Cost Queue */ +public void setM_CostQueue_ID (int M_CostQueue_ID) +{ +if (M_CostQueue_ID < 1) throw new IllegalArgumentException ("M_CostQueue_ID is mandatory."); +set_ValueNoCheck ("M_CostQueue_ID", new Integer(M_CostQueue_ID)); +} +/** Get Cost Queue. +@return FiFo/LiFo Cost Queue */ +public int getM_CostQueue_ID() +{ +Integer ii = (Integer)get_Value("M_CostQueue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Type. +@param M_CostType_ID Type of Cost (e.g. Current, Plan, Future) */ +public void setM_CostType_ID (int M_CostType_ID) +{ +if (M_CostType_ID < 1) throw new IllegalArgumentException ("M_CostType_ID is mandatory."); +set_ValueNoCheck ("M_CostType_ID", new Integer(M_CostType_ID)); +} +/** Get Cost Type. +@return Type of Cost (e.g. Current, Plan, Future) */ +public int getM_CostType_ID() +{ +Integer ii = (Integer)get_Value("M_CostType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_CostType.java b/dbPort/src/org/compiere/model/X_M_CostType.java new file mode 100644 index 0000000000..baf053365b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_CostType.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_CostType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.75 */ +public class X_M_CostType extends PO +{ +/** Standard Constructor +@param ctx context +@param M_CostType_ID id +@param trxName transaction +*/ +public X_M_CostType (Properties ctx, int M_CostType_ID, String trxName) +{ +super (ctx, M_CostType_ID, trxName); +/** if (M_CostType_ID == 0) +{ +setM_CostType_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_CostType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=586 */ +public static final int Table_ID=586; + +/** TableName=M_CostType */ +public static final String Table_Name="M_CostType"; + +protected static KeyNamePair Model = new KeyNamePair(586,"M_CostType"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_CostType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Cost Type. +@param M_CostType_ID Type of Cost (e.g. Current, Plan, Future) */ +public void setM_CostType_ID (int M_CostType_ID) +{ +if (M_CostType_ID < 1) throw new IllegalArgumentException ("M_CostType_ID is mandatory."); +set_ValueNoCheck ("M_CostType_ID", new Integer(M_CostType_ID)); +} +/** Get Cost Type. +@return Type of Cost (e.g. Current, Plan, Future) */ +public int getM_CostType_ID() +{ +Integer ii = (Integer)get_Value("M_CostType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Demand.java b/dbPort/src/org/compiere/model/X_M_Demand.java new file mode 100644 index 0000000000..c3a782455c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Demand.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Demand + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.765 */ +public class X_M_Demand extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Demand_ID id +@param trxName transaction +*/ +public X_M_Demand (Properties ctx, int M_Demand_ID, String trxName) +{ +super (ctx, M_Demand_ID, trxName); +/** if (M_Demand_ID == 0) +{ +setC_Calendar_ID (0); +setC_Year_ID (0); +setIsDefault (false); +setM_Demand_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Demand (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=723 */ +public static final int Table_ID=723; + +/** TableName=M_Demand */ +public static final String Table_Name="M_Demand"; + +protected static KeyNamePair Model = new KeyNamePair(723,"M_Demand"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Demand[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID < 1) throw new IllegalArgumentException ("C_Calendar_ID is mandatory."); +set_ValueNoCheck ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Year. +@param C_Year_ID Calendar Year */ +public void setC_Year_ID (int C_Year_ID) +{ +if (C_Year_ID < 1) throw new IllegalArgumentException ("C_Year_ID is mandatory."); +set_ValueNoCheck ("C_Year_ID", new Integer(C_Year_ID)); +} +/** Get Year. +@return Calendar Year */ +public int getC_Year_ID() +{ +Integer ii = (Integer)get_Value("C_Year_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Demand. +@param M_Demand_ID Material Demand */ +public void setM_Demand_ID (int M_Demand_ID) +{ +if (M_Demand_ID < 1) throw new IllegalArgumentException ("M_Demand_ID is mandatory."); +set_ValueNoCheck ("M_Demand_ID", new Integer(M_Demand_ID)); +} +/** Get Demand. +@return Material Demand */ +public int getM_Demand_ID() +{ +Integer ii = (Integer)get_Value("M_Demand_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DemandDetail.java b/dbPort/src/org/compiere/model/X_M_DemandDetail.java new file mode 100644 index 0000000000..a0f49038c6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DemandDetail.java @@ -0,0 +1,173 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DemandDetail + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.765 */ +public class X_M_DemandDetail extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DemandDetail_ID id +@param trxName transaction +*/ +public X_M_DemandDetail (Properties ctx, int M_DemandDetail_ID, String trxName) +{ +super (ctx, M_DemandDetail_ID, trxName); +/** if (M_DemandDetail_ID == 0) +{ +setM_DemandDetail_ID (0); +setM_DemandLine_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DemandDetail (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=721 */ +public static final int Table_ID=721; + +/** TableName=M_DemandDetail */ +public static final String Table_Name="M_DemandDetail"; + +protected static KeyNamePair Model = new KeyNamePair(721,"M_DemandDetail"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DemandDetail[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_Value ("C_OrderLine_ID", null); + else +set_Value ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Demand Detail. +@param M_DemandDetail_ID Material Demand Line Source Detail */ +public void setM_DemandDetail_ID (int M_DemandDetail_ID) +{ +if (M_DemandDetail_ID < 1) throw new IllegalArgumentException ("M_DemandDetail_ID is mandatory."); +set_ValueNoCheck ("M_DemandDetail_ID", new Integer(M_DemandDetail_ID)); +} +/** Get Demand Detail. +@return Material Demand Line Source Detail */ +public int getM_DemandDetail_ID() +{ +Integer ii = (Integer)get_Value("M_DemandDetail_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_DemandDetail_ID())); +} +/** Set Demand Line. +@param M_DemandLine_ID Material Demand Line */ +public void setM_DemandLine_ID (int M_DemandLine_ID) +{ +if (M_DemandLine_ID < 1) throw new IllegalArgumentException ("M_DemandLine_ID is mandatory."); +set_ValueNoCheck ("M_DemandLine_ID", new Integer(M_DemandLine_ID)); +} +/** Get Demand Line. +@return Material Demand Line */ +public int getM_DemandLine_ID() +{ +Integer ii = (Integer)get_Value("M_DemandLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Forecast Line. +@param M_ForecastLine_ID Forecast Line */ +public void setM_ForecastLine_ID (int M_ForecastLine_ID) +{ +if (M_ForecastLine_ID <= 0) set_Value ("M_ForecastLine_ID", null); + else +set_Value ("M_ForecastLine_ID", new Integer(M_ForecastLine_ID)); +} +/** Get Forecast Line. +@return Forecast Line */ +public int getM_ForecastLine_ID() +{ +Integer ii = (Integer)get_Value("M_ForecastLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Requisition Line. +@param M_RequisitionLine_ID Material Requisition Line */ +public void setM_RequisitionLine_ID (int M_RequisitionLine_ID) +{ +if (M_RequisitionLine_ID <= 0) set_Value ("M_RequisitionLine_ID", null); + else +set_Value ("M_RequisitionLine_ID", new Integer(M_RequisitionLine_ID)); +} +/** Get Requisition Line. +@return Material Requisition Line */ +public int getM_RequisitionLine_ID() +{ +Integer ii = (Integer)get_Value("M_RequisitionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DemandLine.java b/dbPort/src/org/compiere/model/X_M_DemandLine.java new file mode 100644 index 0000000000..7be723f389 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DemandLine.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DemandLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.781 */ +public class X_M_DemandLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DemandLine_ID id +@param trxName transaction +*/ +public X_M_DemandLine (Properties ctx, int M_DemandLine_ID, String trxName) +{ +super (ctx, M_DemandLine_ID, trxName); +/** if (M_DemandLine_ID == 0) +{ +setC_Period_ID (0); +setM_DemandLine_ID (0); +setM_Demand_ID (0); +setM_Product_ID (0); +setQty (Env.ZERO); +setQtyCalculated (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DemandLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=719 */ +public static final int Table_ID=719; + +/** TableName=M_DemandLine */ +public static final String Table_Name="M_DemandLine"; + +protected static KeyNamePair Model = new KeyNamePair(719,"M_DemandLine"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DemandLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID < 1) throw new IllegalArgumentException ("C_Period_ID is mandatory."); +set_ValueNoCheck ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Period_ID())); +} +/** Set Demand Line. +@param M_DemandLine_ID Material Demand Line */ +public void setM_DemandLine_ID (int M_DemandLine_ID) +{ +if (M_DemandLine_ID < 1) throw new IllegalArgumentException ("M_DemandLine_ID is mandatory."); +set_ValueNoCheck ("M_DemandLine_ID", new Integer(M_DemandLine_ID)); +} +/** Get Demand Line. +@return Material Demand Line */ +public int getM_DemandLine_ID() +{ +Integer ii = (Integer)get_Value("M_DemandLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Demand. +@param M_Demand_ID Material Demand */ +public void setM_Demand_ID (int M_Demand_ID) +{ +if (M_Demand_ID < 1) throw new IllegalArgumentException ("M_Demand_ID is mandatory."); +set_ValueNoCheck ("M_Demand_ID", new Integer(M_Demand_ID)); +} +/** Get Demand. +@return Material Demand */ +public int getM_Demand_ID() +{ +Integer ii = (Integer)get_Value("M_Demand_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Calculated Quantity. +@param QtyCalculated Calculated Quantity */ +public void setQtyCalculated (BigDecimal QtyCalculated) +{ +if (QtyCalculated == null) throw new IllegalArgumentException ("QtyCalculated is mandatory."); +set_Value ("QtyCalculated", QtyCalculated); +} +/** Get Calculated Quantity. +@return Calculated Quantity */ +public BigDecimal getQtyCalculated() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyCalculated"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DiscountSchema.java b/dbPort/src/org/compiere/model/X_M_DiscountSchema.java new file mode 100644 index 0000000000..4704e6cca9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DiscountSchema.java @@ -0,0 +1,303 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DiscountSchema + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.781 */ +public class X_M_DiscountSchema extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DiscountSchema_ID id +@param trxName transaction +*/ +public X_M_DiscountSchema (Properties ctx, int M_DiscountSchema_ID, String trxName) +{ +super (ctx, M_DiscountSchema_ID, trxName); +/** if (M_DiscountSchema_ID == 0) +{ +setDiscountType (null); +setIsBPartnerFlatDiscount (false); +setIsQuantityBased (true); // Y +setM_DiscountSchema_ID (0); +setName (null); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DiscountSchema (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=475 */ +public static final int Table_ID=475; + +/** TableName=M_DiscountSchema */ +public static final String Table_Name="M_DiscountSchema"; + +protected static KeyNamePair Model = new KeyNamePair(475,"M_DiscountSchema"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DiscountSchema[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** CumulativeLevel AD_Reference_ID=246 */ +public static final int CUMULATIVELEVEL_AD_Reference_ID=246; +/** Line = L */ +public static final String CUMULATIVELEVEL_Line = "L"; +/** Set Accumulation Level. +@param CumulativeLevel Level for accumulative calculations */ +public void setCumulativeLevel (String CumulativeLevel) +{ +if (CumulativeLevel == null) throw new IllegalArgumentException ("CumulativeLevel is mandatory"); +if (CumulativeLevel == null || CumulativeLevel.equals("L")); + else throw new IllegalArgumentException ("CumulativeLevel Invalid value - " + CumulativeLevel + " - Reference_ID=246 - L"); +if (CumulativeLevel != null && CumulativeLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CumulativeLevel = CumulativeLevel.substring(0,0); +} +set_Value ("CumulativeLevel", CumulativeLevel); +} +/** Get Accumulation Level. +@return Level for accumulative calculations */ +public String getCumulativeLevel() +{ +return (String)get_Value("CumulativeLevel"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DiscountType AD_Reference_ID=247 */ +public static final int DISCOUNTTYPE_AD_Reference_ID=247; +/** Breaks = B */ +public static final String DISCOUNTTYPE_Breaks = "B"; +/** Flat Percent = F */ +public static final String DISCOUNTTYPE_FlatPercent = "F"; +/** Pricelist = P */ +public static final String DISCOUNTTYPE_Pricelist = "P"; +/** Formula = S */ +public static final String DISCOUNTTYPE_Formula = "S"; +/** Set Discount Type. +@param DiscountType Type of trade discount calculation */ +public void setDiscountType (String DiscountType) +{ +if (DiscountType == null) throw new IllegalArgumentException ("DiscountType is mandatory"); +if (DiscountType.equals("B") || DiscountType.equals("F") || DiscountType.equals("P") || DiscountType.equals("S")); + else throw new IllegalArgumentException ("DiscountType Invalid value - " + DiscountType + " - Reference_ID=247 - B - F - P - S"); +if (DiscountType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DiscountType = DiscountType.substring(0,0); +} +set_Value ("DiscountType", DiscountType); +} +/** Get Discount Type. +@return Type of trade discount calculation */ +public String getDiscountType() +{ +return (String)get_Value("DiscountType"); +} +/** Set Flat Discount %. +@param FlatDiscount Flat discount percentage */ +public void setFlatDiscount (BigDecimal FlatDiscount) +{ +set_Value ("FlatDiscount", FlatDiscount); +} +/** Get Flat Discount %. +@return Flat discount percentage */ +public BigDecimal getFlatDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("FlatDiscount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set B.Partner Flat Discount. +@param IsBPartnerFlatDiscount Use flat discount defined on Business Partner Level */ +public void setIsBPartnerFlatDiscount (boolean IsBPartnerFlatDiscount) +{ +set_Value ("IsBPartnerFlatDiscount", new Boolean(IsBPartnerFlatDiscount)); +} +/** Get B.Partner Flat Discount. +@return Use flat discount defined on Business Partner Level */ +public boolean isBPartnerFlatDiscount() +{ +Object oo = get_Value("IsBPartnerFlatDiscount"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity based. +@param IsQuantityBased Trade discount break level based on Quantity (not value) */ +public void setIsQuantityBased (boolean IsQuantityBased) +{ +set_Value ("IsQuantityBased", new Boolean(IsQuantityBased)); +} +/** Get Quantity based. +@return Trade discount break level based on Quantity (not value) */ +public boolean isQuantityBased() +{ +Object oo = get_Value("IsQuantityBased"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID < 1) throw new IllegalArgumentException ("M_DiscountSchema_ID is mandatory."); +set_ValueNoCheck ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Script. +@param Script Dynamic Java Language Script to calculate result */ +public void setScript (String Script) +{ +if (Script != null && Script.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Script = Script.substring(0,1999); +} +set_Value ("Script", Script); +} +/** Get Script. +@return Dynamic Java Language Script to calculate result */ +public String getScript() +{ +return (String)get_Value("Script"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DiscountSchemaBreak.java b/dbPort/src/org/compiere/model/X_M_DiscountSchemaBreak.java new file mode 100644 index 0000000000..a40ff8d8e2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DiscountSchemaBreak.java @@ -0,0 +1,225 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DiscountSchemaBreak + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.796 */ +public class X_M_DiscountSchemaBreak extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DiscountSchemaBreak_ID id +@param trxName transaction +*/ +public X_M_DiscountSchemaBreak (Properties ctx, int M_DiscountSchemaBreak_ID, String trxName) +{ +super (ctx, M_DiscountSchemaBreak_ID, trxName); +/** if (M_DiscountSchemaBreak_ID == 0) +{ +setBreakDiscount (Env.ZERO); +setBreakValue (Env.ZERO); +setIsBPartnerFlatDiscount (false); // N +setM_DiscountSchemaBreak_ID (0); +setM_DiscountSchema_ID (0); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM M_DiscountSchemaBreak WHERE M_DiscountSchema_ID=@M_DiscountSchema_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DiscountSchemaBreak (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=476 */ +public static final int Table_ID=476; + +/** TableName=M_DiscountSchemaBreak */ +public static final String Table_Name="M_DiscountSchemaBreak"; + +protected static KeyNamePair Model = new KeyNamePair(476,"M_DiscountSchemaBreak"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DiscountSchemaBreak[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Break Discount %. +@param BreakDiscount Trade Discount in Percent for the break level */ +public void setBreakDiscount (BigDecimal BreakDiscount) +{ +if (BreakDiscount == null) throw new IllegalArgumentException ("BreakDiscount is mandatory."); +set_Value ("BreakDiscount", BreakDiscount); +} +/** Get Break Discount %. +@return Trade Discount in Percent for the break level */ +public BigDecimal getBreakDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("BreakDiscount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Break Value. +@param BreakValue Low Value of trade discount break level */ +public void setBreakValue (BigDecimal BreakValue) +{ +if (BreakValue == null) throw new IllegalArgumentException ("BreakValue is mandatory."); +set_Value ("BreakValue", BreakValue); +} +/** Get Break Value. +@return Low Value of trade discount break level */ +public BigDecimal getBreakValue() +{ +BigDecimal bd = (BigDecimal)get_Value("BreakValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set B.Partner Flat Discount. +@param IsBPartnerFlatDiscount Use flat discount defined on Business Partner Level */ +public void setIsBPartnerFlatDiscount (boolean IsBPartnerFlatDiscount) +{ +set_Value ("IsBPartnerFlatDiscount", new Boolean(IsBPartnerFlatDiscount)); +} +/** Get B.Partner Flat Discount. +@return Use flat discount defined on Business Partner Level */ +public boolean isBPartnerFlatDiscount() +{ +Object oo = get_Value("IsBPartnerFlatDiscount"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discount Schema Break. +@param M_DiscountSchemaBreak_ID Trade Discount Break */ +public void setM_DiscountSchemaBreak_ID (int M_DiscountSchemaBreak_ID) +{ +if (M_DiscountSchemaBreak_ID < 1) throw new IllegalArgumentException ("M_DiscountSchemaBreak_ID is mandatory."); +set_ValueNoCheck ("M_DiscountSchemaBreak_ID", new Integer(M_DiscountSchemaBreak_ID)); +} +/** Get Discount Schema Break. +@return Trade Discount Break */ +public int getM_DiscountSchemaBreak_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchemaBreak_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID < 1) throw new IllegalArgumentException ("M_DiscountSchema_ID is mandatory."); +set_ValueNoCheck ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DiscountSchemaLine.java b/dbPort/src/org/compiere/model/X_M_DiscountSchemaLine.java new file mode 100644 index 0000000000..c7c642b2a7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DiscountSchemaLine.java @@ -0,0 +1,668 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DiscountSchemaLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.812 */ +public class X_M_DiscountSchemaLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DiscountSchemaLine_ID id +@param trxName transaction +*/ +public X_M_DiscountSchemaLine (Properties ctx, int M_DiscountSchemaLine_ID, String trxName) +{ +super (ctx, M_DiscountSchemaLine_ID, trxName); +/** if (M_DiscountSchemaLine_ID == 0) +{ +setC_ConversionType_ID (0); +setConversionDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setLimit_AddAmt (Env.ZERO); +setLimit_Base (null); // X +setLimit_Discount (Env.ZERO); +setLimit_MaxAmt (Env.ZERO); +setLimit_MinAmt (Env.ZERO); +setLimit_Rounding (null); // C +setList_AddAmt (Env.ZERO); +setList_Base (null); // L +setList_Discount (Env.ZERO); +setList_MaxAmt (Env.ZERO); +setList_MinAmt (Env.ZERO); +setList_Rounding (null); // C +setM_DiscountSchemaLine_ID (0); +setM_DiscountSchema_ID (0); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM M_DiscountSchemaLine WHERE M_DiscountSchema_ID=@M_DiscountSchema_ID@ +setStd_AddAmt (Env.ZERO); +setStd_Base (null); // S +setStd_Discount (Env.ZERO); +setStd_MaxAmt (Env.ZERO); +setStd_MinAmt (Env.ZERO); +setStd_Rounding (null); // C +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DiscountSchemaLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=477 */ +public static final int Table_ID=477; + +/** TableName=M_DiscountSchemaLine */ +public static final String Table_Name="M_DiscountSchemaLine"; + +protected static KeyNamePair Model = new KeyNamePair(477,"M_DiscountSchemaLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DiscountSchemaLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency Type. +@param C_ConversionType_ID Currency Conversion Rate Type */ +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID < 1) throw new IllegalArgumentException ("C_ConversionType_ID is mandatory."); +set_Value ("C_ConversionType_ID", new Integer(C_ConversionType_ID)); +} +/** Get Currency Type. +@return Currency Conversion Rate Type */ +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Conversion Date. +@param ConversionDate Date for selecting conversion rate */ +public void setConversionDate (Timestamp ConversionDate) +{ +if (ConversionDate == null) throw new IllegalArgumentException ("ConversionDate is mandatory."); +set_Value ("ConversionDate", ConversionDate); +} +/** Get Conversion Date. +@return Date for selecting conversion rate */ +public Timestamp getConversionDate() +{ +return (Timestamp)get_Value("ConversionDate"); +} +/** Set Limit price Surcharge Amount. +@param Limit_AddAmt Amount added to the converted/copied price before multiplying */ +public void setLimit_AddAmt (BigDecimal Limit_AddAmt) +{ +if (Limit_AddAmt == null) throw new IllegalArgumentException ("Limit_AddAmt is mandatory."); +set_Value ("Limit_AddAmt", Limit_AddAmt); +} +/** Get Limit price Surcharge Amount. +@return Amount added to the converted/copied price before multiplying */ +public BigDecimal getLimit_AddAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Limit_AddAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** Limit_Base AD_Reference_ID=194 */ +public static final int LIMIT_BASE_AD_Reference_ID=194; +/** Fixed Price = F */ +public static final String LIMIT_BASE_FixedPrice = "F"; +/** List Price = L */ +public static final String LIMIT_BASE_ListPrice = "L"; +/** Standard Price = S */ +public static final String LIMIT_BASE_StandardPrice = "S"; +/** Limit (PO) Price = X */ +public static final String LIMIT_BASE_LimitPOPrice = "X"; +/** Set Limit price Base. +@param Limit_Base Base price for calculation of the new price */ +public void setLimit_Base (String Limit_Base) +{ +if (Limit_Base == null) throw new IllegalArgumentException ("Limit_Base is mandatory"); +if (Limit_Base.equals("F") || Limit_Base.equals("L") || Limit_Base.equals("S") || Limit_Base.equals("X")); + else throw new IllegalArgumentException ("Limit_Base Invalid value - " + Limit_Base + " - Reference_ID=194 - F - L - S - X"); +if (Limit_Base.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Limit_Base = Limit_Base.substring(0,0); +} +set_Value ("Limit_Base", Limit_Base); +} +/** Get Limit price Base. +@return Base price for calculation of the new price */ +public String getLimit_Base() +{ +return (String)get_Value("Limit_Base"); +} +/** Set Limit price Discount %. +@param Limit_Discount Discount in percent to be subtracted from base, if negative it will be added to base price */ +public void setLimit_Discount (BigDecimal Limit_Discount) +{ +if (Limit_Discount == null) throw new IllegalArgumentException ("Limit_Discount is mandatory."); +set_Value ("Limit_Discount", Limit_Discount); +} +/** Get Limit price Discount %. +@return Discount in percent to be subtracted from base, if negative it will be added to base price */ +public BigDecimal getLimit_Discount() +{ +BigDecimal bd = (BigDecimal)get_Value("Limit_Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Fixed Limit Price. +@param Limit_Fixed Fixed Limit Price (not calculated) */ +public void setLimit_Fixed (BigDecimal Limit_Fixed) +{ +set_Value ("Limit_Fixed", Limit_Fixed); +} +/** Get Fixed Limit Price. +@return Fixed Limit Price (not calculated) */ +public BigDecimal getLimit_Fixed() +{ +BigDecimal bd = (BigDecimal)get_Value("Limit_Fixed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Limit price max Margin. +@param Limit_MaxAmt Maximum difference to original limit price; + ignored if zero */ +public void setLimit_MaxAmt (BigDecimal Limit_MaxAmt) +{ +if (Limit_MaxAmt == null) throw new IllegalArgumentException ("Limit_MaxAmt is mandatory."); +set_Value ("Limit_MaxAmt", Limit_MaxAmt); +} +/** Get Limit price max Margin. +@return Maximum difference to original limit price; + ignored if zero */ +public BigDecimal getLimit_MaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Limit_MaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Limit price min Margin. +@param Limit_MinAmt Minimum difference to original limit price; + ignored if zero */ +public void setLimit_MinAmt (BigDecimal Limit_MinAmt) +{ +if (Limit_MinAmt == null) throw new IllegalArgumentException ("Limit_MinAmt is mandatory."); +set_Value ("Limit_MinAmt", Limit_MinAmt); +} +/** Get Limit price min Margin. +@return Minimum difference to original limit price; + ignored if zero */ +public BigDecimal getLimit_MinAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Limit_MinAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** Limit_Rounding AD_Reference_ID=155 */ +public static final int LIMIT_ROUNDING_AD_Reference_ID=155; +/** Whole Number .00 = 0 */ +public static final String LIMIT_ROUNDING_WholeNumber00 = "0"; +/** Nickel .05, .10, .15, ... = 5 */ +public static final String LIMIT_ROUNDING_Nickel051015 = "5"; +/** Currency Precision = C */ +public static final String LIMIT_ROUNDING_CurrencyPrecision = "C"; +/** Dime .10, .20, .30, ... = D */ +public static final String LIMIT_ROUNDING_Dime102030 = "D"; +/** No Rounding = N */ +public static final String LIMIT_ROUNDING_NoRounding = "N"; +/** Quarter .25 .50 .75 = Q */ +public static final String LIMIT_ROUNDING_Quarter255075 = "Q"; +/** Ten 10.00, 20.00, .. = T */ +public static final String LIMIT_ROUNDING_Ten10002000 = "T"; +/** Set Limit price Rounding. +@param Limit_Rounding Rounding of the final result */ +public void setLimit_Rounding (String Limit_Rounding) +{ +if (Limit_Rounding == null) throw new IllegalArgumentException ("Limit_Rounding is mandatory"); +if (Limit_Rounding.equals("0") || Limit_Rounding.equals("5") || Limit_Rounding.equals("C") || Limit_Rounding.equals("D") || Limit_Rounding.equals("N") || Limit_Rounding.equals("Q") || Limit_Rounding.equals("T")); + else throw new IllegalArgumentException ("Limit_Rounding Invalid value - " + Limit_Rounding + " - Reference_ID=155 - 0 - 5 - C - D - N - Q - T"); +if (Limit_Rounding.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Limit_Rounding = Limit_Rounding.substring(0,0); +} +set_Value ("Limit_Rounding", Limit_Rounding); +} +/** Get Limit price Rounding. +@return Rounding of the final result */ +public String getLimit_Rounding() +{ +return (String)get_Value("Limit_Rounding"); +} +/** Set List price Surcharge Amount. +@param List_AddAmt List Price Surcharge Amount */ +public void setList_AddAmt (BigDecimal List_AddAmt) +{ +if (List_AddAmt == null) throw new IllegalArgumentException ("List_AddAmt is mandatory."); +set_Value ("List_AddAmt", List_AddAmt); +} +/** Get List price Surcharge Amount. +@return List Price Surcharge Amount */ +public BigDecimal getList_AddAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("List_AddAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** List_Base AD_Reference_ID=194 */ +public static final int LIST_BASE_AD_Reference_ID=194; +/** Fixed Price = F */ +public static final String LIST_BASE_FixedPrice = "F"; +/** List Price = L */ +public static final String LIST_BASE_ListPrice = "L"; +/** Standard Price = S */ +public static final String LIST_BASE_StandardPrice = "S"; +/** Limit (PO) Price = X */ +public static final String LIST_BASE_LimitPOPrice = "X"; +/** Set List price Base. +@param List_Base Price used as the basis for price list calculations */ +public void setList_Base (String List_Base) +{ +if (List_Base == null) throw new IllegalArgumentException ("List_Base is mandatory"); +if (List_Base.equals("F") || List_Base.equals("L") || List_Base.equals("S") || List_Base.equals("X")); + else throw new IllegalArgumentException ("List_Base Invalid value - " + List_Base + " - Reference_ID=194 - F - L - S - X"); +if (List_Base.length() > 1) +{ +log.warning("Length > 1 - truncated"); +List_Base = List_Base.substring(0,0); +} +set_Value ("List_Base", List_Base); +} +/** Get List price Base. +@return Price used as the basis for price list calculations */ +public String getList_Base() +{ +return (String)get_Value("List_Base"); +} +/** Set List price Discount %. +@param List_Discount Discount from list price as a percentage */ +public void setList_Discount (BigDecimal List_Discount) +{ +if (List_Discount == null) throw new IllegalArgumentException ("List_Discount is mandatory."); +set_Value ("List_Discount", List_Discount); +} +/** Get List price Discount %. +@return Discount from list price as a percentage */ +public BigDecimal getList_Discount() +{ +BigDecimal bd = (BigDecimal)get_Value("List_Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Fixed List Price. +@param List_Fixed Fixes List Price (not calculated) */ +public void setList_Fixed (BigDecimal List_Fixed) +{ +set_Value ("List_Fixed", List_Fixed); +} +/** Get Fixed List Price. +@return Fixes List Price (not calculated) */ +public BigDecimal getList_Fixed() +{ +BigDecimal bd = (BigDecimal)get_Value("List_Fixed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List price max Margin. +@param List_MaxAmt Maximum margin for a product */ +public void setList_MaxAmt (BigDecimal List_MaxAmt) +{ +if (List_MaxAmt == null) throw new IllegalArgumentException ("List_MaxAmt is mandatory."); +set_Value ("List_MaxAmt", List_MaxAmt); +} +/** Get List price max Margin. +@return Maximum margin for a product */ +public BigDecimal getList_MaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("List_MaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List price min Margin. +@param List_MinAmt Minimum margin for a product */ +public void setList_MinAmt (BigDecimal List_MinAmt) +{ +if (List_MinAmt == null) throw new IllegalArgumentException ("List_MinAmt is mandatory."); +set_Value ("List_MinAmt", List_MinAmt); +} +/** Get List price min Margin. +@return Minimum margin for a product */ +public BigDecimal getList_MinAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("List_MinAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** List_Rounding AD_Reference_ID=155 */ +public static final int LIST_ROUNDING_AD_Reference_ID=155; +/** Whole Number .00 = 0 */ +public static final String LIST_ROUNDING_WholeNumber00 = "0"; +/** Nickel .05, .10, .15, ... = 5 */ +public static final String LIST_ROUNDING_Nickel051015 = "5"; +/** Currency Precision = C */ +public static final String LIST_ROUNDING_CurrencyPrecision = "C"; +/** Dime .10, .20, .30, ... = D */ +public static final String LIST_ROUNDING_Dime102030 = "D"; +/** No Rounding = N */ +public static final String LIST_ROUNDING_NoRounding = "N"; +/** Quarter .25 .50 .75 = Q */ +public static final String LIST_ROUNDING_Quarter255075 = "Q"; +/** Ten 10.00, 20.00, .. = T */ +public static final String LIST_ROUNDING_Ten10002000 = "T"; +/** Set List price Rounding. +@param List_Rounding Rounding rule for final list price */ +public void setList_Rounding (String List_Rounding) +{ +if (List_Rounding == null) throw new IllegalArgumentException ("List_Rounding is mandatory"); +if (List_Rounding.equals("0") || List_Rounding.equals("5") || List_Rounding.equals("C") || List_Rounding.equals("D") || List_Rounding.equals("N") || List_Rounding.equals("Q") || List_Rounding.equals("T")); + else throw new IllegalArgumentException ("List_Rounding Invalid value - " + List_Rounding + " - Reference_ID=155 - 0 - 5 - C - D - N - Q - T"); +if (List_Rounding.length() > 1) +{ +log.warning("Length > 1 - truncated"); +List_Rounding = List_Rounding.substring(0,0); +} +set_Value ("List_Rounding", List_Rounding); +} +/** Get List price Rounding. +@return Rounding rule for final list price */ +public String getList_Rounding() +{ +return (String)get_Value("List_Rounding"); +} +/** Set Discount Pricelist. +@param M_DiscountSchemaLine_ID Line of the pricelist trade discount schema */ +public void setM_DiscountSchemaLine_ID (int M_DiscountSchemaLine_ID) +{ +if (M_DiscountSchemaLine_ID < 1) throw new IllegalArgumentException ("M_DiscountSchemaLine_ID is mandatory."); +set_ValueNoCheck ("M_DiscountSchemaLine_ID", new Integer(M_DiscountSchemaLine_ID)); +} +/** Get Discount Pricelist. +@return Line of the pricelist trade discount schema */ +public int getM_DiscountSchemaLine_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchemaLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID < 1) throw new IllegalArgumentException ("M_DiscountSchema_ID is mandatory."); +set_ValueNoCheck ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +/** Set Standard price Surcharge Amount. +@param Std_AddAmt Amount added to a price as a surcharge */ +public void setStd_AddAmt (BigDecimal Std_AddAmt) +{ +if (Std_AddAmt == null) throw new IllegalArgumentException ("Std_AddAmt is mandatory."); +set_Value ("Std_AddAmt", Std_AddAmt); +} +/** Get Standard price Surcharge Amount. +@return Amount added to a price as a surcharge */ +public BigDecimal getStd_AddAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Std_AddAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** Std_Base AD_Reference_ID=194 */ +public static final int STD_BASE_AD_Reference_ID=194; +/** Fixed Price = F */ +public static final String STD_BASE_FixedPrice = "F"; +/** List Price = L */ +public static final String STD_BASE_ListPrice = "L"; +/** Standard Price = S */ +public static final String STD_BASE_StandardPrice = "S"; +/** Limit (PO) Price = X */ +public static final String STD_BASE_LimitPOPrice = "X"; +/** Set Standard price Base. +@param Std_Base Base price for calculating new standard price */ +public void setStd_Base (String Std_Base) +{ +if (Std_Base == null) throw new IllegalArgumentException ("Std_Base is mandatory"); +if (Std_Base.equals("F") || Std_Base.equals("L") || Std_Base.equals("S") || Std_Base.equals("X")); + else throw new IllegalArgumentException ("Std_Base Invalid value - " + Std_Base + " - Reference_ID=194 - F - L - S - X"); +if (Std_Base.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Std_Base = Std_Base.substring(0,0); +} +set_Value ("Std_Base", Std_Base); +} +/** Get Standard price Base. +@return Base price for calculating new standard price */ +public String getStd_Base() +{ +return (String)get_Value("Std_Base"); +} +/** Set Standard price Discount %. +@param Std_Discount Discount percentage to subtract from base price */ +public void setStd_Discount (BigDecimal Std_Discount) +{ +if (Std_Discount == null) throw new IllegalArgumentException ("Std_Discount is mandatory."); +set_Value ("Std_Discount", Std_Discount); +} +/** Get Standard price Discount %. +@return Discount percentage to subtract from base price */ +public BigDecimal getStd_Discount() +{ +BigDecimal bd = (BigDecimal)get_Value("Std_Discount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Fixed Standard Price. +@param Std_Fixed Fixed Standard Price (not calculated) */ +public void setStd_Fixed (BigDecimal Std_Fixed) +{ +set_Value ("Std_Fixed", Std_Fixed); +} +/** Get Fixed Standard Price. +@return Fixed Standard Price (not calculated) */ +public BigDecimal getStd_Fixed() +{ +BigDecimal bd = (BigDecimal)get_Value("Std_Fixed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard max Margin. +@param Std_MaxAmt Maximum margin allowed for a product */ +public void setStd_MaxAmt (BigDecimal Std_MaxAmt) +{ +if (Std_MaxAmt == null) throw new IllegalArgumentException ("Std_MaxAmt is mandatory."); +set_Value ("Std_MaxAmt", Std_MaxAmt); +} +/** Get Standard max Margin. +@return Maximum margin allowed for a product */ +public BigDecimal getStd_MaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Std_MaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard price min Margin. +@param Std_MinAmt Minimum margin allowed for a product */ +public void setStd_MinAmt (BigDecimal Std_MinAmt) +{ +if (Std_MinAmt == null) throw new IllegalArgumentException ("Std_MinAmt is mandatory."); +set_Value ("Std_MinAmt", Std_MinAmt); +} +/** Get Standard price min Margin. +@return Minimum margin allowed for a product */ +public BigDecimal getStd_MinAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Std_MinAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** Std_Rounding AD_Reference_ID=155 */ +public static final int STD_ROUNDING_AD_Reference_ID=155; +/** Whole Number .00 = 0 */ +public static final String STD_ROUNDING_WholeNumber00 = "0"; +/** Nickel .05, .10, .15, ... = 5 */ +public static final String STD_ROUNDING_Nickel051015 = "5"; +/** Currency Precision = C */ +public static final String STD_ROUNDING_CurrencyPrecision = "C"; +/** Dime .10, .20, .30, ... = D */ +public static final String STD_ROUNDING_Dime102030 = "D"; +/** No Rounding = N */ +public static final String STD_ROUNDING_NoRounding = "N"; +/** Quarter .25 .50 .75 = Q */ +public static final String STD_ROUNDING_Quarter255075 = "Q"; +/** Ten 10.00, 20.00, .. = T */ +public static final String STD_ROUNDING_Ten10002000 = "T"; +/** Set Standard price Rounding. +@param Std_Rounding Rounding rule for calculated price */ +public void setStd_Rounding (String Std_Rounding) +{ +if (Std_Rounding == null) throw new IllegalArgumentException ("Std_Rounding is mandatory"); +if (Std_Rounding.equals("0") || Std_Rounding.equals("5") || Std_Rounding.equals("C") || Std_Rounding.equals("D") || Std_Rounding.equals("N") || Std_Rounding.equals("Q") || Std_Rounding.equals("T")); + else throw new IllegalArgumentException ("Std_Rounding Invalid value - " + Std_Rounding + " - Reference_ID=155 - 0 - 5 - C - D - N - Q - T"); +if (Std_Rounding.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Std_Rounding = Std_Rounding.substring(0,0); +} +set_Value ("Std_Rounding", Std_Rounding); +} +/** Get Standard price Rounding. +@return Rounding rule for calculated price */ +public String getStd_Rounding() +{ +return (String)get_Value("Std_Rounding"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DistributionList.java b/dbPort/src/org/compiere/model/X_M_DistributionList.java new file mode 100644 index 0000000000..93dd510df0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DistributionList.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DistributionList + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.843 */ +public class X_M_DistributionList extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DistributionList_ID id +@param trxName transaction +*/ +public X_M_DistributionList (Properties ctx, int M_DistributionList_ID, String trxName) +{ +super (ctx, M_DistributionList_ID, trxName); +/** if (M_DistributionList_ID == 0) +{ +setM_DistributionList_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DistributionList (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=666 */ +public static final int Table_ID=666; + +/** TableName=M_DistributionList */ +public static final String Table_Name="M_DistributionList"; + +protected static KeyNamePair Model = new KeyNamePair(666,"M_DistributionList"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DistributionList[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Distribution List. +@param M_DistributionList_ID Distribution Lists allow to distribute products to a selected list of partners */ +public void setM_DistributionList_ID (int M_DistributionList_ID) +{ +if (M_DistributionList_ID < 1) throw new IllegalArgumentException ("M_DistributionList_ID is mandatory."); +set_ValueNoCheck ("M_DistributionList_ID", new Integer(M_DistributionList_ID)); +} +/** Get Distribution List. +@return Distribution Lists allow to distribute products to a selected list of partners */ +public int getM_DistributionList_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Ratio. +@param RatioTotal Total of relative weight in a distribution */ +public void setRatioTotal (BigDecimal RatioTotal) +{ +set_Value ("RatioTotal", RatioTotal); +} +/** Get Total Ratio. +@return Total of relative weight in a distribution */ +public BigDecimal getRatioTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("RatioTotal"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DistributionListLine.java b/dbPort/src/org/compiere/model/X_M_DistributionListLine.java new file mode 100644 index 0000000000..3325d65959 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DistributionListLine.java @@ -0,0 +1,204 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DistributionListLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.859 */ +public class X_M_DistributionListLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DistributionListLine_ID id +@param trxName transaction +*/ +public X_M_DistributionListLine (Properties ctx, int M_DistributionListLine_ID, String trxName) +{ +super (ctx, M_DistributionListLine_ID, trxName); +/** if (M_DistributionListLine_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setM_DistributionListLine_ID (0); +setM_DistributionList_ID (0); +setMinQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DistributionListLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=665 */ +public static final int Table_ID=665; + +/** TableName=M_DistributionListLine */ +public static final String Table_Name="M_DistributionListLine"; + +protected static KeyNamePair Model = new KeyNamePair(665,"M_DistributionListLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DistributionListLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Distribution List Line. +@param M_DistributionListLine_ID Distribution List Line with Business Partner and Quantity/Percentage */ +public void setM_DistributionListLine_ID (int M_DistributionListLine_ID) +{ +if (M_DistributionListLine_ID < 1) throw new IllegalArgumentException ("M_DistributionListLine_ID is mandatory."); +set_ValueNoCheck ("M_DistributionListLine_ID", new Integer(M_DistributionListLine_ID)); +} +/** Get Distribution List Line. +@return Distribution List Line with Business Partner and Quantity/Percentage */ +public int getM_DistributionListLine_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionListLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution List. +@param M_DistributionList_ID Distribution Lists allow to distribute products to a selected list of partners */ +public void setM_DistributionList_ID (int M_DistributionList_ID) +{ +if (M_DistributionList_ID < 1) throw new IllegalArgumentException ("M_DistributionList_ID is mandatory."); +set_ValueNoCheck ("M_DistributionList_ID", new Integer(M_DistributionList_ID)); +} +/** Get Distribution List. +@return Distribution Lists allow to distribute products to a selected list of partners */ +public int getM_DistributionList_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_DistributionList_ID())); +} +/** Set Minimum Quantity. +@param MinQty Minimum quantity for the business partner */ +public void setMinQty (BigDecimal MinQty) +{ +if (MinQty == null) throw new IllegalArgumentException ("MinQty is mandatory."); +set_Value ("MinQty", MinQty); +} +/** Get Minimum Quantity. +@return Minimum quantity for the business partner */ +public BigDecimal getMinQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MinQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ratio. +@param Ratio Relative Ratio for Distributions */ +public void setRatio (BigDecimal Ratio) +{ +set_Value ("Ratio", Ratio); +} +/** Get Ratio. +@return Relative Ratio for Distributions */ +public BigDecimal getRatio() +{ +BigDecimal bd = (BigDecimal)get_Value("Ratio"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DistributionRun.java b/dbPort/src/org/compiere/model/X_M_DistributionRun.java new file mode 100644 index 0000000000..f6daae76bf --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DistributionRun.java @@ -0,0 +1,214 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DistributionRun + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.859 */ +public class X_M_DistributionRun extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DistributionRun_ID id +@param trxName transaction +*/ +public X_M_DistributionRun (Properties ctx, int M_DistributionRun_ID, String trxName) +{ +super (ctx, M_DistributionRun_ID, trxName); +/** if (M_DistributionRun_ID == 0) +{ +setIsCreateSingleOrder (false); // N +setM_DistributionRun_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DistributionRun (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=712 */ +public static final int Table_ID=712; + +/** TableName=M_DistributionRun */ +public static final String Table_Name="M_DistributionRun"; + +protected static KeyNamePair Model = new KeyNamePair(712,"M_DistributionRun"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DistributionRun[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID <= 0) set_Value ("C_BPartner_Location_ID", null); + else +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Create Single Order. +@param IsCreateSingleOrder For all shipments create one Order */ +public void setIsCreateSingleOrder (boolean IsCreateSingleOrder) +{ +set_Value ("IsCreateSingleOrder", new Boolean(IsCreateSingleOrder)); +} +/** Get Create Single Order. +@return For all shipments create one Order */ +public boolean isCreateSingleOrder() +{ +Object oo = get_Value("IsCreateSingleOrder"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Distribution Run. +@param M_DistributionRun_ID Distribution Run create Orders to distribute products to a selected list of partners */ +public void setM_DistributionRun_ID (int M_DistributionRun_ID) +{ +if (M_DistributionRun_ID < 1) throw new IllegalArgumentException ("M_DistributionRun_ID is mandatory."); +set_ValueNoCheck ("M_DistributionRun_ID", new Integer(M_DistributionRun_ID)); +} +/** Get Distribution Run. +@return Distribution Run create Orders to distribute products to a selected list of partners */ +public int getM_DistributionRun_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_DistributionRunLine.java b/dbPort/src/org/compiere/model/X_M_DistributionRunLine.java new file mode 100644 index 0000000000..198787abc7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_DistributionRunLine.java @@ -0,0 +1,221 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_DistributionRunLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.875 */ +public class X_M_DistributionRunLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_DistributionRunLine_ID id +@param trxName transaction +*/ +public X_M_DistributionRunLine (Properties ctx, int M_DistributionRunLine_ID, String trxName) +{ +super (ctx, M_DistributionRunLine_ID, trxName); +/** if (M_DistributionRunLine_ID == 0) +{ +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_DistributionRunLine WHERE M_DistributionRun_ID=@M_DistributionRun_ID@ +setM_DistributionList_ID (0); +setM_DistributionRunLine_ID (0); +setM_DistributionRun_ID (0); +setM_Product_ID (0); +setMinQty (Env.ZERO); // 0 +setTotalQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_DistributionRunLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=713 */ +public static final int Table_ID=713; + +/** TableName=M_DistributionRunLine */ +public static final String Table_Name="M_DistributionRunLine"; + +protected static KeyNamePair Model = new KeyNamePair(713,"M_DistributionRunLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_DistributionRunLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution List. +@param M_DistributionList_ID Distribution Lists allow to distribute products to a selected list of partners */ +public void setM_DistributionList_ID (int M_DistributionList_ID) +{ +if (M_DistributionList_ID < 1) throw new IllegalArgumentException ("M_DistributionList_ID is mandatory."); +set_Value ("M_DistributionList_ID", new Integer(M_DistributionList_ID)); +} +/** Get Distribution List. +@return Distribution Lists allow to distribute products to a selected list of partners */ +public int getM_DistributionList_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution Run Line. +@param M_DistributionRunLine_ID Distribution Run Lines define Distribution List, the Product and Quantiries */ +public void setM_DistributionRunLine_ID (int M_DistributionRunLine_ID) +{ +if (M_DistributionRunLine_ID < 1) throw new IllegalArgumentException ("M_DistributionRunLine_ID is mandatory."); +set_ValueNoCheck ("M_DistributionRunLine_ID", new Integer(M_DistributionRunLine_ID)); +} +/** Get Distribution Run Line. +@return Distribution Run Lines define Distribution List, the Product and Quantiries */ +public int getM_DistributionRunLine_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionRunLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution Run. +@param M_DistributionRun_ID Distribution Run create Orders to distribute products to a selected list of partners */ +public void setM_DistributionRun_ID (int M_DistributionRun_ID) +{ +if (M_DistributionRun_ID < 1) throw new IllegalArgumentException ("M_DistributionRun_ID is mandatory."); +set_ValueNoCheck ("M_DistributionRun_ID", new Integer(M_DistributionRun_ID)); +} +/** Get Distribution Run. +@return Distribution Run create Orders to distribute products to a selected list of partners */ +public int getM_DistributionRun_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_DistributionRun_ID())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Minimum Quantity. +@param MinQty Minimum quantity for the business partner */ +public void setMinQty (BigDecimal MinQty) +{ +if (MinQty == null) throw new IllegalArgumentException ("MinQty is mandatory."); +set_Value ("MinQty", MinQty); +} +/** Get Minimum Quantity. +@return Minimum quantity for the business partner */ +public BigDecimal getMinQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MinQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Total Quantity. +@param TotalQty Total Quantity */ +public void setTotalQty (BigDecimal TotalQty) +{ +if (TotalQty == null) throw new IllegalArgumentException ("TotalQty is mandatory."); +set_Value ("TotalQty", TotalQty); +} +/** Get Total Quantity. +@return Total Quantity */ +public BigDecimal getTotalQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_EDI.java b/dbPort/src/org/compiere/model/X_M_EDI.java new file mode 100644 index 0000000000..6056e25e8f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_EDI.java @@ -0,0 +1,423 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_EDI + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.89 */ +public class X_M_EDI extends PO +{ +/** Standard Constructor +@param ctx context +@param M_EDI_ID id +@param trxName transaction +*/ +public X_M_EDI (Properties ctx, int M_EDI_ID, String trxName) +{ +super (ctx, M_EDI_ID, trxName); +/** if (M_EDI_ID == 0) +{ +setC_BP_EDI_ID (0); +setDocumentNo (null); +setEDIStatus (null); +setLine (0); +setM_EDI_ID (0); +setM_Product_ID (0); +setM_Warehouse_ID (0); +setProcessed (false); +setRequest_Qty (Env.ZERO); +setRequest_Shipdate (new Timestamp(System.currentTimeMillis())); +setTrxSent (new Timestamp(System.currentTimeMillis())); +setTrxType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_EDI (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=367 */ +public static final int Table_ID=367; + +/** TableName=M_EDI */ +public static final String Table_Name="M_EDI"; + +protected static KeyNamePair Model = new KeyNamePair(367,"M_EDI"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_EDI[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set EDI Definition. +@param C_BP_EDI_ID Electronic Data Interchange */ +public void setC_BP_EDI_ID (int C_BP_EDI_ID) +{ +if (C_BP_EDI_ID < 1) throw new IllegalArgumentException ("C_BP_EDI_ID is mandatory."); +set_Value ("C_BP_EDI_ID", new Integer(C_BP_EDI_ID)); +} +/** Get EDI Definition. +@return Electronic Data Interchange */ +public int getC_BP_EDI_ID() +{ +Integer ii = (Integer)get_Value("C_BP_EDI_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} + +/** EDIStatus AD_Reference_ID=202 */ +public static final int EDISTATUS_AD_Reference_ID=202; +/** Acknowledged = A */ +public static final String EDISTATUS_Acknowledged = "A"; +/** Answered (complete) = C */ +public static final String EDISTATUS_AnsweredComplete = "C"; +/** Draft = D */ +public static final String EDISTATUS_Draft = "D"; +/** Sent = S */ +public static final String EDISTATUS_Sent = "S"; +/** Set EDI Status. +@param EDIStatus EDI Status */ +public void setEDIStatus (String EDIStatus) +{ +if (EDIStatus == null) throw new IllegalArgumentException ("EDIStatus is mandatory"); +if (EDIStatus.equals("A") || EDIStatus.equals("C") || EDIStatus.equals("D") || EDIStatus.equals("S")); + else throw new IllegalArgumentException ("EDIStatus Invalid value - " + EDIStatus + " - Reference_ID=202 - A - C - D - S"); +if (EDIStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +EDIStatus = EDIStatus.substring(0,0); +} +set_ValueNoCheck ("EDIStatus", EDIStatus); +} +/** Get EDI Status. +@return EDI Status */ +public String getEDIStatus() +{ +return (String)get_Value("EDIStatus"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set EDI Transaction. +@param M_EDI_ID EDI Transaction */ +public void setM_EDI_ID (int M_EDI_ID) +{ +if (M_EDI_ID < 1) throw new IllegalArgumentException ("M_EDI_ID is mandatory."); +set_ValueNoCheck ("M_EDI_ID", new Integer(M_EDI_ID)); +} +/** Get EDI Transaction. +@return EDI Transaction */ +public int getM_EDI_ID() +{ +Integer ii = (Integer)get_Value("M_EDI_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Reply Price. +@param Reply_Price Confirmed Price from EDI Partner */ +public void setReply_Price (BigDecimal Reply_Price) +{ +set_Value ("Reply_Price", Reply_Price); +} +/** Get Reply Price. +@return Confirmed Price from EDI Partner */ +public BigDecimal getReply_Price() +{ +BigDecimal bd = (BigDecimal)get_Value("Reply_Price"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reply Qty Available. +@param Reply_QtyAvailable Reply Qty Available */ +public void setReply_QtyAvailable (BigDecimal Reply_QtyAvailable) +{ +set_Value ("Reply_QtyAvailable", Reply_QtyAvailable); +} +/** Get Reply Qty Available. +@return Reply Qty Available */ +public BigDecimal getReply_QtyAvailable() +{ +BigDecimal bd = (BigDecimal)get_Value("Reply_QtyAvailable"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reply Qty Confirmed. +@param Reply_QtyConfirmed Reply Qty Confirmed */ +public void setReply_QtyConfirmed (BigDecimal Reply_QtyConfirmed) +{ +set_Value ("Reply_QtyConfirmed", Reply_QtyConfirmed); +} +/** Get Reply Qty Confirmed. +@return Reply Qty Confirmed */ +public BigDecimal getReply_QtyConfirmed() +{ +BigDecimal bd = (BigDecimal)get_Value("Reply_QtyConfirmed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reply Received. +@param Reply_Received Reply Received */ +public void setReply_Received (Timestamp Reply_Received) +{ +set_Value ("Reply_Received", Reply_Received); +} +/** Get Reply Received. +@return Reply Received */ +public Timestamp getReply_Received() +{ +return (Timestamp)get_Value("Reply_Received"); +} +/** Set Reply Remarks. +@param Reply_Remarks Reply Remarks */ +public void setReply_Remarks (String Reply_Remarks) +{ +if (Reply_Remarks != null && Reply_Remarks.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Reply_Remarks = Reply_Remarks.substring(0,1999); +} +set_Value ("Reply_Remarks", Reply_Remarks); +} +/** Get Reply Remarks. +@return Reply Remarks */ +public String getReply_Remarks() +{ +return (String)get_Value("Reply_Remarks"); +} +/** Set Reply Ship date. +@param Reply_ShipDate Reply Ship date */ +public void setReply_ShipDate (Timestamp Reply_ShipDate) +{ +set_Value ("Reply_ShipDate", Reply_ShipDate); +} +/** Get Reply Ship date. +@return Reply Ship date */ +public Timestamp getReply_ShipDate() +{ +return (Timestamp)get_Value("Reply_ShipDate"); +} +/** Set Request Price. +@param Request_Price Request Price */ +public void setRequest_Price (BigDecimal Request_Price) +{ +set_Value ("Request_Price", Request_Price); +} +/** Get Request Price. +@return Request Price */ +public BigDecimal getRequest_Price() +{ +BigDecimal bd = (BigDecimal)get_Value("Request_Price"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Request Qty. +@param Request_Qty Request Qty */ +public void setRequest_Qty (BigDecimal Request_Qty) +{ +if (Request_Qty == null) throw new IllegalArgumentException ("Request_Qty is mandatory."); +set_Value ("Request_Qty", Request_Qty); +} +/** Get Request Qty. +@return Request Qty */ +public BigDecimal getRequest_Qty() +{ +BigDecimal bd = (BigDecimal)get_Value("Request_Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Request Ship date. +@param Request_Shipdate Request Ship date */ +public void setRequest_Shipdate (Timestamp Request_Shipdate) +{ +if (Request_Shipdate == null) throw new IllegalArgumentException ("Request_Shipdate is mandatory."); +set_Value ("Request_Shipdate", Request_Shipdate); +} +/** Get Request Ship date. +@return Request Ship date */ +public Timestamp getRequest_Shipdate() +{ +return (Timestamp)get_Value("Request_Shipdate"); +} +/** Set Transaction received. +@param TrxReceived Transaction received */ +public void setTrxReceived (Timestamp TrxReceived) +{ +set_Value ("TrxReceived", TrxReceived); +} +/** Get Transaction received. +@return Transaction received */ +public Timestamp getTrxReceived() +{ +return (Timestamp)get_Value("TrxReceived"); +} +/** Set Transaction sent. +@param TrxSent Transaction sent */ +public void setTrxSent (Timestamp TrxSent) +{ +if (TrxSent == null) throw new IllegalArgumentException ("TrxSent is mandatory."); +set_Value ("TrxSent", TrxSent); +} +/** Get Transaction sent. +@return Transaction sent */ +public Timestamp getTrxSent() +{ +return (Timestamp)get_Value("TrxSent"); +} + +/** TrxType AD_Reference_ID=203 */ +public static final int TRXTYPE_AD_Reference_ID=203; +/** Inquiry = I */ +public static final String TRXTYPE_Inquiry = "I"; +/** Purchase Order = O */ +public static final String TRXTYPE_PurchaseOrder = "O"; +/** Set Transaction Type. +@param TrxType Type of credit card transaction */ +public void setTrxType (String TrxType) +{ +if (TrxType == null) throw new IllegalArgumentException ("TrxType is mandatory"); +if (TrxType.equals("I") || TrxType.equals("O")); + else throw new IllegalArgumentException ("TrxType Invalid value - " + TrxType + " - Reference_ID=203 - I - O"); +if (TrxType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TrxType = TrxType.substring(0,0); +} +set_ValueNoCheck ("TrxType", TrxType); +} +/** Get Transaction Type. +@return Type of credit card transaction */ +public String getTrxType() +{ +return (String)get_Value("TrxType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_EDI_Info.java b/dbPort/src/org/compiere/model/X_M_EDI_Info.java new file mode 100644 index 0000000000..f5330de48d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_EDI_Info.java @@ -0,0 +1,144 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_EDI_Info + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.906 */ +public class X_M_EDI_Info extends PO +{ +/** Standard Constructor +@param ctx context +@param M_EDI_Info_ID id +@param trxName transaction +*/ +public X_M_EDI_Info (Properties ctx, int M_EDI_Info_ID, String trxName) +{ +super (ctx, M_EDI_Info_ID, trxName); +/** if (M_EDI_Info_ID == 0) +{ +setInfo (null); +setM_EDI_ID (0); +setM_EDI_Info_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_EDI_Info (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=368 */ +public static final int Table_ID=368; + +/** TableName=M_EDI_Info */ +public static final String Table_Name="M_EDI_Info"; + +protected static KeyNamePair Model = new KeyNamePair(368,"M_EDI_Info"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_EDI_Info[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Info. +@param Info Information */ +public void setInfo (String Info) +{ +if (Info == null) throw new IllegalArgumentException ("Info is mandatory."); +if (Info.length() > 4000) +{ +log.warning("Length > 4000 - truncated"); +Info = Info.substring(0,3999); +} +set_Value ("Info", Info); +} +/** Get Info. +@return Information */ +public String getInfo() +{ +return (String)get_Value("Info"); +} +/** Set EDI Transaction. +@param M_EDI_ID EDI Transaction */ +public void setM_EDI_ID (int M_EDI_ID) +{ +if (M_EDI_ID < 1) throw new IllegalArgumentException ("M_EDI_ID is mandatory."); +set_ValueNoCheck ("M_EDI_ID", new Integer(M_EDI_ID)); +} +/** Get EDI Transaction. +@return EDI Transaction */ +public int getM_EDI_ID() +{ +Integer ii = (Integer)get_Value("M_EDI_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_EDI_ID())); +} +/** Set EDI Log. +@param M_EDI_Info_ID EDI Log */ +public void setM_EDI_Info_ID (int M_EDI_Info_ID) +{ +if (M_EDI_Info_ID < 1) throw new IllegalArgumentException ("M_EDI_Info_ID is mandatory."); +set_ValueNoCheck ("M_EDI_Info_ID", new Integer(M_EDI_Info_ID)); +} +/** Get EDI Log. +@return EDI Log */ +public int getM_EDI_Info_ID() +{ +Integer ii = (Integer)get_Value("M_EDI_Info_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Forecast.java b/dbPort/src/org/compiere/model/X_M_Forecast.java new file mode 100644 index 0000000000..b9fa6056fb --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Forecast.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Forecast + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.921 */ +public class X_M_Forecast extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Forecast_ID id +@param trxName transaction +*/ +public X_M_Forecast (Properties ctx, int M_Forecast_ID, String trxName) +{ +super (ctx, M_Forecast_ID, trxName); +/** if (M_Forecast_ID == 0) +{ +setC_Calendar_ID (0); +setC_Year_ID (0); +setIsDefault (false); +setM_Forecast_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Forecast (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=720 */ +public static final int Table_ID=720; + +/** TableName=M_Forecast */ +public static final String Table_Name="M_Forecast"; + +protected static KeyNamePair Model = new KeyNamePair(720,"M_Forecast"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Forecast[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID < 1) throw new IllegalArgumentException ("C_Calendar_ID is mandatory."); +set_ValueNoCheck ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Year. +@param C_Year_ID Calendar Year */ +public void setC_Year_ID (int C_Year_ID) +{ +if (C_Year_ID < 1) throw new IllegalArgumentException ("C_Year_ID is mandatory."); +set_ValueNoCheck ("C_Year_ID", new Integer(C_Year_ID)); +} +/** Get Year. +@return Calendar Year */ +public int getC_Year_ID() +{ +Integer ii = (Integer)get_Value("C_Year_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Forecast. +@param M_Forecast_ID Material Forecast */ +public void setM_Forecast_ID (int M_Forecast_ID) +{ +if (M_Forecast_ID < 1) throw new IllegalArgumentException ("M_Forecast_ID is mandatory."); +set_ValueNoCheck ("M_Forecast_ID", new Integer(M_Forecast_ID)); +} +/** Get Forecast. +@return Material Forecast */ +public int getM_Forecast_ID() +{ +Integer ii = (Integer)get_Value("M_Forecast_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ForecastLine.java b/dbPort/src/org/compiere/model/X_M_ForecastLine.java new file mode 100644 index 0000000000..e24165cedd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ForecastLine.java @@ -0,0 +1,189 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ForecastLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.921 */ +public class X_M_ForecastLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ForecastLine_ID id +@param trxName transaction +*/ +public X_M_ForecastLine (Properties ctx, int M_ForecastLine_ID, String trxName) +{ +super (ctx, M_ForecastLine_ID, trxName); +/** if (M_ForecastLine_ID == 0) +{ +setC_Period_ID (0); +setM_ForecastLine_ID (0); +setM_Forecast_ID (0); +setM_Product_ID (0); +setQty (Env.ZERO); +setQtyCalculated (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ForecastLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=722 */ +public static final int Table_ID=722; + +/** TableName=M_ForecastLine */ +public static final String Table_Name="M_ForecastLine"; + +protected static KeyNamePair Model = new KeyNamePair(722,"M_ForecastLine"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ForecastLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Period. +@param C_Period_ID Period of the Calendar */ +public void setC_Period_ID (int C_Period_ID) +{ +if (C_Period_ID < 1) throw new IllegalArgumentException ("C_Period_ID is mandatory."); +set_ValueNoCheck ("C_Period_ID", new Integer(C_Period_ID)); +} +/** Get Period. +@return Period of the Calendar */ +public int getC_Period_ID() +{ +Integer ii = (Integer)get_Value("C_Period_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Period_ID())); +} +/** Set Forecast Line. +@param M_ForecastLine_ID Forecast Line */ +public void setM_ForecastLine_ID (int M_ForecastLine_ID) +{ +if (M_ForecastLine_ID < 1) throw new IllegalArgumentException ("M_ForecastLine_ID is mandatory."); +set_ValueNoCheck ("M_ForecastLine_ID", new Integer(M_ForecastLine_ID)); +} +/** Get Forecast Line. +@return Forecast Line */ +public int getM_ForecastLine_ID() +{ +Integer ii = (Integer)get_Value("M_ForecastLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Forecast. +@param M_Forecast_ID Material Forecast */ +public void setM_Forecast_ID (int M_Forecast_ID) +{ +if (M_Forecast_ID < 1) throw new IllegalArgumentException ("M_Forecast_ID is mandatory."); +set_ValueNoCheck ("M_Forecast_ID", new Integer(M_Forecast_ID)); +} +/** Get Forecast. +@return Material Forecast */ +public int getM_Forecast_ID() +{ +Integer ii = (Integer)get_Value("M_Forecast_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Calculated Quantity. +@param QtyCalculated Calculated Quantity */ +public void setQtyCalculated (BigDecimal QtyCalculated) +{ +if (QtyCalculated == null) throw new IllegalArgumentException ("QtyCalculated is mandatory."); +set_Value ("QtyCalculated", QtyCalculated); +} +/** Get Calculated Quantity. +@return Calculated Quantity */ +public BigDecimal getQtyCalculated() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyCalculated"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Freight.java b/dbPort/src/org/compiere/model/X_M_Freight.java new file mode 100644 index 0000000000..31fd7383a7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Freight.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Freight + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.937 */ +public class X_M_Freight extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Freight_ID id +@param trxName transaction +*/ +public X_M_Freight (Properties ctx, int M_Freight_ID, String trxName) +{ +super (ctx, M_Freight_ID, trxName); +/** if (M_Freight_ID == 0) +{ +setC_Currency_ID (0); +setFreightAmt (Env.ZERO); +setM_FreightCategory_ID (0); +setM_Freight_ID (0); +setM_Shipper_ID (0); +setValidFrom (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Freight (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=596 */ +public static final int Table_ID=596; + +/** TableName=M_Freight */ +public static final String Table_Name="M_Freight"; + +protected static KeyNamePair Model = new KeyNamePair(596,"M_Freight"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Freight[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID <= 0) set_Value ("C_Country_ID", null); + else +set_Value ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_Value ("C_Region_ID", null); + else +set_Value ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Freight Amount. +@param FreightAmt Freight Amount */ +public void setFreightAmt (BigDecimal FreightAmt) +{ +if (FreightAmt == null) throw new IllegalArgumentException ("FreightAmt is mandatory."); +set_Value ("FreightAmt", FreightAmt); +} +/** Get Freight Amount. +@return Freight Amount */ +public BigDecimal getFreightAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Freight Category. +@param M_FreightCategory_ID Category of the Freight */ +public void setM_FreightCategory_ID (int M_FreightCategory_ID) +{ +if (M_FreightCategory_ID < 1) throw new IllegalArgumentException ("M_FreightCategory_ID is mandatory."); +set_Value ("M_FreightCategory_ID", new Integer(M_FreightCategory_ID)); +} +/** Get Freight Category. +@return Category of the Freight */ +public int getM_FreightCategory_ID() +{ +Integer ii = (Integer)get_Value("M_FreightCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Freight. +@param M_Freight_ID Freight Rate */ +public void setM_Freight_ID (int M_Freight_ID) +{ +if (M_Freight_ID < 1) throw new IllegalArgumentException ("M_Freight_ID is mandatory."); +set_ValueNoCheck ("M_Freight_ID", new Integer(M_Freight_ID)); +} +/** Get Freight. +@return Freight Rate */ +public int getM_Freight_ID() +{ +Integer ii = (Integer)get_Value("M_Freight_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID < 1) throw new IllegalArgumentException ("M_Shipper_ID is mandatory."); +set_ValueNoCheck ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_Shipper_ID())); +} + +/** To_Country_ID AD_Reference_ID=156 */ +public static final int TO_COUNTRY_ID_AD_Reference_ID=156; +/** Set To. +@param To_Country_ID Receiving Country */ +public void setTo_Country_ID (int To_Country_ID) +{ +if (To_Country_ID <= 0) set_Value ("To_Country_ID", null); + else +set_Value ("To_Country_ID", new Integer(To_Country_ID)); +} +/** Get To. +@return Receiving Country */ +public int getTo_Country_ID() +{ +Integer ii = (Integer)get_Value("To_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** To_Region_ID AD_Reference_ID=157 */ +public static final int TO_REGION_ID_AD_Reference_ID=157; +/** Set To. +@param To_Region_ID Receiving Region */ +public void setTo_Region_ID (int To_Region_ID) +{ +if (To_Region_ID <= 0) set_Value ("To_Region_ID", null); + else +set_Value ("To_Region_ID", new Integer(To_Region_ID)); +} +/** Get To. +@return Receiving Region */ +public int getTo_Region_ID() +{ +Integer ii = (Integer)get_Value("To_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_FreightCategory.java b/dbPort/src/org/compiere/model/X_M_FreightCategory.java new file mode 100644 index 0000000000..a749145efd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_FreightCategory.java @@ -0,0 +1,181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_FreightCategory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.953 */ +public class X_M_FreightCategory extends PO +{ +/** Standard Constructor +@param ctx context +@param M_FreightCategory_ID id +@param trxName transaction +*/ +public X_M_FreightCategory (Properties ctx, int M_FreightCategory_ID, String trxName) +{ +super (ctx, M_FreightCategory_ID, trxName); +/** if (M_FreightCategory_ID == 0) +{ +setM_FreightCategory_ID (0); +setName (null); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_FreightCategory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=595 */ +public static final int Table_ID=595; + +/** TableName=M_FreightCategory */ +public static final String Table_Name="M_FreightCategory"; + +protected static KeyNamePair Model = new KeyNamePair(595,"M_FreightCategory"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_FreightCategory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Freight Category. +@param M_FreightCategory_ID Category of the Freight */ +public void setM_FreightCategory_ID (int M_FreightCategory_ID) +{ +if (M_FreightCategory_ID < 1) throw new IllegalArgumentException ("M_FreightCategory_ID is mandatory."); +set_ValueNoCheck ("M_FreightCategory_ID", new Integer(M_FreightCategory_ID)); +} +/** Get Freight Category. +@return Category of the Freight */ +public int getM_FreightCategory_ID() +{ +Integer ii = (Integer)get_Value("M_FreightCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InOut.java b/dbPort/src/org/compiere/model/X_M_InOut.java new file mode 100644 index 0000000000..5e148286cc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InOut.java @@ -0,0 +1,1145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InOut + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:00.953 */ +public class X_M_InOut extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InOut_ID id +@param trxName transaction +*/ +public X_M_InOut (Properties ctx, int M_InOut_ID, String trxName) +{ +super (ctx, M_InOut_ID, trxName); +/** if (M_InOut_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_DocType_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDeliveryRule (null); // A +setDeliveryViaRule (null); // P +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setFreightCostRule (null); // I +setIsApproved (false); +setIsInDispute (false); +setIsInTransit (false); +setIsPrinted (false); +setIsSOTrx (false); // @IsSOTrx@ +setM_InOut_ID (0); +setM_Warehouse_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setMovementType (null); +setPosted (false); +setPriorityRule (null); // 5 +setProcessed (false); +setSendEMail (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InOut (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=319 */ +public static final int Table_ID=319; + +/** TableName=M_InOut */ +public static final String Table_Name="M_InOut"; + +protected static KeyNamePair Model = new KeyNamePair(319,"M_InOut"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOut[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_Charge_ID AD_Reference_ID=200 */ +public static final int C_CHARGE_ID_AD_Reference_ID=200; +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocType_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPE_ID_AD_Reference_ID=170; +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_ValueNoCheck ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge amount. +@param ChargeAmt Charge Amount */ +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} +/** Get Charge amount. +@return Charge Amount */ +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Create Confirm. +@param CreateConfirm Create Confirm */ +public void setCreateConfirm (String CreateConfirm) +{ +if (CreateConfirm != null && CreateConfirm.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateConfirm = CreateConfirm.substring(0,0); +} +set_Value ("CreateConfirm", CreateConfirm); +} +/** Get Create Confirm. +@return Create Confirm */ +public String getCreateConfirm() +{ +return (String)get_Value("CreateConfirm"); +} +/** Set Create lines from. +@param CreateFrom Process which will generate a new document lines based on an existing document */ +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} +/** Get Create lines from. +@return Process which will generate a new document lines based on an existing document */ +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} +/** Set Create Package. +@param CreatePackage Create Package */ +public void setCreatePackage (String CreatePackage) +{ +if (CreatePackage != null && CreatePackage.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreatePackage = CreatePackage.substring(0,0); +} +set_Value ("CreatePackage", CreatePackage); +} +/** Get Create Package. +@return Create Package */ +public String getCreatePackage() +{ +return (String)get_Value("CreatePackage"); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Date Ordered. +@param DateOrdered Date of Order */ +public void setDateOrdered (Timestamp DateOrdered) +{ +set_ValueNoCheck ("DateOrdered", DateOrdered); +} +/** Get Date Ordered. +@return Date of Order */ +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} +/** Set Date printed. +@param DatePrinted Date the document was printed. */ +public void setDatePrinted (Timestamp DatePrinted) +{ +set_Value ("DatePrinted", DatePrinted); +} +/** Get Date printed. +@return Date the document was printed. */ +public Timestamp getDatePrinted() +{ +return (Timestamp)get_Value("DatePrinted"); +} +/** Set Date received. +@param DateReceived Date a product was received */ +public void setDateReceived (Timestamp DateReceived) +{ +set_Value ("DateReceived", DateReceived); +} +/** Get Date received. +@return Date a product was received */ +public Timestamp getDateReceived() +{ +return (Timestamp)get_Value("DateReceived"); +} + +/** DeliveryRule AD_Reference_ID=151 */ +public static final int DELIVERYRULE_AD_Reference_ID=151; +/** Availability = A */ +public static final String DELIVERYRULE_Availability = "A"; +/** Force = F */ +public static final String DELIVERYRULE_Force = "F"; +/** Complete Line = L */ +public static final String DELIVERYRULE_CompleteLine = "L"; +/** Manual = M */ +public static final String DELIVERYRULE_Manual = "M"; +/** Complete Order = O */ +public static final String DELIVERYRULE_CompleteOrder = "O"; +/** After Receipt = R */ +public static final String DELIVERYRULE_AfterReceipt = "R"; +/** Set Delivery Rule. +@param DeliveryRule Defines the timing of Delivery */ +public void setDeliveryRule (String DeliveryRule) +{ +if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); +if (DeliveryRule.equals("A") || DeliveryRule.equals("F") || DeliveryRule.equals("L") || DeliveryRule.equals("M") || DeliveryRule.equals("O") || DeliveryRule.equals("R")); + else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - A - F - L - M - O - R"); +if (DeliveryRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryRule = DeliveryRule.substring(0,0); +} +set_Value ("DeliveryRule", DeliveryRule); +} +/** Get Delivery Rule. +@return Defines the timing of Delivery */ +public String getDeliveryRule() +{ +return (String)get_Value("DeliveryRule"); +} + +/** DeliveryViaRule AD_Reference_ID=152 */ +public static final int DELIVERYVIARULE_AD_Reference_ID=152; +/** Delivery = D */ +public static final String DELIVERYVIARULE_Delivery = "D"; +/** Pickup = P */ +public static final String DELIVERYVIARULE_Pickup = "P"; +/** Shipper = S */ +public static final String DELIVERYVIARULE_Shipper = "S"; +/** Set Delivery Via. +@param DeliveryViaRule How the order will be delivered */ +public void setDeliveryViaRule (String DeliveryViaRule) +{ +if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); +if (DeliveryViaRule.equals("D") || DeliveryViaRule.equals("P") || DeliveryViaRule.equals("S")); + else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - D - P - S"); +if (DeliveryViaRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryViaRule = DeliveryViaRule.substring(0,0); +} +set_Value ("DeliveryViaRule", DeliveryViaRule); +} +/** Get Delivery Via. +@return How the order will be delivered */ +public String getDeliveryViaRule() +{ +return (String)get_Value("DeliveryViaRule"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Freight Amount. +@param FreightAmt Freight Amount */ +public void setFreightAmt (BigDecimal FreightAmt) +{ +set_Value ("FreightAmt", FreightAmt); +} +/** Get Freight Amount. +@return Freight Amount */ +public BigDecimal getFreightAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** FreightCostRule AD_Reference_ID=153 */ +public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; +/** Calculated = C */ +public static final String FREIGHTCOSTRULE_Calculated = "C"; +/** Fix price = F */ +public static final String FREIGHTCOSTRULE_FixPrice = "F"; +/** Freight included = I */ +public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; +/** Line = L */ +public static final String FREIGHTCOSTRULE_Line = "L"; +/** Set Freight Cost Rule. +@param FreightCostRule Method for charging Freight */ +public void setFreightCostRule (String FreightCostRule) +{ +if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); +if (FreightCostRule.equals("C") || FreightCostRule.equals("F") || FreightCostRule.equals("I") || FreightCostRule.equals("L")); + else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - C - F - I - L"); +if (FreightCostRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FreightCostRule = FreightCostRule.substring(0,0); +} +set_Value ("FreightCostRule", FreightCostRule); +} +/** Get Freight Cost Rule. +@return Method for charging Freight */ +public String getFreightCostRule() +{ +return (String)get_Value("FreightCostRule"); +} +/** Set Generate To. +@param GenerateTo Generate To */ +public void setGenerateTo (String GenerateTo) +{ +if (GenerateTo != null && GenerateTo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateTo = GenerateTo.substring(0,0); +} +set_Value ("GenerateTo", GenerateTo); +} +/** Get Generate To. +@return Generate To */ +public String getGenerateTo() +{ +return (String)get_Value("GenerateTo"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Dispute. +@param IsInDispute Document is in dispute */ +public void setIsInDispute (boolean IsInDispute) +{ +set_Value ("IsInDispute", new Boolean(IsInDispute)); +} +/** Get In Dispute. +@return Document is in dispute */ +public boolean isInDispute() +{ +Object oo = get_Value("IsInDispute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Transit. +@param IsInTransit Movement is in transit */ +public void setIsInTransit (boolean IsInTransit) +{ +set_Value ("IsInTransit", new Boolean(IsInTransit)); +} +/** Get In Transit. +@return Movement is in transit */ +public boolean isInTransit() +{ +Object oo = get_Value("IsInTransit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID <= 0) set_Value ("M_Shipper_ID", null); + else +set_Value ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} + +/** MovementType AD_Reference_ID=189 */ +public static final int MOVEMENTTYPE_AD_Reference_ID=189; +/** Customer Returns = C+ */ +public static final String MOVEMENTTYPE_CustomerReturns = "C+"; +/** Customer Shipment = C- */ +public static final String MOVEMENTTYPE_CustomerShipment = "C-"; +/** Inventory In = I+ */ +public static final String MOVEMENTTYPE_InventoryIn = "I+"; +/** Inventory Out = I- */ +public static final String MOVEMENTTYPE_InventoryOut = "I-"; +/** Movement To = M+ */ +public static final String MOVEMENTTYPE_MovementTo = "M+"; +/** Movement From = M- */ +public static final String MOVEMENTTYPE_MovementFrom = "M-"; +/** Production + = P+ */ +public static final String MOVEMENTTYPE_ProductionPlus = "P+"; +/** Production - = P- */ +public static final String MOVEMENTTYPE_Production_ = "P-"; +/** Vendor Receipts = V+ */ +public static final String MOVEMENTTYPE_VendorReceipts = "V+"; +/** Vendor Returns = V- */ +public static final String MOVEMENTTYPE_VendorReturns = "V-"; +/** Work Order + = W+ */ +public static final String MOVEMENTTYPE_WorkOrderPlus = "W+"; +/** Work Order - = W- */ +public static final String MOVEMENTTYPE_WorkOrder_ = "W-"; +/** Set Movement Type. +@param MovementType Method of moving the inventory */ +public void setMovementType (String MovementType) +{ +if (MovementType == null) throw new IllegalArgumentException ("MovementType is mandatory"); +if (MovementType.equals("C+") || MovementType.equals("C-") || MovementType.equals("I+") || MovementType.equals("I-") || MovementType.equals("M+") || MovementType.equals("M-") || MovementType.equals("P+") || MovementType.equals("P-") || MovementType.equals("V+") || MovementType.equals("V-") || MovementType.equals("W+") || MovementType.equals("W-")); + else throw new IllegalArgumentException ("MovementType Invalid value - " + MovementType + " - Reference_ID=189 - C+ - C- - I+ - I- - M+ - M- - P+ - P- - V+ - V- - W+ - W-"); +if (MovementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +MovementType = MovementType.substring(0,1); +} +set_ValueNoCheck ("MovementType", MovementType); +} +/** Get Movement Type. +@return Method of moving the inventory */ +public String getMovementType() +{ +return (String)get_Value("MovementType"); +} +/** Set No Packages. +@param NoPackages Number of packages shipped */ +public void setNoPackages (int NoPackages) +{ +set_Value ("NoPackages", new Integer(NoPackages)); +} +/** Get No Packages. +@return Number of packages shipped */ +public int getNoPackages() +{ +Integer ii = (Integer)get_Value("NoPackages"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order Reference. +@param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} +/** Get Order Reference. +@return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public String getPOReference() +{ +return (String)get_Value("POReference"); +} +/** Set Pick Date. +@param PickDate Date/Time when picked for Shipment */ +public void setPickDate (Timestamp PickDate) +{ +set_Value ("PickDate", PickDate); +} +/** Get Pick Date. +@return Date/Time when picked for Shipment */ +public Timestamp getPickDate() +{ +return (Timestamp)get_Value("PickDate"); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PriorityRule AD_Reference_ID=154 */ +public static final int PRIORITYRULE_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITYRULE_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITYRULE_High = "3"; +/** Medium = 5 */ +public static final String PRIORITYRULE_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITYRULE_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITYRULE_Minor = "9"; +/** Set Priority. +@param PriorityRule Priority of a document */ +public void setPriorityRule (String PriorityRule) +{ +if (PriorityRule == null) throw new IllegalArgumentException ("PriorityRule is mandatory"); +if (PriorityRule.equals("1") || PriorityRule.equals("3") || PriorityRule.equals("5") || PriorityRule.equals("7") || PriorityRule.equals("9")); + else throw new IllegalArgumentException ("PriorityRule Invalid value - " + PriorityRule + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (PriorityRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityRule = PriorityRule.substring(0,0); +} +set_Value ("PriorityRule", PriorityRule); +} +/** Get Priority. +@return Priority of a document */ +public String getPriorityRule() +{ +return (String)get_Value("PriorityRule"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Referenced Shipment. +@param Ref_InOut_ID Referenced Shipment */ +public void setRef_InOut_ID (int Ref_InOut_ID) +{ +if (Ref_InOut_ID <= 0) set_Value ("Ref_InOut_ID", null); + else +set_Value ("Ref_InOut_ID", new Integer(Ref_InOut_ID)); +} +/** Get Referenced Shipment. +@return Referenced Shipment */ +public int getRef_InOut_ID() +{ +Integer ii = (Integer)get_Value("Ref_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Send EMail. +@param SendEMail Enable sending Document EMail */ +public void setSendEMail (boolean SendEMail) +{ +set_Value ("SendEMail", new Boolean(SendEMail)); +} +/** Get Send EMail. +@return Enable sending Document EMail */ +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ship Date. +@param ShipDate Shipment Date/Time */ +public void setShipDate (Timestamp ShipDate) +{ +set_Value ("ShipDate", ShipDate); +} +/** Get Ship Date. +@return Shipment Date/Time */ +public Timestamp getShipDate() +{ +return (Timestamp)get_Value("ShipDate"); +} +/** Set Tracking No. +@param TrackingNo Number to track the shipment */ +public void setTrackingNo (String TrackingNo) +{ +if (TrackingNo != null && TrackingNo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +TrackingNo = TrackingNo.substring(0,59); +} +set_Value ("TrackingNo", TrackingNo); +} +/** Get Tracking No. +@return Number to track the shipment */ +public String getTrackingNo() +{ +return (String)get_Value("TrackingNo"); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Volume. +@param Volume Volume of a product */ +public void setVolume (BigDecimal Volume) +{ +set_Value ("Volume", Volume); +} +/** Get Volume. +@return Volume of a product */ +public BigDecimal getVolume() +{ +BigDecimal bd = (BigDecimal)get_Value("Volume"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Weight. +@param Weight Weight of a product */ +public void setWeight (BigDecimal Weight) +{ +set_Value ("Weight", Weight); +} +/** Get Weight. +@return Weight of a product */ +public BigDecimal getWeight() +{ +BigDecimal bd = (BigDecimal)get_Value("Weight"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InOutConfirm.java b/dbPort/src/org/compiere/model/X_M_InOutConfirm.java new file mode 100644 index 0000000000..8673f9fcfa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InOutConfirm.java @@ -0,0 +1,469 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InOutConfirm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.031 */ +public class X_M_InOutConfirm extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InOutConfirm_ID id +@param trxName transaction +*/ +public X_M_InOutConfirm (Properties ctx, int M_InOutConfirm_ID, String trxName) +{ +super (ctx, M_InOutConfirm_ID, trxName); +/** if (M_InOutConfirm_ID == 0) +{ +setConfirmType (null); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setIsCancelled (false); +setIsInDispute (false); // N +setM_InOutConfirm_ID (0); +setM_InOut_ID (0); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InOutConfirm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=727 */ +public static final int Table_ID=727; + +/** TableName=M_InOutConfirm */ +public static final String Table_Name="M_InOutConfirm"; + +protected static KeyNamePair Model = new KeyNamePair(727,"M_InOutConfirm"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOutConfirm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Approval Amount. +@param ApprovalAmt Document Approval Amount */ +public void setApprovalAmt (BigDecimal ApprovalAmt) +{ +set_Value ("ApprovalAmt", ApprovalAmt); +} +/** Get Approval Amount. +@return Document Approval Amount */ +public BigDecimal getApprovalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ApprovalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ConfirmType AD_Reference_ID=320 */ +public static final int CONFIRMTYPE_AD_Reference_ID=320; +/** Drop Ship Confirm = DS */ +public static final String CONFIRMTYPE_DropShipConfirm = "DS"; +/** Pick/QA Confirm = PC */ +public static final String CONFIRMTYPE_PickQAConfirm = "PC"; +/** Ship/Receipt Confirm = SC */ +public static final String CONFIRMTYPE_ShipReceiptConfirm = "SC"; +/** Customer Confirmation = XC */ +public static final String CONFIRMTYPE_CustomerConfirmation = "XC"; +/** Vendor Confirmation = XV */ +public static final String CONFIRMTYPE_VendorConfirmation = "XV"; +/** Set Confirmation Type. +@param ConfirmType Type of confirmation */ +public void setConfirmType (String ConfirmType) +{ +if (ConfirmType == null) throw new IllegalArgumentException ("ConfirmType is mandatory"); +if (ConfirmType.equals("DS") || ConfirmType.equals("PC") || ConfirmType.equals("SC") || ConfirmType.equals("XC") || ConfirmType.equals("XV")); + else throw new IllegalArgumentException ("ConfirmType Invalid value - " + ConfirmType + " - Reference_ID=320 - DS - PC - SC - XC - XV"); +if (ConfirmType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +ConfirmType = ConfirmType.substring(0,1); +} +set_Value ("ConfirmType", ConfirmType); +} +/** Get Confirmation Type. +@return Type of confirmation */ +public String getConfirmType() +{ +return (String)get_Value("ConfirmType"); +} +/** Set Confirmation No. +@param ConfirmationNo Confirmation Number */ +public void setConfirmationNo (String ConfirmationNo) +{ +if (ConfirmationNo != null && ConfirmationNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ConfirmationNo = ConfirmationNo.substring(0,19); +} +set_Value ("ConfirmationNo", ConfirmationNo); +} +/** Get Confirmation No. +@return Confirmation Number */ +public String getConfirmationNo() +{ +return (String)get_Value("ConfirmationNo"); +} +/** Set Create Package. +@param CreatePackage Create Package */ +public void setCreatePackage (String CreatePackage) +{ +if (CreatePackage != null && CreatePackage.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreatePackage = CreatePackage.substring(0,0); +} +set_Value ("CreatePackage", CreatePackage); +} +/** Get Create Package. +@return Create Package */ +public String getCreatePackage() +{ +return (String)get_Value("CreatePackage"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Cancelled. +@param IsCancelled The transaction was cancelled */ +public void setIsCancelled (boolean IsCancelled) +{ +set_Value ("IsCancelled", new Boolean(IsCancelled)); +} +/** Get Cancelled. +@return The transaction was cancelled */ +public boolean isCancelled() +{ +Object oo = get_Value("IsCancelled"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Dispute. +@param IsInDispute Document is in dispute */ +public void setIsInDispute (boolean IsInDispute) +{ +set_Value ("IsInDispute", new Boolean(IsInDispute)); +} +/** Get In Dispute. +@return Document is in dispute */ +public boolean isInDispute() +{ +Object oo = get_Value("IsInDispute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Ship/Receipt Confirmation. +@param M_InOutConfirm_ID Material Shipment or Receipt Confirmation */ +public void setM_InOutConfirm_ID (int M_InOutConfirm_ID) +{ +if (M_InOutConfirm_ID < 1) throw new IllegalArgumentException ("M_InOutConfirm_ID is mandatory."); +set_ValueNoCheck ("M_InOutConfirm_ID", new Integer(M_InOutConfirm_ID)); +} +/** Get Ship/Receipt Confirmation. +@return Material Shipment or Receipt Confirmation */ +public int getM_InOutConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_InOutConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory. +@param M_Inventory_ID Parameters for a Physical Inventory */ +public void setM_Inventory_ID (int M_Inventory_ID) +{ +if (M_Inventory_ID <= 0) set_Value ("M_Inventory_ID", null); + else +set_Value ("M_Inventory_ID", new Integer(M_Inventory_ID)); +} +/** Get Phys.Inventory. +@return Parameters for a Physical Inventory */ +public int getM_Inventory_ID() +{ +Integer ii = (Integer)get_Value("M_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InOutLine.java b/dbPort/src/org/compiere/model/X_M_InOutLine.java new file mode 100644 index 0000000000..1708461828 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InOutLine.java @@ -0,0 +1,551 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InOutLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.062 */ +public class X_M_InOutLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InOutLine_ID id +@param trxName transaction +*/ +public X_M_InOutLine (Properties ctx, int M_InOutLine_ID, String trxName) +{ +super (ctx, M_InOutLine_ID, trxName); +/** if (M_InOutLine_ID == 0) +{ +setC_UOM_ID (0); // @#C_UOM_ID@ +setIsDescription (false); // N +setIsInvoiced (false); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_InOutLine WHERE M_InOut_ID=@M_InOut_ID@ +setM_AttributeSetInstance_ID (0); +setM_InOutLine_ID (0); +setM_InOut_ID (0); +setM_Locator_ID (0); // @M_Locator_ID@ +setMovementQty (Env.ZERO); // 1 +setProcessed (false); +setQtyEntered (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InOutLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=320 */ +public static final int Table_ID=320; + +/** TableName=M_InOutLine */ +public static final String Table_Name="M_InOutLine"; + +protected static KeyNamePair Model = new KeyNamePair(320,"M_InOutLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOutLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); + else +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_Value ("C_ProjectPhase_ID", null); + else +set_Value ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_Value ("C_ProjectTask_ID", null); + else +set_Value ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_ValueNoCheck ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Confirmed Quantity. +@param ConfirmedQty Confirmation of a received quantity */ +public void setConfirmedQty (BigDecimal ConfirmedQty) +{ +set_Value ("ConfirmedQty", ConfirmedQty); +} +/** Get Confirmed Quantity. +@return Confirmation of a received quantity */ +public BigDecimal getConfirmedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Description Only. +@param IsDescription if true, the line is just description and no transaction */ +public void setIsDescription (boolean IsDescription) +{ +set_Value ("IsDescription", new Boolean(IsDescription)); +} +/** Get Description Only. +@return if true, the line is just description and no transaction */ +public boolean isDescription() +{ +Object oo = get_Value("IsDescription"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (boolean IsInvoiced) +{ +set_Value ("IsInvoiced", new Boolean(IsInvoiced)); +} +/** Get Invoiced. +@return Is this invoiced? */ +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Picked Quantity. +@param PickedQty Picked Quantity */ +public void setPickedQty (BigDecimal PickedQty) +{ +set_Value ("PickedQty", PickedQty); +} +/** Get Picked Quantity. +@return Picked Quantity */ +public BigDecimal getPickedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("PickedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param QtyEntered The Quantity Entered is based on the selected UoM */ +public void setQtyEntered (BigDecimal QtyEntered) +{ +if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); +set_Value ("QtyEntered", QtyEntered); +} +/** Get Quantity. +@return The Quantity Entered is based on the selected UoM */ +public BigDecimal getQtyEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Referenced Shipment Line. +@param Ref_InOutLine_ID Referenced Shipment Line */ +public void setRef_InOutLine_ID (int Ref_InOutLine_ID) +{ +if (Ref_InOutLine_ID <= 0) set_Value ("Ref_InOutLine_ID", null); + else +set_Value ("Ref_InOutLine_ID", new Integer(Ref_InOutLine_ID)); +} +/** Get Referenced Shipment Line. +@return Referenced Shipment Line */ +public int getRef_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("Ref_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Scrapped Quantity. +@param ScrappedQty The Quantity scrapped due to QA issues */ +public void setScrappedQty (BigDecimal ScrappedQty) +{ +set_Value ("ScrappedQty", ScrappedQty); +} +/** Get Scrapped Quantity. +@return The Quantity scrapped due to QA issues */ +public BigDecimal getScrappedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Target Quantity. +@param TargetQty Target Movement Quantity */ +public void setTargetQty (BigDecimal TargetQty) +{ +set_Value ("TargetQty", TargetQty); +} +/** Get Target Quantity. +@return Target Movement Quantity */ +public BigDecimal getTargetQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TargetQty"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InOutLineConfirm.java b/dbPort/src/org/compiere/model/X_M_InOutLineConfirm.java new file mode 100644 index 0000000000..7da2b1e5c3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InOutLineConfirm.java @@ -0,0 +1,286 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InOutLineConfirm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.093 */ +public class X_M_InOutLineConfirm extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InOutLineConfirm_ID id +@param trxName transaction +*/ +public X_M_InOutLineConfirm (Properties ctx, int M_InOutLineConfirm_ID, String trxName) +{ +super (ctx, M_InOutLineConfirm_ID, trxName); +/** if (M_InOutLineConfirm_ID == 0) +{ +setConfirmedQty (Env.ZERO); +setM_InOutConfirm_ID (0); +setM_InOutLineConfirm_ID (0); +setM_InOutLine_ID (0); +setProcessed (false); +setTargetQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InOutLineConfirm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=728 */ +public static final int Table_ID=728; + +/** TableName=M_InOutLineConfirm */ +public static final String Table_Name="M_InOutLineConfirm"; + +protected static KeyNamePair Model = new KeyNamePair(728,"M_InOutLineConfirm"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOutLineConfirm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_Value ("C_InvoiceLine_ID", null); + else +set_Value ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Confirmation No. +@param ConfirmationNo Confirmation Number */ +public void setConfirmationNo (String ConfirmationNo) +{ +if (ConfirmationNo != null && ConfirmationNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +ConfirmationNo = ConfirmationNo.substring(0,19); +} +set_Value ("ConfirmationNo", ConfirmationNo); +} +/** Get Confirmation No. +@return Confirmation Number */ +public String getConfirmationNo() +{ +return (String)get_Value("ConfirmationNo"); +} +/** Set Confirmed Quantity. +@param ConfirmedQty Confirmation of a received quantity */ +public void setConfirmedQty (BigDecimal ConfirmedQty) +{ +if (ConfirmedQty == null) throw new IllegalArgumentException ("ConfirmedQty is mandatory."); +set_Value ("ConfirmedQty", ConfirmedQty); +} +/** Get Confirmed Quantity. +@return Confirmation of a received quantity */ +public BigDecimal getConfirmedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Difference. +@param DifferenceQty Difference Quantity */ +public void setDifferenceQty (BigDecimal DifferenceQty) +{ +set_Value ("DifferenceQty", DifferenceQty); +} +/** Get Difference. +@return Difference Quantity */ +public BigDecimal getDifferenceQty() +{ +BigDecimal bd = (BigDecimal)get_Value("DifferenceQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ship/Receipt Confirmation. +@param M_InOutConfirm_ID Material Shipment or Receipt Confirmation */ +public void setM_InOutConfirm_ID (int M_InOutConfirm_ID) +{ +if (M_InOutConfirm_ID < 1) throw new IllegalArgumentException ("M_InOutConfirm_ID is mandatory."); +set_ValueNoCheck ("M_InOutConfirm_ID", new Integer(M_InOutConfirm_ID)); +} +/** Get Ship/Receipt Confirmation. +@return Material Shipment or Receipt Confirmation */ +public int getM_InOutConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_InOutConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Ship/Receipt Confirmation Line. +@param M_InOutLineConfirm_ID Material Shipment or Receipt Confirmation Line */ +public void setM_InOutLineConfirm_ID (int M_InOutLineConfirm_ID) +{ +if (M_InOutLineConfirm_ID < 1) throw new IllegalArgumentException ("M_InOutLineConfirm_ID is mandatory."); +set_ValueNoCheck ("M_InOutLineConfirm_ID", new Integer(M_InOutLineConfirm_ID)); +} +/** Get Ship/Receipt Confirmation Line. +@return Material Shipment or Receipt Confirmation Line */ +public int getM_InOutLineConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLineConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_InOutLine_ID())); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_Value ("M_InventoryLine_ID", null); + else +set_Value ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Scrapped Quantity. +@param ScrappedQty The Quantity scrapped due to QA issues */ +public void setScrappedQty (BigDecimal ScrappedQty) +{ +set_Value ("ScrappedQty", ScrappedQty); +} +/** Get Scrapped Quantity. +@return The Quantity scrapped due to QA issues */ +public BigDecimal getScrappedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Target Quantity. +@param TargetQty Target Movement Quantity */ +public void setTargetQty (BigDecimal TargetQty) +{ +if (TargetQty == null) throw new IllegalArgumentException ("TargetQty is mandatory."); +set_ValueNoCheck ("TargetQty", TargetQty); +} +/** Get Target Quantity. +@return Target Movement Quantity */ +public BigDecimal getTargetQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TargetQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InOutLineMA.java b/dbPort/src/org/compiere/model/X_M_InOutLineMA.java new file mode 100644 index 0000000000..dee3facf58 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InOutLineMA.java @@ -0,0 +1,141 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InOutLineMA + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.109 */ +public class X_M_InOutLineMA extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InOutLineMA_ID id +@param trxName transaction +*/ +public X_M_InOutLineMA (Properties ctx, int M_InOutLineMA_ID, String trxName) +{ +super (ctx, M_InOutLineMA_ID, trxName); +/** if (M_InOutLineMA_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_InOutLine_ID (0); +setMovementQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InOutLineMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=762 */ +public static final int Table_ID=762; + +/** TableName=M_InOutLineMA */ +public static final String Table_Name="M_InOutLineMA"; + +protected static KeyNamePair Model = new KeyNamePair(762,"M_InOutLineMA"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOutLineMA[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_InOutLine_ID())); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Inventory.java b/dbPort/src/org/compiere/model/X_M_Inventory.java new file mode 100644 index 0000000000..7ef969e2b9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Inventory.java @@ -0,0 +1,535 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Inventory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.125 */ +public class X_M_Inventory extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Inventory_ID id +@param trxName transaction +*/ +public X_M_Inventory (Properties ctx, int M_Inventory_ID, String trxName) +{ +super (ctx, M_Inventory_ID, trxName); +/** if (M_Inventory_ID == 0) +{ +setC_DocType_ID (0); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setM_Inventory_ID (0); +setM_Warehouse_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setPosted (false); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Inventory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=321 */ +public static final int Table_ID=321; + +/** TableName=M_Inventory */ +public static final String Table_Name="M_Inventory"; + +protected static KeyNamePair Model = new KeyNamePair(321,"M_Inventory"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Inventory[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Approval Amount. +@param ApprovalAmt Document Approval Amount */ +public void setApprovalAmt (BigDecimal ApprovalAmt) +{ +set_Value ("ApprovalAmt", ApprovalAmt); +} +/** Get Approval Amount. +@return Document Approval Amount */ +public BigDecimal getApprovalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ApprovalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Generate List. +@param GenerateList Generate List */ +public void setGenerateList (String GenerateList) +{ +if (GenerateList != null && GenerateList.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateList = GenerateList.substring(0,0); +} +set_Value ("GenerateList", GenerateList); +} +/** Get Generate List. +@return Generate List */ +public String getGenerateList() +{ +return (String)get_Value("GenerateList"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Phys.Inventory. +@param M_Inventory_ID Parameters for a Physical Inventory */ +public void setM_Inventory_ID (int M_Inventory_ID) +{ +if (M_Inventory_ID < 1) throw new IllegalArgumentException ("M_Inventory_ID is mandatory."); +set_ValueNoCheck ("M_Inventory_ID", new Integer(M_Inventory_ID)); +} +/** Get Phys.Inventory. +@return Parameters for a Physical Inventory */ +public int getM_Inventory_ID() +{ +Integer ii = (Integer)get_Value("M_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Perpetual Inventory. +@param M_PerpetualInv_ID Rules for generating physical inventory */ +public void setM_PerpetualInv_ID (int M_PerpetualInv_ID) +{ +if (M_PerpetualInv_ID <= 0) set_ValueNoCheck ("M_PerpetualInv_ID", null); + else +set_ValueNoCheck ("M_PerpetualInv_ID", new Integer(M_PerpetualInv_ID)); +} +/** Get Perpetual Inventory. +@return Rules for generating physical inventory */ +public int getM_PerpetualInv_ID() +{ +Integer ii = (Integer)get_Value("M_PerpetualInv_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Update Quantities. +@param UpdateQty Update Quantities */ +public void setUpdateQty (String UpdateQty) +{ +if (UpdateQty != null && UpdateQty.length() > 1) +{ +log.warning("Length > 1 - truncated"); +UpdateQty = UpdateQty.substring(0,0); +} +set_Value ("UpdateQty", UpdateQty); +} +/** Get Update Quantities. +@return Update Quantities */ +public String getUpdateQty() +{ +return (String)get_Value("UpdateQty"); +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InventoryLine.java b/dbPort/src/org/compiere/model/X_M_InventoryLine.java new file mode 100644 index 0000000000..ad09129e1f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InventoryLine.java @@ -0,0 +1,340 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InventoryLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.171 */ +public class X_M_InventoryLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InventoryLine_ID id +@param trxName transaction +*/ +public X_M_InventoryLine (Properties ctx, int M_InventoryLine_ID, String trxName) +{ +super (ctx, M_InventoryLine_ID, trxName); +/** if (M_InventoryLine_ID == 0) +{ +setInventoryType (null); // D +setM_AttributeSetInstance_ID (0); +setM_InventoryLine_ID (0); +setM_Inventory_ID (0); +setM_Locator_ID (0); // @M_Locator_ID@ +setM_Product_ID (0); +setProcessed (false); +setQtyBook (Env.ZERO); +setQtyCount (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InventoryLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=322 */ +public static final int Table_ID=322; + +/** TableName=M_InventoryLine */ +public static final String Table_Name="M_InventoryLine"; + +protected static KeyNamePair Model = new KeyNamePair(322,"M_InventoryLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InventoryLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** InventoryType AD_Reference_ID=292 */ +public static final int INVENTORYTYPE_AD_Reference_ID=292; +/** Charge Account = C */ +public static final String INVENTORYTYPE_ChargeAccount = "C"; +/** Inventory Difference = D */ +public static final String INVENTORYTYPE_InventoryDifference = "D"; +/** Set Inventory Type. +@param InventoryType Type of inventory difference */ +public void setInventoryType (String InventoryType) +{ +if (InventoryType == null) throw new IllegalArgumentException ("InventoryType is mandatory"); +if (InventoryType.equals("C") || InventoryType.equals("D")); + else throw new IllegalArgumentException ("InventoryType Invalid value - " + InventoryType + " - Reference_ID=292 - C - D"); +if (InventoryType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InventoryType = InventoryType.substring(0,0); +} +set_Value ("InventoryType", InventoryType); +} +/** Get Inventory Type. +@return Type of inventory difference */ +public String getInventoryType() +{ +return (String)get_Value("InventoryType"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID < 1) throw new IllegalArgumentException ("M_InventoryLine_ID is mandatory."); +set_ValueNoCheck ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory. +@param M_Inventory_ID Parameters for a Physical Inventory */ +public void setM_Inventory_ID (int M_Inventory_ID) +{ +if (M_Inventory_ID < 1) throw new IllegalArgumentException ("M_Inventory_ID is mandatory."); +set_ValueNoCheck ("M_Inventory_ID", new Integer(M_Inventory_ID)); +} +/** Get Phys.Inventory. +@return Parameters for a Physical Inventory */ +public int getM_Inventory_ID() +{ +Integer ii = (Integer)get_Value("M_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_Product_ID AD_Reference_ID=171 */ +public static final int M_PRODUCT_ID_AD_Reference_ID=171; +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity book. +@param QtyBook Book Quantity */ +public void setQtyBook (BigDecimal QtyBook) +{ +if (QtyBook == null) throw new IllegalArgumentException ("QtyBook is mandatory."); +set_ValueNoCheck ("QtyBook", QtyBook); +} +/** Get Quantity book. +@return Book Quantity */ +public BigDecimal getQtyBook() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyBook"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity count. +@param QtyCount Counted Quantity */ +public void setQtyCount (BigDecimal QtyCount) +{ +if (QtyCount == null) throw new IllegalArgumentException ("QtyCount is mandatory."); +set_Value ("QtyCount", QtyCount); +} +/** Get Quantity count. +@return Counted Quantity */ +public BigDecimal getQtyCount() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyCount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Internal Use Qty. +@param QtyInternalUse Internal Use Quantity removed from Inventory */ +public void setQtyInternalUse (BigDecimal QtyInternalUse) +{ +set_Value ("QtyInternalUse", QtyInternalUse); +} +/** Get Internal Use Qty. +@return Internal Use Quantity removed from Inventory */ +public BigDecimal getQtyInternalUse() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInternalUse"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +throw new IllegalArgumentException ("UPC is virtual column"); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +throw new IllegalArgumentException ("Value is virtual column"); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_InventoryLineMA.java b/dbPort/src/org/compiere/model/X_M_InventoryLineMA.java new file mode 100644 index 0000000000..a8114c1b83 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_InventoryLineMA.java @@ -0,0 +1,141 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_InventoryLineMA + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.187 */ +public class X_M_InventoryLineMA extends PO +{ +/** Standard Constructor +@param ctx context +@param M_InventoryLineMA_ID id +@param trxName transaction +*/ +public X_M_InventoryLineMA (Properties ctx, int M_InventoryLineMA_ID, String trxName) +{ +super (ctx, M_InventoryLineMA_ID, trxName); +/** if (M_InventoryLineMA_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_InventoryLine_ID (0); +setMovementQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_InventoryLineMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=763 */ +public static final int Table_ID=763; + +/** TableName=M_InventoryLineMA */ +public static final String Table_Name="M_InventoryLineMA"; + +protected static KeyNamePair Model = new KeyNamePair(763,"M_InventoryLineMA"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InventoryLineMA[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID < 1) throw new IllegalArgumentException ("M_InventoryLine_ID is mandatory."); +set_ValueNoCheck ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_InventoryLine_ID())); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Locator.java b/dbPort/src/org/compiere/model/X_M_Locator.java new file mode 100644 index 0000000000..2a92097e1c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Locator.java @@ -0,0 +1,235 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Locator + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.203 */ +public class X_M_Locator extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Locator_ID id +@param trxName transaction +*/ +public X_M_Locator (Properties ctx, int M_Locator_ID, String trxName) +{ +super (ctx, M_Locator_ID, trxName); +/** if (M_Locator_ID == 0) +{ +setIsDefault (false); +setM_Locator_ID (0); +setM_Warehouse_ID (0); +setPriorityNo (0); // 50 +setValue (null); +setX (null); +setY (null); +setZ (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Locator (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=207 */ +public static final int Table_ID=207; + +/** TableName=M_Locator */ +public static final String Table_Name="M_Locator"; + +protected static KeyNamePair Model = new KeyNamePair(207,"M_Locator"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Locator[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_ValueNoCheck ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Relative Priority. +@param PriorityNo Where inventory should be picked from first */ +public void setPriorityNo (int PriorityNo) +{ +set_Value ("PriorityNo", new Integer(PriorityNo)); +} +/** Get Relative Priority. +@return Where inventory should be picked from first */ +public int getPriorityNo() +{ +Integer ii = (Integer)get_Value("PriorityNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getValue()); +} +/** Set Aisle (X). +@param X X dimension, e.g., Aisle */ +public void setX (String X) +{ +if (X == null) throw new IllegalArgumentException ("X is mandatory."); +if (X.length() > 60) +{ +log.warning("Length > 60 - truncated"); +X = X.substring(0,59); +} +set_Value ("X", X); +} +/** Get Aisle (X). +@return X dimension, e.g., Aisle */ +public String getX() +{ +return (String)get_Value("X"); +} +/** Set Bin (Y). +@param Y Y dimension, e.g., Bin */ +public void setY (String Y) +{ +if (Y == null) throw new IllegalArgumentException ("Y is mandatory."); +if (Y.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Y = Y.substring(0,59); +} +set_Value ("Y", Y); +} +/** Get Bin (Y). +@return Y dimension, e.g., Bin */ +public String getY() +{ +return (String)get_Value("Y"); +} +/** Set Level (Z). +@param Z Z dimension, e.g., Level */ +public void setZ (String Z) +{ +if (Z == null) throw new IllegalArgumentException ("Z is mandatory."); +if (Z.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Z = Z.substring(0,59); +} +set_Value ("Z", Z); +} +/** Get Level (Z). +@return Z dimension, e.g., Level */ +public String getZ() +{ +return (String)get_Value("Z"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Lot.java b/dbPort/src/org/compiere/model/X_M_Lot.java new file mode 100644 index 0000000000..1acf5b757b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Lot.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Lot + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.234 */ +public class X_M_Lot extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Lot_ID id +@param trxName transaction +*/ +public X_M_Lot (Properties ctx, int M_Lot_ID, String trxName) +{ +super (ctx, M_Lot_ID, trxName); +/** if (M_Lot_ID == 0) +{ +setM_Lot_ID (0); +setM_Product_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Lot (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=557 */ +public static final int Table_ID=557; + +/** TableName=M_Lot */ +public static final String Table_Name="M_Lot"; + +protected static KeyNamePair Model = new KeyNamePair(557,"M_Lot"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Lot[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Date From. +@param DateFrom Starting date for a range */ +public void setDateFrom (Timestamp DateFrom) +{ +set_Value ("DateFrom", DateFrom); +} +/** Get Date From. +@return Starting date for a range */ +public Timestamp getDateFrom() +{ +return (Timestamp)get_Value("DateFrom"); +} +/** Set Date To. +@param DateTo End date of a date range */ +public void setDateTo (Timestamp DateTo) +{ +set_Value ("DateTo", DateTo); +} +/** Get Date To. +@return End date of a date range */ +public Timestamp getDateTo() +{ +return (Timestamp)get_Value("DateTo"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Lot Control. +@param M_LotCtl_ID Product Lot Control */ +public void setM_LotCtl_ID (int M_LotCtl_ID) +{ +if (M_LotCtl_ID <= 0) set_ValueNoCheck ("M_LotCtl_ID", null); + else +set_ValueNoCheck ("M_LotCtl_ID", new Integer(M_LotCtl_ID)); +} +/** Get Lot Control. +@return Product Lot Control */ +public int getM_LotCtl_ID() +{ +Integer ii = (Integer)get_Value("M_LotCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Lot. +@param M_Lot_ID Product Lot Definition */ +public void setM_Lot_ID (int M_Lot_ID) +{ +if (M_Lot_ID < 1) throw new IllegalArgumentException ("M_Lot_ID is mandatory."); +set_ValueNoCheck ("M_Lot_ID", new Integer(M_Lot_ID)); +} +/** Get Lot. +@return Product Lot Definition */ +public int getM_Lot_ID() +{ +Integer ii = (Integer)get_Value("M_Lot_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_Product_ID())); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_LotCtl.java b/dbPort/src/org/compiere/model/X_M_LotCtl.java new file mode 100644 index 0000000000..24697d1848 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_LotCtl.java @@ -0,0 +1,224 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_LotCtl + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.265 */ +public class X_M_LotCtl extends PO +{ +/** Standard Constructor +@param ctx context +@param M_LotCtl_ID id +@param trxName transaction +*/ +public X_M_LotCtl (Properties ctx, int M_LotCtl_ID, String trxName) +{ +super (ctx, M_LotCtl_ID, trxName); +/** if (M_LotCtl_ID == 0) +{ +setCurrentNext (0); // 100 +setIncrementNo (0); // 1 +setM_LotCtl_ID (0); +setName (null); +setStartNo (0); // 100 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_LotCtl (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=556 */ +public static final int Table_ID=556; + +/** TableName=M_LotCtl */ +public static final String Table_Name="M_LotCtl"; + +protected static KeyNamePair Model = new KeyNamePair(556,"M_LotCtl"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_LotCtl[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Current Next. +@param CurrentNext The next number to be used */ +public void setCurrentNext (int CurrentNext) +{ +set_Value ("CurrentNext", new Integer(CurrentNext)); +} +/** Get Current Next. +@return The next number to be used */ +public int getCurrentNext() +{ +Integer ii = (Integer)get_Value("CurrentNext"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Increment. +@param IncrementNo The number to increment the last document number by */ +public void setIncrementNo (int IncrementNo) +{ +set_Value ("IncrementNo", new Integer(IncrementNo)); +} +/** Get Increment. +@return The number to increment the last document number by */ +public int getIncrementNo() +{ +Integer ii = (Integer)get_Value("IncrementNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Lot Control. +@param M_LotCtl_ID Product Lot Control */ +public void setM_LotCtl_ID (int M_LotCtl_ID) +{ +if (M_LotCtl_ID < 1) throw new IllegalArgumentException ("M_LotCtl_ID is mandatory."); +set_ValueNoCheck ("M_LotCtl_ID", new Integer(M_LotCtl_ID)); +} +/** Get Lot Control. +@return Product Lot Control */ +public int getM_LotCtl_ID() +{ +Integer ii = (Integer)get_Value("M_LotCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Prefix. +@param Prefix Prefix before the sequence number */ +public void setPrefix (String Prefix) +{ +if (Prefix != null && Prefix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Prefix = Prefix.substring(0,9); +} +set_Value ("Prefix", Prefix); +} +/** Get Prefix. +@return Prefix before the sequence number */ +public String getPrefix() +{ +return (String)get_Value("Prefix"); +} +/** Set Start No. +@param StartNo Starting number/position */ +public void setStartNo (int StartNo) +{ +set_Value ("StartNo", new Integer(StartNo)); +} +/** Get Start No. +@return Starting number/position */ +public int getStartNo() +{ +Integer ii = (Integer)get_Value("StartNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Suffix. +@param Suffix Suffix after the number */ +public void setSuffix (String Suffix) +{ +if (Suffix != null && Suffix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Suffix = Suffix.substring(0,9); +} +set_Value ("Suffix", Suffix); +} +/** Get Suffix. +@return Suffix after the number */ +public String getSuffix() +{ +return (String)get_Value("Suffix"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_LotCtlExclude.java b/dbPort/src/org/compiere/model/X_M_LotCtlExclude.java new file mode 100644 index 0000000000..cb7cde65e7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_LotCtlExclude.java @@ -0,0 +1,154 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_LotCtlExclude + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.281 */ +public class X_M_LotCtlExclude extends PO +{ +/** Standard Constructor +@param ctx context +@param M_LotCtlExclude_ID id +@param trxName transaction +*/ +public X_M_LotCtlExclude (Properties ctx, int M_LotCtlExclude_ID, String trxName) +{ +super (ctx, M_LotCtlExclude_ID, trxName); +/** if (M_LotCtlExclude_ID == 0) +{ +setAD_Table_ID (0); +setIsSOTrx (false); +setM_LotCtlExclude_ID (0); +setM_LotCtl_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_LotCtlExclude (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=810 */ +public static final int Table_ID=810; + +/** TableName=M_LotCtlExclude */ +public static final String Table_Name="M_LotCtlExclude"; + +protected static KeyNamePair Model = new KeyNamePair(810,"M_LotCtlExclude"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_LotCtlExclude[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Exclude Lot. +@param M_LotCtlExclude_ID Exclude the ability to create Lots in Attribute Sets */ +public void setM_LotCtlExclude_ID (int M_LotCtlExclude_ID) +{ +if (M_LotCtlExclude_ID < 1) throw new IllegalArgumentException ("M_LotCtlExclude_ID is mandatory."); +set_ValueNoCheck ("M_LotCtlExclude_ID", new Integer(M_LotCtlExclude_ID)); +} +/** Get Exclude Lot. +@return Exclude the ability to create Lots in Attribute Sets */ +public int getM_LotCtlExclude_ID() +{ +Integer ii = (Integer)get_Value("M_LotCtlExclude_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Lot Control. +@param M_LotCtl_ID Product Lot Control */ +public void setM_LotCtl_ID (int M_LotCtl_ID) +{ +if (M_LotCtl_ID < 1) throw new IllegalArgumentException ("M_LotCtl_ID is mandatory."); +set_ValueNoCheck ("M_LotCtl_ID", new Integer(M_LotCtl_ID)); +} +/** Get Lot Control. +@return Product Lot Control */ +public int getM_LotCtl_ID() +{ +Integer ii = (Integer)get_Value("M_LotCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_MatchInv.java b/dbPort/src/org/compiere/model/X_M_MatchInv.java new file mode 100644 index 0000000000..7b897627a2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_MatchInv.java @@ -0,0 +1,308 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_MatchInv + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.437 */ +public class X_M_MatchInv extends PO +{ +/** Standard Constructor +@param ctx context +@param M_MatchInv_ID id +@param trxName transaction +*/ +public X_M_MatchInv (Properties ctx, int M_MatchInv_ID, String trxName) +{ +super (ctx, M_MatchInv_ID, trxName); +/** if (M_MatchInv_ID == 0) +{ +setC_InvoiceLine_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setDateTrx (new Timestamp(System.currentTimeMillis())); +setM_InOutLine_ID (0); +setM_MatchInv_ID (0); +setM_Product_ID (0); +setPosted (false); +setProcessed (false); +setProcessing (false); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_MatchInv (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=472 */ +public static final int Table_ID=472; + +/** TableName=M_MatchInv */ +public static final String Table_Name="M_MatchInv"; + +protected static KeyNamePair Model = new KeyNamePair(472,"M_MatchInv"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_MatchInv[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_ValueNoCheck ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID <= 0) set_ValueNoCheck ("M_AttributeSetInstance_ID", null); + else +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Match Invoice. +@param M_MatchInv_ID Match Shipment/Receipt to Invoice */ +public void setM_MatchInv_ID (int M_MatchInv_ID) +{ +if (M_MatchInv_ID < 1) throw new IllegalArgumentException ("M_MatchInv_ID is mandatory."); +set_ValueNoCheck ("M_MatchInv_ID", new Integer(M_MatchInv_ID)); +} +/** Get Match Invoice. +@return Match Shipment/Receipt to Invoice */ +public int getM_MatchInv_ID() +{ +Integer ii = (Integer)get_Value("M_MatchInv_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_ValueNoCheck ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_ValueNoCheck ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_MatchPO.java b/dbPort/src/org/compiere/model/X_M_MatchPO.java new file mode 100644 index 0000000000..94d1f967ab --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_MatchPO.java @@ -0,0 +1,356 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_MatchPO + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.468 */ +public class X_M_MatchPO extends PO +{ +/** Standard Constructor +@param ctx context +@param M_MatchPO_ID id +@param trxName transaction +*/ +public X_M_MatchPO (Properties ctx, int M_MatchPO_ID, String trxName) +{ +super (ctx, M_MatchPO_ID, trxName); +/** if (M_MatchPO_ID == 0) +{ +setC_OrderLine_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setDateTrx (new Timestamp(System.currentTimeMillis())); +setM_InOutLine_ID (0); +setM_MatchPO_ID (0); +setM_Product_ID (0); +setPosted (false); +setProcessed (false); +setProcessing (false); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_MatchPO (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=473 */ +public static final int Table_ID=473; + +/** TableName=M_MatchPO */ +public static final String Table_Name="M_MatchPO"; + +protected static KeyNamePair Model = new KeyNamePair(473,"M_MatchPO"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_MatchPO[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_ValueNoCheck ("C_InvoiceLine_ID", null); + else +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID < 1) throw new IllegalArgumentException ("C_OrderLine_ID is mandatory."); +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_ValueNoCheck ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo != null && DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID <= 0) set_ValueNoCheck ("M_AttributeSetInstance_ID", null); + else +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Match PO. +@param M_MatchPO_ID Match Purchase Order to Shipment/Receipt and Invoice */ +public void setM_MatchPO_ID (int M_MatchPO_ID) +{ +if (M_MatchPO_ID < 1) throw new IllegalArgumentException ("M_MatchPO_ID is mandatory."); +set_ValueNoCheck ("M_MatchPO_ID", new Integer(M_MatchPO_ID)); +} +/** Get Match PO. +@return Match Purchase Order to Shipment/Receipt and Invoice */ +public int getM_MatchPO_ID() +{ +Integer ii = (Integer)get_Value("M_MatchPO_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_ValueNoCheck ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price Match Difference. +@param PriceMatchDifference Difference between Purchase and Invoice Price per matched line */ +public void setPriceMatchDifference (BigDecimal PriceMatchDifference) +{ +set_Value ("PriceMatchDifference", PriceMatchDifference); +} +/** Get Price Match Difference. +@return Difference between Purchase and Invoice Price per matched line */ +public BigDecimal getPriceMatchDifference() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceMatchDifference"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_ValueNoCheck ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Movement.java b/dbPort/src/org/compiere/model/X_M_Movement.java new file mode 100644 index 0000000000..9fd985ed48 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Movement.java @@ -0,0 +1,500 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Movement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.484 */ +public class X_M_Movement extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Movement_ID id +@param trxName transaction +*/ +public X_M_Movement (Properties ctx, int M_Movement_ID, String trxName) +{ +super (ctx, M_Movement_ID, trxName); +/** if (M_Movement_ID == 0) +{ +setC_DocType_ID (0); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setIsInTransit (false); +setM_Movement_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setPosted (false); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Movement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=323 */ +public static final int Table_ID=323; + +/** TableName=M_Movement */ +public static final String Table_Name="M_Movement"; + +protected static KeyNamePair Model = new KeyNamePair(323,"M_Movement"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Movement[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Approval Amount. +@param ApprovalAmt Document Approval Amount */ +public void setApprovalAmt (BigDecimal ApprovalAmt) +{ +set_Value ("ApprovalAmt", ApprovalAmt); +} +/** Get Approval Amount. +@return Document Approval Amount */ +public BigDecimal getApprovalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ApprovalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date received. +@param DateReceived Date a product was received */ +public void setDateReceived (Timestamp DateReceived) +{ +set_Value ("DateReceived", DateReceived); +} +/** Get Date received. +@return Date a product was received */ +public Timestamp getDateReceived() +{ +return (Timestamp)get_Value("DateReceived"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set In Transit. +@param IsInTransit Movement is in transit */ +public void setIsInTransit (boolean IsInTransit) +{ +set_Value ("IsInTransit", new Boolean(IsInTransit)); +} +/** Get In Transit. +@return Movement is in transit */ +public boolean isInTransit() +{ +Object oo = get_Value("IsInTransit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Inventory Move. +@param M_Movement_ID Movement of Inventory */ +public void setM_Movement_ID (int M_Movement_ID) +{ +if (M_Movement_ID < 1) throw new IllegalArgumentException ("M_Movement_ID is mandatory."); +set_ValueNoCheck ("M_Movement_ID", new Integer(M_Movement_ID)); +} +/** Get Inventory Move. +@return Movement of Inventory */ +public int getM_Movement_ID() +{ +Integer ii = (Integer)get_Value("M_Movement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_MovementConfirm.java b/dbPort/src/org/compiere/model/X_M_MovementConfirm.java new file mode 100644 index 0000000000..aa4d49eb6c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_MovementConfirm.java @@ -0,0 +1,347 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_MovementConfirm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.531 */ +public class X_M_MovementConfirm extends PO +{ +/** Standard Constructor +@param ctx context +@param M_MovementConfirm_ID id +@param trxName transaction +*/ +public X_M_MovementConfirm (Properties ctx, int M_MovementConfirm_ID, String trxName) +{ +super (ctx, M_MovementConfirm_ID, trxName); +/** if (M_MovementConfirm_ID == 0) +{ +setDocAction (null); +setDocStatus (null); +setDocumentNo (null); +setIsApproved (false); // N +setM_MovementConfirm_ID (0); +setM_Movement_ID (0); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_MovementConfirm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=738 */ +public static final int Table_ID=738; + +/** TableName=M_MovementConfirm */ +public static final String Table_Name="M_MovementConfirm"; + +protected static KeyNamePair Model = new KeyNamePair(738,"M_MovementConfirm"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_MovementConfirm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Approval Amount. +@param ApprovalAmt Document Approval Amount */ +public void setApprovalAmt (BigDecimal ApprovalAmt) +{ +set_Value ("ApprovalAmt", ApprovalAmt); +} +/** Get Approval Amount. +@return Document Approval Amount */ +public BigDecimal getApprovalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ApprovalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Phys.Inventory. +@param M_Inventory_ID Parameters for a Physical Inventory */ +public void setM_Inventory_ID (int M_Inventory_ID) +{ +if (M_Inventory_ID <= 0) set_Value ("M_Inventory_ID", null); + else +set_Value ("M_Inventory_ID", new Integer(M_Inventory_ID)); +} +/** Get Phys.Inventory. +@return Parameters for a Physical Inventory */ +public int getM_Inventory_ID() +{ +Integer ii = (Integer)get_Value("M_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Confirm. +@param M_MovementConfirm_ID Inventory Move Confirmation */ +public void setM_MovementConfirm_ID (int M_MovementConfirm_ID) +{ +if (M_MovementConfirm_ID < 1) throw new IllegalArgumentException ("M_MovementConfirm_ID is mandatory."); +set_ValueNoCheck ("M_MovementConfirm_ID", new Integer(M_MovementConfirm_ID)); +} +/** Get Move Confirm. +@return Inventory Move Confirmation */ +public int getM_MovementConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_MovementConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Move. +@param M_Movement_ID Movement of Inventory */ +public void setM_Movement_ID (int M_Movement_ID) +{ +if (M_Movement_ID < 1) throw new IllegalArgumentException ("M_Movement_ID is mandatory."); +set_Value ("M_Movement_ID", new Integer(M_Movement_ID)); +} +/** Get Inventory Move. +@return Movement of Inventory */ +public int getM_Movement_ID() +{ +Integer ii = (Integer)get_Value("M_Movement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_MovementLine.java b/dbPort/src/org/compiere/model/X_M_MovementLine.java new file mode 100644 index 0000000000..92eb7390d8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_MovementLine.java @@ -0,0 +1,322 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_MovementLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.578 */ +public class X_M_MovementLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_MovementLine_ID id +@param trxName transaction +*/ +public X_M_MovementLine (Properties ctx, int M_MovementLine_ID, String trxName) +{ +super (ctx, M_MovementLine_ID, trxName); +/** if (M_MovementLine_ID == 0) +{ +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_MovementLine WHERE M_Movement_ID=@M_Movement_ID@ +setM_AttributeSetInstance_ID (0); +setM_LocatorTo_ID (0); // @M_LocatorTo_ID@ +setM_Locator_ID (0); // @M_Locator_ID@ +setM_MovementLine_ID (0); +setM_Movement_ID (0); +setM_Product_ID (0); +setMovementQty (Env.ZERO); // 1 +setProcessed (false); +setTargetQty (Env.ZERO); // 0 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_MovementLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=324 */ +public static final int Table_ID=324; + +/** TableName=M_MovementLine */ +public static final String Table_Name="M_MovementLine"; + +protected static KeyNamePair Model = new KeyNamePair(324,"M_MovementLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_MovementLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Confirmed Quantity. +@param ConfirmedQty Confirmation of a received quantity */ +public void setConfirmedQty (BigDecimal ConfirmedQty) +{ +set_Value ("ConfirmedQty", ConfirmedQty); +} +/** Get Confirmed Quantity. +@return Confirmation of a received quantity */ +public BigDecimal getConfirmedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Attribute Set Instance To. +@param M_AttributeSetInstanceTo_ID Target Product Attribute Set Instance */ +public void setM_AttributeSetInstanceTo_ID (int M_AttributeSetInstanceTo_ID) +{ +if (M_AttributeSetInstanceTo_ID <= 0) set_ValueNoCheck ("M_AttributeSetInstanceTo_ID", null); + else +set_ValueNoCheck ("M_AttributeSetInstanceTo_ID", new Integer(M_AttributeSetInstanceTo_ID)); +} +/** Get Attribute Set Instance To. +@return Target Product Attribute Set Instance */ +public int getM_AttributeSetInstanceTo_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstanceTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_LocatorTo_ID AD_Reference_ID=191 */ +public static final int M_LOCATORTO_ID_AD_Reference_ID=191; +/** Set Locator To. +@param M_LocatorTo_ID Location inventory is moved to */ +public void setM_LocatorTo_ID (int M_LocatorTo_ID) +{ +if (M_LocatorTo_ID < 1) throw new IllegalArgumentException ("M_LocatorTo_ID is mandatory."); +set_Value ("M_LocatorTo_ID", new Integer(M_LocatorTo_ID)); +} +/** Get Locator To. +@return Location inventory is moved to */ +public int getM_LocatorTo_ID() +{ +Integer ii = (Integer)get_Value("M_LocatorTo_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Line. +@param M_MovementLine_ID Inventory Move document Line */ +public void setM_MovementLine_ID (int M_MovementLine_ID) +{ +if (M_MovementLine_ID < 1) throw new IllegalArgumentException ("M_MovementLine_ID is mandatory."); +set_ValueNoCheck ("M_MovementLine_ID", new Integer(M_MovementLine_ID)); +} +/** Get Move Line. +@return Inventory Move document Line */ +public int getM_MovementLine_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Move. +@param M_Movement_ID Movement of Inventory */ +public void setM_Movement_ID (int M_Movement_ID) +{ +if (M_Movement_ID < 1) throw new IllegalArgumentException ("M_Movement_ID is mandatory."); +set_ValueNoCheck ("M_Movement_ID", new Integer(M_Movement_ID)); +} +/** Get Inventory Move. +@return Movement of Inventory */ +public int getM_Movement_ID() +{ +Integer ii = (Integer)get_Value("M_Movement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_Product_ID AD_Reference_ID=171 */ +public static final int M_PRODUCT_ID_AD_Reference_ID=171; +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Scrapped Quantity. +@param ScrappedQty The Quantity scrapped due to QA issues */ +public void setScrappedQty (BigDecimal ScrappedQty) +{ +set_Value ("ScrappedQty", ScrappedQty); +} +/** Get Scrapped Quantity. +@return The Quantity scrapped due to QA issues */ +public BigDecimal getScrappedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Target Quantity. +@param TargetQty Target Movement Quantity */ +public void setTargetQty (BigDecimal TargetQty) +{ +if (TargetQty == null) throw new IllegalArgumentException ("TargetQty is mandatory."); +set_Value ("TargetQty", TargetQty); +} +/** Get Target Quantity. +@return Target Movement Quantity */ +public BigDecimal getTargetQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TargetQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_MovementLineConfirm.java b/dbPort/src/org/compiere/model/X_M_MovementLineConfirm.java new file mode 100644 index 0000000000..228bae445a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_MovementLineConfirm.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_MovementLineConfirm + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.593 */ +public class X_M_MovementLineConfirm extends PO +{ +/** Standard Constructor +@param ctx context +@param M_MovementLineConfirm_ID id +@param trxName transaction +*/ +public X_M_MovementLineConfirm (Properties ctx, int M_MovementLineConfirm_ID, String trxName) +{ +super (ctx, M_MovementLineConfirm_ID, trxName); +/** if (M_MovementLineConfirm_ID == 0) +{ +setConfirmedQty (Env.ZERO); +setDifferenceQty (Env.ZERO); +setM_MovementConfirm_ID (0); +setM_MovementLineConfirm_ID (0); +setM_MovementLine_ID (0); +setProcessed (false); +setScrappedQty (Env.ZERO); +setTargetQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_MovementLineConfirm (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=737 */ +public static final int Table_ID=737; + +/** TableName=M_MovementLineConfirm */ +public static final String Table_Name="M_MovementLineConfirm"; + +protected static KeyNamePair Model = new KeyNamePair(737,"M_MovementLineConfirm"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_MovementLineConfirm[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Confirmed Quantity. +@param ConfirmedQty Confirmation of a received quantity */ +public void setConfirmedQty (BigDecimal ConfirmedQty) +{ +if (ConfirmedQty == null) throw new IllegalArgumentException ("ConfirmedQty is mandatory."); +set_Value ("ConfirmedQty", ConfirmedQty); +} +/** Get Confirmed Quantity. +@return Confirmation of a received quantity */ +public BigDecimal getConfirmedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Difference. +@param DifferenceQty Difference Quantity */ +public void setDifferenceQty (BigDecimal DifferenceQty) +{ +if (DifferenceQty == null) throw new IllegalArgumentException ("DifferenceQty is mandatory."); +set_Value ("DifferenceQty", DifferenceQty); +} +/** Get Difference. +@return Difference Quantity */ +public BigDecimal getDifferenceQty() +{ +BigDecimal bd = (BigDecimal)get_Value("DifferenceQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_Value ("M_InventoryLine_ID", null); + else +set_Value ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Confirm. +@param M_MovementConfirm_ID Inventory Move Confirmation */ +public void setM_MovementConfirm_ID (int M_MovementConfirm_ID) +{ +if (M_MovementConfirm_ID < 1) throw new IllegalArgumentException ("M_MovementConfirm_ID is mandatory."); +set_ValueNoCheck ("M_MovementConfirm_ID", new Integer(M_MovementConfirm_ID)); +} +/** Get Move Confirm. +@return Inventory Move Confirmation */ +public int getM_MovementConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_MovementConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_MovementConfirm_ID())); +} +/** Set Move Line Confirm. +@param M_MovementLineConfirm_ID Inventory Move Line Confirmation */ +public void setM_MovementLineConfirm_ID (int M_MovementLineConfirm_ID) +{ +if (M_MovementLineConfirm_ID < 1) throw new IllegalArgumentException ("M_MovementLineConfirm_ID is mandatory."); +set_ValueNoCheck ("M_MovementLineConfirm_ID", new Integer(M_MovementLineConfirm_ID)); +} +/** Get Move Line Confirm. +@return Inventory Move Line Confirmation */ +public int getM_MovementLineConfirm_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLineConfirm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Line. +@param M_MovementLine_ID Inventory Move document Line */ +public void setM_MovementLine_ID (int M_MovementLine_ID) +{ +if (M_MovementLine_ID < 1) throw new IllegalArgumentException ("M_MovementLine_ID is mandatory."); +set_Value ("M_MovementLine_ID", new Integer(M_MovementLine_ID)); +} +/** Get Move Line. +@return Inventory Move document Line */ +public int getM_MovementLine_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Scrapped Quantity. +@param ScrappedQty The Quantity scrapped due to QA issues */ +public void setScrappedQty (BigDecimal ScrappedQty) +{ +if (ScrappedQty == null) throw new IllegalArgumentException ("ScrappedQty is mandatory."); +set_Value ("ScrappedQty", ScrappedQty); +} +/** Get Scrapped Quantity. +@return The Quantity scrapped due to QA issues */ +public BigDecimal getScrappedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Target Quantity. +@param TargetQty Target Movement Quantity */ +public void setTargetQty (BigDecimal TargetQty) +{ +if (TargetQty == null) throw new IllegalArgumentException ("TargetQty is mandatory."); +set_Value ("TargetQty", TargetQty); +} +/** Get Target Quantity. +@return Target Movement Quantity */ +public BigDecimal getTargetQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TargetQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_MovementLineMA.java b/dbPort/src/org/compiere/model/X_M_MovementLineMA.java new file mode 100644 index 0000000000..ef36cdc1bd --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_MovementLineMA.java @@ -0,0 +1,139 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_MovementLineMA + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.625 */ +public class X_M_MovementLineMA extends PO +{ +/** Standard Constructor +@param ctx context +@param M_MovementLineMA_ID id +@param trxName transaction +*/ +public X_M_MovementLineMA (Properties ctx, int M_MovementLineMA_ID, String trxName) +{ +super (ctx, M_MovementLineMA_ID, trxName); +/** if (M_MovementLineMA_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_MovementLine_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_MovementLineMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=764 */ +public static final int Table_ID=764; + +/** TableName=M_MovementLineMA */ +public static final String Table_Name="M_MovementLineMA"; + +protected static KeyNamePair Model = new KeyNamePair(764,"M_MovementLineMA"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_MovementLineMA[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Line. +@param M_MovementLine_ID Inventory Move document Line */ +public void setM_MovementLine_ID (int M_MovementLine_ID) +{ +if (M_MovementLine_ID < 1) throw new IllegalArgumentException ("M_MovementLine_ID is mandatory."); +set_ValueNoCheck ("M_MovementLine_ID", new Integer(M_MovementLine_ID)); +} +/** Get Move Line. +@return Inventory Move document Line */ +public int getM_MovementLine_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_MovementLine_ID())); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_OperationResource.java b/dbPort/src/org/compiere/model/X_M_OperationResource.java new file mode 100644 index 0000000000..86ae5c9066 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_OperationResource.java @@ -0,0 +1,258 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_OperationResource + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.625 */ +public class X_M_OperationResource extends PO +{ +/** Standard Constructor +@param ctx context +@param M_OperationResource_ID id +@param trxName transaction +*/ +public X_M_OperationResource (Properties ctx, int M_OperationResource_ID, String trxName) +{ +super (ctx, M_OperationResource_ID, trxName); +/** if (M_OperationResource_ID == 0) +{ +setM_OperationResource_ID (0); +setM_ProductOperation_ID (0); +setName (null); +setSetupTime (Env.ZERO); +setTeardownTime (Env.ZERO); +setUnitRuntime (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_OperationResource (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=797 */ +public static final int Table_ID=797; + +/** TableName=M_OperationResource */ +public static final String Table_Name="M_OperationResource"; + +protected static KeyNamePair Model = new KeyNamePair(797,"M_OperationResource"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_OperationResource[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Position. +@param C_Job_ID Job Position */ +public void setC_Job_ID (int C_Job_ID) +{ +if (C_Job_ID <= 0) set_Value ("C_Job_ID", null); + else +set_Value ("C_Job_ID", new Integer(C_Job_ID)); +} +/** Get Position. +@return Job Position */ +public int getC_Job_ID() +{ +Integer ii = (Integer)get_Value("C_Job_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Operation Resource. +@param M_OperationResource_ID Product Operation Resource */ +public void setM_OperationResource_ID (int M_OperationResource_ID) +{ +if (M_OperationResource_ID < 1) throw new IllegalArgumentException ("M_OperationResource_ID is mandatory."); +set_ValueNoCheck ("M_OperationResource_ID", new Integer(M_OperationResource_ID)); +} +/** Get Operation Resource. +@return Product Operation Resource */ +public int getM_OperationResource_ID() +{ +Integer ii = (Integer)get_Value("M_OperationResource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Operation. +@param M_ProductOperation_ID Product Manufacturing Operation */ +public void setM_ProductOperation_ID (int M_ProductOperation_ID) +{ +if (M_ProductOperation_ID < 1) throw new IllegalArgumentException ("M_ProductOperation_ID is mandatory."); +set_ValueNoCheck ("M_ProductOperation_ID", new Integer(M_ProductOperation_ID)); +} +/** Get Product Operation. +@return Product Manufacturing Operation */ +public int getM_ProductOperation_ID() +{ +Integer ii = (Integer)get_Value("M_ProductOperation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Setup Time. +@param SetupTime Setup time before starting Production */ +public void setSetupTime (BigDecimal SetupTime) +{ +if (SetupTime == null) throw new IllegalArgumentException ("SetupTime is mandatory."); +set_Value ("SetupTime", SetupTime); +} +/** Get Setup Time. +@return Setup time before starting Production */ +public BigDecimal getSetupTime() +{ +BigDecimal bd = (BigDecimal)get_Value("SetupTime"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Teardown Time. +@param TeardownTime Time at the end of the operation */ +public void setTeardownTime (BigDecimal TeardownTime) +{ +if (TeardownTime == null) throw new IllegalArgumentException ("TeardownTime is mandatory."); +set_Value ("TeardownTime", TeardownTime); +} +/** Get Teardown Time. +@return Time at the end of the operation */ +public BigDecimal getTeardownTime() +{ +BigDecimal bd = (BigDecimal)get_Value("TeardownTime"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Runtime per Unit. +@param UnitRuntime Time to produce one unit */ +public void setUnitRuntime (BigDecimal UnitRuntime) +{ +if (UnitRuntime == null) throw new IllegalArgumentException ("UnitRuntime is mandatory."); +set_Value ("UnitRuntime", UnitRuntime); +} +/** Get Runtime per Unit. +@return Time to produce one unit */ +public BigDecimal getUnitRuntime() +{ +BigDecimal bd = (BigDecimal)get_Value("UnitRuntime"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Package.java b/dbPort/src/org/compiere/model/X_M_Package.java new file mode 100644 index 0000000000..dea6bd6ba0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Package.java @@ -0,0 +1,229 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Package + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.64 */ +public class X_M_Package extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Package_ID id +@param trxName transaction +*/ +public X_M_Package (Properties ctx, int M_Package_ID, String trxName) +{ +super (ctx, M_Package_ID, trxName); +/** if (M_Package_ID == 0) +{ +setDocumentNo (null); +setM_InOut_ID (0); +setM_Package_ID (0); +setM_Shipper_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Package (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=664 */ +public static final int Table_ID=664; + +/** TableName=M_Package */ +public static final String Table_Name="M_Package"; + +protected static KeyNamePair Model = new KeyNamePair(664,"M_Package"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Package[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Date received. +@param DateReceived Date a product was received */ +public void setDateReceived (Timestamp DateReceived) +{ +set_Value ("DateReceived", DateReceived); +} +/** Get Date received. +@return Date a product was received */ +public Timestamp getDateReceived() +{ +return (Timestamp)get_Value("DateReceived"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Package. +@param M_Package_ID Shipment Package */ +public void setM_Package_ID (int M_Package_ID) +{ +if (M_Package_ID < 1) throw new IllegalArgumentException ("M_Package_ID is mandatory."); +set_ValueNoCheck ("M_Package_ID", new Integer(M_Package_ID)); +} +/** Get Package. +@return Shipment Package */ +public int getM_Package_ID() +{ +Integer ii = (Integer)get_Value("M_Package_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID < 1) throw new IllegalArgumentException ("M_Shipper_ID is mandatory."); +set_Value ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Info Received. +@param ReceivedInfo Information of the receipt of the package (acknowledgement) */ +public void setReceivedInfo (String ReceivedInfo) +{ +if (ReceivedInfo != null && ReceivedInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ReceivedInfo = ReceivedInfo.substring(0,254); +} +set_Value ("ReceivedInfo", ReceivedInfo); +} +/** Get Info Received. +@return Information of the receipt of the package (acknowledgement) */ +public String getReceivedInfo() +{ +return (String)get_Value("ReceivedInfo"); +} +/** Set Ship Date. +@param ShipDate Shipment Date/Time */ +public void setShipDate (Timestamp ShipDate) +{ +set_Value ("ShipDate", ShipDate); +} +/** Get Ship Date. +@return Shipment Date/Time */ +public Timestamp getShipDate() +{ +return (Timestamp)get_Value("ShipDate"); +} +/** Set Tracking Info. +@param TrackingInfo Tracking Info */ +public void setTrackingInfo (String TrackingInfo) +{ +if (TrackingInfo != null && TrackingInfo.length() > 255) +{ +log.warning("Length > 255 - truncated"); +TrackingInfo = TrackingInfo.substring(0,254); +} +set_Value ("TrackingInfo", TrackingInfo); +} +/** Get Tracking Info. +@return Tracking Info */ +public String getTrackingInfo() +{ +return (String)get_Value("TrackingInfo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_PackageLine.java b/dbPort/src/org/compiere/model/X_M_PackageLine.java new file mode 100644 index 0000000000..18dcbf1b86 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_PackageLine.java @@ -0,0 +1,174 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_PackageLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.656 */ +public class X_M_PackageLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_PackageLine_ID id +@param trxName transaction +*/ +public X_M_PackageLine (Properties ctx, int M_PackageLine_ID, String trxName) +{ +super (ctx, M_PackageLine_ID, trxName); +/** if (M_PackageLine_ID == 0) +{ +setM_InOutLine_ID (0); +setM_PackageLine_ID (0); +setM_Package_ID (0); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_PackageLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=663 */ +public static final int Table_ID=663; + +/** TableName=M_PackageLine */ +public static final String Table_Name="M_PackageLine"; + +protected static KeyNamePair Model = new KeyNamePair(663,"M_PackageLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_PackageLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Package Line. +@param M_PackageLine_ID The detail content of the Package */ +public void setM_PackageLine_ID (int M_PackageLine_ID) +{ +if (M_PackageLine_ID < 1) throw new IllegalArgumentException ("M_PackageLine_ID is mandatory."); +set_ValueNoCheck ("M_PackageLine_ID", new Integer(M_PackageLine_ID)); +} +/** Get Package Line. +@return The detail content of the Package */ +public int getM_PackageLine_ID() +{ +Integer ii = (Integer)get_Value("M_PackageLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Package. +@param M_Package_ID Shipment Package */ +public void setM_Package_ID (int M_Package_ID) +{ +if (M_Package_ID < 1) throw new IllegalArgumentException ("M_Package_ID is mandatory."); +set_ValueNoCheck ("M_Package_ID", new Integer(M_Package_ID)); +} +/** Get Package. +@return Shipment Package */ +public int getM_Package_ID() +{ +Integer ii = (Integer)get_Value("M_Package_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_Package_ID())); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_PerpetualInv.java b/dbPort/src/org/compiere/model/X_M_PerpetualInv.java new file mode 100644 index 0000000000..9ea3982bb7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_PerpetualInv.java @@ -0,0 +1,285 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_PerpetualInv + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.703 */ +public class X_M_PerpetualInv extends PO +{ +/** Standard Constructor +@param ctx context +@param M_PerpetualInv_ID id +@param trxName transaction +*/ +public X_M_PerpetualInv (Properties ctx, int M_PerpetualInv_ID, String trxName) +{ +super (ctx, M_PerpetualInv_ID, trxName); +/** if (M_PerpetualInv_ID == 0) +{ +setCountHighMovement (false); +setDateNextRun (new Timestamp(System.currentTimeMillis())); +setM_PerpetualInv_ID (0); +setName (null); +setNoInventoryCount (0); // 1 +setNoProductCount (0); // 1 +setNumberOfRuns (0); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_PerpetualInv (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=342 */ +public static final int Table_ID=342; + +/** TableName=M_PerpetualInv */ +public static final String Table_Name="M_PerpetualInv"; + +protected static KeyNamePair Model = new KeyNamePair(342,"M_PerpetualInv"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_PerpetualInv[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Count high turnover items. +@param CountHighMovement Count High Movement products */ +public void setCountHighMovement (boolean CountHighMovement) +{ +set_Value ("CountHighMovement", new Boolean(CountHighMovement)); +} +/** Get Count high turnover items. +@return Count High Movement products */ +public boolean isCountHighMovement() +{ +Object oo = get_Value("CountHighMovement"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_ValueNoCheck ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +if (DateNextRun == null) throw new IllegalArgumentException ("DateNextRun is mandatory."); +set_ValueNoCheck ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Perpetual Inventory. +@param M_PerpetualInv_ID Rules for generating physical inventory */ +public void setM_PerpetualInv_ID (int M_PerpetualInv_ID) +{ +if (M_PerpetualInv_ID < 1) throw new IllegalArgumentException ("M_PerpetualInv_ID is mandatory."); +set_ValueNoCheck ("M_PerpetualInv_ID", new Integer(M_PerpetualInv_ID)); +} +/** Get Perpetual Inventory. +@return Rules for generating physical inventory */ +public int getM_PerpetualInv_ID() +{ +Integer ii = (Integer)get_Value("M_PerpetualInv_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID <= 0) set_Value ("M_Warehouse_ID", null); + else +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Number of Inventory counts. +@param NoInventoryCount Frequency of inventory counts per year */ +public void setNoInventoryCount (int NoInventoryCount) +{ +set_Value ("NoInventoryCount", new Integer(NoInventoryCount)); +} +/** Get Number of Inventory counts. +@return Frequency of inventory counts per year */ +public int getNoInventoryCount() +{ +Integer ii = (Integer)get_Value("NoInventoryCount"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Number of Product counts. +@param NoProductCount Frequency of product counts per year */ +public void setNoProductCount (int NoProductCount) +{ +set_Value ("NoProductCount", new Integer(NoProductCount)); +} +/** Get Number of Product counts. +@return Frequency of product counts per year */ +public int getNoProductCount() +{ +Integer ii = (Integer)get_Value("NoProductCount"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Number of runs. +@param NumberOfRuns Frequency of processing Perpetual Inventory */ +public void setNumberOfRuns (int NumberOfRuns) +{ +set_Value ("NumberOfRuns", new Integer(NumberOfRuns)); +} +/** Get Number of runs. +@return Frequency of processing Perpetual Inventory */ +public int getNumberOfRuns() +{ +Integer ii = (Integer)get_Value("NumberOfRuns"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_PriceList.java b/dbPort/src/org/compiere/model/X_M_PriceList.java new file mode 100644 index 0000000000..4c20640859 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_PriceList.java @@ -0,0 +1,272 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_PriceList + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.734 */ +public class X_M_PriceList extends PO +{ +/** Standard Constructor +@param ctx context +@param M_PriceList_ID id +@param trxName transaction +*/ +public X_M_PriceList (Properties ctx, int M_PriceList_ID, String trxName) +{ +super (ctx, M_PriceList_ID, trxName); +/** if (M_PriceList_ID == 0) +{ +setC_Currency_ID (0); +setEnforcePriceLimit (false); +setIsDefault (false); +setIsSOPriceList (false); +setIsTaxIncluded (false); +setM_PriceList_ID (0); +setName (null); +setPricePrecision (Env.ZERO); // 2 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_PriceList (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=255 */ +public static final int Table_ID=255; + +/** TableName=M_PriceList */ +public static final String Table_Name="M_PriceList"; + +protected static KeyNamePair Model = new KeyNamePair(255,"M_PriceList"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_PriceList[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** BasePriceList_ID AD_Reference_ID=166 */ +public static final int BASEPRICELIST_ID_AD_Reference_ID=166; +/** Set Base Pricelist. +@param BasePriceList_ID Pricelist to be used, if product not found on this pricelist */ +public void setBasePriceList_ID (int BasePriceList_ID) +{ +if (BasePriceList_ID <= 0) set_Value ("BasePriceList_ID", null); + else +set_Value ("BasePriceList_ID", new Integer(BasePriceList_ID)); +} +/** Get Base Pricelist. +@return Pricelist to be used, if product not found on this pricelist */ +public int getBasePriceList_ID() +{ +Integer ii = (Integer)get_Value("BasePriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Enforce price limit. +@param EnforcePriceLimit Do not allow prices below the limit price */ +public void setEnforcePriceLimit (boolean EnforcePriceLimit) +{ +set_Value ("EnforcePriceLimit", new Boolean(EnforcePriceLimit)); +} +/** Get Enforce price limit. +@return Do not allow prices below the limit price */ +public boolean isEnforcePriceLimit() +{ +Object oo = get_Value("EnforcePriceLimit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Price list. +@param IsSOPriceList This is a Sales Price List */ +public void setIsSOPriceList (boolean IsSOPriceList) +{ +set_Value ("IsSOPriceList", new Boolean(IsSOPriceList)); +} +/** Get Sales Price list. +@return This is a Sales Price List */ +public boolean isSOPriceList() +{ +Object oo = get_Value("IsSOPriceList"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price includes Tax. +@param IsTaxIncluded Tax is included in the price */ +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", new Boolean(IsTaxIncluded)); +} +/** Get Price includes Tax. +@return Tax is included in the price */ +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_ValueNoCheck ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Price Precision. +@param PricePrecision Precision (number of decimals) for the Price */ +public void setPricePrecision (BigDecimal PricePrecision) +{ +if (PricePrecision == null) throw new IllegalArgumentException ("PricePrecision is mandatory."); +set_Value ("PricePrecision", PricePrecision); +} +/** Get Price Precision. +@return Precision (number of decimals) for the Price */ +public BigDecimal getPricePrecision() +{ +BigDecimal bd = (BigDecimal)get_Value("PricePrecision"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_PriceList_Version.java b/dbPort/src/org/compiere/model/X_M_PriceList_Version.java new file mode 100644 index 0000000000..d029ede27d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_PriceList_Version.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_PriceList_Version + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.75 */ +public class X_M_PriceList_Version extends PO +{ +/** Standard Constructor +@param ctx context +@param M_PriceList_Version_ID id +@param trxName transaction +*/ +public X_M_PriceList_Version (Properties ctx, int M_PriceList_Version_ID, String trxName) +{ +super (ctx, M_PriceList_Version_ID, trxName); +/** if (M_PriceList_Version_ID == 0) +{ +setM_DiscountSchema_ID (0); +setM_PriceList_ID (0); +setM_PriceList_Version_ID (0); +setName (null); // @#Date@ +setValidFrom (new Timestamp(System.currentTimeMillis())); // @#Date@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_PriceList_Version (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=295 */ +public static final int Table_ID=295; + +/** TableName=M_PriceList_Version */ +public static final String Table_Name="M_PriceList_Version"; + +protected static KeyNamePair Model = new KeyNamePair(295,"M_PriceList_Version"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_PriceList_Version[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID < 1) throw new IllegalArgumentException ("M_DiscountSchema_ID is mandatory."); +set_Value ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_ValueNoCheck ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price List Version. +@param M_PriceList_Version_ID Identifies a unique instance of a Price List */ +public void setM_PriceList_Version_ID (int M_PriceList_Version_ID) +{ +if (M_PriceList_Version_ID < 1) throw new IllegalArgumentException ("M_PriceList_Version_ID is mandatory."); +set_ValueNoCheck ("M_PriceList_Version_ID", new Integer(M_PriceList_Version_ID)); +} +/** Get Price List Version. +@return Identifies a unique instance of a Price List */ +public int getM_PriceList_Version_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_Version_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_Pricelist_Version_Base_ID AD_Reference_ID=188 */ +public static final int M_PRICELIST_VERSION_BASE_ID_AD_Reference_ID=188; +/** Set Base Price List. +@param M_Pricelist_Version_Base_ID Source for Price list calculations */ +public void setM_Pricelist_Version_Base_ID (int M_Pricelist_Version_Base_ID) +{ +if (M_Pricelist_Version_Base_ID <= 0) set_Value ("M_Pricelist_Version_Base_ID", null); + else +set_Value ("M_Pricelist_Version_Base_ID", new Integer(M_Pricelist_Version_Base_ID)); +} +/** Get Base Price List. +@return Source for Price list calculations */ +public int getM_Pricelist_Version_Base_ID() +{ +Integer ii = (Integer)get_Value("M_Pricelist_Version_Base_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Create. +@param ProcCreate Create */ +public void setProcCreate (String ProcCreate) +{ +if (ProcCreate != null && ProcCreate.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProcCreate = ProcCreate.substring(0,0); +} +set_Value ("ProcCreate", ProcCreate); +} +/** Get Create. +@return Create */ +public String getProcCreate() +{ +return (String)get_Value("ProcCreate"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory."); +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product.java b/dbPort/src/org/compiere/model/X_M_Product.java new file mode 100644 index 0000000000..bf90d93775 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product.java @@ -0,0 +1,936 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.75 */ +public class X_M_Product extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_ID id +@param trxName transaction +*/ +public X_M_Product (Properties ctx, int M_Product_ID, String trxName) +{ +super (ctx, M_Product_ID, trxName); +/** if (M_Product_ID == 0) +{ +setC_TaxCategory_ID (0); +setC_UOM_ID (0); +setIsBOM (false); // N +setIsDropShip (false); +setIsExcludeAutoDelivery (false); // N +setIsInvoicePrintDetails (false); +setIsPickListPrintDetails (false); +setIsPurchased (true); // Y +setIsSelfService (true); // Y +setIsSold (true); // Y +setIsStocked (true); // Y +setIsSummary (false); +setIsVerified (false); // N +setIsWebStoreFeatured (false); +setM_AttributeSetInstance_ID (0); +setM_Product_Category_ID (0); +setM_Product_ID (0); +setName (null); +setProductType (null); // I +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=208 */ +public static final int Table_ID=208; + +/** TableName=M_Product */ +public static final String Table_Name="M_Product"; + +protected static KeyNamePair Model = new KeyNamePair(208,"M_Product"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Revenue Recognition. +@param C_RevenueRecognition_ID Method for recording revenue */ +public void setC_RevenueRecognition_ID (int C_RevenueRecognition_ID) +{ +if (C_RevenueRecognition_ID <= 0) set_Value ("C_RevenueRecognition_ID", null); + else +set_Value ("C_RevenueRecognition_ID", new Integer(C_RevenueRecognition_ID)); +} +/** Get Revenue Recognition. +@return Method for recording revenue */ +public int getC_RevenueRecognition_ID() +{ +Integer ii = (Integer)get_Value("C_RevenueRecognition_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Subscription Type. +@param C_SubscriptionType_ID Type of subscription */ +public void setC_SubscriptionType_ID (int C_SubscriptionType_ID) +{ +if (C_SubscriptionType_ID <= 0) set_Value ("C_SubscriptionType_ID", null); + else +set_Value ("C_SubscriptionType_ID", new Integer(C_SubscriptionType_ID)); +} +/** Get Subscription Type. +@return Type of subscription */ +public int getC_SubscriptionType_ID() +{ +Integer ii = (Integer)get_Value("C_SubscriptionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_Value ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Classification. +@param Classification Classification for grouping */ +public void setClassification (String Classification) +{ +if (Classification != null && Classification.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Classification = Classification.substring(0,0); +} +set_Value ("Classification", Classification); +} +/** Get Classification. +@return Classification for grouping */ +public String getClassification() +{ +return (String)get_Value("Classification"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Description URL. +@param DescriptionURL URL for the description */ +public void setDescriptionURL (String DescriptionURL) +{ +if (DescriptionURL != null && DescriptionURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DescriptionURL = DescriptionURL.substring(0,119); +} +set_Value ("DescriptionURL", DescriptionURL); +} +/** Get Description URL. +@return URL for the description */ +public String getDescriptionURL() +{ +return (String)get_Value("DescriptionURL"); +} +/** Set Discontinued. +@param Discontinued This product is no longer available */ +public void setDiscontinued (boolean Discontinued) +{ +set_Value ("Discontinued", new Boolean(Discontinued)); +} +/** Get Discontinued. +@return This product is no longer available */ +public boolean isDiscontinued() +{ +Object oo = get_Value("Discontinued"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discontinued by. +@param DiscontinuedBy Discontinued By */ +public void setDiscontinuedBy (Timestamp DiscontinuedBy) +{ +set_Value ("DiscontinuedBy", DiscontinuedBy); +} +/** Get Discontinued by. +@return Discontinued By */ +public Timestamp getDiscontinuedBy() +{ +return (Timestamp)get_Value("DiscontinuedBy"); +} +/** Set Document Note. +@param DocumentNote Additional information for a Document */ +public void setDocumentNote (String DocumentNote) +{ +if (DocumentNote != null && DocumentNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DocumentNote = DocumentNote.substring(0,1999); +} +set_Value ("DocumentNote", DocumentNote); +} +/** Get Document Note. +@return Additional information for a Document */ +public String getDocumentNote() +{ +return (String)get_Value("DocumentNote"); +} +/** Set Guarantee Days. +@param GuaranteeDays Number of days the product is guaranteed or available */ +public void setGuaranteeDays (int GuaranteeDays) +{ +set_Value ("GuaranteeDays", new Integer(GuaranteeDays)); +} +/** Get Guarantee Days. +@return Number of days the product is guaranteed or available */ +public int getGuaranteeDays() +{ +Integer ii = (Integer)get_Value("GuaranteeDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Min Guarantee Days. +@param GuaranteeDaysMin Minumum number of guarantee days */ +public void setGuaranteeDaysMin (int GuaranteeDaysMin) +{ +set_Value ("GuaranteeDaysMin", new Integer(GuaranteeDaysMin)); +} +/** Get Min Guarantee Days. +@return Minumum number of guarantee days */ +public int getGuaranteeDaysMin() +{ +Integer ii = (Integer)get_Value("GuaranteeDaysMin"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Bill of Materials. +@param IsBOM Bill of Materials */ +public void setIsBOM (boolean IsBOM) +{ +set_Value ("IsBOM", new Boolean(IsBOM)); +} +/** Get Bill of Materials. +@return Bill of Materials */ +public boolean isBOM() +{ +Object oo = get_Value("IsBOM"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Drop Shipment. +@param IsDropShip Drop Shipments are sent from the Vendor directly to the Customer */ +public void setIsDropShip (boolean IsDropShip) +{ +set_Value ("IsDropShip", new Boolean(IsDropShip)); +} +/** Get Drop Shipment. +@return Drop Shipments are sent from the Vendor directly to the Customer */ +public boolean isDropShip() +{ +Object oo = get_Value("IsDropShip"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Exclude Auto Delivery. +@param IsExcludeAutoDelivery Exclude from automatic Delivery */ +public void setIsExcludeAutoDelivery (boolean IsExcludeAutoDelivery) +{ +set_Value ("IsExcludeAutoDelivery", new Boolean(IsExcludeAutoDelivery)); +} +/** Get Exclude Auto Delivery. +@return Exclude from automatic Delivery */ +public boolean isExcludeAutoDelivery() +{ +Object oo = get_Value("IsExcludeAutoDelivery"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Print detail records on invoice . +@param IsInvoicePrintDetails Print detail BOM elements on the invoice */ +public void setIsInvoicePrintDetails (boolean IsInvoicePrintDetails) +{ +set_Value ("IsInvoicePrintDetails", new Boolean(IsInvoicePrintDetails)); +} +/** Get Print detail records on invoice . +@return Print detail BOM elements on the invoice */ +public boolean isInvoicePrintDetails() +{ +Object oo = get_Value("IsInvoicePrintDetails"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Print detail records on pick list. +@param IsPickListPrintDetails Print detail BOM elements on the pick list */ +public void setIsPickListPrintDetails (boolean IsPickListPrintDetails) +{ +set_Value ("IsPickListPrintDetails", new Boolean(IsPickListPrintDetails)); +} +/** Get Print detail records on pick list. +@return Print detail BOM elements on the pick list */ +public boolean isPickListPrintDetails() +{ +Object oo = get_Value("IsPickListPrintDetails"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Purchased. +@param IsPurchased Organization purchases this product */ +public void setIsPurchased (boolean IsPurchased) +{ +set_Value ("IsPurchased", new Boolean(IsPurchased)); +} +/** Get Purchased. +@return Organization purchases this product */ +public boolean isPurchased() +{ +Object oo = get_Value("IsPurchased"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sold. +@param IsSold Organization sells this product */ +public void setIsSold (boolean IsSold) +{ +set_Value ("IsSold", new Boolean(IsSold)); +} +/** Get Sold. +@return Organization sells this product */ +public boolean isSold() +{ +Object oo = get_Value("IsSold"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Stocked. +@param IsStocked Organization stocks this product */ +public void setIsStocked (boolean IsStocked) +{ +set_Value ("IsStocked", new Boolean(IsStocked)); +} +/** Get Stocked. +@return Organization stocks this product */ +public boolean isStocked() +{ +Object oo = get_Value("IsStocked"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Verified. +@param IsVerified The BOM configuration has been verified */ +public void setIsVerified (boolean IsVerified) +{ +set_ValueNoCheck ("IsVerified", new Boolean(IsVerified)); +} +/** Get Verified. +@return The BOM configuration has been verified */ +public boolean isVerified() +{ +Object oo = get_Value("IsVerified"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Featured in Web Store. +@param IsWebStoreFeatured If selected, the product is displayed in the inital or any empy search */ +public void setIsWebStoreFeatured (boolean IsWebStoreFeatured) +{ +set_Value ("IsWebStoreFeatured", new Boolean(IsWebStoreFeatured)); +} +/** Get Featured in Web Store. +@return If selected, the product is displayed in the inital or any empy search */ +public boolean isWebStoreFeatured() +{ +Object oo = get_Value("IsWebStoreFeatured"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set. +@param M_AttributeSet_ID Product Attribute Set */ +public void setM_AttributeSet_ID (int M_AttributeSet_ID) +{ +if (M_AttributeSet_ID <= 0) set_Value ("M_AttributeSet_ID", null); + else +set_Value ("M_AttributeSet_ID", new Integer(M_AttributeSet_ID)); +} +/** Get Attribute Set. +@return Product Attribute Set */ +public int getM_AttributeSet_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Freight Category. +@param M_FreightCategory_ID Category of the Freight */ +public void setM_FreightCategory_ID (int M_FreightCategory_ID) +{ +if (M_FreightCategory_ID <= 0) set_Value ("M_FreightCategory_ID", null); + else +set_Value ("M_FreightCategory_ID", new Integer(M_FreightCategory_ID)); +} +/** Get Freight Category. +@return Category of the Freight */ +public int getM_FreightCategory_ID() +{ +Integer ii = (Integer)get_Value("M_FreightCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID <= 0) set_Value ("M_Locator_ID", null); + else +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_Product_Category_ID AD_Reference_ID=163 */ +public static final int M_PRODUCT_CATEGORY_ID_AD_Reference_ID=163; +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID < 1) throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** ProductType AD_Reference_ID=270 */ +public static final int PRODUCTTYPE_AD_Reference_ID=270; +/** Expense type = E */ +public static final String PRODUCTTYPE_ExpenseType = "E"; +/** Item = I */ +public static final String PRODUCTTYPE_Item = "I"; +/** Online = O */ +public static final String PRODUCTTYPE_Online = "O"; +/** Resource = R */ +public static final String PRODUCTTYPE_Resource = "R"; +/** Service = S */ +public static final String PRODUCTTYPE_Service = "S"; +/** Set Product Type. +@param ProductType Type of product */ +public void setProductType (String ProductType) +{ +if (ProductType == null) throw new IllegalArgumentException ("ProductType is mandatory"); +if (ProductType.equals("E") || ProductType.equals("I") || ProductType.equals("O") || ProductType.equals("R") || ProductType.equals("S")); + else throw new IllegalArgumentException ("ProductType Invalid value - " + ProductType + " - Reference_ID=270 - E - I - O - R - S"); +if (ProductType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ProductType = ProductType.substring(0,0); +} +set_Value ("ProductType", ProductType); +} +/** Get Product Type. +@return Type of product */ +public String getProductType() +{ +return (String)get_Value("ProductType"); +} +/** Set Mail Template. +@param R_MailText_ID Text templates for mailings */ +public void setR_MailText_ID (int R_MailText_ID) +{ +if (R_MailText_ID <= 0) set_Value ("R_MailText_ID", null); + else +set_Value ("R_MailText_ID", new Integer(R_MailText_ID)); +} +/** Get Mail Template. +@return Text templates for mailings */ +public int getR_MailText_ID() +{ +Integer ii = (Integer)get_Value("R_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set SKU. +@param SKU Stock Keeping Unit */ +public void setSKU (String SKU) +{ +if (SKU != null && SKU.length() > 30) +{ +log.warning("Length > 30 - truncated"); +SKU = SKU.substring(0,29); +} +set_Value ("SKU", SKU); +} +/** Get SKU. +@return Stock Keeping Unit */ +public String getSKU() +{ +return (String)get_Value("SKU"); +} +/** Set Expense Type. +@param S_ExpenseType_ID Expense report type */ +public void setS_ExpenseType_ID (int S_ExpenseType_ID) +{ +if (S_ExpenseType_ID <= 0) set_ValueNoCheck ("S_ExpenseType_ID", null); + else +set_ValueNoCheck ("S_ExpenseType_ID", new Integer(S_ExpenseType_ID)); +} +/** Get Expense Type. +@return Expense report type */ +public int getS_ExpenseType_ID() +{ +Integer ii = (Integer)get_Value("S_ExpenseType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resource. +@param S_Resource_ID Resource */ +public void setS_Resource_ID (int S_Resource_ID) +{ +if (S_Resource_ID <= 0) set_ValueNoCheck ("S_Resource_ID", null); + else +set_ValueNoCheck ("S_Resource_ID", new Integer(S_Resource_ID)); +} +/** Get Resource. +@return Resource */ +public int getS_Resource_ID() +{ +Integer ii = (Integer)get_Value("S_Resource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); + else +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shelf Depth. +@param ShelfDepth Shelf depth required */ +public void setShelfDepth (int ShelfDepth) +{ +set_Value ("ShelfDepth", new Integer(ShelfDepth)); +} +/** Get Shelf Depth. +@return Shelf depth required */ +public int getShelfDepth() +{ +Integer ii = (Integer)get_Value("ShelfDepth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shelf Height. +@param ShelfHeight Shelf height required */ +public void setShelfHeight (int ShelfHeight) +{ +set_Value ("ShelfHeight", new Integer(ShelfHeight)); +} +/** Get Shelf Height. +@return Shelf height required */ +public int getShelfHeight() +{ +Integer ii = (Integer)get_Value("ShelfHeight"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shelf Width. +@param ShelfWidth Shelf width required */ +public void setShelfWidth (int ShelfWidth) +{ +set_Value ("ShelfWidth", new Integer(ShelfWidth)); +} +/** Get Shelf Width. +@return Shelf width required */ +public int getShelfWidth() +{ +Integer ii = (Integer)get_Value("ShelfWidth"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +/** Set Units Per Pallet. +@param UnitsPerPallet Units Per Pallet */ +public void setUnitsPerPallet (int UnitsPerPallet) +{ +set_Value ("UnitsPerPallet", new Integer(UnitsPerPallet)); +} +/** Get Units Per Pallet. +@return Units Per Pallet */ +public int getUnitsPerPallet() +{ +Integer ii = (Integer)get_Value("UnitsPerPallet"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Version No. +@param VersionNo Version Number */ +public void setVersionNo (String VersionNo) +{ +if (VersionNo != null && VersionNo.length() > 20) +{ +log.warning("Length > 20 - truncated"); +VersionNo = VersionNo.substring(0,19); +} +set_Value ("VersionNo", VersionNo); +} +/** Get Version No. +@return Version Number */ +public String getVersionNo() +{ +return (String)get_Value("VersionNo"); +} +/** Set Volume. +@param Volume Volume of a product */ +public void setVolume (BigDecimal Volume) +{ +set_Value ("Volume", Volume); +} +/** Get Volume. +@return Volume of a product */ +public BigDecimal getVolume() +{ +BigDecimal bd = (BigDecimal)get_Value("Volume"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Weight. +@param Weight Weight of a product */ +public void setWeight (BigDecimal Weight) +{ +set_Value ("Weight", Weight); +} +/** Get Weight. +@return Weight of a product */ +public BigDecimal getWeight() +{ +BigDecimal bd = (BigDecimal)get_Value("Weight"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ProductDownload.java b/dbPort/src/org/compiere/model/X_M_ProductDownload.java new file mode 100644 index 0000000000..7f221f51e5 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ProductDownload.java @@ -0,0 +1,163 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ProductDownload + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.796 */ +public class X_M_ProductDownload extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ProductDownload_ID id +@param trxName transaction +*/ +public X_M_ProductDownload (Properties ctx, int M_ProductDownload_ID, String trxName) +{ +super (ctx, M_ProductDownload_ID, trxName); +/** if (M_ProductDownload_ID == 0) +{ +setDownloadURL (null); +setM_ProductDownload_ID (0); +setM_Product_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ProductDownload (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=777 */ +public static final int Table_ID=777; + +/** TableName=M_ProductDownload */ +public static final String Table_Name="M_ProductDownload"; + +protected static KeyNamePair Model = new KeyNamePair(777,"M_ProductDownload"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ProductDownload[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Download URL. +@param DownloadURL URL of the Download files */ +public void setDownloadURL (String DownloadURL) +{ +if (DownloadURL == null) throw new IllegalArgumentException ("DownloadURL is mandatory."); +if (DownloadURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DownloadURL = DownloadURL.substring(0,119); +} +set_Value ("DownloadURL", DownloadURL); +} +/** Get Download URL. +@return URL of the Download files */ +public String getDownloadURL() +{ +return (String)get_Value("DownloadURL"); +} +/** Set Product Download. +@param M_ProductDownload_ID Product downloads */ +public void setM_ProductDownload_ID (int M_ProductDownload_ID) +{ +if (M_ProductDownload_ID < 1) throw new IllegalArgumentException ("M_ProductDownload_ID is mandatory."); +set_ValueNoCheck ("M_ProductDownload_ID", new Integer(M_ProductDownload_ID)); +} +/** Get Product Download. +@return Product downloads */ +public int getM_ProductDownload_ID() +{ +Integer ii = (Integer)get_Value("M_ProductDownload_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ProductOperation.java b/dbPort/src/org/compiere/model/X_M_ProductOperation.java new file mode 100644 index 0000000000..5d1d4865de --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ProductOperation.java @@ -0,0 +1,220 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ProductOperation + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.812 */ +public class X_M_ProductOperation extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ProductOperation_ID id +@param trxName transaction +*/ +public X_M_ProductOperation (Properties ctx, int M_ProductOperation_ID, String trxName) +{ +super (ctx, M_ProductOperation_ID, trxName); +/** if (M_ProductOperation_ID == 0) +{ +setM_ProductOperation_ID (0); +setM_Product_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ProductOperation (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=796 */ +public static final int Table_ID=796; + +/** TableName=M_ProductOperation */ +public static final String Table_Name="M_ProductOperation"; + +protected static KeyNamePair Model = new KeyNamePair(796,"M_ProductOperation"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ProductOperation[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Product Operation. +@param M_ProductOperation_ID Product Manufacturing Operation */ +public void setM_ProductOperation_ID (int M_ProductOperation_ID) +{ +if (M_ProductOperation_ID < 1) throw new IllegalArgumentException ("M_ProductOperation_ID is mandatory."); +set_ValueNoCheck ("M_ProductOperation_ID", new Integer(M_ProductOperation_ID)); +} +/** Get Product Operation. +@return Product Manufacturing Operation */ +public int getM_ProductOperation_ID() +{ +Integer ii = (Integer)get_Value("M_ProductOperation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Setup Time. +@param SetupTime Setup time before starting Production */ +public void setSetupTime (BigDecimal SetupTime) +{ +set_Value ("SetupTime", SetupTime); +} +/** Get Setup Time. +@return Setup time before starting Production */ +public BigDecimal getSetupTime() +{ +BigDecimal bd = (BigDecimal)get_Value("SetupTime"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Teardown Time. +@param TeardownTime Time at the end of the operation */ +public void setTeardownTime (BigDecimal TeardownTime) +{ +set_Value ("TeardownTime", TeardownTime); +} +/** Get Teardown Time. +@return Time at the end of the operation */ +public BigDecimal getTeardownTime() +{ +BigDecimal bd = (BigDecimal)get_Value("TeardownTime"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Runtime per Unit. +@param UnitRuntime Time to produce one unit */ +public void setUnitRuntime (BigDecimal UnitRuntime) +{ +set_Value ("UnitRuntime", UnitRuntime); +} +/** Get Runtime per Unit. +@return Time to produce one unit */ +public BigDecimal getUnitRuntime() +{ +BigDecimal bd = (BigDecimal)get_Value("UnitRuntime"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ProductPrice.java b/dbPort/src/org/compiere/model/X_M_ProductPrice.java new file mode 100644 index 0000000000..04b43923bf --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ProductPrice.java @@ -0,0 +1,167 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ProductPrice + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.828 */ +public class X_M_ProductPrice extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ProductPrice_ID id +@param trxName transaction +*/ +public X_M_ProductPrice (Properties ctx, int M_ProductPrice_ID, String trxName) +{ +super (ctx, M_ProductPrice_ID, trxName); +/** if (M_ProductPrice_ID == 0) +{ +setM_PriceList_Version_ID (0); +setM_Product_ID (0); +setPriceLimit (Env.ZERO); +setPriceList (Env.ZERO); +setPriceStd (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ProductPrice (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=251 */ +public static final int Table_ID=251; + +/** TableName=M_ProductPrice */ +public static final String Table_Name="M_ProductPrice"; + +protected static KeyNamePair Model = new KeyNamePair(251,"M_ProductPrice"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ProductPrice[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Price List Version. +@param M_PriceList_Version_ID Identifies a unique instance of a Price List */ +public void setM_PriceList_Version_ID (int M_PriceList_Version_ID) +{ +if (M_PriceList_Version_ID < 1) throw new IllegalArgumentException ("M_PriceList_Version_ID is mandatory."); +set_ValueNoCheck ("M_PriceList_Version_ID", new Integer(M_PriceList_Version_ID)); +} +/** Get Price List Version. +@return Identifies a unique instance of a Price List */ +public int getM_PriceList_Version_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_Version_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Limit Price. +@param PriceLimit Lowest price for a product */ +public void setPriceLimit (BigDecimal PriceLimit) +{ +if (PriceLimit == null) throw new IllegalArgumentException ("PriceLimit is mandatory."); +set_Value ("PriceLimit", PriceLimit); +} +/** Get Limit Price. +@return Lowest price for a product */ +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +if (PriceList == null) throw new IllegalArgumentException ("PriceList is mandatory."); +set_Value ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Price. +@param PriceStd Standard Price */ +public void setPriceStd (BigDecimal PriceStd) +{ +if (PriceStd == null) throw new IllegalArgumentException ("PriceStd is mandatory."); +set_Value ("PriceStd", PriceStd); +} +/** Get Standard Price. +@return Standard Price */ +public BigDecimal getPriceStd() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceStd"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product_Acct.java b/dbPort/src/org/compiere/model/X_M_Product_Acct.java new file mode 100644 index 0000000000..22dd2c7aea --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product_Acct.java @@ -0,0 +1,269 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.828 */ +public class X_M_Product_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_Acct_ID id +@param trxName transaction +*/ +public X_M_Product_Acct (Properties ctx, int M_Product_Acct_ID, String trxName) +{ +super (ctx, M_Product_Acct_ID, trxName); +/** if (M_Product_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setM_Product_ID (0); +setP_Asset_Acct (0); +setP_COGS_Acct (0); +setP_CostAdjustment_Acct (0); +setP_Expense_Acct (0); +setP_InventoryClearing_Acct (0); +setP_InvoicePriceVariance_Acct (0); +setP_PurchasePriceVariance_Acct (0); +setP_Revenue_Acct (0); +setP_TradeDiscountGrant_Acct (0); +setP_TradeDiscountRec_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=273 */ +public static final int Table_ID=273; + +/** TableName=M_Product_Acct */ +public static final String Table_Name="M_Product_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(273,"M_Product_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Asset. +@param P_Asset_Acct Account for Product Asset (Inventory) */ +public void setP_Asset_Acct (int P_Asset_Acct) +{ +set_Value ("P_Asset_Acct", new Integer(P_Asset_Acct)); +} +/** Get Product Asset. +@return Account for Product Asset (Inventory) */ +public int getP_Asset_Acct() +{ +Integer ii = (Integer)get_Value("P_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product COGS. +@param P_COGS_Acct Account for Cost of Goods Sold */ +public void setP_COGS_Acct (int P_COGS_Acct) +{ +set_Value ("P_COGS_Acct", new Integer(P_COGS_Acct)); +} +/** Get Product COGS. +@return Account for Cost of Goods Sold */ +public int getP_COGS_Acct() +{ +Integer ii = (Integer)get_Value("P_COGS_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Adjustment. +@param P_CostAdjustment_Acct Product Cost Adjustment Account */ +public void setP_CostAdjustment_Acct (int P_CostAdjustment_Acct) +{ +set_Value ("P_CostAdjustment_Acct", new Integer(P_CostAdjustment_Acct)); +} +/** Get Cost Adjustment. +@return Product Cost Adjustment Account */ +public int getP_CostAdjustment_Acct() +{ +Integer ii = (Integer)get_Value("P_CostAdjustment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Expense. +@param P_Expense_Acct Account for Product Expense */ +public void setP_Expense_Acct (int P_Expense_Acct) +{ +set_Value ("P_Expense_Acct", new Integer(P_Expense_Acct)); +} +/** Get Product Expense. +@return Account for Product Expense */ +public int getP_Expense_Acct() +{ +Integer ii = (Integer)get_Value("P_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Clearing. +@param P_InventoryClearing_Acct Product Inventory Clearing Account */ +public void setP_InventoryClearing_Acct (int P_InventoryClearing_Acct) +{ +set_Value ("P_InventoryClearing_Acct", new Integer(P_InventoryClearing_Acct)); +} +/** Get Inventory Clearing. +@return Product Inventory Clearing Account */ +public int getP_InventoryClearing_Acct() +{ +Integer ii = (Integer)get_Value("P_InventoryClearing_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Price Variance. +@param P_InvoicePriceVariance_Acct Difference between Costs and Invoice Price (IPV) */ +public void setP_InvoicePriceVariance_Acct (int P_InvoicePriceVariance_Acct) +{ +set_Value ("P_InvoicePriceVariance_Acct", new Integer(P_InvoicePriceVariance_Acct)); +} +/** Get Invoice Price Variance. +@return Difference between Costs and Invoice Price (IPV) */ +public int getP_InvoicePriceVariance_Acct() +{ +Integer ii = (Integer)get_Value("P_InvoicePriceVariance_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Purchase Price Variance. +@param P_PurchasePriceVariance_Acct Difference between Standard Cost and Purchase Price (PPV) */ +public void setP_PurchasePriceVariance_Acct (int P_PurchasePriceVariance_Acct) +{ +set_Value ("P_PurchasePriceVariance_Acct", new Integer(P_PurchasePriceVariance_Acct)); +} +/** Get Purchase Price Variance. +@return Difference between Standard Cost and Purchase Price (PPV) */ +public int getP_PurchasePriceVariance_Acct() +{ +Integer ii = (Integer)get_Value("P_PurchasePriceVariance_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Revenue. +@param P_Revenue_Acct Account for Product Revenue (Sales Account) */ +public void setP_Revenue_Acct (int P_Revenue_Acct) +{ +set_Value ("P_Revenue_Acct", new Integer(P_Revenue_Acct)); +} +/** Get Product Revenue. +@return Account for Product Revenue (Sales Account) */ +public int getP_Revenue_Acct() +{ +Integer ii = (Integer)get_Value("P_Revenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trade Discount Granted. +@param P_TradeDiscountGrant_Acct Trade Discount Granted Account */ +public void setP_TradeDiscountGrant_Acct (int P_TradeDiscountGrant_Acct) +{ +set_Value ("P_TradeDiscountGrant_Acct", new Integer(P_TradeDiscountGrant_Acct)); +} +/** Get Trade Discount Granted. +@return Trade Discount Granted Account */ +public int getP_TradeDiscountGrant_Acct() +{ +Integer ii = (Integer)get_Value("P_TradeDiscountGrant_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trade Discount Received. +@param P_TradeDiscountRec_Acct Trade Discount Receivable Account */ +public void setP_TradeDiscountRec_Acct (int P_TradeDiscountRec_Acct) +{ +set_Value ("P_TradeDiscountRec_Acct", new Integer(P_TradeDiscountRec_Acct)); +} +/** Get Trade Discount Received. +@return Trade Discount Receivable Account */ +public int getP_TradeDiscountRec_Acct() +{ +Integer ii = (Integer)get_Value("P_TradeDiscountRec_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product_BOM.java b/dbPort/src/org/compiere/model/X_M_Product_BOM.java new file mode 100644 index 0000000000..90b712df1b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product_BOM.java @@ -0,0 +1,237 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product_BOM + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.843 */ +public class X_M_Product_BOM extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_BOM_ID id +@param trxName transaction +*/ +public X_M_Product_BOM (Properties ctx, int M_Product_BOM_ID, String trxName) +{ +super (ctx, M_Product_BOM_ID, trxName); +/** if (M_Product_BOM_ID == 0) +{ +setBOMQty (Env.ZERO); // 1 +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_Product_BOM WHERE M_Product_ID=@M_Product_ID@ +setM_ProductBOM_ID (0); +setM_Product_BOM_ID (0); +setM_Product_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product_BOM (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=383 */ +public static final int Table_ID=383; + +/** TableName=M_Product_BOM */ +public static final String Table_Name="M_Product_BOM"; + +protected static KeyNamePair Model = new KeyNamePair(383,"M_Product_BOM"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product_BOM[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set BOM Quantity. +@param BOMQty Bill of Materials Quantity */ +public void setBOMQty (BigDecimal BOMQty) +{ +if (BOMQty == null) throw new IllegalArgumentException ("BOMQty is mandatory."); +set_Value ("BOMQty", BOMQty); +} +/** Get BOM Quantity. +@return Bill of Materials Quantity */ +public BigDecimal getBOMQty() +{ +BigDecimal bd = (BigDecimal)get_Value("BOMQty"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** BOMType AD_Reference_ID=279 */ +public static final int BOMTYPE_AD_Reference_ID=279; +/** In alternative Group 1 = 1 */ +public static final String BOMTYPE_InAlternativeGroup1 = "1"; +/** In alternative Group 2 = 2 */ +public static final String BOMTYPE_InAlternativeGroup2 = "2"; +/** In alternaltve Group 3 = 3 */ +public static final String BOMTYPE_InAlternaltveGroup3 = "3"; +/** In alternative Group 4 = 4 */ +public static final String BOMTYPE_InAlternativeGroup4 = "4"; +/** In alternative Group 5 = 5 */ +public static final String BOMTYPE_InAlternativeGroup5 = "5"; +/** In alternative Group 6 = 6 */ +public static final String BOMTYPE_InAlternativeGroup6 = "6"; +/** In alternative Group 7 = 7 */ +public static final String BOMTYPE_InAlternativeGroup7 = "7"; +/** In alternative Group 8 = 8 */ +public static final String BOMTYPE_InAlternativeGroup8 = "8"; +/** In alternative Group 9 = 9 */ +public static final String BOMTYPE_InAlternativeGroup9 = "9"; +/** Optional Part = O */ +public static final String BOMTYPE_OptionalPart = "O"; +/** Standard Part = P */ +public static final String BOMTYPE_StandardPart = "P"; +/** Set BOM Type. +@param BOMType Type of BOM */ +public void setBOMType (String BOMType) +{ +if (BOMType == null) throw new IllegalArgumentException ("BOMType is mandatory"); +if (BOMType == null || BOMType.equals("1") || BOMType.equals("2") || BOMType.equals("3") || BOMType.equals("4") || BOMType.equals("5") || BOMType.equals("6") || BOMType.equals("7") || BOMType.equals("8") || BOMType.equals("9") || BOMType.equals("O") || BOMType.equals("P")); + else throw new IllegalArgumentException ("BOMType Invalid value - " + BOMType + " - Reference_ID=279 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - O - P"); +if (BOMType != null && BOMType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +BOMType = BOMType.substring(0,0); +} +set_Value ("BOMType", BOMType); +} +/** Get BOM Type. +@return Type of BOM */ +public String getBOMType() +{ +return (String)get_Value("BOMType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_ProductBOM_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTBOM_ID_AD_Reference_ID=162; +/** Set BOM Product. +@param M_ProductBOM_ID Bill of Material Component Product */ +public void setM_ProductBOM_ID (int M_ProductBOM_ID) +{ +if (M_ProductBOM_ID < 1) throw new IllegalArgumentException ("M_ProductBOM_ID is mandatory."); +set_Value ("M_ProductBOM_ID", new Integer(M_ProductBOM_ID)); +} +/** Get BOM Product. +@return Bill of Material Component Product */ +public int getM_ProductBOM_ID() +{ +Integer ii = (Integer)get_Value("M_ProductBOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_ProductBOM_ID())); +} +/** Set BOM Line. +@param M_Product_BOM_ID BOM Line */ +public void setM_Product_BOM_ID (int M_Product_BOM_ID) +{ +if (M_Product_BOM_ID < 1) throw new IllegalArgumentException ("M_Product_BOM_ID is mandatory."); +set_ValueNoCheck ("M_Product_BOM_ID", new Integer(M_Product_BOM_ID)); +} +/** Get BOM Line. +@return BOM Line */ +public int getM_Product_BOM_ID() +{ +Integer ii = (Integer)get_Value("M_Product_BOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product_Category.java b/dbPort/src/org/compiere/model/X_M_Product_Category.java new file mode 100644 index 0000000000..45002f1577 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product_Category.java @@ -0,0 +1,278 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product_Category + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.859 */ +public class X_M_Product_Category extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_Category_ID id +@param trxName transaction +*/ +public X_M_Product_Category (Properties ctx, int M_Product_Category_ID, String trxName) +{ +super (ctx, M_Product_Category_ID, trxName); +/** if (M_Product_Category_ID == 0) +{ +setIsDefault (false); +setIsSelfService (true); // Y +setMMPolicy (null); // F +setM_Product_Category_ID (0); +setName (null); +setPlannedMargin (Env.ZERO); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product_Category (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=209 */ +public static final int Table_ID=209; + +/** TableName=M_Product_Category */ +public static final String Table_Name="M_Product_Category"; + +protected static KeyNamePair Model = new KeyNamePair(209,"M_Product_Category"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product_Category[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Color. +@param AD_PrintColor_ID Color used for printing and display */ +public void setAD_PrintColor_ID (int AD_PrintColor_ID) +{ +if (AD_PrintColor_ID <= 0) set_Value ("AD_PrintColor_ID", null); + else +set_Value ("AD_PrintColor_ID", new Integer(AD_PrintColor_ID)); +} +/** Get Print Color. +@return Color used for printing and display */ +public int getAD_PrintColor_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset Group. +@param A_Asset_Group_ID Group of Assets */ +public void setA_Asset_Group_ID (int A_Asset_Group_ID) +{ +if (A_Asset_Group_ID <= 0) set_Value ("A_Asset_Group_ID", null); + else +set_Value ("A_Asset_Group_ID", new Integer(A_Asset_Group_ID)); +} +/** Get Asset Group. +@return Group of Assets */ +public int getA_Asset_Group_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** MMPolicy AD_Reference_ID=335 */ +public static final int MMPOLICY_AD_Reference_ID=335; +/** FiFo = F */ +public static final String MMPOLICY_FiFo = "F"; +/** LiFo = L */ +public static final String MMPOLICY_LiFo = "L"; +/** Set Material Policy. +@param MMPolicy Material Movement Policy */ +public void setMMPolicy (String MMPolicy) +{ +if (MMPolicy == null) throw new IllegalArgumentException ("MMPolicy is mandatory"); +if (MMPolicy.equals("F") || MMPolicy.equals("L")); + else throw new IllegalArgumentException ("MMPolicy Invalid value - " + MMPolicy + " - Reference_ID=335 - F - L"); +if (MMPolicy.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MMPolicy = MMPolicy.substring(0,0); +} +set_Value ("MMPolicy", MMPolicy); +} +/** Get Material Policy. +@return Material Movement Policy */ +public String getMMPolicy() +{ +return (String)get_Value("MMPolicy"); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID < 1) throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); +set_ValueNoCheck ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Planned Margin %. +@param PlannedMargin Project's planned margin as a percentage */ +public void setPlannedMargin (BigDecimal PlannedMargin) +{ +if (PlannedMargin == null) throw new IllegalArgumentException ("PlannedMargin is mandatory."); +set_Value ("PlannedMargin", PlannedMargin); +} +/** Get Planned Margin %. +@return Project's planned margin as a percentage */ +public BigDecimal getPlannedMargin() +{ +BigDecimal bd = (BigDecimal)get_Value("PlannedMargin"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product_Category_Acct.java b/dbPort/src/org/compiere/model/X_M_Product_Category_Acct.java new file mode 100644 index 0000000000..ae8b97ce4c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product_Category_Acct.java @@ -0,0 +1,357 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product_Category_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.875 */ +public class X_M_Product_Category_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_Category_Acct_ID id +@param trxName transaction +*/ +public X_M_Product_Category_Acct (Properties ctx, int M_Product_Category_Acct_ID, String trxName) +{ +super (ctx, M_Product_Category_Acct_ID, trxName); +/** if (M_Product_Category_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setM_Product_Category_ID (0); +setP_Asset_Acct (0); +setP_COGS_Acct (0); +setP_CostAdjustment_Acct (0); +setP_Expense_Acct (0); +setP_InventoryClearing_Acct (0); +setP_InvoicePriceVariance_Acct (0); +setP_PurchasePriceVariance_Acct (0); +setP_Revenue_Acct (0); +setP_TradeDiscountGrant_Acct (0); +setP_TradeDiscountRec_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product_Category_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=401 */ +public static final int Table_ID=401; + +/** TableName=M_Product_Category_Acct */ +public static final String Table_Name="M_Product_Category_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(401,"M_Product_Category_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product_Category_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CostingLevel AD_Reference_ID=355 */ +public static final int COSTINGLEVEL_AD_Reference_ID=355; +/** Batch/Lot = B */ +public static final String COSTINGLEVEL_BatchLot = "B"; +/** Client = C */ +public static final String COSTINGLEVEL_Client = "C"; +/** Organization = O */ +public static final String COSTINGLEVEL_Organization = "O"; +/** Set Costing Level. +@param CostingLevel The lowest level to accumulate Costing Information */ +public void setCostingLevel (String CostingLevel) +{ +if (CostingLevel == null) throw new IllegalArgumentException ("CostingLevel is mandatory"); +if (CostingLevel == null || CostingLevel.equals("B") || CostingLevel.equals("C") || CostingLevel.equals("O")); + else throw new IllegalArgumentException ("CostingLevel Invalid value - " + CostingLevel + " - Reference_ID=355 - B - C - O"); +if (CostingLevel != null && CostingLevel.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CostingLevel = CostingLevel.substring(0,0); +} +set_Value ("CostingLevel", CostingLevel); +} +/** Get Costing Level. +@return The lowest level to accumulate Costing Information */ +public String getCostingLevel() +{ +return (String)get_Value("CostingLevel"); +} + +/** CostingMethod AD_Reference_ID=122 */ +public static final int COSTINGMETHOD_AD_Reference_ID=122; +/** Average PO = A */ +public static final String COSTINGMETHOD_AveragePO = "A"; +/** Fifo = F */ +public static final String COSTINGMETHOD_Fifo = "F"; +/** Average Invoice = I */ +public static final String COSTINGMETHOD_AverageInvoice = "I"; +/** Lifo = L */ +public static final String COSTINGMETHOD_Lifo = "L"; +/** Standard Costing = S */ +public static final String COSTINGMETHOD_StandardCosting = "S"; +/** User Defined = U */ +public static final String COSTINGMETHOD_UserDefined = "U"; +/** Last Invoice = i */ +public static final String COSTINGMETHOD_LastInvoice = "i"; +/** Last PO Price = p */ +public static final String COSTINGMETHOD_LastPOPrice = "p"; +/** _ = x */ +public static final String COSTINGMETHOD__ = "x"; +/** Set Costing Method. +@param CostingMethod Indicates how Costs will be calculated */ +public void setCostingMethod (String CostingMethod) +{ +if (CostingMethod == null) throw new IllegalArgumentException ("CostingMethod is mandatory"); +if (CostingMethod == null || CostingMethod.equals("A") || CostingMethod.equals("F") || CostingMethod.equals("I") || CostingMethod.equals("L") || CostingMethod.equals("S") || CostingMethod.equals("U") || CostingMethod.equals("i") || CostingMethod.equals("p") || CostingMethod.equals("x")); + else throw new IllegalArgumentException ("CostingMethod Invalid value - " + CostingMethod + " - Reference_ID=122 - A - F - I - L - S - U - i - p - x"); +if (CostingMethod != null && CostingMethod.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CostingMethod = CostingMethod.substring(0,0); +} +set_Value ("CostingMethod", CostingMethod); +} +/** Get Costing Method. +@return Indicates how Costs will be calculated */ +public String getCostingMethod() +{ +return (String)get_Value("CostingMethod"); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID < 1) throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); +set_ValueNoCheck ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Asset. +@param P_Asset_Acct Account for Product Asset (Inventory) */ +public void setP_Asset_Acct (int P_Asset_Acct) +{ +set_Value ("P_Asset_Acct", new Integer(P_Asset_Acct)); +} +/** Get Product Asset. +@return Account for Product Asset (Inventory) */ +public int getP_Asset_Acct() +{ +Integer ii = (Integer)get_Value("P_Asset_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product COGS. +@param P_COGS_Acct Account for Cost of Goods Sold */ +public void setP_COGS_Acct (int P_COGS_Acct) +{ +set_Value ("P_COGS_Acct", new Integer(P_COGS_Acct)); +} +/** Get Product COGS. +@return Account for Cost of Goods Sold */ +public int getP_COGS_Acct() +{ +Integer ii = (Integer)get_Value("P_COGS_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Adjustment. +@param P_CostAdjustment_Acct Product Cost Adjustment Account */ +public void setP_CostAdjustment_Acct (int P_CostAdjustment_Acct) +{ +set_Value ("P_CostAdjustment_Acct", new Integer(P_CostAdjustment_Acct)); +} +/** Get Cost Adjustment. +@return Product Cost Adjustment Account */ +public int getP_CostAdjustment_Acct() +{ +Integer ii = (Integer)get_Value("P_CostAdjustment_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Expense. +@param P_Expense_Acct Account for Product Expense */ +public void setP_Expense_Acct (int P_Expense_Acct) +{ +set_Value ("P_Expense_Acct", new Integer(P_Expense_Acct)); +} +/** Get Product Expense. +@return Account for Product Expense */ +public int getP_Expense_Acct() +{ +Integer ii = (Integer)get_Value("P_Expense_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Clearing. +@param P_InventoryClearing_Acct Product Inventory Clearing Account */ +public void setP_InventoryClearing_Acct (int P_InventoryClearing_Acct) +{ +set_Value ("P_InventoryClearing_Acct", new Integer(P_InventoryClearing_Acct)); +} +/** Get Inventory Clearing. +@return Product Inventory Clearing Account */ +public int getP_InventoryClearing_Acct() +{ +Integer ii = (Integer)get_Value("P_InventoryClearing_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Price Variance. +@param P_InvoicePriceVariance_Acct Difference between Costs and Invoice Price (IPV) */ +public void setP_InvoicePriceVariance_Acct (int P_InvoicePriceVariance_Acct) +{ +set_Value ("P_InvoicePriceVariance_Acct", new Integer(P_InvoicePriceVariance_Acct)); +} +/** Get Invoice Price Variance. +@return Difference between Costs and Invoice Price (IPV) */ +public int getP_InvoicePriceVariance_Acct() +{ +Integer ii = (Integer)get_Value("P_InvoicePriceVariance_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Purchase Price Variance. +@param P_PurchasePriceVariance_Acct Difference between Standard Cost and Purchase Price (PPV) */ +public void setP_PurchasePriceVariance_Acct (int P_PurchasePriceVariance_Acct) +{ +set_Value ("P_PurchasePriceVariance_Acct", new Integer(P_PurchasePriceVariance_Acct)); +} +/** Get Purchase Price Variance. +@return Difference between Standard Cost and Purchase Price (PPV) */ +public int getP_PurchasePriceVariance_Acct() +{ +Integer ii = (Integer)get_Value("P_PurchasePriceVariance_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Revenue. +@param P_Revenue_Acct Account for Product Revenue (Sales Account) */ +public void setP_Revenue_Acct (int P_Revenue_Acct) +{ +set_Value ("P_Revenue_Acct", new Integer(P_Revenue_Acct)); +} +/** Get Product Revenue. +@return Account for Product Revenue (Sales Account) */ +public int getP_Revenue_Acct() +{ +Integer ii = (Integer)get_Value("P_Revenue_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trade Discount Granted. +@param P_TradeDiscountGrant_Acct Trade Discount Granted Account */ +public void setP_TradeDiscountGrant_Acct (int P_TradeDiscountGrant_Acct) +{ +set_Value ("P_TradeDiscountGrant_Acct", new Integer(P_TradeDiscountGrant_Acct)); +} +/** Get Trade Discount Granted. +@return Trade Discount Granted Account */ +public int getP_TradeDiscountGrant_Acct() +{ +Integer ii = (Integer)get_Value("P_TradeDiscountGrant_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Trade Discount Received. +@param P_TradeDiscountRec_Acct Trade Discount Receivable Account */ +public void setP_TradeDiscountRec_Acct (int P_TradeDiscountRec_Acct) +{ +set_Value ("P_TradeDiscountRec_Acct", new Integer(P_TradeDiscountRec_Acct)); +} +/** Get Trade Discount Received. +@return Trade Discount Receivable Account */ +public int getP_TradeDiscountRec_Acct() +{ +Integer ii = (Integer)get_Value("P_TradeDiscountRec_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product_Costing.java b/dbPort/src/org/compiere/model/X_M_Product_Costing.java new file mode 100644 index 0000000000..9720bbfb59 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product_Costing.java @@ -0,0 +1,343 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product_Costing + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.89 */ +public class X_M_Product_Costing extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_Costing_ID id +@param trxName transaction +*/ +public X_M_Product_Costing (Properties ctx, int M_Product_Costing_ID, String trxName) +{ +super (ctx, M_Product_Costing_ID, trxName); +/** if (M_Product_Costing_ID == 0) +{ +setC_AcctSchema_ID (0); +setCostAverage (Env.ZERO); +setCostAverageCumAmt (Env.ZERO); +setCostAverageCumQty (Env.ZERO); +setCostStandard (Env.ZERO); +setCostStandardCumAmt (Env.ZERO); +setCostStandardCumQty (Env.ZERO); +setCostStandardPOAmt (Env.ZERO); +setCostStandardPOQty (Env.ZERO); +setCurrentCostPrice (Env.ZERO); +setFutureCostPrice (Env.ZERO); +setM_Product_ID (0); +setPriceLastInv (Env.ZERO); +setPriceLastPO (Env.ZERO); +setTotalInvAmt (Env.ZERO); +setTotalInvQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product_Costing (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=327 */ +public static final int Table_ID=327; + +/** TableName=M_Product_Costing */ +public static final String Table_Name="M_Product_Costing"; + +protected static KeyNamePair Model = new KeyNamePair(327,"M_Product_Costing"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product_Costing[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Average Cost. +@param CostAverage Weighted average costs */ +public void setCostAverage (BigDecimal CostAverage) +{ +if (CostAverage == null) throw new IllegalArgumentException ("CostAverage is mandatory."); +set_ValueNoCheck ("CostAverage", CostAverage); +} +/** Get Average Cost. +@return Weighted average costs */ +public BigDecimal getCostAverage() +{ +BigDecimal bd = (BigDecimal)get_Value("CostAverage"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Average Cost Amount Sum. +@param CostAverageCumAmt Cumulative average cost amounts (internal) */ +public void setCostAverageCumAmt (BigDecimal CostAverageCumAmt) +{ +if (CostAverageCumAmt == null) throw new IllegalArgumentException ("CostAverageCumAmt is mandatory."); +set_ValueNoCheck ("CostAverageCumAmt", CostAverageCumAmt); +} +/** Get Average Cost Amount Sum. +@return Cumulative average cost amounts (internal) */ +public BigDecimal getCostAverageCumAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CostAverageCumAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Average Cost Quantity Sum. +@param CostAverageCumQty Cumulative average cost quantities (internal) */ +public void setCostAverageCumQty (BigDecimal CostAverageCumQty) +{ +if (CostAverageCumQty == null) throw new IllegalArgumentException ("CostAverageCumQty is mandatory."); +set_ValueNoCheck ("CostAverageCumQty", CostAverageCumQty); +} +/** Get Average Cost Quantity Sum. +@return Cumulative average cost quantities (internal) */ +public BigDecimal getCostAverageCumQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CostAverageCumQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Cost. +@param CostStandard Standard Costs */ +public void setCostStandard (BigDecimal CostStandard) +{ +if (CostStandard == null) throw new IllegalArgumentException ("CostStandard is mandatory."); +set_ValueNoCheck ("CostStandard", CostStandard); +} +/** Get Standard Cost. +@return Standard Costs */ +public BigDecimal getCostStandard() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandard"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Std Cost Amount Sum. +@param CostStandardCumAmt Standard Cost Invoice Amount Sum (internal) */ +public void setCostStandardCumAmt (BigDecimal CostStandardCumAmt) +{ +if (CostStandardCumAmt == null) throw new IllegalArgumentException ("CostStandardCumAmt is mandatory."); +set_ValueNoCheck ("CostStandardCumAmt", CostStandardCumAmt); +} +/** Get Std Cost Amount Sum. +@return Standard Cost Invoice Amount Sum (internal) */ +public BigDecimal getCostStandardCumAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandardCumAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Std Cost Quantity Sum. +@param CostStandardCumQty Standard Cost Invoice Quantity Sum (internal) */ +public void setCostStandardCumQty (BigDecimal CostStandardCumQty) +{ +if (CostStandardCumQty == null) throw new IllegalArgumentException ("CostStandardCumQty is mandatory."); +set_ValueNoCheck ("CostStandardCumQty", CostStandardCumQty); +} +/** Get Std Cost Quantity Sum. +@return Standard Cost Invoice Quantity Sum (internal) */ +public BigDecimal getCostStandardCumQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandardCumQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Std PO Cost Amount Sum. +@param CostStandardPOAmt Standard Cost Purchase Order Amount Sum (internal) */ +public void setCostStandardPOAmt (BigDecimal CostStandardPOAmt) +{ +if (CostStandardPOAmt == null) throw new IllegalArgumentException ("CostStandardPOAmt is mandatory."); +set_ValueNoCheck ("CostStandardPOAmt", CostStandardPOAmt); +} +/** Get Std PO Cost Amount Sum. +@return Standard Cost Purchase Order Amount Sum (internal) */ +public BigDecimal getCostStandardPOAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandardPOAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Std PO Cost Quantity Sum. +@param CostStandardPOQty Standard Cost Purchase Order Quantity Sum (internal) */ +public void setCostStandardPOQty (BigDecimal CostStandardPOQty) +{ +if (CostStandardPOQty == null) throw new IllegalArgumentException ("CostStandardPOQty is mandatory."); +set_ValueNoCheck ("CostStandardPOQty", CostStandardPOQty); +} +/** Get Std PO Cost Quantity Sum. +@return Standard Cost Purchase Order Quantity Sum (internal) */ +public BigDecimal getCostStandardPOQty() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandardPOQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Current Cost Price. +@param CurrentCostPrice The currently used cost price */ +public void setCurrentCostPrice (BigDecimal CurrentCostPrice) +{ +if (CurrentCostPrice == null) throw new IllegalArgumentException ("CurrentCostPrice is mandatory."); +set_Value ("CurrentCostPrice", CurrentCostPrice); +} +/** Get Current Cost Price. +@return The currently used cost price */ +public BigDecimal getCurrentCostPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("CurrentCostPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Future Cost Price. +@param FutureCostPrice Future Cost Price */ +public void setFutureCostPrice (BigDecimal FutureCostPrice) +{ +if (FutureCostPrice == null) throw new IllegalArgumentException ("FutureCostPrice is mandatory."); +set_Value ("FutureCostPrice", FutureCostPrice); +} +/** Get Future Cost Price. +@return Future Cost Price */ +public BigDecimal getFutureCostPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("FutureCostPrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Last Invoice Price. +@param PriceLastInv Price of the last invoice for the product */ +public void setPriceLastInv (BigDecimal PriceLastInv) +{ +if (PriceLastInv == null) throw new IllegalArgumentException ("PriceLastInv is mandatory."); +set_ValueNoCheck ("PriceLastInv", PriceLastInv); +} +/** Get Last Invoice Price. +@return Price of the last invoice for the product */ +public BigDecimal getPriceLastInv() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLastInv"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Last PO Price. +@param PriceLastPO Price of the last purchase order for the product */ +public void setPriceLastPO (BigDecimal PriceLastPO) +{ +if (PriceLastPO == null) throw new IllegalArgumentException ("PriceLastPO is mandatory."); +set_ValueNoCheck ("PriceLastPO", PriceLastPO); +} +/** Get Last PO Price. +@return Price of the last purchase order for the product */ +public BigDecimal getPriceLastPO() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLastPO"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Total Invoice Amount. +@param TotalInvAmt Cumulative total lifetime invoice amount */ +public void setTotalInvAmt (BigDecimal TotalInvAmt) +{ +if (TotalInvAmt == null) throw new IllegalArgumentException ("TotalInvAmt is mandatory."); +set_ValueNoCheck ("TotalInvAmt", TotalInvAmt); +} +/** Get Total Invoice Amount. +@return Cumulative total lifetime invoice amount */ +public BigDecimal getTotalInvAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalInvAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Total Invoice Quantity. +@param TotalInvQty Cumulative total lifetime invoice quantity */ +public void setTotalInvQty (BigDecimal TotalInvQty) +{ +if (TotalInvQty == null) throw new IllegalArgumentException ("TotalInvQty is mandatory."); +set_ValueNoCheck ("TotalInvQty", TotalInvQty); +} +/** Get Total Invoice Quantity. +@return Cumulative total lifetime invoice quantity */ +public BigDecimal getTotalInvQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalInvQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Product_PO.java b/dbPort/src/org/compiere/model/X_M_Product_PO.java new file mode 100644 index 0000000000..fdd4a4ec95 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Product_PO.java @@ -0,0 +1,436 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Product_PO + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.906 */ +public class X_M_Product_PO extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Product_PO_ID id +@param trxName transaction +*/ +public X_M_Product_PO (Properties ctx, int M_Product_PO_ID, String trxName) +{ +super (ctx, M_Product_PO_ID, trxName); +/** if (M_Product_PO_ID == 0) +{ +setC_BPartner_ID (0); // 0 +setIsCurrentVendor (true); // Y +setM_Product_ID (0); // @M_Product_ID@ +setVendorProductNo (null); // @Value@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Product_PO (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=210 */ +public static final int Table_ID=210; + +/** TableName=M_Product_PO */ +public static final String Table_Name="M_Product_PO"; + +protected static KeyNamePair Model = new KeyNamePair(210,"M_Product_PO"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Product_PO[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost per Order. +@param CostPerOrder Fixed Cost Per Order */ +public void setCostPerOrder (BigDecimal CostPerOrder) +{ +set_Value ("CostPerOrder", CostPerOrder); +} +/** Get Cost per Order. +@return Fixed Cost Per Order */ +public BigDecimal getCostPerOrder() +{ +BigDecimal bd = (BigDecimal)get_Value("CostPerOrder"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Actual Delivery Time. +@param DeliveryTime_Actual Actual days between order and delivery */ +public void setDeliveryTime_Actual (int DeliveryTime_Actual) +{ +set_Value ("DeliveryTime_Actual", new Integer(DeliveryTime_Actual)); +} +/** Get Actual Delivery Time. +@return Actual days between order and delivery */ +public int getDeliveryTime_Actual() +{ +Integer ii = (Integer)get_Value("DeliveryTime_Actual"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Promised Delivery Time. +@param DeliveryTime_Promised Promised days between order and delivery */ +public void setDeliveryTime_Promised (int DeliveryTime_Promised) +{ +set_Value ("DeliveryTime_Promised", new Integer(DeliveryTime_Promised)); +} +/** Get Promised Delivery Time. +@return Promised days between order and delivery */ +public int getDeliveryTime_Promised() +{ +Integer ii = (Integer)get_Value("DeliveryTime_Promised"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Discontinued. +@param Discontinued This product is no longer available */ +public void setDiscontinued (boolean Discontinued) +{ +set_Value ("Discontinued", new Boolean(Discontinued)); +} +/** Get Discontinued. +@return This product is no longer available */ +public boolean isDiscontinued() +{ +Object oo = get_Value("Discontinued"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discontinued by. +@param DiscontinuedBy Discontinued By */ +public void setDiscontinuedBy (Timestamp DiscontinuedBy) +{ +set_Value ("DiscontinuedBy", DiscontinuedBy); +} +/** Get Discontinued by. +@return Discontinued By */ +public Timestamp getDiscontinuedBy() +{ +return (Timestamp)get_Value("DiscontinuedBy"); +} +/** Set Current vendor. +@param IsCurrentVendor Use this Vendor for pricing and stock replenishment */ +public void setIsCurrentVendor (boolean IsCurrentVendor) +{ +set_Value ("IsCurrentVendor", new Boolean(IsCurrentVendor)); +} +/** Get Current vendor. +@return Use this Vendor for pricing and stock replenishment */ +public boolean isCurrentVendor() +{ +Object oo = get_Value("IsCurrentVendor"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Manufacturer. +@param Manufacturer Manufacturer of the Product */ +public void setManufacturer (String Manufacturer) +{ +if (Manufacturer != null && Manufacturer.length() > 30) +{ +log.warning("Length > 30 - truncated"); +Manufacturer = Manufacturer.substring(0,29); +} +set_Value ("Manufacturer", Manufacturer); +} +/** Get Manufacturer. +@return Manufacturer of the Product */ +public String getManufacturer() +{ +return (String)get_Value("Manufacturer"); +} +/** Set Minimum Order Qty. +@param Order_Min Minimum order quantity in UOM */ +public void setOrder_Min (BigDecimal Order_Min) +{ +set_Value ("Order_Min", Order_Min); +} +/** Get Minimum Order Qty. +@return Minimum order quantity in UOM */ +public BigDecimal getOrder_Min() +{ +BigDecimal bd = (BigDecimal)get_Value("Order_Min"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Order Pack Qty. +@param Order_Pack Package order size in UOM (e.g. order set of 5 units) */ +public void setOrder_Pack (BigDecimal Order_Pack) +{ +set_Value ("Order_Pack", Order_Pack); +} +/** Get Order Pack Qty. +@return Package order size in UOM (e.g. order set of 5 units) */ +public BigDecimal getOrder_Pack() +{ +BigDecimal bd = (BigDecimal)get_Value("Order_Pack"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Price effective. +@param PriceEffective Effective Date of Price */ +public void setPriceEffective (Timestamp PriceEffective) +{ +set_Value ("PriceEffective", PriceEffective); +} +/** Get Price effective. +@return Effective Date of Price */ +public Timestamp getPriceEffective() +{ +return (Timestamp)get_Value("PriceEffective"); +} +/** Set Last Invoice Price. +@param PriceLastInv Price of the last invoice for the product */ +public void setPriceLastInv (BigDecimal PriceLastInv) +{ +set_ValueNoCheck ("PriceLastInv", PriceLastInv); +} +/** Get Last Invoice Price. +@return Price of the last invoice for the product */ +public BigDecimal getPriceLastInv() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLastInv"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Last PO Price. +@param PriceLastPO Price of the last purchase order for the product */ +public void setPriceLastPO (BigDecimal PriceLastPO) +{ +set_ValueNoCheck ("PriceLastPO", PriceLastPO); +} +/** Get Last PO Price. +@return Price of the last purchase order for the product */ +public BigDecimal getPriceLastPO() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLastPO"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +set_Value ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set PO Price. +@param PricePO Price based on a purchase order */ +public void setPricePO (BigDecimal PricePO) +{ +set_Value ("PricePO", PricePO); +} +/** Get PO Price. +@return Price based on a purchase order */ +public BigDecimal getPricePO() +{ +BigDecimal bd = (BigDecimal)get_Value("PricePO"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quality Rating. +@param QualityRating Method for rating vendors */ +public void setQualityRating (int QualityRating) +{ +set_Value ("QualityRating", new Integer(QualityRating)); +} +/** Get Quality Rating. +@return Method for rating vendors */ +public int getQualityRating() +{ +Integer ii = (Integer)get_Value("QualityRating"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Royalty Amount. +@param RoyaltyAmt (Included) Amount for copyright, etc. */ +public void setRoyaltyAmt (BigDecimal RoyaltyAmt) +{ +set_Value ("RoyaltyAmt", RoyaltyAmt); +} +/** Get Royalty Amount. +@return (Included) Amount for copyright, etc. */ +public BigDecimal getRoyaltyAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RoyaltyAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 20) +{ +log.warning("Length > 20 - truncated"); +UPC = UPC.substring(0,19); +} +set_Value ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +/** Set Partner Category. +@param VendorCategory Product Category of the Business Partner */ +public void setVendorCategory (String VendorCategory) +{ +if (VendorCategory != null && VendorCategory.length() > 30) +{ +log.warning("Length > 30 - truncated"); +VendorCategory = VendorCategory.substring(0,29); +} +set_Value ("VendorCategory", VendorCategory); +} +/** Get Partner Category. +@return Product Category of the Business Partner */ +public String getVendorCategory() +{ +return (String)get_Value("VendorCategory"); +} +/** Set Partner Product Key. +@param VendorProductNo Product Key of the Business Partner */ +public void setVendorProductNo (String VendorProductNo) +{ +if (VendorProductNo == null) throw new IllegalArgumentException ("VendorProductNo is mandatory."); +if (VendorProductNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +VendorProductNo = VendorProductNo.substring(0,29); +} +set_Value ("VendorProductNo", VendorProductNo); +} +/** Get Partner Product Key. +@return Product Key of the Business Partner */ +public String getVendorProductNo() +{ +return (String)get_Value("VendorProductNo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Production.java b/dbPort/src/org/compiere/model/X_M_Production.java new file mode 100644 index 0000000000..8045362eef --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Production.java @@ -0,0 +1,339 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Production + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.937 */ +public class X_M_Production extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Production_ID id +@param trxName transaction +*/ +public X_M_Production (Properties ctx, int M_Production_ID, String trxName) +{ +super (ctx, M_Production_ID, trxName); +/** if (M_Production_ID == 0) +{ +setIsCreated (false); +setM_Production_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setName (null); +setPosted (false); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Production (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=325 */ +public static final int Table_ID=325; + +/** TableName=M_Production */ +public static final String Table_Name="M_Production"; + +protected static KeyNamePair Model = new KeyNamePair(325,"M_Production"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Production[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=130 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); + else +set_Value ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Records created. +@param IsCreated Records created */ +public void setIsCreated (boolean IsCreated) +{ +set_ValueNoCheck ("IsCreated", new Boolean(IsCreated)); +} +/** Get Records created. +@return Records created */ +public boolean isCreated() +{ +Object oo = get_Value("IsCreated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Production. +@param M_Production_ID Plan for producing a product */ +public void setM_Production_ID (int M_Production_ID) +{ +if (M_Production_ID < 1) throw new IllegalArgumentException ("M_Production_ID is mandatory."); +set_ValueNoCheck ("M_Production_ID", new Integer(M_Production_ID)); +} +/** Get Production. +@return Plan for producing a product */ +public int getM_Production_ID() +{ +Integer ii = (Integer)get_Value("M_Production_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** User1_ID AD_Reference_ID=134 */ +public static final int USER1_ID_AD_Reference_ID=134; +/** Set User List 1. +@param User1_ID User defined list element #1 */ +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); + else +set_Value ("User1_ID", new Integer(User1_ID)); +} +/** Get User List 1. +@return User defined list element #1 */ +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** User2_ID AD_Reference_ID=137 */ +public static final int USER2_ID_AD_Reference_ID=137; +/** Set User List 2. +@param User2_ID User defined list element #2 */ +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); + else +set_Value ("User2_ID", new Integer(User2_ID)); +} +/** Get User List 2. +@return User defined list element #2 */ +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ProductionLine.java b/dbPort/src/org/compiere/model/X_M_ProductionLine.java new file mode 100644 index 0000000000..a6d32f51af --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ProductionLine.java @@ -0,0 +1,240 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ProductionLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.953 */ +public class X_M_ProductionLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ProductionLine_ID id +@param trxName transaction +*/ +public X_M_ProductionLine (Properties ctx, int M_ProductionLine_ID, String trxName) +{ +super (ctx, M_ProductionLine_ID, trxName); +/** if (M_ProductionLine_ID == 0) +{ +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_ProductionLine WHERE M_ProductionPlan_ID=@M_ProductionPlan_ID@ +setM_AttributeSetInstance_ID (0); +setM_Locator_ID (0); // @M_Locator_ID@ +setM_Product_ID (0); +setM_ProductionLine_ID (0); +setM_ProductionPlan_ID (0); +setMovementQty (Env.ZERO); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ProductionLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=326 */ +public static final int Table_ID=326; + +/** TableName=M_ProductionLine */ +public static final String Table_Name="M_ProductionLine"; + +protected static KeyNamePair Model = new KeyNamePair(326,"M_ProductionLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ProductionLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Line. +@param M_ProductionLine_ID Document Line representing a production */ +public void setM_ProductionLine_ID (int M_ProductionLine_ID) +{ +if (M_ProductionLine_ID < 1) throw new IllegalArgumentException ("M_ProductionLine_ID is mandatory."); +set_ValueNoCheck ("M_ProductionLine_ID", new Integer(M_ProductionLine_ID)); +} +/** Get Production Line. +@return Document Line representing a production */ +public int getM_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Plan. +@param M_ProductionPlan_ID Plan for how a product is produced */ +public void setM_ProductionPlan_ID (int M_ProductionPlan_ID) +{ +if (M_ProductionPlan_ID < 1) throw new IllegalArgumentException ("M_ProductionPlan_ID is mandatory."); +set_ValueNoCheck ("M_ProductionPlan_ID", new Integer(M_ProductionPlan_ID)); +} +/** Get Production Plan. +@return Plan for how a product is produced */ +public int getM_ProductionPlan_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionPlan_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ProductionLineMA.java b/dbPort/src/org/compiere/model/X_M_ProductionLineMA.java new file mode 100644 index 0000000000..b508e152dc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ProductionLineMA.java @@ -0,0 +1,141 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ProductionLineMA + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.968 */ +public class X_M_ProductionLineMA extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ProductionLineMA_ID id +@param trxName transaction +*/ +public X_M_ProductionLineMA (Properties ctx, int M_ProductionLineMA_ID, String trxName) +{ +super (ctx, M_ProductionLineMA_ID, trxName); +/** if (M_ProductionLineMA_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_ProductionLine_ID (0); +setMovementQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ProductionLineMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=765 */ +public static final int Table_ID=765; + +/** TableName=M_ProductionLineMA */ +public static final String Table_Name="M_ProductionLineMA"; + +protected static KeyNamePair Model = new KeyNamePair(765,"M_ProductionLineMA"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ProductionLineMA[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Line. +@param M_ProductionLine_ID Document Line representing a production */ +public void setM_ProductionLine_ID (int M_ProductionLine_ID) +{ +if (M_ProductionLine_ID < 1) throw new IllegalArgumentException ("M_ProductionLine_ID is mandatory."); +set_ValueNoCheck ("M_ProductionLine_ID", new Integer(M_ProductionLine_ID)); +} +/** Get Production Line. +@return Document Line representing a production */ +public int getM_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_ProductionLine_ID())); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_ProductionPlan.java b/dbPort/src/org/compiere/model/X_M_ProductionPlan.java new file mode 100644 index 0000000000..ed1c16c4bc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_ProductionPlan.java @@ -0,0 +1,227 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_ProductionPlan + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.984 */ +public class X_M_ProductionPlan extends PO +{ +/** Standard Constructor +@param ctx context +@param M_ProductionPlan_ID id +@param trxName transaction +*/ +public X_M_ProductionPlan (Properties ctx, int M_ProductionPlan_ID, String trxName) +{ +super (ctx, M_ProductionPlan_ID, trxName); +/** if (M_ProductionPlan_ID == 0) +{ +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_ProductionPlan WHERE M_Production_ID=@M_Production_ID@ +setM_Locator_ID (0); // @M_Locator_ID@ +setM_Product_ID (0); +setM_ProductionPlan_ID (0); +setM_Production_ID (0); +setProcessed (false); +setProductionQty (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_ProductionPlan (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=385 */ +public static final int Table_ID=385; + +/** TableName=M_ProductionPlan */ +public static final String Table_Name="M_ProductionPlan"; + +protected static KeyNamePair Model = new KeyNamePair(385,"M_ProductionPlan"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_ProductionPlan[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_Product_ID AD_Reference_ID=211 */ +public static final int M_PRODUCT_ID_AD_Reference_ID=211; +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Plan. +@param M_ProductionPlan_ID Plan for how a product is produced */ +public void setM_ProductionPlan_ID (int M_ProductionPlan_ID) +{ +if (M_ProductionPlan_ID < 1) throw new IllegalArgumentException ("M_ProductionPlan_ID is mandatory."); +set_ValueNoCheck ("M_ProductionPlan_ID", new Integer(M_ProductionPlan_ID)); +} +/** Get Production Plan. +@return Plan for how a product is produced */ +public int getM_ProductionPlan_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionPlan_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production. +@param M_Production_ID Plan for producing a product */ +public void setM_Production_ID (int M_Production_ID) +{ +if (M_Production_ID < 1) throw new IllegalArgumentException ("M_Production_ID is mandatory."); +set_ValueNoCheck ("M_Production_ID", new Integer(M_Production_ID)); +} +/** Get Production. +@return Plan for producing a product */ +public int getM_Production_ID() +{ +Integer ii = (Integer)get_Value("M_Production_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Production Quantity. +@param ProductionQty Quantity of products to produce */ +public void setProductionQty (BigDecimal ProductionQty) +{ +if (ProductionQty == null) throw new IllegalArgumentException ("ProductionQty is mandatory."); +set_Value ("ProductionQty", ProductionQty); +} +/** Get Production Quantity. +@return Quantity of products to produce */ +public BigDecimal getProductionQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ProductionQty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_RMA.java b/dbPort/src/org/compiere/model/X_M_RMA.java new file mode 100644 index 0000000000..ec00141551 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_RMA.java @@ -0,0 +1,469 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_RMA + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:01.984 */ +public class X_M_RMA extends PO +{ +/** Standard Constructor +@param ctx context +@param M_RMA_ID id +@param trxName transaction +*/ +public X_M_RMA (Properties ctx, int M_RMA_ID, String trxName) +{ +super (ctx, M_RMA_ID, trxName); +/** if (M_RMA_ID == 0) +{ +setC_DocType_ID (0); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setM_InOut_ID (0); +setM_RMAType_ID (0); +setM_RMA_ID (0); +setName (null); +setProcessed (false); +setSalesRep_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_RMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=661 */ +public static final int Table_ID=661; + +/** TableName=M_RMA */ +public static final String Table_Name="M_RMA"; + +protected static KeyNamePair Model = new KeyNamePair(661,"M_RMA"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RMA[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocType_ID AD_Reference_ID=321 */ +public static final int C_DOCTYPE_ID_AD_Reference_ID=321; +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RMA Type. +@param M_RMAType_ID Return Material Authorization Type */ +public void setM_RMAType_ID (int M_RMAType_ID) +{ +if (M_RMAType_ID < 1) throw new IllegalArgumentException ("M_RMAType_ID is mandatory."); +set_Value ("M_RMAType_ID", new Integer(M_RMAType_ID)); +} +/** Get RMA Type. +@return Return Material Authorization Type */ +public int getM_RMAType_ID() +{ +Integer ii = (Integer)get_Value("M_RMAType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RMA. +@param M_RMA_ID Return Material Authorization */ +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID < 1) throw new IllegalArgumentException ("M_RMA_ID is mandatory."); +set_ValueNoCheck ("M_RMA_ID", new Integer(M_RMA_ID)); +} +/** Get RMA. +@return Return Material Authorization */ +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_RMALine.java b/dbPort/src/org/compiere/model/X_M_RMALine.java new file mode 100644 index 0000000000..56da3c2cd6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_RMALine.java @@ -0,0 +1,193 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_RMALine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.015 */ +public class X_M_RMALine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_RMALine_ID id +@param trxName transaction +*/ +public X_M_RMALine (Properties ctx, int M_RMALine_ID, String trxName) +{ +super (ctx, M_RMALine_ID, trxName); +/** if (M_RMALine_ID == 0) +{ +setM_InOutLine_ID (0); +setM_RMALine_ID (0); +setM_RMA_ID (0); +setProcessed (false); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_RMALine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=660 */ +public static final int Table_ID=660; + +/** TableName=M_RMALine */ +public static final String Table_Name="M_RMALine"; + +protected static KeyNamePair Model = new KeyNamePair(660,"M_RMALine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RMALine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_Value ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RMA Line. +@param M_RMALine_ID Return Material Authorization Line */ +public void setM_RMALine_ID (int M_RMALine_ID) +{ +if (M_RMALine_ID < 1) throw new IllegalArgumentException ("M_RMALine_ID is mandatory."); +set_ValueNoCheck ("M_RMALine_ID", new Integer(M_RMALine_ID)); +} +/** Get RMA Line. +@return Return Material Authorization Line */ +public int getM_RMALine_ID() +{ +Integer ii = (Integer)get_Value("M_RMALine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RMA. +@param M_RMA_ID Return Material Authorization */ +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID < 1) throw new IllegalArgumentException ("M_RMA_ID is mandatory."); +set_ValueNoCheck ("M_RMA_ID", new Integer(M_RMA_ID)); +} +/** Get RMA. +@return Return Material Authorization */ +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_RMA_ID())); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_RMAType.java b/dbPort/src/org/compiere/model/X_M_RMAType.java new file mode 100644 index 0000000000..953d3e2b74 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_RMAType.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_RMAType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.031 */ +public class X_M_RMAType extends PO +{ +/** Standard Constructor +@param ctx context +@param M_RMAType_ID id +@param trxName transaction +*/ +public X_M_RMAType (Properties ctx, int M_RMAType_ID, String trxName) +{ +super (ctx, M_RMAType_ID, trxName); +/** if (M_RMAType_ID == 0) +{ +setM_RMAType_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_RMAType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=729 */ +public static final int Table_ID=729; + +/** TableName=M_RMAType */ +public static final String Table_Name="M_RMAType"; + +protected static KeyNamePair Model = new KeyNamePair(729,"M_RMAType"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RMAType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set RMA Type. +@param M_RMAType_ID Return Material Authorization Type */ +public void setM_RMAType_ID (int M_RMAType_ID) +{ +if (M_RMAType_ID < 1) throw new IllegalArgumentException ("M_RMAType_ID is mandatory."); +set_ValueNoCheck ("M_RMAType_ID", new Integer(M_RMAType_ID)); +} +/** Get RMA Type. +@return Return Material Authorization Type */ +public int getM_RMAType_ID() +{ +Integer ii = (Integer)get_Value("M_RMAType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_RelatedProduct.java b/dbPort/src/org/compiere/model/X_M_RelatedProduct.java new file mode 100644 index 0000000000..cd9488c492 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_RelatedProduct.java @@ -0,0 +1,188 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_RelatedProduct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.031 */ +public class X_M_RelatedProduct extends PO +{ +/** Standard Constructor +@param ctx context +@param M_RelatedProduct_ID id +@param trxName transaction +*/ +public X_M_RelatedProduct (Properties ctx, int M_RelatedProduct_ID, String trxName) +{ +super (ctx, M_RelatedProduct_ID, trxName); +/** if (M_RelatedProduct_ID == 0) +{ +setM_Product_ID (0); +setName (null); +setRelatedProductType (null); +setRelatedProduct_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_RelatedProduct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=662 */ +public static final int Table_ID=662; + +/** TableName=M_RelatedProduct */ +public static final String Table_Name="M_RelatedProduct"; + +protected static KeyNamePair Model = new KeyNamePair(662,"M_RelatedProduct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RelatedProduct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} + +/** RelatedProductType AD_Reference_ID=313 */ +public static final int RELATEDPRODUCTTYPE_AD_Reference_ID=313; +/** Alternative = A */ +public static final String RELATEDPRODUCTTYPE_Alternative = "A"; +/** Web Promotion = P */ +public static final String RELATEDPRODUCTTYPE_WebPromotion = "P"; +/** Supplemental = S */ +public static final String RELATEDPRODUCTTYPE_Supplemental = "S"; +/** Set Related Product Type. +@param RelatedProductType Related Product Type */ +public void setRelatedProductType (String RelatedProductType) +{ +if (RelatedProductType == null) throw new IllegalArgumentException ("RelatedProductType is mandatory"); +if (RelatedProductType.equals("A") || RelatedProductType.equals("P") || RelatedProductType.equals("S")); + else throw new IllegalArgumentException ("RelatedProductType Invalid value - " + RelatedProductType + " - Reference_ID=313 - A - P - S"); +if (RelatedProductType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RelatedProductType = RelatedProductType.substring(0,0); +} +set_Value ("RelatedProductType", RelatedProductType); +} +/** Get Related Product Type. +@return Related Product Type */ +public String getRelatedProductType() +{ +return (String)get_Value("RelatedProductType"); +} + +/** RelatedProduct_ID AD_Reference_ID=162 */ +public static final int RELATEDPRODUCT_ID_AD_Reference_ID=162; +/** Set Related Product. +@param RelatedProduct_ID Related Product */ +public void setRelatedProduct_ID (int RelatedProduct_ID) +{ +if (RelatedProduct_ID < 1) throw new IllegalArgumentException ("RelatedProduct_ID is mandatory."); +set_ValueNoCheck ("RelatedProduct_ID", new Integer(RelatedProduct_ID)); +} +/** Get Related Product. +@return Related Product */ +public int getRelatedProduct_ID() +{ +Integer ii = (Integer)get_Value("RelatedProduct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Replenish.java b/dbPort/src/org/compiere/model/X_M_Replenish.java new file mode 100644 index 0000000000..2bf9cce18f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Replenish.java @@ -0,0 +1,202 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Replenish + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.046 */ +public class X_M_Replenish extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Replenish_ID id +@param trxName transaction +*/ +public X_M_Replenish (Properties ctx, int M_Replenish_ID, String trxName) +{ +super (ctx, M_Replenish_ID, trxName); +/** if (M_Replenish_ID == 0) +{ +setLevel_Max (Env.ZERO); +setLevel_Min (Env.ZERO); +setM_Product_ID (0); +setM_Warehouse_ID (0); +setReplenishType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Replenish (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=249 */ +public static final int Table_ID=249; + +/** TableName=M_Replenish */ +public static final String Table_Name="M_Replenish"; + +protected static KeyNamePair Model = new KeyNamePair(249,"M_Replenish"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Replenish[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Maximum Level. +@param Level_Max Maximum Inventory level for this product */ +public void setLevel_Max (BigDecimal Level_Max) +{ +if (Level_Max == null) throw new IllegalArgumentException ("Level_Max is mandatory."); +set_Value ("Level_Max", Level_Max); +} +/** Get Maximum Level. +@return Maximum Inventory level for this product */ +public BigDecimal getLevel_Max() +{ +BigDecimal bd = (BigDecimal)get_Value("Level_Max"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Minimum Level. +@param Level_Min Minimum Inventory level for this product */ +public void setLevel_Min (BigDecimal Level_Min) +{ +if (Level_Min == null) throw new IllegalArgumentException ("Level_Min is mandatory."); +set_Value ("Level_Min", Level_Min); +} +/** Get Minimum Level. +@return Minimum Inventory level for this product */ +public BigDecimal getLevel_Min() +{ +BigDecimal bd = (BigDecimal)get_Value("Level_Min"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_WarehouseSource_ID AD_Reference_ID=197 */ +public static final int M_WAREHOUSESOURCE_ID_AD_Reference_ID=197; +/** Set Source Warehouse. +@param M_WarehouseSource_ID Optional Warehouse to replenish from */ +public void setM_WarehouseSource_ID (int M_WarehouseSource_ID) +{ +if (M_WarehouseSource_ID <= 0) set_Value ("M_WarehouseSource_ID", null); + else +set_Value ("M_WarehouseSource_ID", new Integer(M_WarehouseSource_ID)); +} +/** Get Source Warehouse. +@return Optional Warehouse to replenish from */ +public int getM_WarehouseSource_ID() +{ +Integer ii = (Integer)get_Value("M_WarehouseSource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ReplenishType AD_Reference_ID=164 */ +public static final int REPLENISHTYPE_AD_Reference_ID=164; +/** Manual = 0 */ +public static final String REPLENISHTYPE_Manual = "0"; +/** Reorder below Minimum Level = 1 */ +public static final String REPLENISHTYPE_ReorderBelowMinimumLevel = "1"; +/** Maintain Maximum Level = 2 */ +public static final String REPLENISHTYPE_MaintainMaximumLevel = "2"; +/** Custom = 9 */ +public static final String REPLENISHTYPE_Custom = "9"; +/** Set Replenish Type. +@param ReplenishType Method for re-ordering a product */ +public void setReplenishType (String ReplenishType) +{ +if (ReplenishType == null) throw new IllegalArgumentException ("ReplenishType is mandatory"); +if (ReplenishType.equals("0") || ReplenishType.equals("1") || ReplenishType.equals("2") || ReplenishType.equals("9")); + else throw new IllegalArgumentException ("ReplenishType Invalid value - " + ReplenishType + " - Reference_ID=164 - 0 - 1 - 2 - 9"); +if (ReplenishType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ReplenishType = ReplenishType.substring(0,0); +} +set_Value ("ReplenishType", ReplenishType); +} +/** Get Replenish Type. +@return Method for re-ordering a product */ +public String getReplenishType() +{ +return (String)get_Value("ReplenishType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Requisition.java b/dbPort/src/org/compiere/model/X_M_Requisition.java new file mode 100644 index 0000000000..9f04184bfc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Requisition.java @@ -0,0 +1,479 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Requisition + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.062 */ +public class X_M_Requisition extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Requisition_ID id +@param trxName transaction +*/ +public X_M_Requisition (Properties ctx, int M_Requisition_ID, String trxName) +{ +super (ctx, M_Requisition_ID, trxName); +/** if (M_Requisition_ID == 0) +{ +setAD_User_ID (0); +setC_DocType_ID (0); +setDateDoc (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDateRequired (new Timestamp(System.currentTimeMillis())); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setM_PriceList_ID (0); +setM_Requisition_ID (0); +setM_Warehouse_ID (0); +setPosted (false); +setPriorityRule (null); // 5 +setProcessed (false); +setTotalLines (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Requisition (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=702 */ +public static final int Table_ID=702; + +/** TableName=M_Requisition */ +public static final String Table_Name="M_Requisition"; + +protected static KeyNamePair Model = new KeyNamePair(702,"M_Requisition"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Requisition[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Date. +@param DateDoc Date of the Document */ +public void setDateDoc (Timestamp DateDoc) +{ +if (DateDoc == null) throw new IllegalArgumentException ("DateDoc is mandatory."); +set_Value ("DateDoc", DateDoc); +} +/** Get Document Date. +@return Date of the Document */ +public Timestamp getDateDoc() +{ +return (Timestamp)get_Value("DateDoc"); +} +/** Set Date Required. +@param DateRequired Date when required */ +public void setDateRequired (Timestamp DateRequired) +{ +if (DateRequired == null) throw new IllegalArgumentException ("DateRequired is mandatory."); +set_Value ("DateRequired", DateRequired); +} +/** Get Date Required. +@return Date when required */ +public Timestamp getDateRequired() +{ +return (Timestamp)get_Value("DateRequired"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Requisition. +@param M_Requisition_ID Material Requisition */ +public void setM_Requisition_ID (int M_Requisition_ID) +{ +if (M_Requisition_ID < 1) throw new IllegalArgumentException ("M_Requisition_ID is mandatory."); +set_ValueNoCheck ("M_Requisition_ID", new Integer(M_Requisition_ID)); +} +/** Get Requisition. +@return Material Requisition */ +public int getM_Requisition_ID() +{ +Integer ii = (Integer)get_Value("M_Requisition_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Posted. +@param Posted Posting status */ +public void setPosted (boolean Posted) +{ +set_Value ("Posted", new Boolean(Posted)); +} +/** Get Posted. +@return Posting status */ +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PriorityRule AD_Reference_ID=154 */ +public static final int PRIORITYRULE_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITYRULE_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITYRULE_High = "3"; +/** Medium = 5 */ +public static final String PRIORITYRULE_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITYRULE_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITYRULE_Minor = "9"; +/** Set Priority. +@param PriorityRule Priority of a document */ +public void setPriorityRule (String PriorityRule) +{ +if (PriorityRule == null) throw new IllegalArgumentException ("PriorityRule is mandatory"); +if (PriorityRule.equals("1") || PriorityRule.equals("3") || PriorityRule.equals("5") || PriorityRule.equals("7") || PriorityRule.equals("9")); + else throw new IllegalArgumentException ("PriorityRule Invalid value - " + PriorityRule + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (PriorityRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityRule = PriorityRule.substring(0,0); +} +set_Value ("PriorityRule", PriorityRule); +} +/** Get Priority. +@return Priority of a document */ +public String getPriorityRule() +{ +return (String)get_Value("PriorityRule"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Total Lines. +@param TotalLines Total of all document lines */ +public void setTotalLines (BigDecimal TotalLines) +{ +if (TotalLines == null) throw new IllegalArgumentException ("TotalLines is mandatory."); +set_Value ("TotalLines", TotalLines); +} +/** Get Total Lines. +@return Total of all document lines */ +public BigDecimal getTotalLines() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalLines"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_RequisitionLine.java b/dbPort/src/org/compiere/model/X_M_RequisitionLine.java new file mode 100644 index 0000000000..c1971b6e91 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_RequisitionLine.java @@ -0,0 +1,269 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_RequisitionLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.093 */ +public class X_M_RequisitionLine extends PO +{ +/** Standard Constructor +@param ctx context +@param M_RequisitionLine_ID id +@param trxName transaction +*/ +public X_M_RequisitionLine (Properties ctx, int M_RequisitionLine_ID, String trxName) +{ +super (ctx, M_RequisitionLine_ID, trxName); +/** if (M_RequisitionLine_ID == 0) +{ +setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM M_RequisitionLine WHERE M_Requisition_ID=@M_Requisition_ID@ +setLineNetAmt (Env.ZERO); +setM_RequisitionLine_ID (0); +setM_Requisition_ID (0); +setPriceActual (Env.ZERO); +setQty (Env.ZERO); // 1 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_RequisitionLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=703 */ +public static final int Table_ID=703; + +/** TableName=M_RequisitionLine */ +public static final String Table_Name="M_RequisitionLine"; + +protected static KeyNamePair Model = new KeyNamePair(703,"M_RequisitionLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RequisitionLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", new Integer(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_Value ("C_OrderLine_ID", null); + else +set_Value ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Line Amount. +@param LineNetAmt Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public void setLineNetAmt (BigDecimal LineNetAmt) +{ +if (LineNetAmt == null) throw new IllegalArgumentException ("LineNetAmt is mandatory."); +set_Value ("LineNetAmt", LineNetAmt); +} +/** Get Line Amount. +@return Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public BigDecimal getLineNetAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID <= 0) set_Value ("M_AttributeSetInstance_ID", null); + else +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Requisition Line. +@param M_RequisitionLine_ID Material Requisition Line */ +public void setM_RequisitionLine_ID (int M_RequisitionLine_ID) +{ +if (M_RequisitionLine_ID < 1) throw new IllegalArgumentException ("M_RequisitionLine_ID is mandatory."); +set_ValueNoCheck ("M_RequisitionLine_ID", new Integer(M_RequisitionLine_ID)); +} +/** Get Requisition Line. +@return Material Requisition Line */ +public int getM_RequisitionLine_ID() +{ +Integer ii = (Integer)get_Value("M_RequisitionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Requisition. +@param M_Requisition_ID Material Requisition */ +public void setM_Requisition_ID (int M_Requisition_ID) +{ +if (M_Requisition_ID < 1) throw new IllegalArgumentException ("M_Requisition_ID is mandatory."); +set_ValueNoCheck ("M_Requisition_ID", new Integer(M_Requisition_ID)); +} +/** Get Requisition. +@return Material Requisition */ +public int getM_Requisition_ID() +{ +Integer ii = (Integer)get_Value("M_Requisition_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Unit Price. +@param PriceActual Actual Price */ +public void setPriceActual (BigDecimal PriceActual) +{ +if (PriceActual == null) throw new IllegalArgumentException ("PriceActual is mandatory."); +set_Value ("PriceActual", PriceActual); +} +/** Get Unit Price. +@return Actual Price */ +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_SerNoCtl.java b/dbPort/src/org/compiere/model/X_M_SerNoCtl.java new file mode 100644 index 0000000000..6f95b1ddc8 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_SerNoCtl.java @@ -0,0 +1,224 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_SerNoCtl + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.109 */ +public class X_M_SerNoCtl extends PO +{ +/** Standard Constructor +@param ctx context +@param M_SerNoCtl_ID id +@param trxName transaction +*/ +public X_M_SerNoCtl (Properties ctx, int M_SerNoCtl_ID, String trxName) +{ +super (ctx, M_SerNoCtl_ID, trxName); +/** if (M_SerNoCtl_ID == 0) +{ +setCurrentNext (0); // 100 +setIncrementNo (0); // 1 +setM_SerNoCtl_ID (0); +setName (null); +setStartNo (0); // 100 +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_SerNoCtl (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=555 */ +public static final int Table_ID=555; + +/** TableName=M_SerNoCtl */ +public static final String Table_Name="M_SerNoCtl"; + +protected static KeyNamePair Model = new KeyNamePair(555,"M_SerNoCtl"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_SerNoCtl[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Current Next. +@param CurrentNext The next number to be used */ +public void setCurrentNext (int CurrentNext) +{ +set_Value ("CurrentNext", new Integer(CurrentNext)); +} +/** Get Current Next. +@return The next number to be used */ +public int getCurrentNext() +{ +Integer ii = (Integer)get_Value("CurrentNext"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Increment. +@param IncrementNo The number to increment the last document number by */ +public void setIncrementNo (int IncrementNo) +{ +set_Value ("IncrementNo", new Integer(IncrementNo)); +} +/** Get Increment. +@return The number to increment the last document number by */ +public int getIncrementNo() +{ +Integer ii = (Integer)get_Value("IncrementNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Serial No Control. +@param M_SerNoCtl_ID Product Serial Number Control */ +public void setM_SerNoCtl_ID (int M_SerNoCtl_ID) +{ +if (M_SerNoCtl_ID < 1) throw new IllegalArgumentException ("M_SerNoCtl_ID is mandatory."); +set_ValueNoCheck ("M_SerNoCtl_ID", new Integer(M_SerNoCtl_ID)); +} +/** Get Serial No Control. +@return Product Serial Number Control */ +public int getM_SerNoCtl_ID() +{ +Integer ii = (Integer)get_Value("M_SerNoCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Prefix. +@param Prefix Prefix before the sequence number */ +public void setPrefix (String Prefix) +{ +if (Prefix != null && Prefix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Prefix = Prefix.substring(0,9); +} +set_Value ("Prefix", Prefix); +} +/** Get Prefix. +@return Prefix before the sequence number */ +public String getPrefix() +{ +return (String)get_Value("Prefix"); +} +/** Set Start No. +@param StartNo Starting number/position */ +public void setStartNo (int StartNo) +{ +set_Value ("StartNo", new Integer(StartNo)); +} +/** Get Start No. +@return Starting number/position */ +public int getStartNo() +{ +Integer ii = (Integer)get_Value("StartNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Suffix. +@param Suffix Suffix after the number */ +public void setSuffix (String Suffix) +{ +if (Suffix != null && Suffix.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Suffix = Suffix.substring(0,9); +} +set_Value ("Suffix", Suffix); +} +/** Get Suffix. +@return Suffix after the number */ +public String getSuffix() +{ +return (String)get_Value("Suffix"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_SerNoCtlExclude.java b/dbPort/src/org/compiere/model/X_M_SerNoCtlExclude.java new file mode 100644 index 0000000000..750c05b843 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_SerNoCtlExclude.java @@ -0,0 +1,154 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_SerNoCtlExclude + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.125 */ +public class X_M_SerNoCtlExclude extends PO +{ +/** Standard Constructor +@param ctx context +@param M_SerNoCtlExclude_ID id +@param trxName transaction +*/ +public X_M_SerNoCtlExclude (Properties ctx, int M_SerNoCtlExclude_ID, String trxName) +{ +super (ctx, M_SerNoCtlExclude_ID, trxName); +/** if (M_SerNoCtlExclude_ID == 0) +{ +setAD_Table_ID (0); +setIsSOTrx (false); +setM_SerNoCtlExclude_ID (0); +setM_SerNoCtl_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_SerNoCtlExclude (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=811 */ +public static final int Table_ID=811; + +/** TableName=M_SerNoCtlExclude */ +public static final String Table_Name="M_SerNoCtlExclude"; + +protected static KeyNamePair Model = new KeyNamePair(811,"M_SerNoCtlExclude"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_SerNoCtlExclude[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Exclude SerNo. +@param M_SerNoCtlExclude_ID Exclude the ability to create Serial Numbers in Attribute Sets */ +public void setM_SerNoCtlExclude_ID (int M_SerNoCtlExclude_ID) +{ +if (M_SerNoCtlExclude_ID < 1) throw new IllegalArgumentException ("M_SerNoCtlExclude_ID is mandatory."); +set_ValueNoCheck ("M_SerNoCtlExclude_ID", new Integer(M_SerNoCtlExclude_ID)); +} +/** Get Exclude SerNo. +@return Exclude the ability to create Serial Numbers in Attribute Sets */ +public int getM_SerNoCtlExclude_ID() +{ +Integer ii = (Integer)get_Value("M_SerNoCtlExclude_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Serial No Control. +@param M_SerNoCtl_ID Product Serial Number Control */ +public void setM_SerNoCtl_ID (int M_SerNoCtl_ID) +{ +if (M_SerNoCtl_ID < 1) throw new IllegalArgumentException ("M_SerNoCtl_ID is mandatory."); +set_ValueNoCheck ("M_SerNoCtl_ID", new Integer(M_SerNoCtl_ID)); +} +/** Get Serial No Control. +@return Product Serial Number Control */ +public int getM_SerNoCtl_ID() +{ +Integer ii = (Integer)get_Value("M_SerNoCtl_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Shipper.java b/dbPort/src/org/compiere/model/X_M_Shipper.java new file mode 100644 index 0000000000..676ede7c62 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Shipper.java @@ -0,0 +1,178 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Shipper + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.125 */ +public class X_M_Shipper extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Shipper_ID id +@param trxName transaction +*/ +public X_M_Shipper (Properties ctx, int M_Shipper_ID, String trxName) +{ +super (ctx, M_Shipper_ID, trxName); +/** if (M_Shipper_ID == 0) +{ +setM_Shipper_ID (0); +setName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Shipper (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=253 */ +public static final int Table_ID=253; + +/** TableName=M_Shipper */ +public static final String Table_Name="M_Shipper"; + +protected static KeyNamePair Model = new KeyNamePair(253,"M_Shipper"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Shipper[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Shipper. +@param M_Shipper_ID Method or manner of product delivery */ +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID < 1) throw new IllegalArgumentException ("M_Shipper_ID is mandatory."); +set_ValueNoCheck ("M_Shipper_ID", new Integer(M_Shipper_ID)); +} +/** Get Shipper. +@return Method or manner of product delivery */ +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Tracking URL. +@param TrackingURL URL of the shipper to track shipments */ +public void setTrackingURL (String TrackingURL) +{ +if (TrackingURL != null && TrackingURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +TrackingURL = TrackingURL.substring(0,119); +} +set_Value ("TrackingURL", TrackingURL); +} +/** Get Tracking URL. +@return URL of the shipper to track shipments */ +public String getTrackingURL() +{ +return (String)get_Value("TrackingURL"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Storage.java b/dbPort/src/org/compiere/model/X_M_Storage.java new file mode 100644 index 0000000000..196a69a472 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Storage.java @@ -0,0 +1,195 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Storage + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.14 */ +public class X_M_Storage extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Storage_ID id +@param trxName transaction +*/ +public X_M_Storage (Properties ctx, int M_Storage_ID, String trxName) +{ +super (ctx, M_Storage_ID, trxName); +/** if (M_Storage_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_Locator_ID (0); +setM_Product_ID (0); +setQtyOnHand (Env.ZERO); +setQtyOrdered (Env.ZERO); +setQtyReserved (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Storage (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=250 */ +public static final int Table_ID=250; + +/** TableName=M_Storage */ +public static final String Table_Name="M_Storage"; + +protected static KeyNamePair Model = new KeyNamePair(250,"M_Storage"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Storage[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Date last inventory count. +@param DateLastInventory Date of Last Inventory Count */ +public void setDateLastInventory (Timestamp DateLastInventory) +{ +set_Value ("DateLastInventory", DateLastInventory); +} +/** Get Date last inventory count. +@return Date of Last Inventory Count */ +public Timestamp getDateLastInventory() +{ +return (Timestamp)get_Value("DateLastInventory"); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_ValueNoCheck ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set On Hand Quantity. +@param QtyOnHand On Hand Quantity */ +public void setQtyOnHand (BigDecimal QtyOnHand) +{ +if (QtyOnHand == null) throw new IllegalArgumentException ("QtyOnHand is mandatory."); +set_ValueNoCheck ("QtyOnHand", QtyOnHand); +} +/** Get On Hand Quantity. +@return On Hand Quantity */ +public BigDecimal getQtyOnHand() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOnHand"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ordered Quantity. +@param QtyOrdered Ordered Quantity */ +public void setQtyOrdered (BigDecimal QtyOrdered) +{ +if (QtyOrdered == null) throw new IllegalArgumentException ("QtyOrdered is mandatory."); +set_ValueNoCheck ("QtyOrdered", QtyOrdered); +} +/** Get Ordered Quantity. +@return Ordered Quantity */ +public BigDecimal getQtyOrdered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOrdered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reserved Quantity. +@param QtyReserved Reserved Quantity */ +public void setQtyReserved (BigDecimal QtyReserved) +{ +if (QtyReserved == null) throw new IllegalArgumentException ("QtyReserved is mandatory."); +set_ValueNoCheck ("QtyReserved", QtyReserved); +} +/** Get Reserved Quantity. +@return Reserved Quantity */ +public BigDecimal getQtyReserved() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyReserved"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Substitute.java b/dbPort/src/org/compiere/model/X_M_Substitute.java new file mode 100644 index 0000000000..3ac3a98281 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Substitute.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Substitute + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.156 */ +public class X_M_Substitute extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Substitute_ID id +@param trxName transaction +*/ +public X_M_Substitute (Properties ctx, int M_Substitute_ID, String trxName) +{ +super (ctx, M_Substitute_ID, trxName); +/** if (M_Substitute_ID == 0) +{ +setM_Product_ID (0); +setName (null); +setSubstitute_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Substitute (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=213 */ +public static final int Table_ID=213; + +/** TableName=M_Substitute */ +public static final String Table_Name="M_Substitute"; + +protected static KeyNamePair Model = new KeyNamePair(213,"M_Substitute"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Substitute[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Substitute_ID AD_Reference_ID=162 */ +public static final int SUBSTITUTE_ID_AD_Reference_ID=162; +/** Set Substitute. +@param Substitute_ID Entity which can be used in place of this entity */ +public void setSubstitute_ID (int Substitute_ID) +{ +if (Substitute_ID < 1) throw new IllegalArgumentException ("Substitute_ID is mandatory."); +set_ValueNoCheck ("Substitute_ID", new Integer(Substitute_ID)); +} +/** Get Substitute. +@return Entity which can be used in place of this entity */ +public int getSubstitute_ID() +{ +Integer ii = (Integer)get_Value("Substitute_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Transaction.java b/dbPort/src/org/compiere/model/X_M_Transaction.java new file mode 100644 index 0000000000..5ecce5e07f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Transaction.java @@ -0,0 +1,315 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Transaction + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.156 */ +public class X_M_Transaction extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Transaction_ID id +@param trxName transaction +*/ +public X_M_Transaction (Properties ctx, int M_Transaction_ID, String trxName) +{ +super (ctx, M_Transaction_ID, trxName); +/** if (M_Transaction_ID == 0) +{ +setM_AttributeSetInstance_ID (0); +setM_Locator_ID (0); +setM_Product_ID (0); +setM_Transaction_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); +setMovementQty (Env.ZERO); +setMovementType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Transaction (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=329 */ +public static final int Table_ID=329; + +/** TableName=M_Transaction */ +public static final String Table_Name="M_Transaction"; + +protected static KeyNamePair Model = new KeyNamePair(329,"M_Transaction"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Transaction[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Project Issue. +@param C_ProjectIssue_ID Project Issues (Material, Labor) */ +public void setC_ProjectIssue_ID (int C_ProjectIssue_ID) +{ +if (C_ProjectIssue_ID <= 0) set_ValueNoCheck ("C_ProjectIssue_ID", null); + else +set_ValueNoCheck ("C_ProjectIssue_ID", new Integer(C_ProjectIssue_ID)); +} +/** Get Project Issue. +@return Project Issues (Material, Labor) */ +public int getC_ProjectIssue_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectIssue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_ValueNoCheck ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_ValueNoCheck ("M_InOutLine_ID", null); + else +set_ValueNoCheck ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_ValueNoCheck ("M_InventoryLine_ID", null); + else +set_ValueNoCheck ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_ValueNoCheck ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Line. +@param M_MovementLine_ID Inventory Move document Line */ +public void setM_MovementLine_ID (int M_MovementLine_ID) +{ +if (M_MovementLine_ID <= 0) set_ValueNoCheck ("M_MovementLine_ID", null); + else +set_ValueNoCheck ("M_MovementLine_ID", new Integer(M_MovementLine_ID)); +} +/** Get Move Line. +@return Inventory Move document Line */ +public int getM_MovementLine_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Line. +@param M_ProductionLine_ID Document Line representing a production */ +public void setM_ProductionLine_ID (int M_ProductionLine_ID) +{ +if (M_ProductionLine_ID <= 0) set_ValueNoCheck ("M_ProductionLine_ID", null); + else +set_ValueNoCheck ("M_ProductionLine_ID", new Integer(M_ProductionLine_ID)); +} +/** Get Production Line. +@return Document Line representing a production */ +public int getM_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Transaction. +@param M_Transaction_ID Inventory Transaction */ +public void setM_Transaction_ID (int M_Transaction_ID) +{ +if (M_Transaction_ID < 1) throw new IllegalArgumentException ("M_Transaction_ID is mandatory."); +set_ValueNoCheck ("M_Transaction_ID", new Integer(M_Transaction_ID)); +} +/** Get Inventory Transaction. +@return Inventory Transaction */ +public int getM_Transaction_ID() +{ +Integer ii = (Integer)get_Value("M_Transaction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_ValueNoCheck ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getMovementDate())); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_ValueNoCheck ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** MovementType AD_Reference_ID=189 */ +public static final int MOVEMENTTYPE_AD_Reference_ID=189; +/** Customer Returns = C+ */ +public static final String MOVEMENTTYPE_CustomerReturns = "C+"; +/** Customer Shipment = C- */ +public static final String MOVEMENTTYPE_CustomerShipment = "C-"; +/** Inventory In = I+ */ +public static final String MOVEMENTTYPE_InventoryIn = "I+"; +/** Inventory Out = I- */ +public static final String MOVEMENTTYPE_InventoryOut = "I-"; +/** Movement To = M+ */ +public static final String MOVEMENTTYPE_MovementTo = "M+"; +/** Movement From = M- */ +public static final String MOVEMENTTYPE_MovementFrom = "M-"; +/** Production + = P+ */ +public static final String MOVEMENTTYPE_ProductionPlus = "P+"; +/** Production - = P- */ +public static final String MOVEMENTTYPE_Production_ = "P-"; +/** Vendor Receipts = V+ */ +public static final String MOVEMENTTYPE_VendorReceipts = "V+"; +/** Vendor Returns = V- */ +public static final String MOVEMENTTYPE_VendorReturns = "V-"; +/** Work Order + = W+ */ +public static final String MOVEMENTTYPE_WorkOrderPlus = "W+"; +/** Work Order - = W- */ +public static final String MOVEMENTTYPE_WorkOrder_ = "W-"; +/** Set Movement Type. +@param MovementType Method of moving the inventory */ +public void setMovementType (String MovementType) +{ +if (MovementType == null) throw new IllegalArgumentException ("MovementType is mandatory"); +if (MovementType.equals("C+") || MovementType.equals("C-") || MovementType.equals("I+") || MovementType.equals("I-") || MovementType.equals("M+") || MovementType.equals("M-") || MovementType.equals("P+") || MovementType.equals("P-") || MovementType.equals("V+") || MovementType.equals("V-") || MovementType.equals("W+") || MovementType.equals("W-")); + else throw new IllegalArgumentException ("MovementType Invalid value - " + MovementType + " - Reference_ID=189 - C+ - C- - I+ - I- - M+ - M- - P+ - P- - V+ - V- - W+ - W-"); +if (MovementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +MovementType = MovementType.substring(0,1); +} +set_ValueNoCheck ("MovementType", MovementType); +} +/** Get Movement Type. +@return Method of moving the inventory */ +public String getMovementType() +{ +return (String)get_Value("MovementType"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_TransactionAllocation.java b/dbPort/src/org/compiere/model/X_M_TransactionAllocation.java new file mode 100644 index 0000000000..16d84ae053 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_TransactionAllocation.java @@ -0,0 +1,341 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_TransactionAllocation + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.171 */ +public class X_M_TransactionAllocation extends PO +{ +/** Standard Constructor +@param ctx context +@param M_TransactionAllocation_ID id +@param trxName transaction +*/ +public X_M_TransactionAllocation (Properties ctx, int M_TransactionAllocation_ID, String trxName) +{ +super (ctx, M_TransactionAllocation_ID, trxName); +/** if (M_TransactionAllocation_ID == 0) +{ +setAllocationStrategyType (null); +setIsAllocated (false); // N +setIsManual (false); // N +setM_AttributeSetInstance_ID (0); +setM_Product_ID (0); +setM_Transaction_ID (0); +setQty (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_TransactionAllocation (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=636 */ +public static final int Table_ID=636; + +/** TableName=M_TransactionAllocation */ +public static final String Table_Name="M_TransactionAllocation"; + +protected static KeyNamePair Model = new KeyNamePair(636,"M_TransactionAllocation"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_TransactionAllocation[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AllocationStrategyType AD_Reference_ID=294 */ +public static final int ALLOCATIONSTRATEGYTYPE_AD_Reference_ID=294; +/** FiFo = F */ +public static final String ALLOCATIONSTRATEGYTYPE_FiFo = "F"; +/** LiFo = L */ +public static final String ALLOCATIONSTRATEGYTYPE_LiFo = "L"; +/** Set Allocation Strategy. +@param AllocationStrategyType Allocation Strategy */ +public void setAllocationStrategyType (String AllocationStrategyType) +{ +if (AllocationStrategyType == null) throw new IllegalArgumentException ("AllocationStrategyType is mandatory"); +if (AllocationStrategyType.equals("F") || AllocationStrategyType.equals("L")); + else throw new IllegalArgumentException ("AllocationStrategyType Invalid value - " + AllocationStrategyType + " - Reference_ID=294 - F - L"); +if (AllocationStrategyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AllocationStrategyType = AllocationStrategyType.substring(0,0); +} +set_Value ("AllocationStrategyType", AllocationStrategyType); +} +/** Get Allocation Strategy. +@return Allocation Strategy */ +public String getAllocationStrategyType() +{ +return (String)get_Value("AllocationStrategyType"); +} +/** Set Allocated. +@param IsAllocated Indicates if the payment has been allocated */ +public void setIsAllocated (boolean IsAllocated) +{ +set_Value ("IsAllocated", new Boolean(IsAllocated)); +} +/** Get Allocated. +@return Indicates if the payment has been allocated */ +public boolean isAllocated() +{ +Object oo = get_Value("IsAllocated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_Value ("M_InOutLine_ID", null); + else +set_Value ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_Value ("M_InventoryLine_ID", null); + else +set_Value ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Line. +@param M_ProductionLine_ID Document Line representing a production */ +public void setM_ProductionLine_ID (int M_ProductionLine_ID) +{ +if (M_ProductionLine_ID <= 0) set_Value ("M_ProductionLine_ID", null); + else +set_Value ("M_ProductionLine_ID", new Integer(M_ProductionLine_ID)); +} +/** Get Production Line. +@return Document Line representing a production */ +public int getM_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Transaction. +@param M_Transaction_ID Inventory Transaction */ +public void setM_Transaction_ID (int M_Transaction_ID) +{ +if (M_Transaction_ID < 1) throw new IllegalArgumentException ("M_Transaction_ID is mandatory."); +set_ValueNoCheck ("M_Transaction_ID", new Integer(M_Transaction_ID)); +} +/** Get Inventory Transaction. +@return Inventory Transaction */ +public int getM_Transaction_ID() +{ +Integer ii = (Integer)get_Value("M_Transaction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Out_M_InOutLine_ID AD_Reference_ID=295 */ +public static final int OUT_M_INOUTLINE_ID_AD_Reference_ID=295; +/** Set Out Shipment Line. +@param Out_M_InOutLine_ID Outgoing Shipment/Receipt */ +public void setOut_M_InOutLine_ID (int Out_M_InOutLine_ID) +{ +if (Out_M_InOutLine_ID <= 0) set_Value ("Out_M_InOutLine_ID", null); + else +set_Value ("Out_M_InOutLine_ID", new Integer(Out_M_InOutLine_ID)); +} +/** Get Out Shipment Line. +@return Outgoing Shipment/Receipt */ +public int getOut_M_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("Out_M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Out_M_InventoryLine_ID AD_Reference_ID=296 */ +public static final int OUT_M_INVENTORYLINE_ID_AD_Reference_ID=296; +/** Set Out Inventory Line. +@param Out_M_InventoryLine_ID Outgoing Inventory Line */ +public void setOut_M_InventoryLine_ID (int Out_M_InventoryLine_ID) +{ +if (Out_M_InventoryLine_ID <= 0) set_Value ("Out_M_InventoryLine_ID", null); + else +set_Value ("Out_M_InventoryLine_ID", new Integer(Out_M_InventoryLine_ID)); +} +/** Get Out Inventory Line. +@return Outgoing Inventory Line */ +public int getOut_M_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("Out_M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Out_M_ProductionLine_ID AD_Reference_ID=297 */ +public static final int OUT_M_PRODUCTIONLINE_ID_AD_Reference_ID=297; +/** Set Out Production Line. +@param Out_M_ProductionLine_ID Outgoing Production Line */ +public void setOut_M_ProductionLine_ID (int Out_M_ProductionLine_ID) +{ +if (Out_M_ProductionLine_ID <= 0) set_Value ("Out_M_ProductionLine_ID", null); + else +set_Value ("Out_M_ProductionLine_ID", new Integer(Out_M_ProductionLine_ID)); +} +/** Get Out Production Line. +@return Outgoing Production Line */ +public int getOut_M_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("Out_M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Out_M_Transaction_ID AD_Reference_ID=298 */ +public static final int OUT_M_TRANSACTION_ID_AD_Reference_ID=298; +/** Set Out Transaction. +@param Out_M_Transaction_ID Outgoing Transaction */ +public void setOut_M_Transaction_ID (int Out_M_Transaction_ID) +{ +if (Out_M_Transaction_ID <= 0) set_Value ("Out_M_Transaction_ID", null); + else +set_Value ("Out_M_Transaction_ID", new Integer(Out_M_Transaction_ID)); +} +/** Get Out Transaction. +@return Outgoing Transaction */ +public int getOut_M_Transaction_ID() +{ +Integer ii = (Integer)get_Value("Out_M_Transaction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Warehouse.java b/dbPort/src/org/compiere/model/X_M_Warehouse.java new file mode 100644 index 0000000000..03e5d85f06 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Warehouse.java @@ -0,0 +1,235 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Warehouse + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.203 */ +public class X_M_Warehouse extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Warehouse_ID id +@param trxName transaction +*/ +public X_M_Warehouse (Properties ctx, int M_Warehouse_ID, String trxName) +{ +super (ctx, M_Warehouse_ID, trxName); +/** if (M_Warehouse_ID == 0) +{ +setC_Location_ID (0); +setM_Warehouse_ID (0); +setName (null); +setSeparator (null); // * +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Warehouse (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=190 */ +public static final int Table_ID=190; + +/** TableName=M_Warehouse */ +public static final String Table_Name="M_Warehouse"; + +protected static KeyNamePair Model = new KeyNamePair(190,"M_Warehouse"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Warehouse[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID < 1) throw new IllegalArgumentException ("C_Location_ID is mandatory."); +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** M_WarehouseSource_ID AD_Reference_ID=197 */ +public static final int M_WAREHOUSESOURCE_ID_AD_Reference_ID=197; +/** Set Source Warehouse. +@param M_WarehouseSource_ID Optional Warehouse to replenish from */ +public void setM_WarehouseSource_ID (int M_WarehouseSource_ID) +{ +if (M_WarehouseSource_ID <= 0) set_Value ("M_WarehouseSource_ID", null); + else +set_Value ("M_WarehouseSource_ID", new Integer(M_WarehouseSource_ID)); +} +/** Get Source Warehouse. +@return Optional Warehouse to replenish from */ +public int getM_WarehouseSource_ID() +{ +Integer ii = (Integer)get_Value("M_WarehouseSource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Replenishment Class. +@param ReplenishmentClass Custom class to calculate Quantity to Order */ +public void setReplenishmentClass (String ReplenishmentClass) +{ +if (ReplenishmentClass != null && ReplenishmentClass.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ReplenishmentClass = ReplenishmentClass.substring(0,59); +} +set_Value ("ReplenishmentClass", ReplenishmentClass); +} +/** Get Replenishment Class. +@return Custom class to calculate Quantity to Order */ +public String getReplenishmentClass() +{ +return (String)get_Value("ReplenishmentClass"); +} +/** Set Element Separator. +@param Separator Element Separator */ +public void setSeparator (String Separator) +{ +if (Separator == null) throw new IllegalArgumentException ("Separator is mandatory."); +if (Separator.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Separator = Separator.substring(0,0); +} +set_Value ("Separator", Separator); +} +/** Get Element Separator. +@return Element Separator */ +public String getSeparator() +{ +return (String)get_Value("Separator"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_M_Warehouse_Acct.java b/dbPort/src/org/compiere/model/X_M_Warehouse_Acct.java new file mode 100644 index 0000000000..89d03089f3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_M_Warehouse_Acct.java @@ -0,0 +1,179 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for M_Warehouse_Acct + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.218 */ +public class X_M_Warehouse_Acct extends PO +{ +/** Standard Constructor +@param ctx context +@param M_Warehouse_Acct_ID id +@param trxName transaction +*/ +public X_M_Warehouse_Acct (Properties ctx, int M_Warehouse_Acct_ID, String trxName) +{ +super (ctx, M_Warehouse_Acct_ID, trxName); +/** if (M_Warehouse_Acct_ID == 0) +{ +setC_AcctSchema_ID (0); +setM_Warehouse_ID (0); +setW_Differences_Acct (0); +setW_InvActualAdjust_Acct (0); +setW_Inventory_Acct (0); +setW_Revaluation_Acct (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_M_Warehouse_Acct (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=191 */ +public static final int Table_ID=191; + +/** TableName=M_Warehouse_Acct */ +public static final String Table_Name="M_Warehouse_Acct"; + +protected static KeyNamePair Model = new KeyNamePair(191,"M_Warehouse_Acct"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_Warehouse_Acct[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_ValueNoCheck ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse Differences. +@param W_Differences_Acct Warehouse Differences Account */ +public void setW_Differences_Acct (int W_Differences_Acct) +{ +set_Value ("W_Differences_Acct", new Integer(W_Differences_Acct)); +} +/** Get Warehouse Differences. +@return Warehouse Differences Account */ +public int getW_Differences_Acct() +{ +Integer ii = (Integer)get_Value("W_Differences_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Adjustment. +@param W_InvActualAdjust_Acct Account for Inventory value adjustments for Actual Costing */ +public void setW_InvActualAdjust_Acct (int W_InvActualAdjust_Acct) +{ +set_Value ("W_InvActualAdjust_Acct", new Integer(W_InvActualAdjust_Acct)); +} +/** Get Inventory Adjustment. +@return Account for Inventory value adjustments for Actual Costing */ +public int getW_InvActualAdjust_Acct() +{ +Integer ii = (Integer)get_Value("W_InvActualAdjust_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set (Not Used). +@param W_Inventory_Acct Warehouse Inventory Asset Account - Currently not used */ +public void setW_Inventory_Acct (int W_Inventory_Acct) +{ +set_Value ("W_Inventory_Acct", new Integer(W_Inventory_Acct)); +} +/** Get (Not Used). +@return Warehouse Inventory Asset Account - Currently not used */ +public int getW_Inventory_Acct() +{ +Integer ii = (Integer)get_Value("W_Inventory_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Revaluation. +@param W_Revaluation_Acct Account for Inventory Revaluation */ +public void setW_Revaluation_Acct (int W_Revaluation_Acct) +{ +set_Value ("W_Revaluation_Acct", new Integer(W_Revaluation_Acct)); +} +/** Get Inventory Revaluation. +@return Account for Inventory Revaluation */ +public int getW_Revaluation_Acct() +{ +Integer ii = (Integer)get_Value("W_Revaluation_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Achievement.java b/dbPort/src/org/compiere/model/X_PA_Achievement.java new file mode 100644 index 0000000000..2d3e4df772 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Achievement.java @@ -0,0 +1,242 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Achievement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.234 */ +public class X_PA_Achievement extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Achievement_ID id +@param trxName transaction +*/ +public X_PA_Achievement (Properties ctx, int PA_Achievement_ID, String trxName) +{ +super (ctx, PA_Achievement_ID, trxName); +/** if (PA_Achievement_ID == 0) +{ +setIsAchieved (false); +setManualActual (Env.ZERO); +setName (null); +setPA_Achievement_ID (0); +setPA_Measure_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Achievement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=438 */ +public static final int Table_ID=438; + +/** TableName=PA_Achievement */ +public static final String Table_Name="PA_Achievement"; + +protected static KeyNamePair Model = new KeyNamePair(438,"PA_Achievement"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Achievement[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Document Date. +@param DateDoc Date of the Document */ +public void setDateDoc (Timestamp DateDoc) +{ +set_Value ("DateDoc", DateDoc); +} +/** Get Document Date. +@return Date of the Document */ +public Timestamp getDateDoc() +{ +return (Timestamp)get_Value("DateDoc"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Achieved. +@param IsAchieved The goal is achieved */ +public void setIsAchieved (boolean IsAchieved) +{ +set_Value ("IsAchieved", new Boolean(IsAchieved)); +} +/** Get Achieved. +@return The goal is achieved */ +public boolean isAchieved() +{ +Object oo = get_Value("IsAchieved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Manual Actual. +@param ManualActual Manually entered actual value */ +public void setManualActual (BigDecimal ManualActual) +{ +if (ManualActual == null) throw new IllegalArgumentException ("ManualActual is mandatory."); +set_Value ("ManualActual", ManualActual); +} +/** Get Manual Actual. +@return Manually entered actual value */ +public BigDecimal getManualActual() +{ +BigDecimal bd = (BigDecimal)get_Value("ManualActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Note = Note.substring(0,1999); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Achievement. +@param PA_Achievement_ID Performance Achievement */ +public void setPA_Achievement_ID (int PA_Achievement_ID) +{ +if (PA_Achievement_ID < 1) throw new IllegalArgumentException ("PA_Achievement_ID is mandatory."); +set_ValueNoCheck ("PA_Achievement_ID", new Integer(PA_Achievement_ID)); +} +/** Get Achievement. +@return Performance Achievement */ +public int getPA_Achievement_ID() +{ +Integer ii = (Integer)get_Value("PA_Achievement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Measure. +@param PA_Measure_ID Concrete Performance Measurement */ +public void setPA_Measure_ID (int PA_Measure_ID) +{ +if (PA_Measure_ID < 1) throw new IllegalArgumentException ("PA_Measure_ID is mandatory."); +set_ValueNoCheck ("PA_Measure_ID", new Integer(PA_Measure_ID)); +} +/** Get Measure. +@return Concrete Performance Measurement */ +public int getPA_Measure_ID() +{ +Integer ii = (Integer)get_Value("PA_Measure_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Benchmark.java b/dbPort/src/org/compiere/model/X_PA_Benchmark.java new file mode 100644 index 0000000000..449d308df7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Benchmark.java @@ -0,0 +1,190 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Benchmark + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.234 */ +public class X_PA_Benchmark extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Benchmark_ID id +@param trxName transaction +*/ +public X_PA_Benchmark (Properties ctx, int PA_Benchmark_ID, String trxName) +{ +super (ctx, PA_Benchmark_ID, trxName); +/** if (PA_Benchmark_ID == 0) +{ +setAccumulationType (null); +setName (null); +setPA_Benchmark_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Benchmark (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=833 */ +public static final int Table_ID=833; + +/** TableName=PA_Benchmark */ +public static final String Table_Name="PA_Benchmark"; + +protected static KeyNamePair Model = new KeyNamePair(833,"PA_Benchmark"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Benchmark[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AccumulationType AD_Reference_ID=370 */ +public static final int ACCUMULATIONTYPE_AD_Reference_ID=370; +/** Average = A */ +public static final String ACCUMULATIONTYPE_Average = "A"; +/** Sum = S */ +public static final String ACCUMULATIONTYPE_Sum = "S"; +/** Set Accumulation Type. +@param AccumulationType How to accumulate data on time axis */ +public void setAccumulationType (String AccumulationType) +{ +if (AccumulationType == null) throw new IllegalArgumentException ("AccumulationType is mandatory"); +if (AccumulationType.equals("A") || AccumulationType.equals("S")); + else throw new IllegalArgumentException ("AccumulationType Invalid value - " + AccumulationType + " - Reference_ID=370 - A - S"); +if (AccumulationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +AccumulationType = AccumulationType.substring(0,0); +} +set_Value ("AccumulationType", AccumulationType); +} +/** Get Accumulation Type. +@return How to accumulate data on time axis */ +public String getAccumulationType() +{ +return (String)get_Value("AccumulationType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Benchmark. +@param PA_Benchmark_ID Performance Benchmark */ +public void setPA_Benchmark_ID (int PA_Benchmark_ID) +{ +if (PA_Benchmark_ID < 1) throw new IllegalArgumentException ("PA_Benchmark_ID is mandatory."); +set_ValueNoCheck ("PA_Benchmark_ID", new Integer(PA_Benchmark_ID)); +} +/** Get Benchmark. +@return Performance Benchmark */ +public int getPA_Benchmark_ID() +{ +Integer ii = (Integer)get_Value("PA_Benchmark_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_BenchmarkData.java b/dbPort/src/org/compiere/model/X_PA_BenchmarkData.java new file mode 100644 index 0000000000..8f5b557bcb --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_BenchmarkData.java @@ -0,0 +1,191 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_BenchmarkData + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.25 */ +public class X_PA_BenchmarkData extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_BenchmarkData_ID id +@param trxName transaction +*/ +public X_PA_BenchmarkData (Properties ctx, int PA_BenchmarkData_ID, String trxName) +{ +super (ctx, PA_BenchmarkData_ID, trxName); +/** if (PA_BenchmarkData_ID == 0) +{ +setBenchmarkDate (new Timestamp(System.currentTimeMillis())); +setBenchmarkValue (Env.ZERO); +setName (null); +setPA_BenchmarkData_ID (0); +setPA_Benchmark_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_BenchmarkData (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=834 */ +public static final int Table_ID=834; + +/** TableName=PA_BenchmarkData */ +public static final String Table_Name="PA_BenchmarkData"; + +protected static KeyNamePair Model = new KeyNamePair(834,"PA_BenchmarkData"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_BenchmarkData[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Date. +@param BenchmarkDate Benchmark Date */ +public void setBenchmarkDate (Timestamp BenchmarkDate) +{ +if (BenchmarkDate == null) throw new IllegalArgumentException ("BenchmarkDate is mandatory."); +set_Value ("BenchmarkDate", BenchmarkDate); +} +/** Get Date. +@return Benchmark Date */ +public Timestamp getBenchmarkDate() +{ +return (Timestamp)get_Value("BenchmarkDate"); +} +/** Set Value. +@param BenchmarkValue Benchmark Value */ +public void setBenchmarkValue (BigDecimal BenchmarkValue) +{ +if (BenchmarkValue == null) throw new IllegalArgumentException ("BenchmarkValue is mandatory."); +set_Value ("BenchmarkValue", BenchmarkValue); +} +/** Get Value. +@return Benchmark Value */ +public BigDecimal getBenchmarkValue() +{ +BigDecimal bd = (BigDecimal)get_Value("BenchmarkValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Benchmark Data. +@param PA_BenchmarkData_ID Performance Benchmark Data Point */ +public void setPA_BenchmarkData_ID (int PA_BenchmarkData_ID) +{ +if (PA_BenchmarkData_ID < 1) throw new IllegalArgumentException ("PA_BenchmarkData_ID is mandatory."); +set_ValueNoCheck ("PA_BenchmarkData_ID", new Integer(PA_BenchmarkData_ID)); +} +/** Get Benchmark Data. +@return Performance Benchmark Data Point */ +public int getPA_BenchmarkData_ID() +{ +Integer ii = (Integer)get_Value("PA_BenchmarkData_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Benchmark. +@param PA_Benchmark_ID Performance Benchmark */ +public void setPA_Benchmark_ID (int PA_Benchmark_ID) +{ +if (PA_Benchmark_ID < 1) throw new IllegalArgumentException ("PA_Benchmark_ID is mandatory."); +set_ValueNoCheck ("PA_Benchmark_ID", new Integer(PA_Benchmark_ID)); +} +/** Get Benchmark. +@return Performance Benchmark */ +public int getPA_Benchmark_ID() +{ +Integer ii = (Integer)get_Value("PA_Benchmark_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_ColorSchema.java b/dbPort/src/org/compiere/model/X_PA_ColorSchema.java new file mode 100644 index 0000000000..cbe63ea956 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_ColorSchema.java @@ -0,0 +1,302 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_ColorSchema + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.265 */ +public class X_PA_ColorSchema extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_ColorSchema_ID id +@param trxName transaction +*/ +public X_PA_ColorSchema (Properties ctx, int PA_ColorSchema_ID, String trxName) +{ +super (ctx, PA_ColorSchema_ID, trxName); +/** if (PA_ColorSchema_ID == 0) +{ +setAD_PrintColor1_ID (0); +setAD_PrintColor2_ID (0); +setEntityType (null); // U +setMark1Percent (0); +setMark2Percent (0); +setName (null); +setPA_ColorSchema_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_ColorSchema (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=831 */ +public static final int Table_ID=831; + +/** TableName=PA_ColorSchema */ +public static final String Table_Name="PA_ColorSchema"; + +protected static KeyNamePair Model = new KeyNamePair(831,"PA_ColorSchema"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_ColorSchema[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_PrintColor1_ID AD_Reference_ID=266 */ +public static final int AD_PRINTCOLOR1_ID_AD_Reference_ID=266; +/** Set Color 1. +@param AD_PrintColor1_ID First color used */ +public void setAD_PrintColor1_ID (int AD_PrintColor1_ID) +{ +if (AD_PrintColor1_ID < 1) throw new IllegalArgumentException ("AD_PrintColor1_ID is mandatory."); +set_Value ("AD_PrintColor1_ID", new Integer(AD_PrintColor1_ID)); +} +/** Get Color 1. +@return First color used */ +public int getAD_PrintColor1_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_PrintColor2_ID AD_Reference_ID=266 */ +public static final int AD_PRINTCOLOR2_ID_AD_Reference_ID=266; +/** Set Color 2. +@param AD_PrintColor2_ID Second color used */ +public void setAD_PrintColor2_ID (int AD_PrintColor2_ID) +{ +if (AD_PrintColor2_ID < 1) throw new IllegalArgumentException ("AD_PrintColor2_ID is mandatory."); +set_Value ("AD_PrintColor2_ID", new Integer(AD_PrintColor2_ID)); +} +/** Get Color 2. +@return Second color used */ +public int getAD_PrintColor2_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_PrintColor3_ID AD_Reference_ID=266 */ +public static final int AD_PRINTCOLOR3_ID_AD_Reference_ID=266; +/** Set Color 3. +@param AD_PrintColor3_ID Third color used */ +public void setAD_PrintColor3_ID (int AD_PrintColor3_ID) +{ +if (AD_PrintColor3_ID <= 0) set_Value ("AD_PrintColor3_ID", null); + else +set_Value ("AD_PrintColor3_ID", new Integer(AD_PrintColor3_ID)); +} +/** Get Color 3. +@return Third color used */ +public int getAD_PrintColor3_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor3_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_PrintColor4_ID AD_Reference_ID=266 */ +public static final int AD_PRINTCOLOR4_ID_AD_Reference_ID=266; +/** Set Color 4. +@param AD_PrintColor4_ID Forth color used */ +public void setAD_PrintColor4_ID (int AD_PrintColor4_ID) +{ +if (AD_PrintColor4_ID <= 0) set_Value ("AD_PrintColor4_ID", null); + else +set_Value ("AD_PrintColor4_ID", new Integer(AD_PrintColor4_ID)); +} +/** Get Color 4. +@return Forth color used */ +public int getAD_PrintColor4_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintColor4_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Mark 1 Percent. +@param Mark1Percent Percentage up to this color is used */ +public void setMark1Percent (int Mark1Percent) +{ +set_Value ("Mark1Percent", new Integer(Mark1Percent)); +} +/** Get Mark 1 Percent. +@return Percentage up to this color is used */ +public int getMark1Percent() +{ +Integer ii = (Integer)get_Value("Mark1Percent"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Mark 2 Percent. +@param Mark2Percent Percentage up to this color is used */ +public void setMark2Percent (int Mark2Percent) +{ +set_Value ("Mark2Percent", new Integer(Mark2Percent)); +} +/** Get Mark 2 Percent. +@return Percentage up to this color is used */ +public int getMark2Percent() +{ +Integer ii = (Integer)get_Value("Mark2Percent"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Mark 3 Percent. +@param Mark3Percent Percentage up to this color is used */ +public void setMark3Percent (int Mark3Percent) +{ +set_Value ("Mark3Percent", new Integer(Mark3Percent)); +} +/** Get Mark 3 Percent. +@return Percentage up to this color is used */ +public int getMark3Percent() +{ +Integer ii = (Integer)get_Value("Mark3Percent"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Mark 4 Percent. +@param Mark4Percent Percentage up to this color is used */ +public void setMark4Percent (int Mark4Percent) +{ +set_Value ("Mark4Percent", new Integer(Mark4Percent)); +} +/** Get Mark 4 Percent. +@return Percentage up to this color is used */ +public int getMark4Percent() +{ +Integer ii = (Integer)get_Value("Mark4Percent"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Color Schema. +@param PA_ColorSchema_ID Performance Color Schema */ +public void setPA_ColorSchema_ID (int PA_ColorSchema_ID) +{ +if (PA_ColorSchema_ID < 1) throw new IllegalArgumentException ("PA_ColorSchema_ID is mandatory."); +set_ValueNoCheck ("PA_ColorSchema_ID", new Integer(PA_ColorSchema_ID)); +} +/** Get Color Schema. +@return Performance Color Schema */ +public int getPA_ColorSchema_ID() +{ +Integer ii = (Integer)get_Value("PA_ColorSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Goal.java b/dbPort/src/org/compiere/model/X_PA_Goal.java new file mode 100644 index 0000000000..c8a0aa1802 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Goal.java @@ -0,0 +1,452 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Goal + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.281 */ +public class X_PA_Goal extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Goal_ID id +@param trxName transaction +*/ +public X_PA_Goal (Properties ctx, int PA_Goal_ID, String trxName) +{ +super (ctx, PA_Goal_ID, trxName); +/** if (PA_Goal_ID == 0) +{ +setGoalPerformance (Env.ZERO); +setIsSummary (false); +setMeasureActual (Env.ZERO); +setMeasureScope (null); +setMeasureTarget (Env.ZERO); +setName (null); +setPA_ColorSchema_ID (0); +setPA_Goal_ID (0); +setRelativeWeight (Env.ZERO); // 1 +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Goal (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=440 */ +public static final int Table_ID=440; + +/** TableName=PA_Goal */ +public static final String Table_Name="PA_Goal"; + +protected static KeyNamePair Model = new KeyNamePair(440,"PA_Goal"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Goal[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID <= 0) set_Value ("AD_Role_ID", null); + else +set_Value ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date From. +@param DateFrom Starting date for a range */ +public void setDateFrom (Timestamp DateFrom) +{ +set_Value ("DateFrom", DateFrom); +} +/** Get Date From. +@return Starting date for a range */ +public Timestamp getDateFrom() +{ +return (Timestamp)get_Value("DateFrom"); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_ValueNoCheck ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date To. +@param DateTo End date of a date range */ +public void setDateTo (Timestamp DateTo) +{ +set_Value ("DateTo", DateTo); +} +/** Get Date To. +@return End date of a date range */ +public Timestamp getDateTo() +{ +return (Timestamp)get_Value("DateTo"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Performance Goal. +@param GoalPerformance Target achievement from 0..1 */ +public void setGoalPerformance (BigDecimal GoalPerformance) +{ +if (GoalPerformance == null) throw new IllegalArgumentException ("GoalPerformance is mandatory."); +set_ValueNoCheck ("GoalPerformance", GoalPerformance); +} +/** Get Performance Goal. +@return Target achievement from 0..1 */ +public BigDecimal getGoalPerformance() +{ +BigDecimal bd = (BigDecimal)get_Value("GoalPerformance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_Value ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Measure Actual. +@param MeasureActual Actual value that has been measured. */ +public void setMeasureActual (BigDecimal MeasureActual) +{ +if (MeasureActual == null) throw new IllegalArgumentException ("MeasureActual is mandatory."); +set_ValueNoCheck ("MeasureActual", MeasureActual); +} +/** Get Measure Actual. +@return Actual value that has been measured. */ +public BigDecimal getMeasureActual() +{ +BigDecimal bd = (BigDecimal)get_Value("MeasureActual"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** MeasureDisplay AD_Reference_ID=367 */ +public static final int MEASUREDISPLAY_AD_Reference_ID=367; +/** Total = 0 */ +public static final String MEASUREDISPLAY_Total = "0"; +/** Year = 1 */ +public static final String MEASUREDISPLAY_Year = "1"; +/** Quarter = 3 */ +public static final String MEASUREDISPLAY_Quarter = "3"; +/** Month = 5 */ +public static final String MEASUREDISPLAY_Month = "5"; +/** Week = 7 */ +public static final String MEASUREDISPLAY_Week = "7"; +/** Day = 8 */ +public static final String MEASUREDISPLAY_Day = "8"; +/** Set Measure Display. +@param MeasureDisplay Measure Scope initially displayed */ +public void setMeasureDisplay (String MeasureDisplay) +{ +if (MeasureDisplay == null) throw new IllegalArgumentException ("MeasureDisplay is mandatory"); +if (MeasureDisplay == null || MeasureDisplay.equals("0") || MeasureDisplay.equals("1") || MeasureDisplay.equals("3") || MeasureDisplay.equals("5") || MeasureDisplay.equals("7") || MeasureDisplay.equals("8")); + else throw new IllegalArgumentException ("MeasureDisplay Invalid value - " + MeasureDisplay + " - Reference_ID=367 - 0 - 1 - 3 - 5 - 7 - 8"); +if (MeasureDisplay != null && MeasureDisplay.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MeasureDisplay = MeasureDisplay.substring(0,0); +} +set_Value ("MeasureDisplay", MeasureDisplay); +} +/** Get Measure Display. +@return Measure Scope initially displayed */ +public String getMeasureDisplay() +{ +return (String)get_Value("MeasureDisplay"); +} + +/** MeasureScope AD_Reference_ID=367 */ +public static final int MEASURESCOPE_AD_Reference_ID=367; +/** Total = 0 */ +public static final String MEASURESCOPE_Total = "0"; +/** Year = 1 */ +public static final String MEASURESCOPE_Year = "1"; +/** Quarter = 3 */ +public static final String MEASURESCOPE_Quarter = "3"; +/** Month = 5 */ +public static final String MEASURESCOPE_Month = "5"; +/** Week = 7 */ +public static final String MEASURESCOPE_Week = "7"; +/** Day = 8 */ +public static final String MEASURESCOPE_Day = "8"; +/** Set Measure Scope. +@param MeasureScope Performance Measure Scope */ +public void setMeasureScope (String MeasureScope) +{ +if (MeasureScope == null) throw new IllegalArgumentException ("MeasureScope is mandatory"); +if (MeasureScope.equals("0") || MeasureScope.equals("1") || MeasureScope.equals("3") || MeasureScope.equals("5") || MeasureScope.equals("7") || MeasureScope.equals("8")); + else throw new IllegalArgumentException ("MeasureScope Invalid value - " + MeasureScope + " - Reference_ID=367 - 0 - 1 - 3 - 5 - 7 - 8"); +if (MeasureScope.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MeasureScope = MeasureScope.substring(0,0); +} +set_Value ("MeasureScope", MeasureScope); +} +/** Get Measure Scope. +@return Performance Measure Scope */ +public String getMeasureScope() +{ +return (String)get_Value("MeasureScope"); +} +/** Set Measure Target. +@param MeasureTarget Target value for measure */ +public void setMeasureTarget (BigDecimal MeasureTarget) +{ +if (MeasureTarget == null) throw new IllegalArgumentException ("MeasureTarget is mandatory."); +set_Value ("MeasureTarget", MeasureTarget); +} +/** Get Measure Target. +@return Target value for measure */ +public BigDecimal getMeasureTarget() +{ +BigDecimal bd = (BigDecimal)get_Value("MeasureTarget"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Note = Note.substring(0,1999); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Color Schema. +@param PA_ColorSchema_ID Performance Color Schema */ +public void setPA_ColorSchema_ID (int PA_ColorSchema_ID) +{ +if (PA_ColorSchema_ID < 1) throw new IllegalArgumentException ("PA_ColorSchema_ID is mandatory."); +set_Value ("PA_ColorSchema_ID", new Integer(PA_ColorSchema_ID)); +} +/** Get Color Schema. +@return Performance Color Schema */ +public int getPA_ColorSchema_ID() +{ +Integer ii = (Integer)get_Value("PA_ColorSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PA_GoalParent_ID AD_Reference_ID=230 */ +public static final int PA_GOALPARENT_ID_AD_Reference_ID=230; +/** Set Parent Goal. +@param PA_GoalParent_ID Parent Goal */ +public void setPA_GoalParent_ID (int PA_GoalParent_ID) +{ +if (PA_GoalParent_ID <= 0) set_Value ("PA_GoalParent_ID", null); + else +set_Value ("PA_GoalParent_ID", new Integer(PA_GoalParent_ID)); +} +/** Get Parent Goal. +@return Parent Goal */ +public int getPA_GoalParent_ID() +{ +Integer ii = (Integer)get_Value("PA_GoalParent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Goal. +@param PA_Goal_ID Performance Goal */ +public void setPA_Goal_ID (int PA_Goal_ID) +{ +if (PA_Goal_ID < 1) throw new IllegalArgumentException ("PA_Goal_ID is mandatory."); +set_ValueNoCheck ("PA_Goal_ID", new Integer(PA_Goal_ID)); +} +/** Get Goal. +@return Performance Goal */ +public int getPA_Goal_ID() +{ +Integer ii = (Integer)get_Value("PA_Goal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Measure. +@param PA_Measure_ID Concrete Performance Measurement */ +public void setPA_Measure_ID (int PA_Measure_ID) +{ +if (PA_Measure_ID <= 0) set_Value ("PA_Measure_ID", null); + else +set_Value ("PA_Measure_ID", new Integer(PA_Measure_ID)); +} +/** Get Measure. +@return Concrete Performance Measurement */ +public int getPA_Measure_ID() +{ +Integer ii = (Integer)get_Value("PA_Measure_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Relative Weight. +@param RelativeWeight Relative weight of this step (0 = ignored) */ +public void setRelativeWeight (BigDecimal RelativeWeight) +{ +if (RelativeWeight == null) throw new IllegalArgumentException ("RelativeWeight is mandatory."); +set_Value ("RelativeWeight", RelativeWeight); +} +/** Get Relative Weight. +@return Relative weight of this step (0 = ignored) */ +public BigDecimal getRelativeWeight() +{ +BigDecimal bd = (BigDecimal)get_Value("RelativeWeight"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_GoalRestriction.java b/dbPort/src/org/compiere/model/X_PA_GoalRestriction.java new file mode 100644 index 0000000000..0837522f99 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_GoalRestriction.java @@ -0,0 +1,261 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_GoalRestriction + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.312 */ +public class X_PA_GoalRestriction extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_GoalRestriction_ID id +@param trxName transaction +*/ +public X_PA_GoalRestriction (Properties ctx, int PA_GoalRestriction_ID, String trxName) +{ +super (ctx, PA_GoalRestriction_ID, trxName); +/** if (PA_GoalRestriction_ID == 0) +{ +setGoalRestrictionType (null); +setName (null); +setPA_GoalRestriction_ID (0); +setPA_Goal_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_GoalRestriction (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=832 */ +public static final int Table_ID=832; + +/** TableName=PA_GoalRestriction */ +public static final String Table_Name="PA_GoalRestriction"; + +protected static KeyNamePair Model = new KeyNamePair(832,"PA_GoalRestriction"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_GoalRestriction[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID <= 0) set_Value ("C_BP_Group_ID", null); + else +set_Value ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** GoalRestrictionType AD_Reference_ID=368 */ +public static final int GOALRESTRICTIONTYPE_AD_Reference_ID=368; +/** Business Partner = B */ +public static final String GOALRESTRICTIONTYPE_BusinessPartner = "B"; +/** Product Category = C */ +public static final String GOALRESTRICTIONTYPE_ProductCategory = "C"; +/** Bus.Partner Group = G */ +public static final String GOALRESTRICTIONTYPE_BusPartnerGroup = "G"; +/** Organization = O */ +public static final String GOALRESTRICTIONTYPE_Organization = "O"; +/** Product = P */ +public static final String GOALRESTRICTIONTYPE_Product = "P"; +/** Set Restriction Type. +@param GoalRestrictionType Goal Restriction Type */ +public void setGoalRestrictionType (String GoalRestrictionType) +{ +if (GoalRestrictionType == null) throw new IllegalArgumentException ("GoalRestrictionType is mandatory"); +if (GoalRestrictionType.equals("B") || GoalRestrictionType.equals("C") || GoalRestrictionType.equals("G") || GoalRestrictionType.equals("O") || GoalRestrictionType.equals("P")); + else throw new IllegalArgumentException ("GoalRestrictionType Invalid value - " + GoalRestrictionType + " - Reference_ID=368 - B - C - G - O - P"); +if (GoalRestrictionType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GoalRestrictionType = GoalRestrictionType.substring(0,0); +} +set_Value ("GoalRestrictionType", GoalRestrictionType); +} +/** Get Restriction Type. +@return Goal Restriction Type */ +public String getGoalRestrictionType() +{ +return (String)get_Value("GoalRestrictionType"); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID <= 0) set_Value ("M_Product_Category_ID", null); + else +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Org_ID AD_Reference_ID=322 */ +public static final int ORG_ID_AD_Reference_ID=322; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID <= 0) set_Value ("Org_ID", null); + else +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Goal Restriction. +@param PA_GoalRestriction_ID Performance Goal Restriction */ +public void setPA_GoalRestriction_ID (int PA_GoalRestriction_ID) +{ +if (PA_GoalRestriction_ID < 1) throw new IllegalArgumentException ("PA_GoalRestriction_ID is mandatory."); +set_ValueNoCheck ("PA_GoalRestriction_ID", new Integer(PA_GoalRestriction_ID)); +} +/** Get Goal Restriction. +@return Performance Goal Restriction */ +public int getPA_GoalRestriction_ID() +{ +Integer ii = (Integer)get_Value("PA_GoalRestriction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Goal. +@param PA_Goal_ID Performance Goal */ +public void setPA_Goal_ID (int PA_Goal_ID) +{ +if (PA_Goal_ID < 1) throw new IllegalArgumentException ("PA_Goal_ID is mandatory."); +set_Value ("PA_Goal_ID", new Integer(PA_Goal_ID)); +} +/** Get Goal. +@return Performance Goal */ +public int getPA_Goal_ID() +{ +Integer ii = (Integer)get_Value("PA_Goal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Hierarchy.java b/dbPort/src/org/compiere/model/X_PA_Hierarchy.java new file mode 100644 index 0000000000..a456f3aea9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Hierarchy.java @@ -0,0 +1,314 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Hierarchy + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.328 */ +public class X_PA_Hierarchy extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Hierarchy_ID id +@param trxName transaction +*/ +public X_PA_Hierarchy (Properties ctx, int PA_Hierarchy_ID, String trxName) +{ +super (ctx, PA_Hierarchy_ID, trxName); +/** if (PA_Hierarchy_ID == 0) +{ +setAD_Tree_Account_ID (0); +setAD_Tree_Activity_ID (0); +setAD_Tree_BPartner_ID (0); +setAD_Tree_Campaign_ID (0); +setAD_Tree_Org_ID (0); +setAD_Tree_Product_ID (0); +setAD_Tree_Project_ID (0); +setAD_Tree_SalesRegion_ID (0); +setName (null); +setPA_Hierarchy_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Hierarchy (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=821 */ +public static final int Table_ID=821; + +/** TableName=PA_Hierarchy */ +public static final String Table_Name="PA_Hierarchy"; + +protected static KeyNamePair Model = new KeyNamePair(821,"PA_Hierarchy"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Hierarchy[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Tree_Account_ID AD_Reference_ID=184 */ +public static final int AD_TREE_ACCOUNT_ID_AD_Reference_ID=184; +/** Set Account Tree. +@param AD_Tree_Account_ID Tree for Natural Account Tree */ +public void setAD_Tree_Account_ID (int AD_Tree_Account_ID) +{ +if (AD_Tree_Account_ID < 1) throw new IllegalArgumentException ("AD_Tree_Account_ID is mandatory."); +set_Value ("AD_Tree_Account_ID", new Integer(AD_Tree_Account_ID)); +} +/** Get Account Tree. +@return Tree for Natural Account Tree */ +public int getAD_Tree_Account_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Activity_ID AD_Reference_ID=184 */ +public static final int AD_TREE_ACTIVITY_ID_AD_Reference_ID=184; +/** Set Activity Tree. +@param AD_Tree_Activity_ID Tree to determine activity hierarchy */ +public void setAD_Tree_Activity_ID (int AD_Tree_Activity_ID) +{ +if (AD_Tree_Activity_ID < 1) throw new IllegalArgumentException ("AD_Tree_Activity_ID is mandatory."); +set_Value ("AD_Tree_Activity_ID", new Integer(AD_Tree_Activity_ID)); +} +/** Get Activity Tree. +@return Tree to determine activity hierarchy */ +public int getAD_Tree_Activity_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_BPartner_ID AD_Reference_ID=184 */ +public static final int AD_TREE_BPARTNER_ID_AD_Reference_ID=184; +/** Set BPartner Tree. +@param AD_Tree_BPartner_ID Tree to determine business partner hierarchy */ +public void setAD_Tree_BPartner_ID (int AD_Tree_BPartner_ID) +{ +if (AD_Tree_BPartner_ID < 1) throw new IllegalArgumentException ("AD_Tree_BPartner_ID is mandatory."); +set_Value ("AD_Tree_BPartner_ID", new Integer(AD_Tree_BPartner_ID)); +} +/** Get BPartner Tree. +@return Tree to determine business partner hierarchy */ +public int getAD_Tree_BPartner_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Campaign_ID AD_Reference_ID=184 */ +public static final int AD_TREE_CAMPAIGN_ID_AD_Reference_ID=184; +/** Set Campaign Tree. +@param AD_Tree_Campaign_ID Tree to determine marketing campaign hierarchy */ +public void setAD_Tree_Campaign_ID (int AD_Tree_Campaign_ID) +{ +if (AD_Tree_Campaign_ID < 1) throw new IllegalArgumentException ("AD_Tree_Campaign_ID is mandatory."); +set_Value ("AD_Tree_Campaign_ID", new Integer(AD_Tree_Campaign_ID)); +} +/** Get Campaign Tree. +@return Tree to determine marketing campaign hierarchy */ +public int getAD_Tree_Campaign_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Org_ID AD_Reference_ID=184 */ +public static final int AD_TREE_ORG_ID_AD_Reference_ID=184; +/** Set Organization Tree. +@param AD_Tree_Org_ID Tree to determine organizational hierarchy */ +public void setAD_Tree_Org_ID (int AD_Tree_Org_ID) +{ +if (AD_Tree_Org_ID < 1) throw new IllegalArgumentException ("AD_Tree_Org_ID is mandatory."); +set_Value ("AD_Tree_Org_ID", new Integer(AD_Tree_Org_ID)); +} +/** Get Organization Tree. +@return Tree to determine organizational hierarchy */ +public int getAD_Tree_Org_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Product_ID AD_Reference_ID=184 */ +public static final int AD_TREE_PRODUCT_ID_AD_Reference_ID=184; +/** Set Product Tree. +@param AD_Tree_Product_ID Tree to determine product hierarchy */ +public void setAD_Tree_Product_ID (int AD_Tree_Product_ID) +{ +if (AD_Tree_Product_ID < 1) throw new IllegalArgumentException ("AD_Tree_Product_ID is mandatory."); +set_Value ("AD_Tree_Product_ID", new Integer(AD_Tree_Product_ID)); +} +/** Get Product Tree. +@return Tree to determine product hierarchy */ +public int getAD_Tree_Product_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_Project_ID AD_Reference_ID=184 */ +public static final int AD_TREE_PROJECT_ID_AD_Reference_ID=184; +/** Set Project Tree. +@param AD_Tree_Project_ID Tree to determine project hierarchy */ +public void setAD_Tree_Project_ID (int AD_Tree_Project_ID) +{ +if (AD_Tree_Project_ID < 1) throw new IllegalArgumentException ("AD_Tree_Project_ID is mandatory."); +set_Value ("AD_Tree_Project_ID", new Integer(AD_Tree_Project_ID)); +} +/** Get Project Tree. +@return Tree to determine project hierarchy */ +public int getAD_Tree_Project_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_Tree_SalesRegion_ID AD_Reference_ID=184 */ +public static final int AD_TREE_SALESREGION_ID_AD_Reference_ID=184; +/** Set Sales Region Tree. +@param AD_Tree_SalesRegion_ID Tree to determine sales regional hierarchy */ +public void setAD_Tree_SalesRegion_ID (int AD_Tree_SalesRegion_ID) +{ +if (AD_Tree_SalesRegion_ID < 1) throw new IllegalArgumentException ("AD_Tree_SalesRegion_ID is mandatory."); +set_Value ("AD_Tree_SalesRegion_ID", new Integer(AD_Tree_SalesRegion_ID)); +} +/** Get Sales Region Tree. +@return Tree to determine sales regional hierarchy */ +public int getAD_Tree_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("AD_Tree_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Reporting Hierarchy. +@param PA_Hierarchy_ID Optional Reporting Hierarchy - If not selected the default hierarchy trees are used. */ +public void setPA_Hierarchy_ID (int PA_Hierarchy_ID) +{ +if (PA_Hierarchy_ID < 1) throw new IllegalArgumentException ("PA_Hierarchy_ID is mandatory."); +set_ValueNoCheck ("PA_Hierarchy_ID", new Integer(PA_Hierarchy_ID)); +} +/** Get Reporting Hierarchy. +@return Optional Reporting Hierarchy - If not selected the default hierarchy trees are used. */ +public int getPA_Hierarchy_ID() +{ +Integer ii = (Integer)get_Value("PA_Hierarchy_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Measure.java b/dbPort/src/org/compiere/model/X_PA_Measure.java new file mode 100644 index 0000000000..8ce0965822 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Measure.java @@ -0,0 +1,355 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Measure + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.375 */ +public class X_PA_Measure extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Measure_ID id +@param trxName transaction +*/ +public X_PA_Measure (Properties ctx, int PA_Measure_ID, String trxName) +{ +super (ctx, PA_Measure_ID, trxName); +/** if (PA_Measure_ID == 0) +{ +setMeasureDataType (null); // T +setMeasureType (null); // M +setName (null); +setPA_Measure_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Measure (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=441 */ +public static final int Table_ID=441; + +/** TableName=PA_Measure */ +public static final String Table_Name="PA_Measure"; + +protected static KeyNamePair Model = new KeyNamePair(441,"PA_Measure"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Measure[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Project Type. +@param C_ProjectType_ID Type of the project */ +public void setC_ProjectType_ID (int C_ProjectType_ID) +{ +if (C_ProjectType_ID <= 0) set_Value ("C_ProjectType_ID", null); + else +set_Value ("C_ProjectType_ID", new Integer(C_ProjectType_ID)); +} +/** Get Project Type. +@return Type of the project */ +public int getC_ProjectType_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Calculation Class. +@param CalculationClass Java Class for calculation, implementing Interface Measure */ +public void setCalculationClass (String CalculationClass) +{ +if (CalculationClass != null && CalculationClass.length() > 60) +{ +log.warning("Length > 60 - truncated"); +CalculationClass = CalculationClass.substring(0,59); +} +set_Value ("CalculationClass", CalculationClass); +} +/** Get Calculation Class. +@return Java Class for calculation, implementing Interface Measure */ +public String getCalculationClass() +{ +return (String)get_Value("CalculationClass"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Manual Actual. +@param ManualActual Manually entered actual value */ +public void setManualActual (BigDecimal ManualActual) +{ +set_Value ("ManualActual", ManualActual); +} +/** Get Manual Actual. +@return Manually entered actual value */ +public BigDecimal getManualActual() +{ +BigDecimal bd = (BigDecimal)get_Value("ManualActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Note. +@param ManualNote Note for manual entry */ +public void setManualNote (String ManualNote) +{ +if (ManualNote != null && ManualNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ManualNote = ManualNote.substring(0,1999); +} +set_Value ("ManualNote", ManualNote); +} +/** Get Note. +@return Note for manual entry */ +public String getManualNote() +{ +return (String)get_Value("ManualNote"); +} + +/** MeasureDataType AD_Reference_ID=369 */ +public static final int MEASUREDATATYPE_AD_Reference_ID=369; +/** Status Qty/Amount = S */ +public static final String MEASUREDATATYPE_StatusQtyAmount = "S"; +/** Qty/Amount in Time = T */ +public static final String MEASUREDATATYPE_QtyAmountInTime = "T"; +/** Set Measure Data Type. +@param MeasureDataType Type of data - Status or in Time */ +public void setMeasureDataType (String MeasureDataType) +{ +if (MeasureDataType == null) throw new IllegalArgumentException ("MeasureDataType is mandatory"); +if (MeasureDataType.equals("S") || MeasureDataType.equals("T")); + else throw new IllegalArgumentException ("MeasureDataType Invalid value - " + MeasureDataType + " - Reference_ID=369 - S - T"); +if (MeasureDataType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MeasureDataType = MeasureDataType.substring(0,0); +} +set_Value ("MeasureDataType", MeasureDataType); +} +/** Get Measure Data Type. +@return Type of data - Status or in Time */ +public String getMeasureDataType() +{ +return (String)get_Value("MeasureDataType"); +} + +/** MeasureType AD_Reference_ID=231 */ +public static final int MEASURETYPE_AD_Reference_ID=231; +/** Achievements = A */ +public static final String MEASURETYPE_Achievements = "A"; +/** Calculated = C */ +public static final String MEASURETYPE_Calculated = "C"; +/** Manual = M */ +public static final String MEASURETYPE_Manual = "M"; +/** Project = P */ +public static final String MEASURETYPE_Project = "P"; +/** Request = Q */ +public static final String MEASURETYPE_Request = "Q"; +/** Ratio = R */ +public static final String MEASURETYPE_Ratio = "R"; +/** User defined = U */ +public static final String MEASURETYPE_UserDefined = "U"; +/** Set Measure Type. +@param MeasureType Determines how the actual performance is derived */ +public void setMeasureType (String MeasureType) +{ +if (MeasureType == null) throw new IllegalArgumentException ("MeasureType is mandatory"); +if (MeasureType.equals("A") || MeasureType.equals("C") || MeasureType.equals("M") || MeasureType.equals("P") || MeasureType.equals("Q") || MeasureType.equals("R") || MeasureType.equals("U")); + else throw new IllegalArgumentException ("MeasureType Invalid value - " + MeasureType + " - Reference_ID=231 - A - C - M - P - Q - R - U"); +if (MeasureType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +MeasureType = MeasureType.substring(0,0); +} +set_Value ("MeasureType", MeasureType); +} +/** Get Measure Type. +@return Determines how the actual performance is derived */ +public String getMeasureType() +{ +return (String)get_Value("MeasureType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Benchmark. +@param PA_Benchmark_ID Performance Benchmark */ +public void setPA_Benchmark_ID (int PA_Benchmark_ID) +{ +if (PA_Benchmark_ID <= 0) set_Value ("PA_Benchmark_ID", null); + else +set_Value ("PA_Benchmark_ID", new Integer(PA_Benchmark_ID)); +} +/** Get Benchmark. +@return Performance Benchmark */ +public int getPA_Benchmark_ID() +{ +Integer ii = (Integer)get_Value("PA_Benchmark_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Reporting Hierarchy. +@param PA_Hierarchy_ID Optional Reporting Hierarchy - If not selected the default hierarchy trees are used. */ +public void setPA_Hierarchy_ID (int PA_Hierarchy_ID) +{ +if (PA_Hierarchy_ID <= 0) set_Value ("PA_Hierarchy_ID", null); + else +set_Value ("PA_Hierarchy_ID", new Integer(PA_Hierarchy_ID)); +} +/** Get Reporting Hierarchy. +@return Optional Reporting Hierarchy - If not selected the default hierarchy trees are used. */ +public int getPA_Hierarchy_ID() +{ +Integer ii = (Integer)get_Value("PA_Hierarchy_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Measure Calculation. +@param PA_MeasureCalc_ID Calculation method for measuring performance */ +public void setPA_MeasureCalc_ID (int PA_MeasureCalc_ID) +{ +if (PA_MeasureCalc_ID <= 0) set_Value ("PA_MeasureCalc_ID", null); + else +set_Value ("PA_MeasureCalc_ID", new Integer(PA_MeasureCalc_ID)); +} +/** Get Measure Calculation. +@return Calculation method for measuring performance */ +public int getPA_MeasureCalc_ID() +{ +Integer ii = (Integer)get_Value("PA_MeasureCalc_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Measure. +@param PA_Measure_ID Concrete Performance Measurement */ +public void setPA_Measure_ID (int PA_Measure_ID) +{ +if (PA_Measure_ID < 1) throw new IllegalArgumentException ("PA_Measure_ID is mandatory."); +set_ValueNoCheck ("PA_Measure_ID", new Integer(PA_Measure_ID)); +} +/** Get Measure. +@return Concrete Performance Measurement */ +public int getPA_Measure_ID() +{ +Integer ii = (Integer)get_Value("PA_Measure_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Ratio. +@param PA_Ratio_ID Performace Ratio */ +public void setPA_Ratio_ID (int PA_Ratio_ID) +{ +if (PA_Ratio_ID <= 0) set_Value ("PA_Ratio_ID", null); + else +set_Value ("PA_Ratio_ID", new Integer(PA_Ratio_ID)); +} +/** Get Ratio. +@return Performace Ratio */ +public int getPA_Ratio_ID() +{ +Integer ii = (Integer)get_Value("PA_Ratio_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_Value ("R_RequestType_ID", null); + else +set_Value ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_MeasureCalc.java b/dbPort/src/org/compiere/model/X_PA_MeasureCalc.java new file mode 100644 index 0000000000..03c62cabfe --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_MeasureCalc.java @@ -0,0 +1,313 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_MeasureCalc + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.39 */ +public class X_PA_MeasureCalc extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_MeasureCalc_ID id +@param trxName transaction +*/ +public X_PA_MeasureCalc (Properties ctx, int PA_MeasureCalc_ID, String trxName) +{ +super (ctx, PA_MeasureCalc_ID, trxName); +/** if (PA_MeasureCalc_ID == 0) +{ +setAD_Table_ID (0); +setDateColumn (null); // x.Date +setEntityType (null); // U +setKeyColumn (null); +setName (null); +setOrgColumn (null); // x.AD_Org_ID +setPA_MeasureCalc_ID (0); +setSelectClause (null); // SELECT ... FROM ... +setWhereClause (null); // WHERE ... +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_MeasureCalc (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=442 */ +public static final int Table_ID=442; + +/** TableName=PA_MeasureCalc */ +public static final String Table_Name="PA_MeasureCalc"; + +protected static KeyNamePair Model = new KeyNamePair(442,"PA_MeasureCalc"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_MeasureCalc[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory."); +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set B.Partner Column. +@param BPartnerColumn Fully qualified Business Partner key column (C_BPartner_ID) */ +public void setBPartnerColumn (String BPartnerColumn) +{ +if (BPartnerColumn != null && BPartnerColumn.length() > 60) +{ +log.warning("Length > 60 - truncated"); +BPartnerColumn = BPartnerColumn.substring(0,59); +} +set_Value ("BPartnerColumn", BPartnerColumn); +} +/** Get B.Partner Column. +@return Fully qualified Business Partner key column (C_BPartner_ID) */ +public String getBPartnerColumn() +{ +return (String)get_Value("BPartnerColumn"); +} +/** Set Date Column. +@param DateColumn Fully qualified date column */ +public void setDateColumn (String DateColumn) +{ +if (DateColumn == null) throw new IllegalArgumentException ("DateColumn is mandatory."); +if (DateColumn.length() > 60) +{ +log.warning("Length > 60 - truncated"); +DateColumn = DateColumn.substring(0,59); +} +set_Value ("DateColumn", DateColumn); +} +/** Get Date Column. +@return Fully qualified date column */ +public String getDateColumn() +{ +return (String)get_Value("DateColumn"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** EntityType AD_Reference_ID=389 */ +public static final int ENTITYTYPE_AD_Reference_ID=389; +/** Set Entity Type. +@param EntityType Dictionary Entity Type; + Determines ownership and synchronization */ +public void setEntityType (String EntityType) +{ +if (EntityType.length() > 4) +{ +log.warning("Length > 4 - truncated"); +EntityType = EntityType.substring(0,3); +} +set_Value ("EntityType", EntityType); +} +/** Get Entity Type. +@return Dictionary Entity Type; + Determines ownership and synchronization */ +public String getEntityType() +{ +return (String)get_Value("EntityType"); +} +/** Set Key Column. +@param KeyColumn Key Column for Table */ +public void setKeyColumn (String KeyColumn) +{ +if (KeyColumn == null) throw new IllegalArgumentException ("KeyColumn is mandatory."); +if (KeyColumn.length() > 60) +{ +log.warning("Length > 60 - truncated"); +KeyColumn = KeyColumn.substring(0,59); +} +set_Value ("KeyColumn", KeyColumn); +} +/** Get Key Column. +@return Key Column for Table */ +public String getKeyColumn() +{ +return (String)get_Value("KeyColumn"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Org Column. +@param OrgColumn Fully qualified Organization column (AD_Org_ID) */ +public void setOrgColumn (String OrgColumn) +{ +if (OrgColumn == null) throw new IllegalArgumentException ("OrgColumn is mandatory."); +if (OrgColumn.length() > 60) +{ +log.warning("Length > 60 - truncated"); +OrgColumn = OrgColumn.substring(0,59); +} +set_Value ("OrgColumn", OrgColumn); +} +/** Get Org Column. +@return Fully qualified Organization column (AD_Org_ID) */ +public String getOrgColumn() +{ +return (String)get_Value("OrgColumn"); +} +/** Set Measure Calculation. +@param PA_MeasureCalc_ID Calculation method for measuring performance */ +public void setPA_MeasureCalc_ID (int PA_MeasureCalc_ID) +{ +if (PA_MeasureCalc_ID < 1) throw new IllegalArgumentException ("PA_MeasureCalc_ID is mandatory."); +set_ValueNoCheck ("PA_MeasureCalc_ID", new Integer(PA_MeasureCalc_ID)); +} +/** Get Measure Calculation. +@return Calculation method for measuring performance */ +public int getPA_MeasureCalc_ID() +{ +Integer ii = (Integer)get_Value("PA_MeasureCalc_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product Column. +@param ProductColumn Fully qualified Product column (M_Product_ID) */ +public void setProductColumn (String ProductColumn) +{ +if (ProductColumn != null && ProductColumn.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProductColumn = ProductColumn.substring(0,59); +} +set_Value ("ProductColumn", ProductColumn); +} +/** Get Product Column. +@return Fully qualified Product column (M_Product_ID) */ +public String getProductColumn() +{ +return (String)get_Value("ProductColumn"); +} +/** Set Sql SELECT. +@param SelectClause SQL SELECT clause */ +public void setSelectClause (String SelectClause) +{ +if (SelectClause == null) throw new IllegalArgumentException ("SelectClause is mandatory."); +if (SelectClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +SelectClause = SelectClause.substring(0,1999); +} +set_Value ("SelectClause", SelectClause); +} +/** Get Sql SELECT. +@return SQL SELECT clause */ +public String getSelectClause() +{ +return (String)get_Value("SelectClause"); +} +/** Set Sql WHERE. +@param WhereClause Fully qualified SQL WHERE clause */ +public void setWhereClause (String WhereClause) +{ +if (WhereClause == null) throw new IllegalArgumentException ("WhereClause is mandatory."); +if (WhereClause.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WhereClause = WhereClause.substring(0,1999); +} +set_Value ("WhereClause", WhereClause); +} +/** Get Sql WHERE. +@return Fully qualified SQL WHERE clause */ +public String getWhereClause() +{ +return (String)get_Value("WhereClause"); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Ratio.java b/dbPort/src/org/compiere/model/X_PA_Ratio.java new file mode 100644 index 0000000000..f5680629e1 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Ratio.java @@ -0,0 +1,178 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Ratio + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.406 */ +public class X_PA_Ratio extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Ratio_ID id +@param trxName transaction +*/ +public X_PA_Ratio (Properties ctx, int PA_Ratio_ID, String trxName) +{ +super (ctx, PA_Ratio_ID, trxName); +/** if (PA_Ratio_ID == 0) +{ +setC_AcctSchema_ID (0); +setName (null); +setPA_Ratio_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Ratio (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=835 */ +public static final int Table_ID=835; + +/** TableName=PA_Ratio */ +public static final String Table_Name="PA_Ratio"; + +protected static KeyNamePair Model = new KeyNamePair(835,"PA_Ratio"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Ratio[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Ratio. +@param PA_Ratio_ID Performace Ratio */ +public void setPA_Ratio_ID (int PA_Ratio_ID) +{ +if (PA_Ratio_ID < 1) throw new IllegalArgumentException ("PA_Ratio_ID is mandatory."); +set_ValueNoCheck ("PA_Ratio_ID", new Integer(PA_Ratio_ID)); +} +/** Get Ratio. +@return Performace Ratio */ +public int getPA_Ratio_ID() +{ +Integer ii = (Integer)get_Value("PA_Ratio_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_RatioElement.java b/dbPort/src/org/compiere/model/X_PA_RatioElement.java new file mode 100644 index 0000000000..9aa661f560 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_RatioElement.java @@ -0,0 +1,343 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_RatioElement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.421 */ +public class X_PA_RatioElement extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_RatioElement_ID id +@param trxName transaction +*/ +public X_PA_RatioElement (Properties ctx, int PA_RatioElement_ID, String trxName) +{ +super (ctx, PA_RatioElement_ID, trxName); +/** if (PA_RatioElement_ID == 0) +{ +setName (null); +setPA_RatioElement_ID (0); +setPA_Ratio_ID (0); +setRatioElementType (null); +setRatioOperand (null); // P +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_RatioElement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=836 */ +public static final int Table_ID=836; + +/** TableName=PA_RatioElement */ +public static final String Table_Name="PA_RatioElement"; + +protected static KeyNamePair Model = new KeyNamePair(836,"PA_RatioElement"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_RatioElement[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** Account_ID AD_Reference_ID=331 */ +public static final int ACCOUNT_ID_AD_Reference_ID=331; +/** Set Account. +@param Account_ID Account used */ +public void setAccount_ID (int Account_ID) +{ +if (Account_ID <= 0) set_Value ("Account_ID", null); + else +set_Value ("Account_ID", new Integer(Account_ID)); +} +/** Get Account. +@return Account used */ +public int getAccount_ID() +{ +Integer ii = (Integer)get_Value("Account_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Constant Value. +@param ConstantValue Constant value */ +public void setConstantValue (BigDecimal ConstantValue) +{ +set_Value ("ConstantValue", ConstantValue); +} +/** Get Constant Value. +@return Constant value */ +public BigDecimal getConstantValue() +{ +BigDecimal bd = (BigDecimal)get_Value("ConstantValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Measure Calculation. +@param PA_MeasureCalc_ID Calculation method for measuring performance */ +public void setPA_MeasureCalc_ID (int PA_MeasureCalc_ID) +{ +if (PA_MeasureCalc_ID <= 0) set_Value ("PA_MeasureCalc_ID", null); + else +set_Value ("PA_MeasureCalc_ID", new Integer(PA_MeasureCalc_ID)); +} +/** Get Measure Calculation. +@return Calculation method for measuring performance */ +public int getPA_MeasureCalc_ID() +{ +Integer ii = (Integer)get_Value("PA_MeasureCalc_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Ratio Element. +@param PA_RatioElement_ID Performance Ratio Element */ +public void setPA_RatioElement_ID (int PA_RatioElement_ID) +{ +if (PA_RatioElement_ID < 1) throw new IllegalArgumentException ("PA_RatioElement_ID is mandatory."); +set_ValueNoCheck ("PA_RatioElement_ID", new Integer(PA_RatioElement_ID)); +} +/** Get Ratio Element. +@return Performance Ratio Element */ +public int getPA_RatioElement_ID() +{ +Integer ii = (Integer)get_Value("PA_RatioElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PA_RatioUsed_ID AD_Reference_ID=371 */ +public static final int PA_RATIOUSED_ID_AD_Reference_ID=371; +/** Set Ratio Used. +@param PA_RatioUsed_ID Performace Ratio Used */ +public void setPA_RatioUsed_ID (int PA_RatioUsed_ID) +{ +if (PA_RatioUsed_ID <= 0) set_Value ("PA_RatioUsed_ID", null); + else +set_Value ("PA_RatioUsed_ID", new Integer(PA_RatioUsed_ID)); +} +/** Get Ratio Used. +@return Performace Ratio Used */ +public int getPA_RatioUsed_ID() +{ +Integer ii = (Integer)get_Value("PA_RatioUsed_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Ratio. +@param PA_Ratio_ID Performace Ratio */ +public void setPA_Ratio_ID (int PA_Ratio_ID) +{ +if (PA_Ratio_ID < 1) throw new IllegalArgumentException ("PA_Ratio_ID is mandatory."); +set_ValueNoCheck ("PA_Ratio_ID", new Integer(PA_Ratio_ID)); +} +/** Get Ratio. +@return Performace Ratio */ +public int getPA_Ratio_ID() +{ +Integer ii = (Integer)get_Value("PA_Ratio_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType == null || PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType != null && PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} + +/** RatioElementType AD_Reference_ID=372 */ +public static final int RATIOELEMENTTYPE_AD_Reference_ID=372; +/** Account Value = A */ +public static final String RATIOELEMENTTYPE_AccountValue = "A"; +/** Constant = C */ +public static final String RATIOELEMENTTYPE_Constant = "C"; +/** Ratio = R */ +public static final String RATIOELEMENTTYPE_Ratio = "R"; +/** Calculation = X */ +public static final String RATIOELEMENTTYPE_Calculation = "X"; +/** Set Element Type. +@param RatioElementType Ratio Element Type */ +public void setRatioElementType (String RatioElementType) +{ +if (RatioElementType == null) throw new IllegalArgumentException ("RatioElementType is mandatory"); +if (RatioElementType.equals("A") || RatioElementType.equals("C") || RatioElementType.equals("R") || RatioElementType.equals("X")); + else throw new IllegalArgumentException ("RatioElementType Invalid value - " + RatioElementType + " - Reference_ID=372 - A - C - R - X"); +if (RatioElementType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RatioElementType = RatioElementType.substring(0,0); +} +set_Value ("RatioElementType", RatioElementType); +} +/** Get Element Type. +@return Ratio Element Type */ +public String getRatioElementType() +{ +return (String)get_Value("RatioElementType"); +} + +/** RatioOperand AD_Reference_ID=373 */ +public static final int RATIOOPERAND_AD_Reference_ID=373; +/** Divide = D */ +public static final String RATIOOPERAND_Divide = "D"; +/** Multiply = M */ +public static final String RATIOOPERAND_Multiply = "M"; +/** Minus = N */ +public static final String RATIOOPERAND_Minus = "N"; +/** Plus = P */ +public static final String RATIOOPERAND_Plus = "P"; +/** Set Operand. +@param RatioOperand Ratio Operand */ +public void setRatioOperand (String RatioOperand) +{ +if (RatioOperand == null) throw new IllegalArgumentException ("RatioOperand is mandatory"); +if (RatioOperand.equals("D") || RatioOperand.equals("M") || RatioOperand.equals("N") || RatioOperand.equals("P")); + else throw new IllegalArgumentException ("RatioOperand Invalid value - " + RatioOperand + " - Reference_ID=373 - D - M - N - P"); +if (RatioOperand.length() > 1) +{ +log.warning("Length > 1 - truncated"); +RatioOperand = RatioOperand.substring(0,0); +} +set_Value ("RatioOperand", RatioOperand); +} +/** Get Operand. +@return Ratio Operand */ +public String getRatioOperand() +{ +return (String)get_Value("RatioOperand"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_Report.java b/dbPort/src/org/compiere/model/X_PA_Report.java new file mode 100644 index 0000000000..1be796452e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_Report.java @@ -0,0 +1,282 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_Report + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.484 */ +public class X_PA_Report extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_Report_ID id +@param trxName transaction +*/ +public X_PA_Report (Properties ctx, int PA_Report_ID, String trxName) +{ +super (ctx, PA_Report_ID, trxName); +/** if (PA_Report_ID == 0) +{ +setC_AcctSchema_ID (0); +setC_Calendar_ID (0); +setListSources (false); +setListTrx (false); +setName (null); +setPA_ReportColumnSet_ID (0); +setPA_ReportLineSet_ID (0); +setPA_Report_ID (0); +setProcessing (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_Report (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=445 */ +public static final int Table_ID=445; + +/** TableName=PA_Report */ +public static final String Table_Name="PA_Report"; + +protected static KeyNamePair Model = new KeyNamePair(445,"PA_Report"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_Report[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Print Format. +@param AD_PrintFormat_ID Data Print Format */ +public void setAD_PrintFormat_ID (int AD_PrintFormat_ID) +{ +if (AD_PrintFormat_ID <= 0) set_Value ("AD_PrintFormat_ID", null); + else +set_Value ("AD_PrintFormat_ID", new Integer(AD_PrintFormat_ID)); +} +/** Get Print Format. +@return Data Print Format */ +public int getAD_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("AD_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounting Schema. +@param C_AcctSchema_ID Rules for accounting */ +public void setC_AcctSchema_ID (int C_AcctSchema_ID) +{ +if (C_AcctSchema_ID < 1) throw new IllegalArgumentException ("C_AcctSchema_ID is mandatory."); +set_Value ("C_AcctSchema_ID", new Integer(C_AcctSchema_ID)); +} +/** Get Accounting Schema. +@return Rules for accounting */ +public int getC_AcctSchema_ID() +{ +Integer ii = (Integer)get_Value("C_AcctSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Calendar. +@param C_Calendar_ID Accounting Calendar Name */ +public void setC_Calendar_ID (int C_Calendar_ID) +{ +if (C_Calendar_ID < 1) throw new IllegalArgumentException ("C_Calendar_ID is mandatory."); +set_Value ("C_Calendar_ID", new Integer(C_Calendar_ID)); +} +/** Get Calendar. +@return Accounting Calendar Name */ +public int getC_Calendar_ID() +{ +Integer ii = (Integer)get_Value("C_Calendar_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set List Sources. +@param ListSources List Report Line Sources */ +public void setListSources (boolean ListSources) +{ +set_Value ("ListSources", new Boolean(ListSources)); +} +/** Get List Sources. +@return List Report Line Sources */ +public boolean isListSources() +{ +Object oo = get_Value("ListSources"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set List Transactions. +@param ListTrx List the report transactions */ +public void setListTrx (boolean ListTrx) +{ +set_Value ("ListTrx", new Boolean(ListTrx)); +} +/** Get List Transactions. +@return List the report transactions */ +public boolean isListTrx() +{ +Object oo = get_Value("ListTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Report Column Set. +@param PA_ReportColumnSet_ID Collection of Columns for Report */ +public void setPA_ReportColumnSet_ID (int PA_ReportColumnSet_ID) +{ +if (PA_ReportColumnSet_ID < 1) throw new IllegalArgumentException ("PA_ReportColumnSet_ID is mandatory."); +set_Value ("PA_ReportColumnSet_ID", new Integer(PA_ReportColumnSet_ID)); +} +/** Get Report Column Set. +@return Collection of Columns for Report */ +public int getPA_ReportColumnSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportColumnSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Line Set. +@param PA_ReportLineSet_ID Report Line Set */ +public void setPA_ReportLineSet_ID (int PA_ReportLineSet_ID) +{ +if (PA_ReportLineSet_ID < 1) throw new IllegalArgumentException ("PA_ReportLineSet_ID is mandatory."); +set_Value ("PA_ReportLineSet_ID", new Integer(PA_ReportLineSet_ID)); +} +/** Get Report Line Set. +@return Report Line Set */ +public int getPA_ReportLineSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLineSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Financial Report. +@param PA_Report_ID Financial Report */ +public void setPA_Report_ID (int PA_Report_ID) +{ +if (PA_Report_ID < 1) throw new IllegalArgumentException ("PA_Report_ID is mandatory."); +set_ValueNoCheck ("PA_Report_ID", new Integer(PA_Report_ID)); +} +/** Get Financial Report. +@return Financial Report */ +public int getPA_Report_ID() +{ +Integer ii = (Integer)get_Value("PA_Report_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_ReportColumn.java b/dbPort/src/org/compiere/model/X_PA_ReportColumn.java new file mode 100644 index 0000000000..61f50048bc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_ReportColumn.java @@ -0,0 +1,670 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_ReportColumn + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.5 */ +public class X_PA_ReportColumn extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_ReportColumn_ID id +@param trxName transaction +*/ +public X_PA_ReportColumn (Properties ctx, int PA_ReportColumn_ID, String trxName) +{ +super (ctx, PA_ReportColumn_ID, trxName); +/** if (PA_ReportColumn_ID == 0) +{ +setColumnType (null); // R +setIsPrinted (true); // Y +setName (null); +setPA_ReportColumnSet_ID (0); +setPA_ReportColumn_ID (0); +setPostingType (null); // A +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM PA_ReportColumn WHERE PA_ReportColumnSet_ID=@PA_ReportColumnSet_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_ReportColumn (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=446 */ +public static final int Table_ID=446; + +/** TableName=PA_ReportColumn */ +public static final String Table_Name="PA_ReportColumn"; + +protected static KeyNamePair Model = new KeyNamePair(446,"PA_ReportColumn"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_ReportColumn[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AmountType AD_Reference_ID=235 */ +public static final int AMOUNTTYPE_AD_Reference_ID=235; +/** Period Balance = BP */ +public static final String AMOUNTTYPE_PeriodBalance = "BP"; +/** Total Balance = BT */ +public static final String AMOUNTTYPE_TotalBalance = "BT"; +/** Year Balance = BY */ +public static final String AMOUNTTYPE_YearBalance = "BY"; +/** Period Credit Only = CP */ +public static final String AMOUNTTYPE_PeriodCreditOnly = "CP"; +/** Total Credit Only = CT */ +public static final String AMOUNTTYPE_TotalCreditOnly = "CT"; +/** Year Credit Only = CY */ +public static final String AMOUNTTYPE_YearCreditOnly = "CY"; +/** Period Debit Only = DP */ +public static final String AMOUNTTYPE_PeriodDebitOnly = "DP"; +/** Total Debit Only = DT */ +public static final String AMOUNTTYPE_TotalDebitOnly = "DT"; +/** Year Debit Only = DY */ +public static final String AMOUNTTYPE_YearDebitOnly = "DY"; +/** Period Quantity = QP */ +public static final String AMOUNTTYPE_PeriodQuantity = "QP"; +/** Total Quantity = QT */ +public static final String AMOUNTTYPE_TotalQuantity = "QT"; +/** Year Quantity = QY */ +public static final String AMOUNTTYPE_YearQuantity = "QY"; +/** Set Amount Type. +@param AmountType Type of amount to report */ +public void setAmountType (String AmountType) +{ +if (AmountType == null) throw new IllegalArgumentException ("AmountType is mandatory"); +if (AmountType == null || AmountType.equals("BP") || AmountType.equals("BT") || AmountType.equals("BY") || AmountType.equals("CP") || AmountType.equals("CT") || AmountType.equals("CY") || AmountType.equals("DP") || AmountType.equals("DT") || AmountType.equals("DY") || AmountType.equals("QP") || AmountType.equals("QT") || AmountType.equals("QY")); + else throw new IllegalArgumentException ("AmountType Invalid value - " + AmountType + " - Reference_ID=235 - BP - BT - BY - CP - CT - CY - DP - DT - DY - QP - QT - QY"); +if (AmountType != null && AmountType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +AmountType = AmountType.substring(0,1); +} +set_Value ("AmountType", AmountType); +} +/** Get Amount Type. +@return Type of amount to report */ +public String getAmountType() +{ +return (String)get_Value("AmountType"); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID <= 0) set_Value ("C_ElementValue_ID", null); + else +set_Value ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** CalculationType AD_Reference_ID=236 */ +public static final int CALCULATIONTYPE_AD_Reference_ID=236; +/** Add (Op1+Op2) = A */ +public static final String CALCULATIONTYPE_AddOp1PlusOp2 = "A"; +/** Percentage (Op1 of Op2) = P */ +public static final String CALCULATIONTYPE_PercentageOp1OfOp2 = "P"; +/** Add Range (Op1 to Op2) = R */ +public static final String CALCULATIONTYPE_AddRangeOp1ToOp2 = "R"; +/** Subtract (Op1-Op2) = S */ +public static final String CALCULATIONTYPE_SubtractOp1_Op2 = "S"; +/** Set Calculation. +@param CalculationType Calculation */ +public void setCalculationType (String CalculationType) +{ +if (CalculationType == null) throw new IllegalArgumentException ("CalculationType is mandatory"); +if (CalculationType == null || CalculationType.equals("A") || CalculationType.equals("P") || CalculationType.equals("R") || CalculationType.equals("S")); + else throw new IllegalArgumentException ("CalculationType Invalid value - " + CalculationType + " - Reference_ID=236 - A - P - R - S"); +if (CalculationType != null && CalculationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CalculationType = CalculationType.substring(0,0); +} +set_Value ("CalculationType", CalculationType); +} +/** Get Calculation. +@return Calculation */ +public String getCalculationType() +{ +return (String)get_Value("CalculationType"); +} + +/** ColumnType AD_Reference_ID=237 */ +public static final int COLUMNTYPE_AD_Reference_ID=237; +/** Calculation = C */ +public static final String COLUMNTYPE_Calculation = "C"; +/** Relative Period = R */ +public static final String COLUMNTYPE_RelativePeriod = "R"; +/** Segment Value = S */ +public static final String COLUMNTYPE_SegmentValue = "S"; +/** Set Column Type. +@param ColumnType Column Type */ +public void setColumnType (String ColumnType) +{ +if (ColumnType == null) throw new IllegalArgumentException ("ColumnType is mandatory"); +if (ColumnType.equals("C") || ColumnType.equals("R") || ColumnType.equals("S")); + else throw new IllegalArgumentException ("ColumnType Invalid value - " + ColumnType + " - Reference_ID=237 - C - R - S"); +if (ColumnType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ColumnType = ColumnType.substring(0,0); +} +set_Value ("ColumnType", ColumnType); +} +/** Get Column Type. +@return Column Type */ +public String getColumnType() +{ +return (String)get_Value("ColumnType"); +} + +/** CurrencyType AD_Reference_ID=238 */ +public static final int CURRENCYTYPE_AD_Reference_ID=238; +/** Accounting Currency = A */ +public static final String CURRENCYTYPE_AccountingCurrency = "A"; +/** Source Currency = S */ +public static final String CURRENCYTYPE_SourceCurrency = "S"; +/** Set Currency Type. +@param CurrencyType Currency Type */ +public void setCurrencyType (String CurrencyType) +{ +if (CurrencyType == null) throw new IllegalArgumentException ("CurrencyType is mandatory"); +if (CurrencyType == null || CurrencyType.equals("A") || CurrencyType.equals("S")); + else throw new IllegalArgumentException ("CurrencyType Invalid value - " + CurrencyType + " - Reference_ID=238 - A - S"); +if (CurrencyType != null && CurrencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CurrencyType = CurrencyType.substring(0,0); +} +set_Value ("CurrencyType", CurrencyType); +} +/** Get Currency Type. +@return Currency Type */ +public String getCurrencyType() +{ +return (String)get_Value("CurrencyType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** ElementType AD_Reference_ID=181 */ +public static final int ELEMENTTYPE_AD_Reference_ID=181; +/** Account = AC */ +public static final String ELEMENTTYPE_Account = "AC"; +/** Activity = AY */ +public static final String ELEMENTTYPE_Activity = "AY"; +/** BPartner = BP */ +public static final String ELEMENTTYPE_BPartner = "BP"; +/** Location From = LF */ +public static final String ELEMENTTYPE_LocationFrom = "LF"; +/** Location To = LT */ +public static final String ELEMENTTYPE_LocationTo = "LT"; +/** Campaign = MC */ +public static final String ELEMENTTYPE_Campaign = "MC"; +/** Organization = OO */ +public static final String ELEMENTTYPE_Organization = "OO"; +/** Org Trx = OT */ +public static final String ELEMENTTYPE_OrgTrx = "OT"; +/** Project = PJ */ +public static final String ELEMENTTYPE_Project = "PJ"; +/** Product = PR */ +public static final String ELEMENTTYPE_Product = "PR"; +/** Sub Account = SA */ +public static final String ELEMENTTYPE_SubAccount = "SA"; +/** Sales Region = SR */ +public static final String ELEMENTTYPE_SalesRegion = "SR"; +/** User List 1 = U1 */ +public static final String ELEMENTTYPE_UserList1 = "U1"; +/** User List 2 = U2 */ +public static final String ELEMENTTYPE_UserList2 = "U2"; +/** User Element 1 = X1 */ +public static final String ELEMENTTYPE_UserElement1 = "X1"; +/** User Element 2 = X2 */ +public static final String ELEMENTTYPE_UserElement2 = "X2"; +/** Set Type. +@param ElementType Element Type (account or user defined) */ +public void setElementType (String ElementType) +{ +if (ElementType == null) throw new IllegalArgumentException ("ElementType is mandatory"); +if (ElementType == null || ElementType.equals("AC") || ElementType.equals("AY") || ElementType.equals("BP") || ElementType.equals("LF") || ElementType.equals("LT") || ElementType.equals("MC") || ElementType.equals("OO") || ElementType.equals("OT") || ElementType.equals("PJ") || ElementType.equals("PR") || ElementType.equals("SA") || ElementType.equals("SR") || ElementType.equals("U1") || ElementType.equals("U2") || ElementType.equals("X1") || ElementType.equals("X2")); + else throw new IllegalArgumentException ("ElementType Invalid value - " + ElementType + " - Reference_ID=181 - AC - AY - BP - LF - LT - MC - OO - OT - PJ - PR - SA - SR - U1 - U2 - X1 - X2"); +if (ElementType != null && ElementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +ElementType = ElementType.substring(0,1); +} +set_Value ("ElementType", ElementType); +} +/** Get Type. +@return Element Type (account or user defined) */ +public String getElementType() +{ +return (String)get_Value("ElementType"); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID <= 0) set_Value ("GL_Budget_ID", null); + else +set_Value ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Adhoc Conversion. +@param IsAdhocConversion Perform conversion for all amounts to currency */ +public void setIsAdhocConversion (boolean IsAdhocConversion) +{ +set_Value ("IsAdhocConversion", new Boolean(IsAdhocConversion)); +} +/** Get Adhoc Conversion. +@return Perform conversion for all amounts to currency */ +public boolean isAdhocConversion() +{ +Object oo = get_Value("IsAdhocConversion"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Oper_1_ID AD_Reference_ID=239 */ +public static final int OPER_1_ID_AD_Reference_ID=239; +/** Set Operand 1. +@param Oper_1_ID First operand for calculation */ +public void setOper_1_ID (int Oper_1_ID) +{ +if (Oper_1_ID <= 0) set_Value ("Oper_1_ID", null); + else +set_Value ("Oper_1_ID", new Integer(Oper_1_ID)); +} +/** Get Operand 1. +@return First operand for calculation */ +public int getOper_1_ID() +{ +Integer ii = (Integer)get_Value("Oper_1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Oper_2_ID AD_Reference_ID=239 */ +public static final int OPER_2_ID_AD_Reference_ID=239; +/** Set Operand 2. +@param Oper_2_ID Second operand for calculation */ +public void setOper_2_ID (int Oper_2_ID) +{ +if (Oper_2_ID <= 0) set_Value ("Oper_2_ID", null); + else +set_Value ("Oper_2_ID", new Integer(Oper_2_ID)); +} +/** Get Operand 2. +@return Second operand for calculation */ +public int getOper_2_ID() +{ +Integer ii = (Integer)get_Value("Oper_2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Org_ID AD_Reference_ID=130 */ +public static final int ORG_ID_AD_Reference_ID=130; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID <= 0) set_Value ("Org_ID", null); + else +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Column Set. +@param PA_ReportColumnSet_ID Collection of Columns for Report */ +public void setPA_ReportColumnSet_ID (int PA_ReportColumnSet_ID) +{ +if (PA_ReportColumnSet_ID < 1) throw new IllegalArgumentException ("PA_ReportColumnSet_ID is mandatory."); +set_ValueNoCheck ("PA_ReportColumnSet_ID", new Integer(PA_ReportColumnSet_ID)); +} +/** Get Report Column Set. +@return Collection of Columns for Report */ +public int getPA_ReportColumnSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportColumnSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Column. +@param PA_ReportColumn_ID Column in Report */ +public void setPA_ReportColumn_ID (int PA_ReportColumn_ID) +{ +if (PA_ReportColumn_ID < 1) throw new IllegalArgumentException ("PA_ReportColumn_ID is mandatory."); +set_ValueNoCheck ("PA_ReportColumn_ID", new Integer(PA_ReportColumn_ID)); +} +/** Get Report Column. +@return Column in Report */ +public int getPA_ReportColumn_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportColumn_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Relative Period. +@param RelativePeriod Period offset (0 is current) */ +public void setRelativePeriod (BigDecimal RelativePeriod) +{ +set_Value ("RelativePeriod", RelativePeriod); +} +/** Get Relative Period. +@return Period offset (0 is current) */ +public BigDecimal getRelativePeriod() +{ +BigDecimal bd = (BigDecimal)get_Value("RelativePeriod"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_ReportColumnSet.java b/dbPort/src/org/compiere/model/X_PA_ReportColumnSet.java new file mode 100644 index 0000000000..eaaf0101ee --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_ReportColumnSet.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_ReportColumnSet + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.609 */ +public class X_PA_ReportColumnSet extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_ReportColumnSet_ID id +@param trxName transaction +*/ +public X_PA_ReportColumnSet (Properties ctx, int PA_ReportColumnSet_ID, String trxName) +{ +super (ctx, PA_ReportColumnSet_ID, trxName); +/** if (PA_ReportColumnSet_ID == 0) +{ +setName (null); +setPA_ReportColumnSet_ID (0); +setProcessing (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_ReportColumnSet (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=447 */ +public static final int Table_ID=447; + +/** TableName=PA_ReportColumnSet */ +public static final String Table_Name="PA_ReportColumnSet"; + +protected static KeyNamePair Model = new KeyNamePair(447,"PA_ReportColumnSet"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_ReportColumnSet[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Report Column Set. +@param PA_ReportColumnSet_ID Collection of Columns for Report */ +public void setPA_ReportColumnSet_ID (int PA_ReportColumnSet_ID) +{ +if (PA_ReportColumnSet_ID < 1) throw new IllegalArgumentException ("PA_ReportColumnSet_ID is mandatory."); +set_ValueNoCheck ("PA_ReportColumnSet_ID", new Integer(PA_ReportColumnSet_ID)); +} +/** Get Report Column Set. +@return Collection of Columns for Report */ +public int getPA_ReportColumnSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportColumnSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_ReportLine.java b/dbPort/src/org/compiere/model/X_PA_ReportLine.java new file mode 100644 index 0000000000..188cec9966 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_ReportLine.java @@ -0,0 +1,390 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_ReportLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.625 */ +public class X_PA_ReportLine extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_ReportLine_ID id +@param trxName transaction +*/ +public X_PA_ReportLine (Properties ctx, int PA_ReportLine_ID, String trxName) +{ +super (ctx, PA_ReportLine_ID, trxName); +/** if (PA_ReportLine_ID == 0) +{ +setIsPrinted (true); // Y +setLineType (null); +setName (null); +setPA_ReportLineSet_ID (0); +setPA_ReportLine_ID (0); +setSeqNo (0); // @SQL=SELECT NVL(MAX(SeqNo),0)+10 AS DefaultValue FROM PA_ReportLine WHERE PA_ReportLineSet_ID=@PA_ReportLineSet_ID@ +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_ReportLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=448 */ +public static final int Table_ID=448; + +/** TableName=PA_ReportLine */ +public static final String Table_Name="PA_ReportLine"; + +protected static KeyNamePair Model = new KeyNamePair(448,"PA_ReportLine"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_ReportLine[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AmountType AD_Reference_ID=235 */ +public static final int AMOUNTTYPE_AD_Reference_ID=235; +/** Period Balance = BP */ +public static final String AMOUNTTYPE_PeriodBalance = "BP"; +/** Total Balance = BT */ +public static final String AMOUNTTYPE_TotalBalance = "BT"; +/** Year Balance = BY */ +public static final String AMOUNTTYPE_YearBalance = "BY"; +/** Period Credit Only = CP */ +public static final String AMOUNTTYPE_PeriodCreditOnly = "CP"; +/** Total Credit Only = CT */ +public static final String AMOUNTTYPE_TotalCreditOnly = "CT"; +/** Year Credit Only = CY */ +public static final String AMOUNTTYPE_YearCreditOnly = "CY"; +/** Period Debit Only = DP */ +public static final String AMOUNTTYPE_PeriodDebitOnly = "DP"; +/** Total Debit Only = DT */ +public static final String AMOUNTTYPE_TotalDebitOnly = "DT"; +/** Year Debit Only = DY */ +public static final String AMOUNTTYPE_YearDebitOnly = "DY"; +/** Period Quantity = QP */ +public static final String AMOUNTTYPE_PeriodQuantity = "QP"; +/** Total Quantity = QT */ +public static final String AMOUNTTYPE_TotalQuantity = "QT"; +/** Year Quantity = QY */ +public static final String AMOUNTTYPE_YearQuantity = "QY"; +/** Set Amount Type. +@param AmountType Type of amount to report */ +public void setAmountType (String AmountType) +{ +if (AmountType == null) throw new IllegalArgumentException ("AmountType is mandatory"); +if (AmountType == null || AmountType.equals("BP") || AmountType.equals("BT") || AmountType.equals("BY") || AmountType.equals("CP") || AmountType.equals("CT") || AmountType.equals("CY") || AmountType.equals("DP") || AmountType.equals("DT") || AmountType.equals("DY") || AmountType.equals("QP") || AmountType.equals("QT") || AmountType.equals("QY")); + else throw new IllegalArgumentException ("AmountType Invalid value - " + AmountType + " - Reference_ID=235 - BP - BT - BY - CP - CT - CY - DP - DT - DY - QP - QT - QY"); +if (AmountType != null && AmountType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +AmountType = AmountType.substring(0,1); +} +set_Value ("AmountType", AmountType); +} +/** Get Amount Type. +@return Type of amount to report */ +public String getAmountType() +{ +return (String)get_Value("AmountType"); +} + +/** CalculationType AD_Reference_ID=236 */ +public static final int CALCULATIONTYPE_AD_Reference_ID=236; +/** Add (Op1+Op2) = A */ +public static final String CALCULATIONTYPE_AddOp1PlusOp2 = "A"; +/** Percentage (Op1 of Op2) = P */ +public static final String CALCULATIONTYPE_PercentageOp1OfOp2 = "P"; +/** Add Range (Op1 to Op2) = R */ +public static final String CALCULATIONTYPE_AddRangeOp1ToOp2 = "R"; +/** Subtract (Op1-Op2) = S */ +public static final String CALCULATIONTYPE_SubtractOp1_Op2 = "S"; +/** Set Calculation. +@param CalculationType Calculation */ +public void setCalculationType (String CalculationType) +{ +if (CalculationType == null) throw new IllegalArgumentException ("CalculationType is mandatory"); +if (CalculationType == null || CalculationType.equals("A") || CalculationType.equals("P") || CalculationType.equals("R") || CalculationType.equals("S")); + else throw new IllegalArgumentException ("CalculationType Invalid value - " + CalculationType + " - Reference_ID=236 - A - P - R - S"); +if (CalculationType != null && CalculationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CalculationType = CalculationType.substring(0,0); +} +set_Value ("CalculationType", CalculationType); +} +/** Get Calculation. +@return Calculation */ +public String getCalculationType() +{ +return (String)get_Value("CalculationType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Budget. +@param GL_Budget_ID General Ledger Budget */ +public void setGL_Budget_ID (int GL_Budget_ID) +{ +if (GL_Budget_ID <= 0) set_Value ("GL_Budget_ID", null); + else +set_Value ("GL_Budget_ID", new Integer(GL_Budget_ID)); +} +/** Get Budget. +@return General Ledger Budget */ +public int getGL_Budget_ID() +{ +Integer ii = (Integer)get_Value("GL_Budget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Printed. +@param IsPrinted Indicates if this document / line is printed */ +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", new Boolean(IsPrinted)); +} +/** Get Printed. +@return Indicates if this document / line is printed */ +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** LineType AD_Reference_ID=241 */ +public static final int LINETYPE_AD_Reference_ID=241; +/** Calculation = C */ +public static final String LINETYPE_Calculation = "C"; +/** Segment Value = S */ +public static final String LINETYPE_SegmentValue = "S"; +/** Set Line Type. +@param LineType Line Type */ +public void setLineType (String LineType) +{ +if (LineType == null) throw new IllegalArgumentException ("LineType is mandatory"); +if (LineType.equals("C") || LineType.equals("S")); + else throw new IllegalArgumentException ("LineType Invalid value - " + LineType + " - Reference_ID=241 - C - S"); +if (LineType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +LineType = LineType.substring(0,0); +} +set_Value ("LineType", LineType); +} +/** Get Line Type. +@return Line Type */ +public String getLineType() +{ +return (String)get_Value("LineType"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** Oper_1_ID AD_Reference_ID=240 */ +public static final int OPER_1_ID_AD_Reference_ID=240; +/** Set Operand 1. +@param Oper_1_ID First operand for calculation */ +public void setOper_1_ID (int Oper_1_ID) +{ +if (Oper_1_ID <= 0) set_Value ("Oper_1_ID", null); + else +set_Value ("Oper_1_ID", new Integer(Oper_1_ID)); +} +/** Get Operand 1. +@return First operand for calculation */ +public int getOper_1_ID() +{ +Integer ii = (Integer)get_Value("Oper_1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Oper_2_ID AD_Reference_ID=240 */ +public static final int OPER_2_ID_AD_Reference_ID=240; +/** Set Operand 2. +@param Oper_2_ID Second operand for calculation */ +public void setOper_2_ID (int Oper_2_ID) +{ +if (Oper_2_ID <= 0) set_Value ("Oper_2_ID", null); + else +set_Value ("Oper_2_ID", new Integer(Oper_2_ID)); +} +/** Get Operand 2. +@return Second operand for calculation */ +public int getOper_2_ID() +{ +Integer ii = (Integer)get_Value("Oper_2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Line Set. +@param PA_ReportLineSet_ID Report Line Set */ +public void setPA_ReportLineSet_ID (int PA_ReportLineSet_ID) +{ +if (PA_ReportLineSet_ID < 1) throw new IllegalArgumentException ("PA_ReportLineSet_ID is mandatory."); +set_ValueNoCheck ("PA_ReportLineSet_ID", new Integer(PA_ReportLineSet_ID)); +} +/** Get Report Line Set. +@return Report Line Set */ +public int getPA_ReportLineSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLineSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Line. +@param PA_ReportLine_ID Report Line */ +public void setPA_ReportLine_ID (int PA_ReportLine_ID) +{ +if (PA_ReportLine_ID < 1) throw new IllegalArgumentException ("PA_ReportLine_ID is mandatory."); +set_ValueNoCheck ("PA_ReportLine_ID", new Integer(PA_ReportLine_ID)); +} +/** Get Report Line. +@return Report Line */ +public int getPA_ReportLine_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PostingType AD_Reference_ID=125 */ +public static final int POSTINGTYPE_AD_Reference_ID=125; +/** Actual = A */ +public static final String POSTINGTYPE_Actual = "A"; +/** Budget = B */ +public static final String POSTINGTYPE_Budget = "B"; +/** Commitment = E */ +public static final String POSTINGTYPE_Commitment = "E"; +/** Reservation = R */ +public static final String POSTINGTYPE_Reservation = "R"; +/** Statistical = S */ +public static final String POSTINGTYPE_Statistical = "S"; +/** Set PostingType. +@param PostingType The type of posted amount for the transaction */ +public void setPostingType (String PostingType) +{ +if (PostingType == null) throw new IllegalArgumentException ("PostingType is mandatory"); +if (PostingType == null || PostingType.equals("A") || PostingType.equals("B") || PostingType.equals("E") || PostingType.equals("R") || PostingType.equals("S")); + else throw new IllegalArgumentException ("PostingType Invalid value - " + PostingType + " - Reference_ID=125 - A - B - E - R - S"); +if (PostingType != null && PostingType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PostingType = PostingType.substring(0,0); +} +set_Value ("PostingType", PostingType); +} +/** Get PostingType. +@return The type of posted amount for the transaction */ +public String getPostingType() +{ +return (String)get_Value("PostingType"); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_ReportLineSet.java b/dbPort/src/org/compiere/model/X_PA_ReportLineSet.java new file mode 100644 index 0000000000..3659d2da99 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_ReportLineSet.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_ReportLineSet + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.656 */ +public class X_PA_ReportLineSet extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_ReportLineSet_ID id +@param trxName transaction +*/ +public X_PA_ReportLineSet (Properties ctx, int PA_ReportLineSet_ID, String trxName) +{ +super (ctx, PA_ReportLineSet_ID, trxName); +/** if (PA_ReportLineSet_ID == 0) +{ +setName (null); +setPA_ReportLineSet_ID (0); +setProcessing (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_ReportLineSet (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=449 */ +public static final int Table_ID=449; + +/** TableName=PA_ReportLineSet */ +public static final String Table_Name="PA_ReportLineSet"; + +protected static KeyNamePair Model = new KeyNamePair(449,"PA_ReportLineSet"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_ReportLineSet[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Report Line Set. +@param PA_ReportLineSet_ID Report Line Set */ +public void setPA_ReportLineSet_ID (int PA_ReportLineSet_ID) +{ +if (PA_ReportLineSet_ID < 1) throw new IllegalArgumentException ("PA_ReportLineSet_ID is mandatory."); +set_ValueNoCheck ("PA_ReportLineSet_ID", new Integer(PA_ReportLineSet_ID)); +} +/** Get Report Line Set. +@return Report Line Set */ +public int getPA_ReportLineSet_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLineSet_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_ReportSource.java b/dbPort/src/org/compiere/model/X_PA_ReportSource.java new file mode 100644 index 0000000000..3bc1e5bdd0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_ReportSource.java @@ -0,0 +1,348 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_ReportSource + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.656 */ +public class X_PA_ReportSource extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_ReportSource_ID id +@param trxName transaction +*/ +public X_PA_ReportSource (Properties ctx, int PA_ReportSource_ID, String trxName) +{ +super (ctx, PA_ReportSource_ID, trxName); +/** if (PA_ReportSource_ID == 0) +{ +setElementType (null); +setPA_ReportLine_ID (0); +setPA_ReportSource_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_ReportSource (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=450 */ +public static final int Table_ID=450; + +/** TableName=PA_ReportSource */ +public static final String Table_Name="PA_ReportSource"; + +protected static KeyNamePair Model = new KeyNamePair(450,"PA_ReportSource"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_ReportSource[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_ElementValue_ID AD_Reference_ID=182 */ +public static final int C_ELEMENTVALUE_ID_AD_Reference_ID=182; +/** Set Account Element. +@param C_ElementValue_ID Account Element */ +public void setC_ElementValue_ID (int C_ElementValue_ID) +{ +if (C_ElementValue_ID <= 0) set_Value ("C_ElementValue_ID", null); + else +set_Value ("C_ElementValue_ID", new Integer(C_ElementValue_ID)); +} +/** Get Account Element. +@return Account Element */ +public int getC_ElementValue_ID() +{ +Integer ii = (Integer)get_Value("C_ElementValue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Region. +@param C_SalesRegion_ID Sales coverage region */ +public void setC_SalesRegion_ID (int C_SalesRegion_ID) +{ +if (C_SalesRegion_ID <= 0) set_Value ("C_SalesRegion_ID", null); + else +set_Value ("C_SalesRegion_ID", new Integer(C_SalesRegion_ID)); +} +/** Get Sales Region. +@return Sales coverage region */ +public int getC_SalesRegion_ID() +{ +Integer ii = (Integer)get_Value("C_SalesRegion_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** ElementType AD_Reference_ID=181 */ +public static final int ELEMENTTYPE_AD_Reference_ID=181; +/** Account = AC */ +public static final String ELEMENTTYPE_Account = "AC"; +/** Activity = AY */ +public static final String ELEMENTTYPE_Activity = "AY"; +/** BPartner = BP */ +public static final String ELEMENTTYPE_BPartner = "BP"; +/** Location From = LF */ +public static final String ELEMENTTYPE_LocationFrom = "LF"; +/** Location To = LT */ +public static final String ELEMENTTYPE_LocationTo = "LT"; +/** Campaign = MC */ +public static final String ELEMENTTYPE_Campaign = "MC"; +/** Organization = OO */ +public static final String ELEMENTTYPE_Organization = "OO"; +/** Org Trx = OT */ +public static final String ELEMENTTYPE_OrgTrx = "OT"; +/** Project = PJ */ +public static final String ELEMENTTYPE_Project = "PJ"; +/** Product = PR */ +public static final String ELEMENTTYPE_Product = "PR"; +/** Sub Account = SA */ +public static final String ELEMENTTYPE_SubAccount = "SA"; +/** Sales Region = SR */ +public static final String ELEMENTTYPE_SalesRegion = "SR"; +/** User List 1 = U1 */ +public static final String ELEMENTTYPE_UserList1 = "U1"; +/** User List 2 = U2 */ +public static final String ELEMENTTYPE_UserList2 = "U2"; +/** User Element 1 = X1 */ +public static final String ELEMENTTYPE_UserElement1 = "X1"; +/** User Element 2 = X2 */ +public static final String ELEMENTTYPE_UserElement2 = "X2"; +/** Set Type. +@param ElementType Element Type (account or user defined) */ +public void setElementType (String ElementType) +{ +if (ElementType == null) throw new IllegalArgumentException ("ElementType is mandatory"); +if (ElementType.equals("AC") || ElementType.equals("AY") || ElementType.equals("BP") || ElementType.equals("LF") || ElementType.equals("LT") || ElementType.equals("MC") || ElementType.equals("OO") || ElementType.equals("OT") || ElementType.equals("PJ") || ElementType.equals("PR") || ElementType.equals("SA") || ElementType.equals("SR") || ElementType.equals("U1") || ElementType.equals("U2") || ElementType.equals("X1") || ElementType.equals("X2")); + else throw new IllegalArgumentException ("ElementType Invalid value - " + ElementType + " - Reference_ID=181 - AC - AY - BP - LF - LT - MC - OO - OT - PJ - PR - SA - SR - U1 - U2 - X1 - X2"); +if (ElementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +ElementType = ElementType.substring(0,1); +} +set_Value ("ElementType", ElementType); +} +/** Get Type. +@return Element Type (account or user defined) */ +public String getElementType() +{ +return (String)get_Value("ElementType"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getElementType())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Org_ID AD_Reference_ID=322 */ +public static final int ORG_ID_AD_Reference_ID=322; +/** Set Organization. +@param Org_ID Organizational entity within client */ +public void setOrg_ID (int Org_ID) +{ +if (Org_ID <= 0) set_Value ("Org_ID", null); + else +set_Value ("Org_ID", new Integer(Org_ID)); +} +/** Get Organization. +@return Organizational entity within client */ +public int getOrg_ID() +{ +Integer ii = (Integer)get_Value("Org_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Line. +@param PA_ReportLine_ID Report Line */ +public void setPA_ReportLine_ID (int PA_ReportLine_ID) +{ +if (PA_ReportLine_ID < 1) throw new IllegalArgumentException ("PA_ReportLine_ID is mandatory."); +set_ValueNoCheck ("PA_ReportLine_ID", new Integer(PA_ReportLine_ID)); +} +/** Get Report Line. +@return Report Line */ +public int getPA_ReportLine_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Source. +@param PA_ReportSource_ID Restriction of what will be shown in Report Line */ +public void setPA_ReportSource_ID (int PA_ReportSource_ID) +{ +if (PA_ReportSource_ID < 1) throw new IllegalArgumentException ("PA_ReportSource_ID is mandatory."); +set_ValueNoCheck ("PA_ReportSource_ID", new Integer(PA_ReportSource_ID)); +} +/** Get Report Source. +@return Restriction of what will be shown in Report Line */ +public int getPA_ReportSource_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportSource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_SLA_Criteria.java b/dbPort/src/org/compiere/model/X_PA_SLA_Criteria.java new file mode 100644 index 0000000000..bb301461be --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_SLA_Criteria.java @@ -0,0 +1,198 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_SLA_Criteria + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.671 */ +public class X_PA_SLA_Criteria extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_SLA_Criteria_ID id +@param trxName transaction +*/ +public X_PA_SLA_Criteria (Properties ctx, int PA_SLA_Criteria_ID, String trxName) +{ +super (ctx, PA_SLA_Criteria_ID, trxName); +/** if (PA_SLA_Criteria_ID == 0) +{ +setIsManual (true); // Y +setName (null); +setPA_SLA_Criteria_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_SLA_Criteria (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=744 */ +public static final int Table_ID=744; + +/** TableName=PA_SLA_Criteria */ +public static final String Table_Name="PA_SLA_Criteria"; + +protected static KeyNamePair Model = new KeyNamePair(744,"PA_SLA_Criteria"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_SLA_Criteria[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Classname. +@param Classname Java Classname */ +public void setClassname (String Classname) +{ +if (Classname != null && Classname.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Classname = Classname.substring(0,59); +} +set_Value ("Classname", Classname); +} +/** Get Classname. +@return Java Classname */ +public String getClassname() +{ +return (String)get_Value("Classname"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Manual. +@param IsManual This is a manual process */ +public void setIsManual (boolean IsManual) +{ +set_Value ("IsManual", new Boolean(IsManual)); +} +/** Get Manual. +@return This is a manual process */ +public boolean isManual() +{ +Object oo = get_Value("IsManual"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set SLA Criteria. +@param PA_SLA_Criteria_ID Service Level Agreement Criteria */ +public void setPA_SLA_Criteria_ID (int PA_SLA_Criteria_ID) +{ +if (PA_SLA_Criteria_ID < 1) throw new IllegalArgumentException ("PA_SLA_Criteria_ID is mandatory."); +set_ValueNoCheck ("PA_SLA_Criteria_ID", new Integer(PA_SLA_Criteria_ID)); +} +/** Get SLA Criteria. +@return Service Level Agreement Criteria */ +public int getPA_SLA_Criteria_ID() +{ +Integer ii = (Integer)get_Value("PA_SLA_Criteria_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_SLA_Goal.java b/dbPort/src/org/compiere/model/X_PA_SLA_Goal.java new file mode 100644 index 0000000000..856ac92a75 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_SLA_Goal.java @@ -0,0 +1,299 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_SLA_Goal + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.687 */ +public class X_PA_SLA_Goal extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_SLA_Goal_ID id +@param trxName transaction +*/ +public X_PA_SLA_Goal (Properties ctx, int PA_SLA_Goal_ID, String trxName) +{ +super (ctx, PA_SLA_Goal_ID, trxName); +/** if (PA_SLA_Goal_ID == 0) +{ +setC_BPartner_ID (0); +setMeasureActual (Env.ZERO); +setMeasureTarget (Env.ZERO); +setName (null); +setPA_SLA_Criteria_ID (0); +setPA_SLA_Goal_ID (0); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_SLA_Goal (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=745 */ +public static final int Table_ID=745; + +/** TableName=PA_SLA_Goal */ +public static final String Table_Name="PA_SLA_Goal"; + +protected static KeyNamePair Model = new KeyNamePair(745,"PA_SLA_Goal"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_SLA_Goal[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Measure Actual. +@param MeasureActual Actual value that has been measured. */ +public void setMeasureActual (BigDecimal MeasureActual) +{ +if (MeasureActual == null) throw new IllegalArgumentException ("MeasureActual is mandatory."); +set_Value ("MeasureActual", MeasureActual); +} +/** Get Measure Actual. +@return Actual value that has been measured. */ +public BigDecimal getMeasureActual() +{ +BigDecimal bd = (BigDecimal)get_Value("MeasureActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Measure Target. +@param MeasureTarget Target value for measure */ +public void setMeasureTarget (BigDecimal MeasureTarget) +{ +if (MeasureTarget == null) throw new IllegalArgumentException ("MeasureTarget is mandatory."); +set_Value ("MeasureTarget", MeasureTarget); +} +/** Get Measure Target. +@return Target value for measure */ +public BigDecimal getMeasureTarget() +{ +BigDecimal bd = (BigDecimal)get_Value("MeasureTarget"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set SLA Criteria. +@param PA_SLA_Criteria_ID Service Level Agreement Criteria */ +public void setPA_SLA_Criteria_ID (int PA_SLA_Criteria_ID) +{ +if (PA_SLA_Criteria_ID < 1) throw new IllegalArgumentException ("PA_SLA_Criteria_ID is mandatory."); +set_Value ("PA_SLA_Criteria_ID", new Integer(PA_SLA_Criteria_ID)); +} +/** Get SLA Criteria. +@return Service Level Agreement Criteria */ +public int getPA_SLA_Criteria_ID() +{ +Integer ii = (Integer)get_Value("PA_SLA_Criteria_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set SLA Goal. +@param PA_SLA_Goal_ID Service Level Agreement Goal */ +public void setPA_SLA_Goal_ID (int PA_SLA_Goal_ID) +{ +if (PA_SLA_Goal_ID < 1) throw new IllegalArgumentException ("PA_SLA_Goal_ID is mandatory."); +set_ValueNoCheck ("PA_SLA_Goal_ID", new Integer(PA_SLA_Goal_ID)); +} +/** Get SLA Goal. +@return Service Level Agreement Goal */ +public int getPA_SLA_Goal_ID() +{ +Integer ii = (Integer)get_Value("PA_SLA_Goal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +} diff --git a/dbPort/src/org/compiere/model/X_PA_SLA_Measure.java b/dbPort/src/org/compiere/model/X_PA_SLA_Measure.java new file mode 100644 index 0000000000..19c0c23f01 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_PA_SLA_Measure.java @@ -0,0 +1,241 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for PA_SLA_Measure + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.703 */ +public class X_PA_SLA_Measure extends PO +{ +/** Standard Constructor +@param ctx context +@param PA_SLA_Measure_ID id +@param trxName transaction +*/ +public X_PA_SLA_Measure (Properties ctx, int PA_SLA_Measure_ID, String trxName) +{ +super (ctx, PA_SLA_Measure_ID, trxName); +/** if (PA_SLA_Measure_ID == 0) +{ +setDateTrx (new Timestamp(System.currentTimeMillis())); +setMeasureActual (Env.ZERO); +setPA_SLA_Goal_ID (0); +setPA_SLA_Measure_ID (0); +setProcessed (false); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_PA_SLA_Measure (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=743 */ +public static final int Table_ID=743; + +/** TableName=PA_SLA_Measure */ +public static final String Table_Name="PA_SLA_Measure"; + +protected static KeyNamePair Model = new KeyNamePair(743,"PA_SLA_Measure"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_PA_SLA_Measure[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_Value ("AD_Table_ID", null); + else +set_Value ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Transaction Date. +@param DateTrx Transaction Date */ +public void setDateTrx (Timestamp DateTrx) +{ +if (DateTrx == null) throw new IllegalArgumentException ("DateTrx is mandatory."); +set_Value ("DateTrx", DateTrx); +} +/** Get Transaction Date. +@return Transaction Date */ +public Timestamp getDateTrx() +{ +return (Timestamp)get_Value("DateTrx"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getDateTrx())); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Measure Actual. +@param MeasureActual Actual value that has been measured. */ +public void setMeasureActual (BigDecimal MeasureActual) +{ +if (MeasureActual == null) throw new IllegalArgumentException ("MeasureActual is mandatory."); +set_Value ("MeasureActual", MeasureActual); +} +/** Get Measure Actual. +@return Actual value that has been measured. */ +public BigDecimal getMeasureActual() +{ +BigDecimal bd = (BigDecimal)get_Value("MeasureActual"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set SLA Goal. +@param PA_SLA_Goal_ID Service Level Agreement Goal */ +public void setPA_SLA_Goal_ID (int PA_SLA_Goal_ID) +{ +if (PA_SLA_Goal_ID < 1) throw new IllegalArgumentException ("PA_SLA_Goal_ID is mandatory."); +set_ValueNoCheck ("PA_SLA_Goal_ID", new Integer(PA_SLA_Goal_ID)); +} +/** Get SLA Goal. +@return Service Level Agreement Goal */ +public int getPA_SLA_Goal_ID() +{ +Integer ii = (Integer)get_Value("PA_SLA_Goal_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set SLA Measure. +@param PA_SLA_Measure_ID Service Level Agreement Measure */ +public void setPA_SLA_Measure_ID (int PA_SLA_Measure_ID) +{ +if (PA_SLA_Measure_ID < 1) throw new IllegalArgumentException ("PA_SLA_Measure_ID is mandatory."); +set_ValueNoCheck ("PA_SLA_Measure_ID", new Integer(PA_SLA_Measure_ID)); +} +/** Get SLA Measure. +@return Service Level Agreement Measure */ +public int getPA_SLA_Measure_ID() +{ +Integer ii = (Integer)get_Value("PA_SLA_Measure_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_Value ("Record_ID", null); + else +set_Value ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_RV_BPartner.java b/dbPort/src/org/compiere/model/X_RV_BPartner.java new file mode 100644 index 0000000000..a5eb3df56f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_RV_BPartner.java @@ -0,0 +1,1703 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for RV_BPartner + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.703 */ +public class X_RV_BPartner extends PO +{ +/** Standard Constructor +@param ctx context +@param RV_BPartner_ID id +@param trxName transaction +*/ +public X_RV_BPartner (Properties ctx, int RV_BPartner_ID, String trxName) +{ +super (ctx, RV_BPartner_ID, trxName); +/** if (RV_BPartner_ID == 0) +{ +setC_BP_Group_ID (0); +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Country_ID (0); +setContactName (null); +setCountryName (null); +setIsCustomer (false); +setIsEmployee (false); +setIsOneTime (false); +setIsProspect (false); +setIsSalesRep (false); +setIsSummary (false); +setIsVendor (false); +setLDAPUser (false); +setName (null); +setNotificationType (null); +setSendEMail (false); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_RV_BPartner (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=520 */ +public static final int Table_ID=520; + +/** TableName=RV_BPartner */ +public static final String Table_Name="RV_BPartner"; + +protected static KeyNamePair Model = new KeyNamePair(520,"RV_BPartner"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_RV_BPartner[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** AD_Language AD_Reference_ID=106 */ +public static final int AD_LANGUAGE_AD_Reference_ID=106; +/** Set Language. +@param AD_Language Language for this entity */ +public void setAD_Language (String AD_Language) +{ +if (AD_Language != null && AD_Language.length() > 6) +{ +log.warning("Length > 6 - truncated"); +AD_Language = AD_Language.substring(0,5); +} +set_ValueNoCheck ("AD_Language", AD_Language); +} +/** Get Language. +@return Language for this entity */ +public String getAD_Language() +{ +return (String)get_Value("AD_Language"); +} + +/** AD_OrgBP_ID AD_Reference_ID=276 */ +public static final int AD_ORGBP_ID_AD_Reference_ID=276; +/** Set Linked Organization. +@param AD_OrgBP_ID The Business Partner is another Organization for explicit Inter-Org transactions */ +public void setAD_OrgBP_ID (int AD_OrgBP_ID) +{ +if (AD_OrgBP_ID <= 0) set_ValueNoCheck ("AD_OrgBP_ID", null); + else +set_ValueNoCheck ("AD_OrgBP_ID", new Integer(AD_OrgBP_ID)); +} +/** Get Linked Organization. +@return The Business Partner is another Organization for explicit Inter-Org transactions */ +public int getAD_OrgBP_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgBP_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** AD_OrgTrx_ID AD_Reference_ID=276 */ +public static final int AD_ORGTRX_ID_AD_Reference_ID=276; +/** Set Trx Organization. +@param AD_OrgTrx_ID Performing or initiating organization */ +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_ValueNoCheck ("AD_OrgTrx_ID", null); + else +set_ValueNoCheck ("AD_OrgTrx_ID", new Integer(AD_OrgTrx_ID)); +} +/** Get Trx Organization. +@return Performing or initiating organization */ +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_ValueNoCheck ("AD_User_ID", null); + else +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Acquisition Cost. +@param AcqusitionCost The cost of gaining the prospect as a customer */ +public void setAcqusitionCost (BigDecimal AcqusitionCost) +{ +set_ValueNoCheck ("AcqusitionCost", AcqusitionCost); +} +/** Get Acquisition Cost. +@return The cost of gaining the prospect as a customer */ +public BigDecimal getAcqusitionCost() +{ +BigDecimal bd = (BigDecimal)get_Value("AcqusitionCost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Actual Life Time Value. +@param ActualLifeTimeValue Actual Life Time Revenue */ +public void setActualLifeTimeValue (BigDecimal ActualLifeTimeValue) +{ +set_ValueNoCheck ("ActualLifeTimeValue", ActualLifeTimeValue); +} +/** Get Actual Life Time Value. +@return Actual Life Time Revenue */ +public BigDecimal getActualLifeTimeValue() +{ +BigDecimal bd = (BigDecimal)get_Value("ActualLifeTimeValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Address 1. +@param Address1 Address line 1 for this location */ +public void setAddress1 (String Address1) +{ +if (Address1 != null && Address1.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address1 = Address1.substring(0,59); +} +set_ValueNoCheck ("Address1", Address1); +} +/** Get Address 1. +@return Address line 1 for this location */ +public String getAddress1() +{ +return (String)get_Value("Address1"); +} +/** Set Address 2. +@param Address2 Address line 2 for this location */ +public void setAddress2 (String Address2) +{ +if (Address2 != null && Address2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address2 = Address2.substring(0,59); +} +set_ValueNoCheck ("Address2", Address2); +} +/** Get Address 2. +@return Address line 2 for this location */ +public String getAddress2() +{ +return (String)get_Value("Address2"); +} +/** Set Address 3. +@param Address3 Address Line 3 for the location */ +public void setAddress3 (String Address3) +{ +if (Address3 != null && Address3.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Address3 = Address3.substring(0,59); +} +set_ValueNoCheck ("Address3", Address3); +} +/** Get Address 3. +@return Address Line 3 for the location */ +public String getAddress3() +{ +return (String)get_Value("Address3"); +} + +/** BPContactGreeting AD_Reference_ID=356 */ +public static final int BPCONTACTGREETING_AD_Reference_ID=356; +/** Set BP Contact Greeting. +@param BPContactGreeting Greeting for Business Partner Contact */ +public void setBPContactGreeting (int BPContactGreeting) +{ +set_ValueNoCheck ("BPContactGreeting", new Integer(BPContactGreeting)); +} +/** Get BP Contact Greeting. +@return Greeting for Business Partner Contact */ +public int getBPContactGreeting() +{ +Integer ii = (Integer)get_Value("BPContactGreeting"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** BPartner_Parent_ID AD_Reference_ID=124 */ +public static final int BPARTNER_PARENT_ID_AD_Reference_ID=124; +/** Set Partner Parent. +@param BPartner_Parent_ID Business Partner Parent */ +public void setBPartner_Parent_ID (int BPartner_Parent_ID) +{ +if (BPartner_Parent_ID <= 0) set_ValueNoCheck ("BPartner_Parent_ID", null); + else +set_ValueNoCheck ("BPartner_Parent_ID", new Integer(BPartner_Parent_ID)); +} +/** Get Partner Parent. +@return Business Partner Parent */ +public int getBPartner_Parent_ID() +{ +Integer ii = (Integer)get_Value("BPartner_Parent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Birthday. +@param Birthday Birthday or Anniversary day */ +public void setBirthday (Timestamp Birthday) +{ +set_ValueNoCheck ("Birthday", Birthday); +} +/** Get Birthday. +@return Birthday or Anniversary day */ +public Timestamp getBirthday() +{ +return (Timestamp)get_Value("Birthday"); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID < 1) throw new IllegalArgumentException ("C_BP_Group_ID is mandatory."); +set_ValueNoCheck ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Country. +@param C_Country_ID Country */ +public void setC_Country_ID (int C_Country_ID) +{ +if (C_Country_ID < 1) throw new IllegalArgumentException ("C_Country_ID is mandatory."); +set_ValueNoCheck ("C_Country_ID", new Integer(C_Country_ID)); +} +/** Get Country. +@return Country */ +public int getC_Country_ID() +{ +Integer ii = (Integer)get_Value("C_Country_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Dunning. +@param C_Dunning_ID Dunning Rules for overdue invoices */ +public void setC_Dunning_ID (int C_Dunning_ID) +{ +if (C_Dunning_ID <= 0) set_ValueNoCheck ("C_Dunning_ID", null); + else +set_ValueNoCheck ("C_Dunning_ID", new Integer(C_Dunning_ID)); +} +/** Get Dunning. +@return Dunning Rules for overdue invoices */ +public int getC_Dunning_ID() +{ +Integer ii = (Integer)get_Value("C_Dunning_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Greeting. +@param C_Greeting_ID Greeting to print on correspondence */ +public void setC_Greeting_ID (int C_Greeting_ID) +{ +if (C_Greeting_ID <= 0) set_ValueNoCheck ("C_Greeting_ID", null); + else +set_ValueNoCheck ("C_Greeting_ID", new Integer(C_Greeting_ID)); +} +/** Get Greeting. +@return Greeting to print on correspondence */ +public int getC_Greeting_ID() +{ +Integer ii = (Integer)get_Value("C_Greeting_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Schedule. +@param C_InvoiceSchedule_ID Schedule for generating Invoices */ +public void setC_InvoiceSchedule_ID (int C_InvoiceSchedule_ID) +{ +if (C_InvoiceSchedule_ID <= 0) set_ValueNoCheck ("C_InvoiceSchedule_ID", null); + else +set_ValueNoCheck ("C_InvoiceSchedule_ID", new Integer(C_InvoiceSchedule_ID)); +} +/** Get Invoice Schedule. +@return Schedule for generating Invoices */ +public int getC_InvoiceSchedule_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceSchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID <= 0) set_ValueNoCheck ("C_PaymentTerm_ID", null); + else +set_ValueNoCheck ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Region. +@param C_Region_ID Identifies a geographical Region */ +public void setC_Region_ID (int C_Region_ID) +{ +if (C_Region_ID <= 0) set_ValueNoCheck ("C_Region_ID", null); + else +set_ValueNoCheck ("C_Region_ID", new Integer(C_Region_ID)); +} +/** Get Region. +@return Identifies a geographical Region */ +public int getC_Region_ID() +{ +Integer ii = (Integer)get_Value("C_Region_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set City. +@param City Identifies a City */ +public void setCity (String City) +{ +if (City != null && City.length() > 60) +{ +log.warning("Length > 60 - truncated"); +City = City.substring(0,59); +} +set_ValueNoCheck ("City", City); +} +/** Get City. +@return Identifies a City */ +public String getCity() +{ +return (String)get_Value("City"); +} +/** Set Comments. +@param Comments Comments or additional information */ +public void setComments (String Comments) +{ +if (Comments != null && Comments.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Comments = Comments.substring(0,1999); +} +set_ValueNoCheck ("Comments", Comments); +} +/** Get Comments. +@return Comments or additional information */ +public String getComments() +{ +return (String)get_Value("Comments"); +} +/** Set Contact Description. +@param ContactDescription Description of Contact */ +public void setContactDescription (String ContactDescription) +{ +if (ContactDescription != null && ContactDescription.length() > 255) +{ +log.warning("Length > 255 - truncated"); +ContactDescription = ContactDescription.substring(0,254); +} +set_ValueNoCheck ("ContactDescription", ContactDescription); +} +/** Get Contact Description. +@return Description of Contact */ +public String getContactDescription() +{ +return (String)get_Value("ContactDescription"); +} +/** Set Contact Name. +@param ContactName Business Partner Contact Name */ +public void setContactName (String ContactName) +{ +if (ContactName == null) throw new IllegalArgumentException ("ContactName is mandatory."); +if (ContactName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ContactName = ContactName.substring(0,59); +} +set_ValueNoCheck ("ContactName", ContactName); +} +/** Get Contact Name. +@return Business Partner Contact Name */ +public String getContactName() +{ +return (String)get_Value("ContactName"); +} +/** Set Country. +@param CountryName Country Name */ +public void setCountryName (String CountryName) +{ +if (CountryName == null) throw new IllegalArgumentException ("CountryName is mandatory."); +if (CountryName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +CountryName = CountryName.substring(0,59); +} +set_ValueNoCheck ("CountryName", CountryName); +} +/** Get Country. +@return Country Name */ +public String getCountryName() +{ +return (String)get_Value("CountryName"); +} +/** Set D-U-N-S. +@param DUNS Dun & Bradstreet Number */ +public void setDUNS (String DUNS) +{ +if (DUNS != null && DUNS.length() > 11) +{ +log.warning("Length > 11 - truncated"); +DUNS = DUNS.substring(0,10); +} +set_ValueNoCheck ("DUNS", DUNS); +} +/** Get D-U-N-S. +@return Dun & Bradstreet Number */ +public String getDUNS() +{ +return (String)get_Value("DUNS"); +} + +/** DeliveryRule AD_Reference_ID=151 */ +public static final int DELIVERYRULE_AD_Reference_ID=151; +/** Availability = A */ +public static final String DELIVERYRULE_Availability = "A"; +/** Force = F */ +public static final String DELIVERYRULE_Force = "F"; +/** Complete Line = L */ +public static final String DELIVERYRULE_CompleteLine = "L"; +/** Manual = M */ +public static final String DELIVERYRULE_Manual = "M"; +/** Complete Order = O */ +public static final String DELIVERYRULE_CompleteOrder = "O"; +/** After Receipt = R */ +public static final String DELIVERYRULE_AfterReceipt = "R"; +/** Set Delivery Rule. +@param DeliveryRule Defines the timing of Delivery */ +public void setDeliveryRule (String DeliveryRule) +{ +if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); +if (DeliveryRule == null || DeliveryRule.equals("A") || DeliveryRule.equals("F") || DeliveryRule.equals("L") || DeliveryRule.equals("M") || DeliveryRule.equals("O") || DeliveryRule.equals("R")); + else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - A - F - L - M - O - R"); +if (DeliveryRule != null && DeliveryRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryRule = DeliveryRule.substring(0,0); +} +set_ValueNoCheck ("DeliveryRule", DeliveryRule); +} +/** Get Delivery Rule. +@return Defines the timing of Delivery */ +public String getDeliveryRule() +{ +return (String)get_Value("DeliveryRule"); +} + +/** DeliveryViaRule AD_Reference_ID=152 */ +public static final int DELIVERYVIARULE_AD_Reference_ID=152; +/** Delivery = D */ +public static final String DELIVERYVIARULE_Delivery = "D"; +/** Pickup = P */ +public static final String DELIVERYVIARULE_Pickup = "P"; +/** Shipper = S */ +public static final String DELIVERYVIARULE_Shipper = "S"; +/** Set Delivery Via. +@param DeliveryViaRule How the order will be delivered */ +public void setDeliveryViaRule (String DeliveryViaRule) +{ +if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); +if (DeliveryViaRule == null || DeliveryViaRule.equals("D") || DeliveryViaRule.equals("P") || DeliveryViaRule.equals("S")); + else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - D - P - S"); +if (DeliveryViaRule != null && DeliveryViaRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryViaRule = DeliveryViaRule.substring(0,0); +} +set_ValueNoCheck ("DeliveryViaRule", DeliveryViaRule); +} +/** Get Delivery Via. +@return How the order will be delivered */ +public String getDeliveryViaRule() +{ +return (String)get_Value("DeliveryViaRule"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_ValueNoCheck ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Document Copies. +@param DocumentCopies Number of copies to be printed */ +public void setDocumentCopies (int DocumentCopies) +{ +set_ValueNoCheck ("DocumentCopies", new Integer(DocumentCopies)); +} +/** Get Document Copies. +@return Number of copies to be printed */ +public int getDocumentCopies() +{ +Integer ii = (Integer)get_Value("DocumentCopies"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_ValueNoCheck ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set EMail User ID. +@param EMailUser User Name (ID) in the Mail System */ +public void setEMailUser (String EMailUser) +{ +if (EMailUser != null && EMailUser.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMailUser = EMailUser.substring(0,59); +} +set_ValueNoCheck ("EMailUser", EMailUser); +} +/** Get EMail User ID. +@return User Name (ID) in the Mail System */ +public String getEMailUser() +{ +return (String)get_Value("EMailUser"); +} +/** Set Verification Info. +@param EMailVerify Verification information of EMail Address */ +public void setEMailVerify (String EMailVerify) +{ +if (EMailVerify != null && EMailVerify.length() > 40) +{ +log.warning("Length > 40 - truncated"); +EMailVerify = EMailVerify.substring(0,39); +} +set_ValueNoCheck ("EMailVerify", EMailVerify); +} +/** Get Verification Info. +@return Verification information of EMail Address */ +public String getEMailVerify() +{ +return (String)get_Value("EMailVerify"); +} +/** Set EMail Verify. +@param EMailVerifyDate Date Email was verified */ +public void setEMailVerifyDate (Timestamp EMailVerifyDate) +{ +set_ValueNoCheck ("EMailVerifyDate", EMailVerifyDate); +} +/** Get EMail Verify. +@return Date Email was verified */ +public Timestamp getEMailVerifyDate() +{ +return (Timestamp)get_Value("EMailVerifyDate"); +} +/** Set Fax. +@param Fax Facsimile number */ +public void setFax (String Fax) +{ +if (Fax != null && Fax.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Fax = Fax.substring(0,39); +} +set_ValueNoCheck ("Fax", Fax); +} +/** Get Fax. +@return Facsimile number */ +public String getFax() +{ +return (String)get_Value("Fax"); +} +/** Set First Sale. +@param FirstSale Date of First Sale */ +public void setFirstSale (Timestamp FirstSale) +{ +set_ValueNoCheck ("FirstSale", FirstSale); +} +/** Get First Sale. +@return Date of First Sale */ +public Timestamp getFirstSale() +{ +return (Timestamp)get_Value("FirstSale"); +} +/** Set Flat Discount %. +@param FlatDiscount Flat discount percentage */ +public void setFlatDiscount (BigDecimal FlatDiscount) +{ +set_ValueNoCheck ("FlatDiscount", FlatDiscount); +} +/** Get Flat Discount %. +@return Flat discount percentage */ +public BigDecimal getFlatDiscount() +{ +BigDecimal bd = (BigDecimal)get_Value("FlatDiscount"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** FreightCostRule AD_Reference_ID=153 */ +public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; +/** Calculated = C */ +public static final String FREIGHTCOSTRULE_Calculated = "C"; +/** Fix price = F */ +public static final String FREIGHTCOSTRULE_FixPrice = "F"; +/** Freight included = I */ +public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; +/** Line = L */ +public static final String FREIGHTCOSTRULE_Line = "L"; +/** Set Freight Cost Rule. +@param FreightCostRule Method for charging Freight */ +public void setFreightCostRule (String FreightCostRule) +{ +if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); +if (FreightCostRule == null || FreightCostRule.equals("C") || FreightCostRule.equals("F") || FreightCostRule.equals("I") || FreightCostRule.equals("L")); + else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - C - F - I - L"); +if (FreightCostRule != null && FreightCostRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FreightCostRule = FreightCostRule.substring(0,0); +} +set_ValueNoCheck ("FreightCostRule", FreightCostRule); +} +/** Get Freight Cost Rule. +@return Method for charging Freight */ +public String getFreightCostRule() +{ +return (String)get_Value("FreightCostRule"); +} + +/** InvoiceRule AD_Reference_ID=150 */ +public static final int INVOICERULE_AD_Reference_ID=150; +/** After Delivery = D */ +public static final String INVOICERULE_AfterDelivery = "D"; +/** Immediate = I */ +public static final String INVOICERULE_Immediate = "I"; +/** After Order delivered = O */ +public static final String INVOICERULE_AfterOrderDelivered = "O"; +/** Customer Schedule after Delivery = S */ +public static final String INVOICERULE_CustomerScheduleAfterDelivery = "S"; +/** Set Invoice Rule. +@param InvoiceRule Frequency and method of invoicing */ +public void setInvoiceRule (String InvoiceRule) +{ +if (InvoiceRule == null) throw new IllegalArgumentException ("InvoiceRule is mandatory"); +if (InvoiceRule == null || InvoiceRule.equals("D") || InvoiceRule.equals("I") || InvoiceRule.equals("O") || InvoiceRule.equals("S")); + else throw new IllegalArgumentException ("InvoiceRule Invalid value - " + InvoiceRule + " - Reference_ID=150 - D - I - O - S"); +if (InvoiceRule != null && InvoiceRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceRule = InvoiceRule.substring(0,0); +} +set_ValueNoCheck ("InvoiceRule", InvoiceRule); +} +/** Get Invoice Rule. +@return Frequency and method of invoicing */ +public String getInvoiceRule() +{ +return (String)get_Value("InvoiceRule"); +} + +/** Invoice_PrintFormat_ID AD_Reference_ID=259 */ +public static final int INVOICE_PRINTFORMAT_ID_AD_Reference_ID=259; +/** Set Invoice Print Format. +@param Invoice_PrintFormat_ID Print Format for printing Invoices */ +public void setInvoice_PrintFormat_ID (int Invoice_PrintFormat_ID) +{ +if (Invoice_PrintFormat_ID <= 0) set_ValueNoCheck ("Invoice_PrintFormat_ID", null); + else +set_ValueNoCheck ("Invoice_PrintFormat_ID", new Integer(Invoice_PrintFormat_ID)); +} +/** Get Invoice Print Format. +@return Print Format for printing Invoices */ +public int getInvoice_PrintFormat_ID() +{ +Integer ii = (Integer)get_Value("Invoice_PrintFormat_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Customer. +@param IsCustomer Indicates if this Business Partner is a Customer */ +public void setIsCustomer (boolean IsCustomer) +{ +set_ValueNoCheck ("IsCustomer", new Boolean(IsCustomer)); +} +/** Get Customer. +@return Indicates if this Business Partner is a Customer */ +public boolean isCustomer() +{ +Object oo = get_Value("IsCustomer"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Discount Printed. +@param IsDiscountPrinted Print Discount on Invoice and Order */ +public void setIsDiscountPrinted (boolean IsDiscountPrinted) +{ +set_ValueNoCheck ("IsDiscountPrinted", new Boolean(IsDiscountPrinted)); +} +/** Get Discount Printed. +@return Print Discount on Invoice and Order */ +public boolean isDiscountPrinted() +{ +Object oo = get_Value("IsDiscountPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Employee. +@param IsEmployee Indicates if this Business Partner is an employee */ +public void setIsEmployee (boolean IsEmployee) +{ +set_ValueNoCheck ("IsEmployee", new Boolean(IsEmployee)); +} +/** Get Employee. +@return Indicates if this Business Partner is an employee */ +public boolean isEmployee() +{ +Object oo = get_Value("IsEmployee"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set One time transaction. +@param IsOneTime One time transaction */ +public void setIsOneTime (boolean IsOneTime) +{ +set_ValueNoCheck ("IsOneTime", new Boolean(IsOneTime)); +} +/** Get One time transaction. +@return One time transaction */ +public boolean isOneTime() +{ +Object oo = get_Value("IsOneTime"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Prospect. +@param IsProspect Indicates this is a Prospect */ +public void setIsProspect (boolean IsProspect) +{ +set_ValueNoCheck ("IsProspect", new Boolean(IsProspect)); +} +/** Get Prospect. +@return Indicates this is a Prospect */ +public boolean isProspect() +{ +Object oo = get_Value("IsProspect"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Representative. +@param IsSalesRep Indicates if the business partner is a sales representative or company agent */ +public void setIsSalesRep (boolean IsSalesRep) +{ +set_ValueNoCheck ("IsSalesRep", new Boolean(IsSalesRep)); +} +/** Get Sales Representative. +@return Indicates if the business partner is a sales representative or company agent */ +public boolean isSalesRep() +{ +Object oo = get_Value("IsSalesRep"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Summary Level. +@param IsSummary This is a summary entity */ +public void setIsSummary (boolean IsSummary) +{ +set_ValueNoCheck ("IsSummary", new Boolean(IsSummary)); +} +/** Get Summary Level. +@return This is a summary entity */ +public boolean isSummary() +{ +Object oo = get_Value("IsSummary"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax exempt. +@param IsTaxExempt Business partner is exempt from tax */ +public void setIsTaxExempt (boolean IsTaxExempt) +{ +set_ValueNoCheck ("IsTaxExempt", new Boolean(IsTaxExempt)); +} +/** Get Tax exempt. +@return Business partner is exempt from tax */ +public boolean isTaxExempt() +{ +Object oo = get_Value("IsTaxExempt"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Vendor. +@param IsVendor Indicates if this Business Partner is a Vendor */ +public void setIsVendor (boolean IsVendor) +{ +set_ValueNoCheck ("IsVendor", new Boolean(IsVendor)); +} +/** Get Vendor. +@return Indicates if this Business Partner is a Vendor */ +public boolean isVendor() +{ +Object oo = get_Value("IsVendor"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set LDAP User Name. +@param LDAPUser User Name used for authorization via LDAP (directory) services */ +public void setLDAPUser (boolean LDAPUser) +{ +set_ValueNoCheck ("LDAPUser", new Boolean(LDAPUser)); +} +/** Get LDAP User Name. +@return User Name used for authorization via LDAP (directory) services */ +public boolean isLDAPUser() +{ +Object oo = get_Value("LDAPUser"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Last Contact. +@param LastContact Date this individual was last contacted */ +public void setLastContact (Timestamp LastContact) +{ +set_ValueNoCheck ("LastContact", LastContact); +} +/** Get Last Contact. +@return Date this individual was last contacted */ +public Timestamp getLastContact() +{ +return (Timestamp)get_Value("LastContact"); +} +/** Set Last Result. +@param LastResult Result of last contact */ +public void setLastResult (String LastResult) +{ +if (LastResult != null && LastResult.length() > 255) +{ +log.warning("Length > 255 - truncated"); +LastResult = LastResult.substring(0,254); +} +set_ValueNoCheck ("LastResult", LastResult); +} +/** Get Last Result. +@return Result of last contact */ +public String getLastResult() +{ +return (String)get_Value("LastResult"); +} +/** Set Discount Schema. +@param M_DiscountSchema_ID Schema to calculate the trade discount percentage */ +public void setM_DiscountSchema_ID (int M_DiscountSchema_ID) +{ +if (M_DiscountSchema_ID <= 0) set_ValueNoCheck ("M_DiscountSchema_ID", null); + else +set_ValueNoCheck ("M_DiscountSchema_ID", new Integer(M_DiscountSchema_ID)); +} +/** Get Discount Schema. +@return Schema to calculate the trade discount percentage */ +public int getM_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("M_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID <= 0) set_ValueNoCheck ("M_PriceList_ID", null); + else +set_ValueNoCheck ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set NAICS/SIC. +@param NAICS Standard Industry Code or its successor NAIC - http://www.osha.gov/oshstats/sicser.html */ +public void setNAICS (String NAICS) +{ +if (NAICS != null && NAICS.length() > 6) +{ +log.warning("Length > 6 - truncated"); +NAICS = NAICS.substring(0,5); +} +set_ValueNoCheck ("NAICS", NAICS); +} +/** Get NAICS/SIC. +@return Standard Industry Code or its successor NAIC - http://www.osha.gov/oshstats/sicser.html */ +public String getNAICS() +{ +return (String)get_Value("NAICS"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_ValueNoCheck ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Name 2. +@param Name2 Additional Name */ +public void setName2 (String Name2) +{ +if (Name2 != null && Name2.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name2 = Name2.substring(0,59); +} +set_ValueNoCheck ("Name2", Name2); +} +/** Get Name 2. +@return Additional Name */ +public String getName2() +{ +return (String)get_Value("Name2"); +} + +/** NotificationType AD_Reference_ID=344 */ +public static final int NOTIFICATIONTYPE_AD_Reference_ID=344; +/** EMail+Notice = B */ +public static final String NOTIFICATIONTYPE_EMailPlusNotice = "B"; +/** EMail = E */ +public static final String NOTIFICATIONTYPE_EMail = "E"; +/** Notice = N */ +public static final String NOTIFICATIONTYPE_Notice = "N"; +/** None = X */ +public static final String NOTIFICATIONTYPE_None = "X"; +/** Set Notification Type. +@param NotificationType Type of Notifications */ +public void setNotificationType (String NotificationType) +{ +if (NotificationType == null) throw new IllegalArgumentException ("NotificationType is mandatory"); +if (NotificationType.equals("B") || NotificationType.equals("E") || NotificationType.equals("N") || NotificationType.equals("X")); + else throw new IllegalArgumentException ("NotificationType Invalid value - " + NotificationType + " - Reference_ID=344 - B - E - N - X"); +if (NotificationType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +NotificationType = NotificationType.substring(0,0); +} +set_ValueNoCheck ("NotificationType", NotificationType); +} +/** Get Notification Type. +@return Type of Notifications */ +public String getNotificationType() +{ +return (String)get_Value("NotificationType"); +} +/** Set Employees. +@param NumberEmployees Number of employees */ +public void setNumberEmployees (int NumberEmployees) +{ +set_ValueNoCheck ("NumberEmployees", new Integer(NumberEmployees)); +} +/** Get Employees. +@return Number of employees */ +public int getNumberEmployees() +{ +Integer ii = (Integer)get_Value("NumberEmployees"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order Reference. +@param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_ValueNoCheck ("POReference", POReference); +} +/** Get Order Reference. +@return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ +public String getPOReference() +{ +return (String)get_Value("POReference"); +} + +/** PO_DiscountSchema_ID AD_Reference_ID=249 */ +public static final int PO_DISCOUNTSCHEMA_ID_AD_Reference_ID=249; +/** Set PO Discount Schema. +@param PO_DiscountSchema_ID Schema to calculate the purchase trade discount percentage */ +public void setPO_DiscountSchema_ID (int PO_DiscountSchema_ID) +{ +if (PO_DiscountSchema_ID <= 0) set_ValueNoCheck ("PO_DiscountSchema_ID", null); + else +set_ValueNoCheck ("PO_DiscountSchema_ID", new Integer(PO_DiscountSchema_ID)); +} +/** Get PO Discount Schema. +@return Schema to calculate the purchase trade discount percentage */ +public int getPO_DiscountSchema_ID() +{ +Integer ii = (Integer)get_Value("PO_DiscountSchema_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PO_PaymentTerm_ID AD_Reference_ID=227 */ +public static final int PO_PAYMENTTERM_ID_AD_Reference_ID=227; +/** Set PO Payment Term. +@param PO_PaymentTerm_ID Payment rules for a purchase order */ +public void setPO_PaymentTerm_ID (int PO_PaymentTerm_ID) +{ +if (PO_PaymentTerm_ID <= 0) set_ValueNoCheck ("PO_PaymentTerm_ID", null); + else +set_ValueNoCheck ("PO_PaymentTerm_ID", new Integer(PO_PaymentTerm_ID)); +} +/** Get PO Payment Term. +@return Payment rules for a purchase order */ +public int getPO_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("PO_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PO_PriceList_ID AD_Reference_ID=166 */ +public static final int PO_PRICELIST_ID_AD_Reference_ID=166; +/** Set Purchase Pricelist. +@param PO_PriceList_ID Price List used by this Business Partner */ +public void setPO_PriceList_ID (int PO_PriceList_ID) +{ +if (PO_PriceList_ID <= 0) set_ValueNoCheck ("PO_PriceList_ID", null); + else +set_ValueNoCheck ("PO_PriceList_ID", new Integer(PO_PriceList_ID)); +} +/** Get Purchase Pricelist. +@return Price List used by this Business Partner */ +public int getPO_PriceList_ID() +{ +Integer ii = (Integer)get_Value("PO_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** PaymentRule AD_Reference_ID=195 */ +public static final int PAYMENTRULE_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULE_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULE_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRule How you pay the invoice */ +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule == null || PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRule != null && PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_ValueNoCheck ("PaymentRule", PaymentRule); +} +/** Get Payment Rule. +@return How you pay the invoice */ +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} + +/** PaymentRulePO AD_Reference_ID=195 */ +public static final int PAYMENTRULEPO_AD_Reference_ID=195; +/** Cash = B */ +public static final String PAYMENTRULEPO_Cash = "B"; +/** Direct Debit = D */ +public static final String PAYMENTRULEPO_DirectDebit = "D"; +/** Credit Card = K */ +public static final String PAYMENTRULEPO_CreditCard = "K"; +/** On Credit = P */ +public static final String PAYMENTRULEPO_OnCredit = "P"; +/** Check = S */ +public static final String PAYMENTRULEPO_Check = "S"; +/** Direct Deposit = T */ +public static final String PAYMENTRULEPO_DirectDeposit = "T"; +/** Set Payment Rule. +@param PaymentRulePO Purchase payment option */ +public void setPaymentRulePO (String PaymentRulePO) +{ +if (PaymentRulePO == null) throw new IllegalArgumentException ("PaymentRulePO is mandatory"); +if (PaymentRulePO == null || PaymentRulePO.equals("B") || PaymentRulePO.equals("D") || PaymentRulePO.equals("K") || PaymentRulePO.equals("P") || PaymentRulePO.equals("S") || PaymentRulePO.equals("T")); + else throw new IllegalArgumentException ("PaymentRulePO Invalid value - " + PaymentRulePO + " - Reference_ID=195 - B - D - K - P - S - T"); +if (PaymentRulePO != null && PaymentRulePO.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRulePO = PaymentRulePO.substring(0,0); +} +set_ValueNoCheck ("PaymentRulePO", PaymentRulePO); +} +/** Get Payment Rule. +@return Purchase payment option */ +public String getPaymentRulePO() +{ +return (String)get_Value("PaymentRulePO"); +} +/** Set Phone. +@param Phone Identifies a telephone number */ +public void setPhone (String Phone) +{ +if (Phone != null && Phone.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone = Phone.substring(0,39); +} +set_ValueNoCheck ("Phone", Phone); +} +/** Get Phone. +@return Identifies a telephone number */ +public String getPhone() +{ +return (String)get_Value("Phone"); +} +/** Set 2nd Phone. +@param Phone2 Identifies an alternate telephone number. */ +public void setPhone2 (String Phone2) +{ +if (Phone2 != null && Phone2.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Phone2 = Phone2.substring(0,39); +} +set_ValueNoCheck ("Phone2", Phone2); +} +/** Get 2nd Phone. +@return Identifies an alternate telephone number. */ +public String getPhone2() +{ +return (String)get_Value("Phone2"); +} +/** Set ZIP. +@param Postal Postal code */ +public void setPostal (String Postal) +{ +if (Postal != null && Postal.length() > 10) +{ +log.warning("Length > 10 - truncated"); +Postal = Postal.substring(0,9); +} +set_ValueNoCheck ("Postal", Postal); +} +/** Get ZIP. +@return Postal code */ +public String getPostal() +{ +return (String)get_Value("Postal"); +} +/** Set Potential Life Time Value. +@param PotentialLifeTimeValue Total Revenue expected */ +public void setPotentialLifeTimeValue (BigDecimal PotentialLifeTimeValue) +{ +set_ValueNoCheck ("PotentialLifeTimeValue", PotentialLifeTimeValue); +} +/** Get Potential Life Time Value. +@return Total Revenue expected */ +public BigDecimal getPotentialLifeTimeValue() +{ +BigDecimal bd = (BigDecimal)get_Value("PotentialLifeTimeValue"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Rating. +@param Rating Classification or Importance */ +public void setRating (String Rating) +{ +if (Rating != null && Rating.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Rating = Rating.substring(0,0); +} +set_ValueNoCheck ("Rating", Rating); +} +/** Get Rating. +@return Classification or Importance */ +public String getRating() +{ +return (String)get_Value("Rating"); +} +/** Set Reference No. +@param ReferenceNo Your customer or vendor number at the Business Partner's site */ +public void setReferenceNo (String ReferenceNo) +{ +if (ReferenceNo != null && ReferenceNo.length() > 40) +{ +log.warning("Length > 40 - truncated"); +ReferenceNo = ReferenceNo.substring(0,39); +} +set_ValueNoCheck ("ReferenceNo", ReferenceNo); +} +/** Get Reference No. +@return Your customer or vendor number at the Business Partner's site */ +public String getReferenceNo() +{ +return (String)get_Value("ReferenceNo"); +} +/** Set Region. +@param RegionName Name of the Region */ +public void setRegionName (String RegionName) +{ +if (RegionName != null && RegionName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +RegionName = RegionName.substring(0,59); +} +set_ValueNoCheck ("RegionName", RegionName); +} +/** Get Region. +@return Name of the Region */ +public String getRegionName() +{ +return (String)get_Value("RegionName"); +} + +/** SOCreditStatus AD_Reference_ID=289 */ +public static final int SOCREDITSTATUS_AD_Reference_ID=289; +/** Credit Hold = H */ +public static final String SOCREDITSTATUS_CreditHold = "H"; +/** Credit OK = O */ +public static final String SOCREDITSTATUS_CreditOK = "O"; +/** Credit Stop = S */ +public static final String SOCREDITSTATUS_CreditStop = "S"; +/** Credit Watch = W */ +public static final String SOCREDITSTATUS_CreditWatch = "W"; +/** No Credit Check = X */ +public static final String SOCREDITSTATUS_NoCreditCheck = "X"; +/** Set Credit Status. +@param SOCreditStatus Business Partner Credit Status */ +public void setSOCreditStatus (String SOCreditStatus) +{ +if (SOCreditStatus == null) throw new IllegalArgumentException ("SOCreditStatus is mandatory"); +if (SOCreditStatus == null || SOCreditStatus.equals("H") || SOCreditStatus.equals("O") || SOCreditStatus.equals("S") || SOCreditStatus.equals("W") || SOCreditStatus.equals("X")); + else throw new IllegalArgumentException ("SOCreditStatus Invalid value - " + SOCreditStatus + " - Reference_ID=289 - H - O - S - W - X"); +if (SOCreditStatus != null && SOCreditStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SOCreditStatus = SOCreditStatus.substring(0,0); +} +set_ValueNoCheck ("SOCreditStatus", SOCreditStatus); +} +/** Get Credit Status. +@return Business Partner Credit Status */ +public String getSOCreditStatus() +{ +return (String)get_Value("SOCreditStatus"); +} +/** Set Credit Available. +@param SO_CreditAvailable Available Credit based on Credit Limit (not Total Open Balance) and Credit Used */ +public void setSO_CreditAvailable (BigDecimal SO_CreditAvailable) +{ +set_ValueNoCheck ("SO_CreditAvailable", SO_CreditAvailable); +} +/** Get Credit Available. +@return Available Credit based on Credit Limit (not Total Open Balance) and Credit Used */ +public BigDecimal getSO_CreditAvailable() +{ +BigDecimal bd = (BigDecimal)get_Value("SO_CreditAvailable"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Credit Limit. +@param SO_CreditLimit Total outstanding invoice amounts allowed */ +public void setSO_CreditLimit (BigDecimal SO_CreditLimit) +{ +set_ValueNoCheck ("SO_CreditLimit", SO_CreditLimit); +} +/** Get Credit Limit. +@return Total outstanding invoice amounts allowed */ +public BigDecimal getSO_CreditLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("SO_CreditLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Credit Used. +@param SO_CreditUsed Current open balance */ +public void setSO_CreditUsed (BigDecimal SO_CreditUsed) +{ +set_ValueNoCheck ("SO_CreditUsed", SO_CreditUsed); +} +/** Get Credit Used. +@return Current open balance */ +public BigDecimal getSO_CreditUsed() +{ +BigDecimal bd = (BigDecimal)get_Value("SO_CreditUsed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Order Description. +@param SO_Description Description to be used on orders */ +public void setSO_Description (String SO_Description) +{ +if (SO_Description != null && SO_Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +SO_Description = SO_Description.substring(0,254); +} +set_ValueNoCheck ("SO_Description", SO_Description); +} +/** Get Order Description. +@return Description to be used on orders */ +public String getSO_Description() +{ +return (String)get_Value("SO_Description"); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_ValueNoCheck ("SalesRep_ID", null); + else +set_ValueNoCheck ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Volume in 1.000. +@param SalesVolume Total Volume of Sales in Thousands of Currency */ +public void setSalesVolume (BigDecimal SalesVolume) +{ +set_ValueNoCheck ("SalesVolume", SalesVolume); +} +/** Get Sales Volume in 1.000. +@return Total Volume of Sales in Thousands of Currency */ +public BigDecimal getSalesVolume() +{ +BigDecimal bd = (BigDecimal)get_Value("SalesVolume"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Send EMail. +@param SendEMail Enable sending Document EMail */ +public void setSendEMail (boolean SendEMail) +{ +set_ValueNoCheck ("SendEMail", new Boolean(SendEMail)); +} +/** Get Send EMail. +@return Enable sending Document EMail */ +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Share. +@param ShareOfCustomer Share of Customer's business as a percentage */ +public void setShareOfCustomer (int ShareOfCustomer) +{ +set_ValueNoCheck ("ShareOfCustomer", new Integer(ShareOfCustomer)); +} +/** Get Share. +@return Share of Customer's business as a percentage */ +public int getShareOfCustomer() +{ +Integer ii = (Integer)get_Value("ShareOfCustomer"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Min Shelf Life %. +@param ShelfLifeMinPct Minimum Shelf Life in percent based on Product Instance Guarantee Date */ +public void setShelfLifeMinPct (int ShelfLifeMinPct) +{ +set_ValueNoCheck ("ShelfLifeMinPct", new Integer(ShelfLifeMinPct)); +} +/** Get Min Shelf Life %. +@return Minimum Shelf Life in percent based on Product Instance Guarantee Date */ +public int getShelfLifeMinPct() +{ +Integer ii = (Integer)get_Value("ShelfLifeMinPct"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Supervisor_ID AD_Reference_ID=110 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=110; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID <= 0) set_ValueNoCheck ("Supervisor_ID", null); + else +set_ValueNoCheck ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tax ID. +@param TaxID Tax Identification */ +public void setTaxID (String TaxID) +{ +if (TaxID != null && TaxID.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TaxID = TaxID.substring(0,19); +} +set_ValueNoCheck ("TaxID", TaxID); +} +/** Get Tax ID. +@return Tax Identification */ +public String getTaxID() +{ +return (String)get_Value("TaxID"); +} +/** Set Title. +@param Title Name this entity is referred to as */ +public void setTitle (String Title) +{ +if (Title != null && Title.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Title = Title.substring(0,39); +} +set_ValueNoCheck ("Title", Title); +} +/** Get Title. +@return Name this entity is referred to as */ +public String getTitle() +{ +return (String)get_Value("Title"); +} +/** Set Open Balance. +@param TotalOpenBalance Total Open Balance Amount in primary Accounting Currency */ +public void setTotalOpenBalance (BigDecimal TotalOpenBalance) +{ +set_ValueNoCheck ("TotalOpenBalance", TotalOpenBalance); +} +/** Get Open Balance. +@return Total Open Balance Amount in primary Accounting Currency */ +public BigDecimal getTotalOpenBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalOpenBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set URL. +@param URL Full URL address - e.g. http://www.adempiere.org */ +public void setURL (String URL) +{ +if (URL != null && URL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +URL = URL.substring(0,119); +} +set_ValueNoCheck ("URL", URL); +} +/** Get URL. +@return Full URL address - e.g. http://www.adempiere.org */ +public String getURL() +{ +return (String)get_Value("URL"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_ValueNoCheck ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_RV_WarehousePrice.java b/dbPort/src/org/compiere/model/X_RV_WarehousePrice.java new file mode 100644 index 0000000000..4c03597801 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_RV_WarehousePrice.java @@ -0,0 +1,389 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for RV_WarehousePrice + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.828 */ +public class X_RV_WarehousePrice extends PO +{ +/** Standard Constructor +@param ctx context +@param RV_WarehousePrice_ID id +@param trxName transaction +*/ +public X_RV_WarehousePrice (Properties ctx, int RV_WarehousePrice_ID, String trxName) +{ +super (ctx, RV_WarehousePrice_ID, trxName); +/** if (RV_WarehousePrice_ID == 0) +{ +setC_UOM_ID (0); +setM_PriceList_Version_ID (0); +setM_Product_ID (0); +setM_Warehouse_ID (0); +setName (null); +setValue (null); +setWarehouseName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_RV_WarehousePrice (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=639 */ +public static final int Table_ID=639; + +/** TableName=RV_WarehousePrice */ +public static final String Table_Name="RV_WarehousePrice"; + +protected static KeyNamePair Model = new KeyNamePair(639,"RV_WarehousePrice"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_RV_WarehousePrice[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_ValueNoCheck ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Instance Attribute. +@param IsInstanceAttribute The product attribute is specific to the instance (like Serial No, Lot or Guarantee Date) */ +public void setIsInstanceAttribute (boolean IsInstanceAttribute) +{ +set_ValueNoCheck ("IsInstanceAttribute", new Boolean(IsInstanceAttribute)); +} +/** Get Instance Attribute. +@return The product attribute is specific to the instance (like Serial No, Lot or Guarantee Date) */ +public boolean isInstanceAttribute() +{ +Object oo = get_Value("IsInstanceAttribute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List Version. +@param M_PriceList_Version_ID Identifies a unique instance of a Price List */ +public void setM_PriceList_Version_ID (int M_PriceList_Version_ID) +{ +if (M_PriceList_Version_ID < 1) throw new IllegalArgumentException ("M_PriceList_Version_ID is mandatory."); +set_ValueNoCheck ("M_PriceList_Version_ID", new Integer(M_PriceList_Version_ID)); +} +/** Get Price List Version. +@return Identifies a unique instance of a Price List */ +public int getM_PriceList_Version_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_Version_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Margin %. +@param Margin Margin for a product as a percentage */ +public void setMargin (BigDecimal Margin) +{ +set_ValueNoCheck ("Margin", Margin); +} +/** Get Margin %. +@return Margin for a product as a percentage */ +public BigDecimal getMargin() +{ +BigDecimal bd = (BigDecimal)get_Value("Margin"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_ValueNoCheck ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Limit Price. +@param PriceLimit Lowest price for a product */ +public void setPriceLimit (BigDecimal PriceLimit) +{ +set_ValueNoCheck ("PriceLimit", PriceLimit); +} +/** Get Limit Price. +@return Lowest price for a product */ +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +set_ValueNoCheck ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Price. +@param PriceStd Standard Price */ +public void setPriceStd (BigDecimal PriceStd) +{ +set_ValueNoCheck ("PriceStd", PriceStd); +} +/** Get Standard Price. +@return Standard Price */ +public BigDecimal getPriceStd() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceStd"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Available Quantity. +@param QtyAvailable Available Quantity (On Hand - Reserved) */ +public void setQtyAvailable (BigDecimal QtyAvailable) +{ +set_ValueNoCheck ("QtyAvailable", QtyAvailable); +} +/** Get Available Quantity. +@return Available Quantity (On Hand - Reserved) */ +public BigDecimal getQtyAvailable() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyAvailable"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set On Hand Quantity. +@param QtyOnHand On Hand Quantity */ +public void setQtyOnHand (BigDecimal QtyOnHand) +{ +set_ValueNoCheck ("QtyOnHand", QtyOnHand); +} +/** Get On Hand Quantity. +@return On Hand Quantity */ +public BigDecimal getQtyOnHand() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOnHand"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ordered Quantity. +@param QtyOrdered Ordered Quantity */ +public void setQtyOrdered (BigDecimal QtyOrdered) +{ +set_ValueNoCheck ("QtyOrdered", QtyOrdered); +} +/** Get Ordered Quantity. +@return Ordered Quantity */ +public BigDecimal getQtyOrdered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOrdered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reserved Quantity. +@param QtyReserved Reserved Quantity */ +public void setQtyReserved (BigDecimal QtyReserved) +{ +set_ValueNoCheck ("QtyReserved", QtyReserved); +} +/** Get Reserved Quantity. +@return Reserved Quantity */ +public BigDecimal getQtyReserved() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyReserved"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set SKU. +@param SKU Stock Keeping Unit */ +public void setSKU (String SKU) +{ +if (SKU != null && SKU.length() > 30) +{ +log.warning("Length > 30 - truncated"); +SKU = SKU.substring(0,29); +} +set_ValueNoCheck ("SKU", SKU); +} +/** Get SKU. +@return Stock Keeping Unit */ +public String getSKU() +{ +return (String)get_Value("SKU"); +} +/** Set Symbol. +@param UOMSymbol Symbol for a Unit of Measure */ +public void setUOMSymbol (String UOMSymbol) +{ +if (UOMSymbol != null && UOMSymbol.length() > 10) +{ +log.warning("Length > 10 - truncated"); +UOMSymbol = UOMSymbol.substring(0,9); +} +set_ValueNoCheck ("UOMSymbol", UOMSymbol); +} +/** Get Symbol. +@return Symbol for a Unit of Measure */ +public String getUOMSymbol() +{ +return (String)get_Value("UOMSymbol"); +} +/** Set UPC/EAN. +@param UPC Bar Code (Universal Product Code or its superset European Article Number) */ +public void setUPC (String UPC) +{ +if (UPC != null && UPC.length() > 30) +{ +log.warning("Length > 30 - truncated"); +UPC = UPC.substring(0,29); +} +set_ValueNoCheck ("UPC", UPC); +} +/** Get UPC/EAN. +@return Bar Code (Universal Product Code or its superset European Article Number) */ +public String getUPC() +{ +return (String)get_Value("UPC"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_ValueNoCheck ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +/** Set Warehouse. +@param WarehouseName Warehouse Name */ +public void setWarehouseName (String WarehouseName) +{ +if (WarehouseName == null) throw new IllegalArgumentException ("WarehouseName is mandatory."); +if (WarehouseName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +WarehouseName = WarehouseName.substring(0,59); +} +set_ValueNoCheck ("WarehouseName", WarehouseName); +} +/** Get Warehouse. +@return Warehouse Name */ +public String getWarehouseName() +{ +return (String)get_Value("WarehouseName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_Category.java b/dbPort/src/org/compiere/model/X_R_Category.java new file mode 100644 index 0000000000..d1d7884c1c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_Category.java @@ -0,0 +1,178 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_Category + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.859 */ +public class X_R_Category extends PO +{ +/** Standard Constructor +@param ctx context +@param R_Category_ID id +@param trxName transaction +*/ +public X_R_Category (Properties ctx, int R_Category_ID, String trxName) +{ +super (ctx, R_Category_ID, trxName); +/** if (R_Category_ID == 0) +{ +setName (null); +setR_Category_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_Category (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=772 */ +public static final int Table_ID=772; + +/** TableName=R_Category */ +public static final String Table_Name="R_Category"; + +protected static KeyNamePair Model = new KeyNamePair(772,"R_Category"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_Category[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Category. +@param R_Category_ID Request Category */ +public void setR_Category_ID (int R_Category_ID) +{ +if (R_Category_ID < 1) throw new IllegalArgumentException ("R_Category_ID is mandatory."); +set_ValueNoCheck ("R_Category_ID", new Integer(R_Category_ID)); +} +/** Get Category. +@return Request Category */ +public int getR_Category_ID() +{ +Integer ii = (Integer)get_Value("R_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_CategoryUpdates.java b/dbPort/src/org/compiere/model/X_R_CategoryUpdates.java new file mode 100644 index 0000000000..fb497e6888 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_CategoryUpdates.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_CategoryUpdates + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.875 */ +public class X_R_CategoryUpdates extends PO +{ +/** Standard Constructor +@param ctx context +@param R_CategoryUpdates_ID id +@param trxName transaction +*/ +public X_R_CategoryUpdates (Properties ctx, int R_CategoryUpdates_ID, String trxName) +{ +super (ctx, R_CategoryUpdates_ID, trxName); +/** if (R_CategoryUpdates_ID == 0) +{ +setAD_User_ID (0); +setIsSelfService (false); +setR_Category_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_CategoryUpdates (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=785 */ +public static final int Table_ID=785; + +/** TableName=R_CategoryUpdates */ +public static final String Table_Name="R_CategoryUpdates"; + +protected static KeyNamePair Model = new KeyNamePair(785,"R_CategoryUpdates"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_CategoryUpdates[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Category. +@param R_Category_ID Request Category */ +public void setR_Category_ID (int R_Category_ID) +{ +if (R_Category_ID < 1) throw new IllegalArgumentException ("R_Category_ID is mandatory."); +set_ValueNoCheck ("R_Category_ID", new Integer(R_Category_ID)); +} +/** Get Category. +@return Request Category */ +public int getR_Category_ID() +{ +Integer ii = (Integer)get_Value("R_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_ContactInterest.java b/dbPort/src/org/compiere/model/X_R_ContactInterest.java new file mode 100644 index 0000000000..7e48c1f387 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_ContactInterest.java @@ -0,0 +1,149 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_ContactInterest + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.875 */ +public class X_R_ContactInterest extends PO +{ +/** Standard Constructor +@param ctx context +@param R_ContactInterest_ID id +@param trxName transaction +*/ +public X_R_ContactInterest (Properties ctx, int R_ContactInterest_ID, String trxName) +{ +super (ctx, R_ContactInterest_ID, trxName); +/** if (R_ContactInterest_ID == 0) +{ +setAD_User_ID (0); // @AD_User_ID@ +setR_InterestArea_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_ContactInterest (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=528 */ +public static final int Table_ID=528; + +/** TableName=R_ContactInterest */ +public static final String Table_Name="R_ContactInterest"; + +protected static KeyNamePair Model = new KeyNamePair(528,"R_ContactInterest"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_ContactInterest[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getAD_User_ID())); +} +/** Set Opt-out Date. +@param OptOutDate Date the contact opted out */ +public void setOptOutDate (Timestamp OptOutDate) +{ +set_ValueNoCheck ("OptOutDate", OptOutDate); +} +/** Get Opt-out Date. +@return Date the contact opted out */ +public Timestamp getOptOutDate() +{ +return (Timestamp)get_Value("OptOutDate"); +} +/** Set Interest Area. +@param R_InterestArea_ID Interest Area or Topic */ +public void setR_InterestArea_ID (int R_InterestArea_ID) +{ +if (R_InterestArea_ID < 1) throw new IllegalArgumentException ("R_InterestArea_ID is mandatory."); +set_ValueNoCheck ("R_InterestArea_ID", new Integer(R_InterestArea_ID)); +} +/** Get Interest Area. +@return Interest Area or Topic */ +public int getR_InterestArea_ID() +{ +Integer ii = (Integer)get_Value("R_InterestArea_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Subscribe Date. +@param SubscribeDate Date the contact actively subscribed */ +public void setSubscribeDate (Timestamp SubscribeDate) +{ +set_ValueNoCheck ("SubscribeDate", SubscribeDate); +} +/** Get Subscribe Date. +@return Date the contact actively subscribed */ +public Timestamp getSubscribeDate() +{ +return (Timestamp)get_Value("SubscribeDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_Group.java b/dbPort/src/org/compiere/model/X_R_Group.java new file mode 100644 index 0000000000..b1daf7c5a0 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_Group.java @@ -0,0 +1,194 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_Group + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.89 */ +public class X_R_Group extends PO +{ +/** Standard Constructor +@param ctx context +@param R_Group_ID id +@param trxName transaction +*/ +public X_R_Group (Properties ctx, int R_Group_ID, String trxName) +{ +super (ctx, R_Group_ID, trxName); +/** if (R_Group_ID == 0) +{ +setName (null); +setR_Group_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_Group (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=773 */ +public static final int Table_ID=773; + +/** TableName=R_Group */ +public static final String Table_Name="R_Group"; + +protected static KeyNamePair Model = new KeyNamePair(773,"R_Group"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_Group[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set BOM. +@param M_BOM_ID Bill of Material */ +public void setM_BOM_ID (int M_BOM_ID) +{ +if (M_BOM_ID <= 0) set_Value ("M_BOM_ID", null); + else +set_Value ("M_BOM_ID", new Integer(M_BOM_ID)); +} +/** Get BOM. +@return Bill of Material */ +public int getM_BOM_ID() +{ +Integer ii = (Integer)get_Value("M_BOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Change Notice. +@param M_ChangeNotice_ID Bill of Materials (Engineering) Change Notice (Version) */ +public void setM_ChangeNotice_ID (int M_ChangeNotice_ID) +{ +if (M_ChangeNotice_ID <= 0) set_Value ("M_ChangeNotice_ID", null); + else +set_Value ("M_ChangeNotice_ID", new Integer(M_ChangeNotice_ID)); +} +/** Get Change Notice. +@return Bill of Materials (Engineering) Change Notice (Version) */ +public int getM_ChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Group. +@param R_Group_ID Request Group */ +public void setR_Group_ID (int R_Group_ID) +{ +if (R_Group_ID < 1) throw new IllegalArgumentException ("R_Group_ID is mandatory."); +set_ValueNoCheck ("R_Group_ID", new Integer(R_Group_ID)); +} +/** Get Group. +@return Request Group */ +public int getR_Group_ID() +{ +Integer ii = (Integer)get_Value("R_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_GroupUpdates.java b/dbPort/src/org/compiere/model/X_R_GroupUpdates.java new file mode 100644 index 0000000000..a6b408df9e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_GroupUpdates.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_GroupUpdates + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.906 */ +public class X_R_GroupUpdates extends PO +{ +/** Standard Constructor +@param ctx context +@param R_GroupUpdates_ID id +@param trxName transaction +*/ +public X_R_GroupUpdates (Properties ctx, int R_GroupUpdates_ID, String trxName) +{ +super (ctx, R_GroupUpdates_ID, trxName); +/** if (R_GroupUpdates_ID == 0) +{ +setAD_User_ID (0); +setIsSelfService (false); +setR_Group_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_GroupUpdates (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=786 */ +public static final int Table_ID=786; + +/** TableName=R_GroupUpdates */ +public static final String Table_Name="R_GroupUpdates"; + +protected static KeyNamePair Model = new KeyNamePair(786,"R_GroupUpdates"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_GroupUpdates[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Group. +@param R_Group_ID Request Group */ +public void setR_Group_ID (int R_Group_ID) +{ +if (R_Group_ID < 1) throw new IllegalArgumentException ("R_Group_ID is mandatory."); +set_ValueNoCheck ("R_Group_ID", new Integer(R_Group_ID)); +} +/** Get Group. +@return Request Group */ +public int getR_Group_ID() +{ +Integer ii = (Integer)get_Value("R_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_InterestArea.java b/dbPort/src/org/compiere/model/X_R_InterestArea.java new file mode 100644 index 0000000000..bf3f3e2f84 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_InterestArea.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_InterestArea + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.906 */ +public class X_R_InterestArea extends PO +{ +/** Standard Constructor +@param ctx context +@param R_InterestArea_ID id +@param trxName transaction +*/ +public X_R_InterestArea (Properties ctx, int R_InterestArea_ID, String trxName) +{ +super (ctx, R_InterestArea_ID, trxName); +/** if (R_InterestArea_ID == 0) +{ +setIsSelfService (true); // Y +setName (null); +setR_InterestArea_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_InterestArea (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=530 */ +public static final int Table_ID=530; + +/** TableName=R_InterestArea */ +public static final String Table_Name="R_InterestArea"; + +protected static KeyNamePair Model = new KeyNamePair(530,"R_InterestArea"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_InterestArea[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Interest Area. +@param R_InterestArea_ID Interest Area or Topic */ +public void setR_InterestArea_ID (int R_InterestArea_ID) +{ +if (R_InterestArea_ID < 1) throw new IllegalArgumentException ("R_InterestArea_ID is mandatory."); +set_ValueNoCheck ("R_InterestArea_ID", new Integer(R_InterestArea_ID)); +} +/** Get Interest Area. +@return Interest Area or Topic */ +public int getR_InterestArea_ID() +{ +Integer ii = (Integer)get_Value("R_InterestArea_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_IssueKnown.java b/dbPort/src/org/compiere/model/X_R_IssueKnown.java new file mode 100644 index 0000000000..89bd7243be --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_IssueKnown.java @@ -0,0 +1,312 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_IssueKnown + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.921 */ +public class X_R_IssueKnown extends PO +{ +/** Standard Constructor +@param ctx context +@param R_IssueKnown_ID id +@param trxName transaction +*/ +public X_R_IssueKnown (Properties ctx, int R_IssueKnown_ID, String trxName) +{ +super (ctx, R_IssueKnown_ID, trxName); +/** if (R_IssueKnown_ID == 0) +{ +setIssueSummary (null); +setR_IssueKnown_ID (0); +setReleaseNo (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_IssueKnown (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=839 */ +public static final int Table_ID=839; + +/** TableName=R_IssueKnown */ +public static final String Table_Name="R_IssueKnown"; + +protected static KeyNamePair Model = new KeyNamePair(839,"R_IssueKnown"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_IssueKnown[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Issue Status. +@param IssueStatus Current Status of the Issue */ +public void setIssueStatus (String IssueStatus) +{ +if (IssueStatus != null && IssueStatus.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +IssueStatus = IssueStatus.substring(0,1999); +} +set_Value ("IssueStatus", IssueStatus); +} +/** Get Issue Status. +@return Current Status of the Issue */ +public String getIssueStatus() +{ +return (String)get_Value("IssueStatus"); +} +/** Set Issue Summary. +@param IssueSummary Issue Summary */ +public void setIssueSummary (String IssueSummary) +{ +if (IssueSummary == null) throw new IllegalArgumentException ("IssueSummary is mandatory."); +if (IssueSummary.length() > 255) +{ +log.warning("Length > 255 - truncated"); +IssueSummary = IssueSummary.substring(0,254); +} +set_Value ("IssueSummary", IssueSummary); +} +/** Get Issue Summary. +@return Issue Summary */ +public String getIssueSummary() +{ +return (String)get_Value("IssueSummary"); +} +/** Set Line. +@param LineNo Line No */ +public void setLineNo (int LineNo) +{ +set_Value ("LineNo", new Integer(LineNo)); +} +/** Get Line. +@return Line No */ +public int getLineNo() +{ +Integer ii = (Integer)get_Value("LineNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Logger. +@param LoggerName Logger Name */ +public void setLoggerName (String LoggerName) +{ +if (LoggerName != null && LoggerName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +LoggerName = LoggerName.substring(0,59); +} +set_Value ("LoggerName", LoggerName); +} +/** Get Logger. +@return Logger Name */ +public String getLoggerName() +{ +return (String)get_Value("LoggerName"); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Known Issue. +@param R_IssueKnown_ID Known Issue */ +public void setR_IssueKnown_ID (int R_IssueKnown_ID) +{ +if (R_IssueKnown_ID < 1) throw new IllegalArgumentException ("R_IssueKnown_ID is mandatory."); +set_ValueNoCheck ("R_IssueKnown_ID", new Integer(R_IssueKnown_ID)); +} +/** Get Known Issue. +@return Known Issue */ +public int getR_IssueKnown_ID() +{ +Integer ii = (Integer)get_Value("R_IssueKnown_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Issue Recommendation. +@param R_IssueRecommendation_ID Recommendations how to fix an Issue */ +public void setR_IssueRecommendation_ID (int R_IssueRecommendation_ID) +{ +if (R_IssueRecommendation_ID <= 0) set_Value ("R_IssueRecommendation_ID", null); + else +set_Value ("R_IssueRecommendation_ID", new Integer(R_IssueRecommendation_ID)); +} +/** Get Issue Recommendation. +@return Recommendations how to fix an Issue */ +public int getR_IssueRecommendation_ID() +{ +Integer ii = (Integer)get_Value("R_IssueRecommendation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Issue Status. +@param R_IssueStatus_ID Status of an Issue */ +public void setR_IssueStatus_ID (int R_IssueStatus_ID) +{ +if (R_IssueStatus_ID <= 0) set_Value ("R_IssueStatus_ID", null); + else +set_Value ("R_IssueStatus_ID", new Integer(R_IssueStatus_ID)); +} +/** Get Issue Status. +@return Status of an Issue */ +public int getR_IssueStatus_ID() +{ +Integer ii = (Integer)get_Value("R_IssueStatus_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request. +@param R_Request_ID Request from a Business Partner or Prospect */ +public void setR_Request_ID (int R_Request_ID) +{ +if (R_Request_ID <= 0) set_Value ("R_Request_ID", null); + else +set_Value ("R_Request_ID", new Integer(R_Request_ID)); +} +/** Get Request. +@return Request from a Business Partner or Prospect */ +public int getR_Request_ID() +{ +Integer ii = (Integer)get_Value("R_Request_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Release No. +@param ReleaseNo Internal Release Number */ +public void setReleaseNo (String ReleaseNo) +{ +if (ReleaseNo == null) throw new IllegalArgumentException ("ReleaseNo is mandatory."); +if (ReleaseNo.length() > 4) +{ +log.warning("Length > 4 - truncated"); +ReleaseNo = ReleaseNo.substring(0,3); +} +set_Value ("ReleaseNo", ReleaseNo); +} +/** Get Release No. +@return Internal Release Number */ +public String getReleaseNo() +{ +return (String)get_Value("ReleaseNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getReleaseNo()); +} +/** Set Source Class. +@param SourceClassName Source Class Name */ +public void setSourceClassName (String SourceClassName) +{ +if (SourceClassName != null && SourceClassName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SourceClassName = SourceClassName.substring(0,59); +} +set_Value ("SourceClassName", SourceClassName); +} +/** Get Source Class. +@return Source Class Name */ +public String getSourceClassName() +{ +return (String)get_Value("SourceClassName"); +} +/** Set Source Method. +@param SourceMethodName Source Method Name */ +public void setSourceMethodName (String SourceMethodName) +{ +if (SourceMethodName != null && SourceMethodName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +SourceMethodName = SourceMethodName.substring(0,59); +} +set_Value ("SourceMethodName", SourceMethodName); +} +/** Get Source Method. +@return Source Method Name */ +public String getSourceMethodName() +{ +return (String)get_Value("SourceMethodName"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_IssueProject.java b/dbPort/src/org/compiere/model/X_R_IssueProject.java new file mode 100644 index 0000000000..cf582e6555 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_IssueProject.java @@ -0,0 +1,241 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_IssueProject + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.937 */ +public class X_R_IssueProject extends PO +{ +/** Standard Constructor +@param ctx context +@param R_IssueProject_ID id +@param trxName transaction +*/ +public X_R_IssueProject (Properties ctx, int R_IssueProject_ID, String trxName) +{ +super (ctx, R_IssueProject_ID, trxName); +/** if (R_IssueProject_ID == 0) +{ +setName (null); +setR_IssueProject_ID (0); +setSystemStatus (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_IssueProject (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=842 */ +public static final int Table_ID=842; + +/** TableName=R_IssueProject */ +public static final String Table_Name="R_IssueProject"; + +protected static KeyNamePair Model = new KeyNamePair(842,"R_IssueProject"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_IssueProject[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Profile. +@param ProfileInfo Information to help profiling the system for solving support issues */ +public void setProfileInfo (String ProfileInfo) +{ +if (ProfileInfo != null && ProfileInfo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProfileInfo = ProfileInfo.substring(0,59); +} +set_Value ("ProfileInfo", ProfileInfo); +} +/** Get Profile. +@return Information to help profiling the system for solving support issues */ +public String getProfileInfo() +{ +return (String)get_Value("ProfileInfo"); +} +/** Set Issue Project. +@param R_IssueProject_ID Implementation Projects */ +public void setR_IssueProject_ID (int R_IssueProject_ID) +{ +if (R_IssueProject_ID < 1) throw new IllegalArgumentException ("R_IssueProject_ID is mandatory."); +set_ValueNoCheck ("R_IssueProject_ID", new Integer(R_IssueProject_ID)); +} +/** Get Issue Project. +@return Implementation Projects */ +public int getR_IssueProject_ID() +{ +Integer ii = (Integer)get_Value("R_IssueProject_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Statistics. +@param StatisticsInfo Information to help profiling the system for solving support issues */ +public void setStatisticsInfo (String StatisticsInfo) +{ +if (StatisticsInfo != null && StatisticsInfo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +StatisticsInfo = StatisticsInfo.substring(0,59); +} +set_Value ("StatisticsInfo", StatisticsInfo); +} +/** Get Statistics. +@return Information to help profiling the system for solving support issues */ +public String getStatisticsInfo() +{ +return (String)get_Value("StatisticsInfo"); +} + +/** SystemStatus AD_Reference_ID=374 */ +public static final int SYSTEMSTATUS_AD_Reference_ID=374; +/** Evaluation = E */ +public static final String SYSTEMSTATUS_Evaluation = "E"; +/** Implementation = I */ +public static final String SYSTEMSTATUS_Implementation = "I"; +/** Production = P */ +public static final String SYSTEMSTATUS_Production = "P"; +/** Set System Status. +@param SystemStatus Status of the system - Support priority depends on system status */ +public void setSystemStatus (String SystemStatus) +{ +if (SystemStatus == null) throw new IllegalArgumentException ("SystemStatus is mandatory"); +if (SystemStatus.equals("E") || SystemStatus.equals("I") || SystemStatus.equals("P")); + else throw new IllegalArgumentException ("SystemStatus Invalid value - " + SystemStatus + " - Reference_ID=374 - E - I - P"); +if (SystemStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SystemStatus = SystemStatus.substring(0,0); +} +set_Value ("SystemStatus", SystemStatus); +} +/** Get System Status. +@return Status of the system - Support priority depends on system status */ +public String getSystemStatus() +{ +return (String)get_Value("SystemStatus"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_IssueRecommendation.java b/dbPort/src/org/compiere/model/X_R_IssueRecommendation.java new file mode 100644 index 0000000000..2338947b8d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_IssueRecommendation.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_IssueRecommendation + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.953 */ +public class X_R_IssueRecommendation extends PO +{ +/** Standard Constructor +@param ctx context +@param R_IssueRecommendation_ID id +@param trxName transaction +*/ +public X_R_IssueRecommendation (Properties ctx, int R_IssueRecommendation_ID, String trxName) +{ +super (ctx, R_IssueRecommendation_ID, trxName); +/** if (R_IssueRecommendation_ID == 0) +{ +setName (null); +setR_IssueRecommendation_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_IssueRecommendation (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=837 */ +public static final int Table_ID=837; + +/** TableName=R_IssueRecommendation */ +public static final String Table_Name="R_IssueRecommendation"; + +protected static KeyNamePair Model = new KeyNamePair(837,"R_IssueRecommendation"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_IssueRecommendation[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Issue Recommendation. +@param R_IssueRecommendation_ID Recommendations how to fix an Issue */ +public void setR_IssueRecommendation_ID (int R_IssueRecommendation_ID) +{ +if (R_IssueRecommendation_ID < 1) throw new IllegalArgumentException ("R_IssueRecommendation_ID is mandatory."); +set_ValueNoCheck ("R_IssueRecommendation_ID", new Integer(R_IssueRecommendation_ID)); +} +/** Get Issue Recommendation. +@return Recommendations how to fix an Issue */ +public int getR_IssueRecommendation_ID() +{ +Integer ii = (Integer)get_Value("R_IssueRecommendation_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_IssueStatus.java b/dbPort/src/org/compiere/model/X_R_IssueStatus.java new file mode 100644 index 0000000000..1a7984cd91 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_IssueStatus.java @@ -0,0 +1,145 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_IssueStatus + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.968 */ +public class X_R_IssueStatus extends PO +{ +/** Standard Constructor +@param ctx context +@param R_IssueStatus_ID id +@param trxName transaction +*/ +public X_R_IssueStatus (Properties ctx, int R_IssueStatus_ID, String trxName) +{ +super (ctx, R_IssueStatus_ID, trxName); +/** if (R_IssueStatus_ID == 0) +{ +setName (null); +setR_IssueStatus_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_IssueStatus (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=838 */ +public static final int Table_ID=838; + +/** TableName=R_IssueStatus */ +public static final String Table_Name="R_IssueStatus"; + +protected static KeyNamePair Model = new KeyNamePair(838,"R_IssueStatus"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_IssueStatus[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Issue Status. +@param R_IssueStatus_ID Status of an Issue */ +public void setR_IssueStatus_ID (int R_IssueStatus_ID) +{ +if (R_IssueStatus_ID < 1) throw new IllegalArgumentException ("R_IssueStatus_ID is mandatory."); +set_ValueNoCheck ("R_IssueStatus_ID", new Integer(R_IssueStatus_ID)); +} +/** Get Issue Status. +@return Status of an Issue */ +public int getR_IssueStatus_ID() +{ +Integer ii = (Integer)get_Value("R_IssueStatus_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_IssueSystem.java b/dbPort/src/org/compiere/model/X_R_IssueSystem.java new file mode 100644 index 0000000000..c9554cb60e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_IssueSystem.java @@ -0,0 +1,208 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_IssueSystem + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.968 */ +public class X_R_IssueSystem extends PO +{ +/** Standard Constructor +@param ctx context +@param R_IssueSystem_ID id +@param trxName transaction +*/ +public X_R_IssueSystem (Properties ctx, int R_IssueSystem_ID, String trxName) +{ +super (ctx, R_IssueSystem_ID, trxName); +/** if (R_IssueSystem_ID == 0) +{ +setDBAddress (null); +setR_IssueSystem_ID (0); +setSystemStatus (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_IssueSystem (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=843 */ +public static final int Table_ID=843; + +/** TableName=R_IssueSystem */ +public static final String Table_Name="R_IssueSystem"; + +protected static KeyNamePair Model = new KeyNamePair(843,"R_IssueSystem"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_IssueSystem[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set DB Address. +@param DBAddress JDBC URL of the database server */ +public void setDBAddress (String DBAddress) +{ +if (DBAddress == null) throw new IllegalArgumentException ("DBAddress is mandatory."); +if (DBAddress.length() > 255) +{ +log.warning("Length > 255 - truncated"); +DBAddress = DBAddress.substring(0,254); +} +set_ValueNoCheck ("DBAddress", DBAddress); +} +/** Get DB Address. +@return JDBC URL of the database server */ +public String getDBAddress() +{ +return (String)get_Value("DBAddress"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDBAddress()); +} +/** Set Profile. +@param ProfileInfo Information to help profiling the system for solving support issues */ +public void setProfileInfo (String ProfileInfo) +{ +if (ProfileInfo != null && ProfileInfo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +ProfileInfo = ProfileInfo.substring(0,59); +} +set_ValueNoCheck ("ProfileInfo", ProfileInfo); +} +/** Get Profile. +@return Information to help profiling the system for solving support issues */ +public String getProfileInfo() +{ +return (String)get_Value("ProfileInfo"); +} +/** Set Issue System. +@param R_IssueSystem_ID System creating the issue */ +public void setR_IssueSystem_ID (int R_IssueSystem_ID) +{ +if (R_IssueSystem_ID < 1) throw new IllegalArgumentException ("R_IssueSystem_ID is mandatory."); +set_ValueNoCheck ("R_IssueSystem_ID", new Integer(R_IssueSystem_ID)); +} +/** Get Issue System. +@return System creating the issue */ +public int getR_IssueSystem_ID() +{ +Integer ii = (Integer)get_Value("R_IssueSystem_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Statistics. +@param StatisticsInfo Information to help profiling the system for solving support issues */ +public void setStatisticsInfo (String StatisticsInfo) +{ +if (StatisticsInfo != null && StatisticsInfo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +StatisticsInfo = StatisticsInfo.substring(0,59); +} +set_ValueNoCheck ("StatisticsInfo", StatisticsInfo); +} +/** Get Statistics. +@return Information to help profiling the system for solving support issues */ +public String getStatisticsInfo() +{ +return (String)get_Value("StatisticsInfo"); +} + +/** SystemStatus AD_Reference_ID=374 */ +public static final int SYSTEMSTATUS_AD_Reference_ID=374; +/** Evaluation = E */ +public static final String SYSTEMSTATUS_Evaluation = "E"; +/** Implementation = I */ +public static final String SYSTEMSTATUS_Implementation = "I"; +/** Production = P */ +public static final String SYSTEMSTATUS_Production = "P"; +/** Set System Status. +@param SystemStatus Status of the system - Support priority depends on system status */ +public void setSystemStatus (String SystemStatus) +{ +if (SystemStatus == null) throw new IllegalArgumentException ("SystemStatus is mandatory"); +if (SystemStatus.equals("E") || SystemStatus.equals("I") || SystemStatus.equals("P")); + else throw new IllegalArgumentException ("SystemStatus Invalid value - " + SystemStatus + " - Reference_ID=374 - E - I - P"); +if (SystemStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +SystemStatus = SystemStatus.substring(0,0); +} +set_Value ("SystemStatus", SystemStatus); +} +/** Get System Status. +@return Status of the system - Support priority depends on system status */ +public String getSystemStatus() +{ +return (String)get_Value("SystemStatus"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_IssueUser.java b/dbPort/src/org/compiere/model/X_R_IssueUser.java new file mode 100644 index 0000000000..3db717c995 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_IssueUser.java @@ -0,0 +1,161 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_IssueUser + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:02.984 */ +public class X_R_IssueUser extends PO +{ +/** Standard Constructor +@param ctx context +@param R_IssueUser_ID id +@param trxName transaction +*/ +public X_R_IssueUser (Properties ctx, int R_IssueUser_ID, String trxName) +{ +super (ctx, R_IssueUser_ID, trxName); +/** if (R_IssueUser_ID == 0) +{ +setR_IssueUser_ID (0); +setUserName (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_IssueUser (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=841 */ +public static final int Table_ID=841; + +/** TableName=R_IssueUser */ +public static final String Table_Name="R_IssueUser"; + +protected static KeyNamePair Model = new KeyNamePair(841,"R_IssueUser"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_IssueUser[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set IssueUser. +@param R_IssueUser_ID User who reported issues */ +public void setR_IssueUser_ID (int R_IssueUser_ID) +{ +if (R_IssueUser_ID < 1) throw new IllegalArgumentException ("R_IssueUser_ID is mandatory."); +set_ValueNoCheck ("R_IssueUser_ID", new Integer(R_IssueUser_ID)); +} +/** Get IssueUser. +@return User who reported issues */ +public int getR_IssueUser_ID() +{ +Integer ii = (Integer)get_Value("R_IssueUser_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Registered EMail. +@param UserName Email of the responsible for the System */ +public void setUserName (String UserName) +{ +if (UserName == null) throw new IllegalArgumentException ("UserName is mandatory."); +if (UserName.length() > 60) +{ +log.warning("Length > 60 - truncated"); +UserName = UserName.substring(0,59); +} +set_ValueNoCheck ("UserName", UserName); +} +/** Get Registered EMail. +@return Email of the responsible for the System */ +public String getUserName() +{ +return (String)get_Value("UserName"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getUserName()); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_MailText.java b/dbPort/src/org/compiere/model/X_R_MailText.java new file mode 100644 index 0000000000..a91fdf94d7 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_MailText.java @@ -0,0 +1,217 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_MailText + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.0 */ +public class X_R_MailText extends PO +{ +/** Standard Constructor +@param ctx context +@param R_MailText_ID id +@param trxName transaction +*/ +public X_R_MailText (Properties ctx, int R_MailText_ID, String trxName) +{ +super (ctx, R_MailText_ID, trxName); +/** if (R_MailText_ID == 0) +{ +setIsHtml (false); +setMailText (null); +setName (null); +setR_MailText_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_MailText (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=416 */ +public static final int Table_ID=416; + +/** TableName=R_MailText */ +public static final String Table_Name="R_MailText"; + +protected static KeyNamePair Model = new KeyNamePair(416,"R_MailText"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_MailText[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set HTML. +@param IsHtml Text has HTML tags */ +public void setIsHtml (boolean IsHtml) +{ +set_Value ("IsHtml", new Boolean(IsHtml)); +} +/** Get HTML. +@return Text has HTML tags */ +public boolean isHtml() +{ +Object oo = get_Value("IsHtml"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Subject. +@param MailHeader Mail Header (Subject) */ +public void setMailHeader (String MailHeader) +{ +if (MailHeader != null && MailHeader.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MailHeader = MailHeader.substring(0,1999); +} +set_Value ("MailHeader", MailHeader); +} +/** Get Subject. +@return Mail Header (Subject) */ +public String getMailHeader() +{ +return (String)get_Value("MailHeader"); +} +/** Set Mail Text. +@param MailText Text used for Mail message */ +public void setMailText (String MailText) +{ +if (MailText == null) throw new IllegalArgumentException ("MailText is mandatory."); +if (MailText.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MailText = MailText.substring(0,1999); +} +set_Value ("MailText", MailText); +} +/** Get Mail Text. +@return Text used for Mail message */ +public String getMailText() +{ +return (String)get_Value("MailText"); +} +/** Set Mail Text 2. +@param MailText2 Optional second text part used for Mail message */ +public void setMailText2 (String MailText2) +{ +if (MailText2 != null && MailText2.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MailText2 = MailText2.substring(0,1999); +} +set_Value ("MailText2", MailText2); +} +/** Get Mail Text 2. +@return Optional second text part used for Mail message */ +public String getMailText2() +{ +return (String)get_Value("MailText2"); +} +/** Set Mail Text 3. +@param MailText3 Optional third text part used for Mail message */ +public void setMailText3 (String MailText3) +{ +if (MailText3 != null && MailText3.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +MailText3 = MailText3.substring(0,1999); +} +set_Value ("MailText3", MailText3); +} +/** Get Mail Text 3. +@return Optional third text part used for Mail message */ +public String getMailText3() +{ +return (String)get_Value("MailText3"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Mail Template. +@param R_MailText_ID Text templates for mailings */ +public void setR_MailText_ID (int R_MailText_ID) +{ +if (R_MailText_ID < 1) throw new IllegalArgumentException ("R_MailText_ID is mandatory."); +set_ValueNoCheck ("R_MailText_ID", new Integer(R_MailText_ID)); +} +/** Get Mail Template. +@return Text templates for mailings */ +public int getR_MailText_ID() +{ +Integer ii = (Integer)get_Value("R_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_Request.java b/dbPort/src/org/compiere/model/X_R_Request.java new file mode 100644 index 0000000000..58de2a8224 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_Request.java @@ -0,0 +1,1115 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_Request + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.0 */ +public class X_R_Request extends PO +{ +/** Standard Constructor +@param ctx context +@param R_Request_ID id +@param trxName transaction +*/ +public X_R_Request (Properties ctx, int R_Request_ID, String trxName) +{ +super (ctx, R_Request_ID, trxName); +/** if (R_Request_ID == 0) +{ +setConfidentialType (null); // C +setConfidentialTypeEntry (null); // C +setDocumentNo (null); +setDueType (null); // 5 +setIsEscalated (false); +setIsInvoiced (false); +setIsSelfService (false); // N +setPriority (null); // 5 +setProcessed (false); +setR_RequestType_ID (0); +setR_Request_ID (0); +setRequestAmt (Env.ZERO); +setSalesRep_ID (0); // @AD_User_ID@ +setSummary (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_Request (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=417 */ +public static final int Table_ID=417; + +/** TableName=R_Request */ +public static final String Table_Name="R_Request"; + +protected static KeyNamePair Model = new KeyNamePair(417,"R_Request"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_Request[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID <= 0) set_Value ("AD_Role_ID", null); + else +set_Value ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Table. +@param AD_Table_ID Database Table information */ +public void setAD_Table_ID (int AD_Table_ID) +{ +if (AD_Table_ID <= 0) set_ValueNoCheck ("AD_Table_ID", null); + else +set_ValueNoCheck ("AD_Table_ID", new Integer(AD_Table_ID)); +} +/** Get Table. +@return Database Table information */ +public int getAD_Table_ID() +{ +Integer ii = (Integer)get_Value("AD_Table_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); + else +set_Value ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_InvoiceRequest_ID AD_Reference_ID=336 */ +public static final int C_INVOICEREQUEST_ID_AD_Reference_ID=336; +/** Set Request Invoice. +@param C_InvoiceRequest_ID The generated invoice for this request */ +public void setC_InvoiceRequest_ID (int C_InvoiceRequest_ID) +{ +if (C_InvoiceRequest_ID <= 0) set_ValueNoCheck ("C_InvoiceRequest_ID", null); + else +set_ValueNoCheck ("C_InvoiceRequest_ID", new Integer(C_InvoiceRequest_ID)); +} +/** Get Request Invoice. +@return The generated invoice for this request */ +public int getC_InvoiceRequest_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceRequest_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_Value ("C_Invoice_ID", null); + else +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_Value ("C_Order_ID", null); + else +set_Value ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Close Date. +@param CloseDate Close Date */ +public void setCloseDate (Timestamp CloseDate) +{ +set_Value ("CloseDate", CloseDate); +} +/** Get Close Date. +@return Close Date */ +public Timestamp getCloseDate() +{ +return (Timestamp)get_Value("CloseDate"); +} + +/** ConfidentialType AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPE_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPE_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPE_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPE_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPE_PrivateInformation = "P"; +/** Set Confidentiality. +@param ConfidentialType Type of Confidentiality */ +public void setConfidentialType (String ConfidentialType) +{ +if (ConfidentialType == null) throw new IllegalArgumentException ("ConfidentialType is mandatory"); +if (ConfidentialType.equals("A") || ConfidentialType.equals("C") || ConfidentialType.equals("I") || ConfidentialType.equals("P")); + else throw new IllegalArgumentException ("ConfidentialType Invalid value - " + ConfidentialType + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialType = ConfidentialType.substring(0,0); +} +set_Value ("ConfidentialType", ConfidentialType); +} +/** Get Confidentiality. +@return Type of Confidentiality */ +public String getConfidentialType() +{ +return (String)get_Value("ConfidentialType"); +} + +/** ConfidentialTypeEntry AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPEENTRY_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPEENTRY_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPEENTRY_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPEENTRY_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPEENTRY_PrivateInformation = "P"; +/** Set Entry Confidentiality. +@param ConfidentialTypeEntry Confidentiality of the individual entry */ +public void setConfidentialTypeEntry (String ConfidentialTypeEntry) +{ +if (ConfidentialTypeEntry == null) throw new IllegalArgumentException ("ConfidentialTypeEntry is mandatory"); +if (ConfidentialTypeEntry.equals("A") || ConfidentialTypeEntry.equals("C") || ConfidentialTypeEntry.equals("I") || ConfidentialTypeEntry.equals("P")); + else throw new IllegalArgumentException ("ConfidentialTypeEntry Invalid value - " + ConfidentialTypeEntry + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialTypeEntry.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialTypeEntry = ConfidentialTypeEntry.substring(0,0); +} +set_Value ("ConfidentialTypeEntry", ConfidentialTypeEntry); +} +/** Get Entry Confidentiality. +@return Confidentiality of the individual entry */ +public String getConfidentialTypeEntry() +{ +return (String)get_Value("ConfidentialTypeEntry"); +} +/** Set Complete Plan. +@param DateCompletePlan Planned Completion Date */ +public void setDateCompletePlan (Timestamp DateCompletePlan) +{ +set_Value ("DateCompletePlan", DateCompletePlan); +} +/** Get Complete Plan. +@return Planned Completion Date */ +public Timestamp getDateCompletePlan() +{ +return (Timestamp)get_Value("DateCompletePlan"); +} +/** Set Date last action. +@param DateLastAction Date this request was last acted on */ +public void setDateLastAction (Timestamp DateLastAction) +{ +set_ValueNoCheck ("DateLastAction", DateLastAction); +} +/** Get Date last action. +@return Date this request was last acted on */ +public Timestamp getDateLastAction() +{ +return (Timestamp)get_Value("DateLastAction"); +} +/** Set Last Alert. +@param DateLastAlert Date when last alert were sent */ +public void setDateLastAlert (Timestamp DateLastAlert) +{ +set_Value ("DateLastAlert", DateLastAlert); +} +/** Get Last Alert. +@return Date when last alert were sent */ +public Timestamp getDateLastAlert() +{ +return (Timestamp)get_Value("DateLastAlert"); +} +/** Set Date next action. +@param DateNextAction Date that this request should be acted on */ +public void setDateNextAction (Timestamp DateNextAction) +{ +set_Value ("DateNextAction", DateNextAction); +} +/** Get Date next action. +@return Date that this request should be acted on */ +public Timestamp getDateNextAction() +{ +return (Timestamp)get_Value("DateNextAction"); +} +/** Set Start Plan. +@param DateStartPlan Planned Start Date */ +public void setDateStartPlan (Timestamp DateStartPlan) +{ +set_Value ("DateStartPlan", DateStartPlan); +} +/** Get Start Plan. +@return Planned Start Date */ +public Timestamp getDateStartPlan() +{ +return (Timestamp)get_Value("DateStartPlan"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} + +/** DueType AD_Reference_ID=222 */ +public static final int DUETYPE_AD_Reference_ID=222; +/** Overdue = 3 */ +public static final String DUETYPE_Overdue = "3"; +/** Due = 5 */ +public static final String DUETYPE_Due = "5"; +/** Scheduled = 7 */ +public static final String DUETYPE_Scheduled = "7"; +/** Set Due type. +@param DueType Status of the next action for this Request */ +public void setDueType (String DueType) +{ +if (DueType == null) throw new IllegalArgumentException ("DueType is mandatory"); +if (DueType.equals("3") || DueType.equals("5") || DueType.equals("7")); + else throw new IllegalArgumentException ("DueType Invalid value - " + DueType + " - Reference_ID=222 - 3 - 5 - 7"); +if (DueType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DueType = DueType.substring(0,0); +} +set_Value ("DueType", DueType); +} +/** Get Due type. +@return Status of the next action for this Request */ +public String getDueType() +{ +return (String)get_Value("DueType"); +} +/** Set End Time. +@param EndTime End of the time span */ +public void setEndTime (Timestamp EndTime) +{ +set_Value ("EndTime", EndTime); +} +/** Get End Time. +@return End of the time span */ +public Timestamp getEndTime() +{ +return (Timestamp)get_Value("EndTime"); +} +/** Set Escalated. +@param IsEscalated This request has been escalated */ +public void setIsEscalated (boolean IsEscalated) +{ +set_Value ("IsEscalated", new Boolean(IsEscalated)); +} +/** Get Escalated. +@return This request has been escalated */ +public boolean isEscalated() +{ +Object oo = get_Value("IsEscalated"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (boolean IsInvoiced) +{ +set_Value ("IsInvoiced", new Boolean(IsInvoiced)); +} +/** Get Invoiced. +@return Is this invoiced? */ +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_ValueNoCheck ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Last Result. +@param LastResult Result of last contact */ +public void setLastResult (String LastResult) +{ +if (LastResult != null && LastResult.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +LastResult = LastResult.substring(0,1999); +} +set_Value ("LastResult", LastResult); +} +/** Get Last Result. +@return Result of last contact */ +public String getLastResult() +{ +return (String)get_Value("LastResult"); +} +/** Set Change Request. +@param M_ChangeRequest_ID BOM (Engineering) Change Request */ +public void setM_ChangeRequest_ID (int M_ChangeRequest_ID) +{ +if (M_ChangeRequest_ID <= 0) set_Value ("M_ChangeRequest_ID", null); + else +set_Value ("M_ChangeRequest_ID", new Integer(M_ChangeRequest_ID)); +} +/** Get Change Request. +@return BOM (Engineering) Change Request */ +public int getM_ChangeRequest_ID() +{ +Integer ii = (Integer)get_Value("M_ChangeRequest_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_FixChangeNotice_ID AD_Reference_ID=351 */ +public static final int M_FIXCHANGENOTICE_ID_AD_Reference_ID=351; +/** Set Fixed in. +@param M_FixChangeNotice_ID Fixed in Change Notice */ +public void setM_FixChangeNotice_ID (int M_FixChangeNotice_ID) +{ +if (M_FixChangeNotice_ID <= 0) set_Value ("M_FixChangeNotice_ID", null); + else +set_Value ("M_FixChangeNotice_ID", new Integer(M_FixChangeNotice_ID)); +} +/** Get Fixed in. +@return Fixed in Change Notice */ +public int getM_FixChangeNotice_ID() +{ +Integer ii = (Integer)get_Value("M_FixChangeNotice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID <= 0) set_Value ("M_InOut_ID", null); + else +set_Value ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_ProductSpent_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTSPENT_ID_AD_Reference_ID=162; +/** Set Product Used. +@param M_ProductSpent_ID Product/Resource/Service used in Request */ +public void setM_ProductSpent_ID (int M_ProductSpent_ID) +{ +if (M_ProductSpent_ID <= 0) set_Value ("M_ProductSpent_ID", null); + else +set_Value ("M_ProductSpent_ID", new Integer(M_ProductSpent_ID)); +} +/** Get Product Used. +@return Product/Resource/Service used in Request */ +public int getM_ProductSpent_ID() +{ +Integer ii = (Integer)get_Value("M_ProductSpent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RMA. +@param M_RMA_ID Return Material Authorization */ +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID <= 0) set_Value ("M_RMA_ID", null); + else +set_Value ("M_RMA_ID", new Integer(M_RMA_ID)); +} +/** Get RMA. +@return Return Material Authorization */ +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** NextAction AD_Reference_ID=219 */ +public static final int NEXTACTION_AD_Reference_ID=219; +/** Follow up = F */ +public static final String NEXTACTION_FollowUp = "F"; +/** None = N */ +public static final String NEXTACTION_None = "N"; +/** Set Next action. +@param NextAction Next Action to be taken */ +public void setNextAction (String NextAction) +{ +if (NextAction == null) throw new IllegalArgumentException ("NextAction is mandatory"); +if (NextAction == null || NextAction.equals("F") || NextAction.equals("N")); + else throw new IllegalArgumentException ("NextAction Invalid value - " + NextAction + " - Reference_ID=219 - F - N"); +if (NextAction != null && NextAction.length() > 1) +{ +log.warning("Length > 1 - truncated"); +NextAction = NextAction.substring(0,0); +} +set_Value ("NextAction", NextAction); +} +/** Get Next action. +@return Next Action to be taken */ +public String getNextAction() +{ +return (String)get_Value("NextAction"); +} + +/** Priority AD_Reference_ID=154 */ +public static final int PRIORITY_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITY_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITY_High = "3"; +/** Medium = 5 */ +public static final String PRIORITY_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITY_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITY_Minor = "9"; +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (String Priority) +{ +if (Priority == null) throw new IllegalArgumentException ("Priority is mandatory"); +if (Priority.equals("1") || Priority.equals("3") || Priority.equals("5") || Priority.equals("7") || Priority.equals("9")); + else throw new IllegalArgumentException ("Priority Invalid value - " + Priority + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (Priority.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Priority = Priority.substring(0,0); +} +set_Value ("Priority", Priority); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public String getPriority() +{ +return (String)get_Value("Priority"); +} + +/** PriorityUser AD_Reference_ID=154 */ +public static final int PRIORITYUSER_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITYUSER_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITYUSER_High = "3"; +/** Medium = 5 */ +public static final String PRIORITYUSER_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITYUSER_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITYUSER_Minor = "9"; +/** Set User Importance. +@param PriorityUser Priority of the issue for the User */ +public void setPriorityUser (String PriorityUser) +{ +if (PriorityUser == null) throw new IllegalArgumentException ("PriorityUser is mandatory"); +if (PriorityUser == null || PriorityUser.equals("1") || PriorityUser.equals("3") || PriorityUser.equals("5") || PriorityUser.equals("7") || PriorityUser.equals("9")); + else throw new IllegalArgumentException ("PriorityUser Invalid value - " + PriorityUser + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (PriorityUser != null && PriorityUser.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityUser = PriorityUser.substring(0,0); +} +set_Value ("PriorityUser", PriorityUser); +} +/** Get User Importance. +@return Priority of the issue for the User */ +public String getPriorityUser() +{ +return (String)get_Value("PriorityUser"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity Invoiced. +@param QtyInvoiced Invoiced Quantity */ +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +set_Value ("QtyInvoiced", QtyInvoiced); +} +/** Get Quantity Invoiced. +@return Invoiced Quantity */ +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Plan. +@param QtyPlan Planned Quantity */ +public void setQtyPlan (BigDecimal QtyPlan) +{ +set_Value ("QtyPlan", QtyPlan); +} +/** Get Quantity Plan. +@return Planned Quantity */ +public BigDecimal getQtyPlan() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyPlan"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Used. +@param QtySpent Quantity used for this event */ +public void setQtySpent (BigDecimal QtySpent) +{ +set_Value ("QtySpent", QtySpent); +} +/** Get Quantity Used. +@return Quantity used for this event */ +public BigDecimal getQtySpent() +{ +BigDecimal bd = (BigDecimal)get_Value("QtySpent"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Category. +@param R_Category_ID Request Category */ +public void setR_Category_ID (int R_Category_ID) +{ +if (R_Category_ID <= 0) set_Value ("R_Category_ID", null); + else +set_Value ("R_Category_ID", new Integer(R_Category_ID)); +} +/** Get Category. +@return Request Category */ +public int getR_Category_ID() +{ +Integer ii = (Integer)get_Value("R_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Group. +@param R_Group_ID Request Group */ +public void setR_Group_ID (int R_Group_ID) +{ +if (R_Group_ID <= 0) set_Value ("R_Group_ID", null); + else +set_Value ("R_Group_ID", new Integer(R_Group_ID)); +} +/** Get Group. +@return Request Group */ +public int getR_Group_ID() +{ +Integer ii = (Integer)get_Value("R_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Mail Template. +@param R_MailText_ID Text templates for mailings */ +public void setR_MailText_ID (int R_MailText_ID) +{ +if (R_MailText_ID <= 0) set_Value ("R_MailText_ID", null); + else +set_Value ("R_MailText_ID", new Integer(R_MailText_ID)); +} +/** Get Mail Template. +@return Text templates for mailings */ +public int getR_MailText_ID() +{ +Integer ii = (Integer)get_Value("R_MailText_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** R_RequestRelated_ID AD_Reference_ID=341 */ +public static final int R_REQUESTRELATED_ID_AD_Reference_ID=341; +/** Set Related Request. +@param R_RequestRelated_ID Related Request (Master Issue, ..) */ +public void setR_RequestRelated_ID (int R_RequestRelated_ID) +{ +if (R_RequestRelated_ID <= 0) set_Value ("R_RequestRelated_ID", null); + else +set_Value ("R_RequestRelated_ID", new Integer(R_RequestRelated_ID)); +} +/** Get Related Request. +@return Related Request (Master Issue, ..) */ +public int getR_RequestRelated_ID() +{ +Integer ii = (Integer)get_Value("R_RequestRelated_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID < 1) throw new IllegalArgumentException ("R_RequestType_ID is mandatory."); +set_Value ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request. +@param R_Request_ID Request from a Business Partner or Prospect */ +public void setR_Request_ID (int R_Request_ID) +{ +if (R_Request_ID < 1) throw new IllegalArgumentException ("R_Request_ID is mandatory."); +set_ValueNoCheck ("R_Request_ID", new Integer(R_Request_ID)); +} +/** Get Request. +@return Request from a Business Partner or Prospect */ +public int getR_Request_ID() +{ +Integer ii = (Integer)get_Value("R_Request_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resolution. +@param R_Resolution_ID Request Resolution */ +public void setR_Resolution_ID (int R_Resolution_ID) +{ +if (R_Resolution_ID <= 0) set_Value ("R_Resolution_ID", null); + else +set_Value ("R_Resolution_ID", new Integer(R_Resolution_ID)); +} +/** Get Resolution. +@return Request Resolution */ +public int getR_Resolution_ID() +{ +Integer ii = (Integer)get_Value("R_Resolution_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Standard Response. +@param R_StandardResponse_ID Request Standard Response */ +public void setR_StandardResponse_ID (int R_StandardResponse_ID) +{ +if (R_StandardResponse_ID <= 0) set_Value ("R_StandardResponse_ID", null); + else +set_Value ("R_StandardResponse_ID", new Integer(R_StandardResponse_ID)); +} +/** Get Standard Response. +@return Request Standard Response */ +public int getR_StandardResponse_ID() +{ +Integer ii = (Integer)get_Value("R_StandardResponse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Status. +@param R_Status_ID Request Status */ +public void setR_Status_ID (int R_Status_ID) +{ +if (R_Status_ID <= 0) set_Value ("R_Status_ID", null); + else +set_Value ("R_Status_ID", new Integer(R_Status_ID)); +} +/** Get Status. +@return Request Status */ +public int getR_Status_ID() +{ +Integer ii = (Integer)get_Value("R_Status_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID <= 0) set_ValueNoCheck ("Record_ID", null); + else +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Amount. +@param RequestAmt Amount associated with this request */ +public void setRequestAmt (BigDecimal RequestAmt) +{ +if (RequestAmt == null) throw new IllegalArgumentException ("RequestAmt is mandatory."); +set_Value ("RequestAmt", RequestAmt); +} +/** Get Request Amount. +@return Amount associated with this request */ +public BigDecimal getRequestAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RequestAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Result. +@param Result Result of the action taken */ +public void setResult (String Result) +{ +if (Result != null && Result.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Result = Result.substring(0,1999); +} +set_Value ("Result", Result); +} +/** Get Result. +@return Result of the action taken */ +public String getResult() +{ +return (String)get_Value("Result"); +} + +/** SalesRep_ID AD_Reference_ID=286 */ +public static final int SALESREP_ID_AD_Reference_ID=286; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +/** Set Start Time. +@param StartTime Time started */ +public void setStartTime (Timestamp StartTime) +{ +set_Value ("StartTime", StartTime); +} +/** Get Start Time. +@return Time started */ +public Timestamp getStartTime() +{ +return (Timestamp)get_Value("StartTime"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary == null) throw new IllegalArgumentException ("Summary is mandatory."); +if (Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} + +/** TaskStatus AD_Reference_ID=366 */ +public static final int TASKSTATUS_AD_Reference_ID=366; +/** 0% Not Started = 0 */ +public static final String TASKSTATUS_0NotStarted = "0"; +/** 20% Started = 2 */ +public static final String TASKSTATUS_20Started = "2"; +/** 40% Busy = 4 */ +public static final String TASKSTATUS_40Busy = "4"; +/** 60% Good Progress = 6 */ +public static final String TASKSTATUS_60GoodProgress = "6"; +/** 80% Nearly Done = 8 */ +public static final String TASKSTATUS_80NearlyDone = "8"; +/** 90% Finishing = 9 */ +public static final String TASKSTATUS_90Finishing = "9"; +/** 95% Almost Done = A */ +public static final String TASKSTATUS_95AlmostDone = "A"; +/** 99% Cleaning up = C */ +public static final String TASKSTATUS_99CleaningUp = "C"; +/** 100% Complete = D */ +public static final String TASKSTATUS_100Complete = "D"; +/** Set Task Status. +@param TaskStatus Status of the Task */ +public void setTaskStatus (String TaskStatus) +{ +if (TaskStatus == null) throw new IllegalArgumentException ("TaskStatus is mandatory"); +if (TaskStatus == null || TaskStatus.equals("0") || TaskStatus.equals("2") || TaskStatus.equals("4") || TaskStatus.equals("6") || TaskStatus.equals("8") || TaskStatus.equals("9") || TaskStatus.equals("A") || TaskStatus.equals("C") || TaskStatus.equals("D")); + else throw new IllegalArgumentException ("TaskStatus Invalid value - " + TaskStatus + " - Reference_ID=366 - 0 - 2 - 4 - 6 - 8 - 9 - A - C - D"); +if (TaskStatus != null && TaskStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TaskStatus = TaskStatus.substring(0,0); +} +set_Value ("TaskStatus", TaskStatus); +} +/** Get Task Status. +@return Status of the Task */ +public String getTaskStatus() +{ +return (String)get_Value("TaskStatus"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestAction.java b/dbPort/src/org/compiere/model/X_R_RequestAction.java new file mode 100644 index 0000000000..02f2059ac2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestAction.java @@ -0,0 +1,784 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestAction + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.093 */ +public class X_R_RequestAction extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestAction_ID id +@param trxName transaction +*/ +public X_R_RequestAction (Properties ctx, int R_RequestAction_ID, String trxName) +{ +super (ctx, R_RequestAction_ID, trxName); +/** if (R_RequestAction_ID == 0) +{ +setR_RequestAction_ID (0); +setR_Request_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestAction (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=418 */ +public static final int Table_ID=418; + +/** TableName=R_RequestAction */ +public static final String Table_Name="R_RequestAction"; + +protected static KeyNamePair Model = new KeyNamePair(418,"R_RequestAction"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestAction[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Role. +@param AD_Role_ID Responsibility Role */ +public void setAD_Role_ID (int AD_Role_ID) +{ +if (AD_Role_ID <= 0) set_ValueNoCheck ("AD_Role_ID", null); + else +set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); +} +/** Get Role. +@return Responsibility Role */ +public int getAD_Role_ID() +{ +Integer ii = (Integer)get_Value("AD_Role_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_ValueNoCheck ("AD_User_ID", null); + else +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Asset. +@param A_Asset_ID Asset used internally or by customers */ +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_ValueNoCheck ("A_Asset_ID", null); + else +set_ValueNoCheck ("A_Asset_ID", new Integer(A_Asset_ID)); +} +/** Get Asset. +@return Asset used internally or by customers */ +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_ValueNoCheck ("C_Activity_ID", null); + else +set_ValueNoCheck ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_ValueNoCheck ("C_BPartner_ID", null); + else +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Order. +@param C_Order_ID Order */ +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); + else +set_ValueNoCheck ("C_Order_ID", new Integer(C_Order_ID)); +} +/** Get Order. +@return Order */ +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_ValueNoCheck ("C_Payment_ID", null); + else +set_ValueNoCheck ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_ValueNoCheck ("C_Project_ID", null); + else +set_ValueNoCheck ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ConfidentialType AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPE_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPE_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPE_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPE_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPE_PrivateInformation = "P"; +/** Set Confidentiality. +@param ConfidentialType Type of Confidentiality */ +public void setConfidentialType (String ConfidentialType) +{ +if (ConfidentialType == null) throw new IllegalArgumentException ("ConfidentialType is mandatory"); +if (ConfidentialType == null || ConfidentialType.equals("A") || ConfidentialType.equals("C") || ConfidentialType.equals("I") || ConfidentialType.equals("P")); + else throw new IllegalArgumentException ("ConfidentialType Invalid value - " + ConfidentialType + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialType != null && ConfidentialType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialType = ConfidentialType.substring(0,0); +} +set_ValueNoCheck ("ConfidentialType", ConfidentialType); +} +/** Get Confidentiality. +@return Type of Confidentiality */ +public String getConfidentialType() +{ +return (String)get_Value("ConfidentialType"); +} +/** Set Complete Plan. +@param DateCompletePlan Planned Completion Date */ +public void setDateCompletePlan (Timestamp DateCompletePlan) +{ +set_Value ("DateCompletePlan", DateCompletePlan); +} +/** Get Complete Plan. +@return Planned Completion Date */ +public Timestamp getDateCompletePlan() +{ +return (Timestamp)get_Value("DateCompletePlan"); +} +/** Set Date next action. +@param DateNextAction Date that this request should be acted on */ +public void setDateNextAction (Timestamp DateNextAction) +{ +set_ValueNoCheck ("DateNextAction", DateNextAction); +} +/** Get Date next action. +@return Date that this request should be acted on */ +public Timestamp getDateNextAction() +{ +return (Timestamp)get_Value("DateNextAction"); +} +/** Set Start Plan. +@param DateStartPlan Planned Start Date */ +public void setDateStartPlan (Timestamp DateStartPlan) +{ +set_Value ("DateStartPlan", DateStartPlan); +} +/** Get Start Plan. +@return Planned Start Date */ +public Timestamp getDateStartPlan() +{ +return (Timestamp)get_Value("DateStartPlan"); +} +/** Set End Date. +@param EndDate Last effective date (inclusive) */ +public void setEndDate (Timestamp EndDate) +{ +set_Value ("EndDate", EndDate); +} +/** Get End Date. +@return Last effective date (inclusive) */ +public Timestamp getEndDate() +{ +return (Timestamp)get_Value("EndDate"); +} + +/** IsEscalated AD_Reference_ID=319 */ +public static final int ISESCALATED_AD_Reference_ID=319; +/** No = N */ +public static final String ISESCALATED_No = "N"; +/** Yes = Y */ +public static final String ISESCALATED_Yes = "Y"; +/** Set Escalated. +@param IsEscalated This request has been escalated */ +public void setIsEscalated (String IsEscalated) +{ +if (IsEscalated == null) throw new IllegalArgumentException ("IsEscalated is mandatory"); +if (IsEscalated == null || IsEscalated.equals("N") || IsEscalated.equals("Y")); + else throw new IllegalArgumentException ("IsEscalated Invalid value - " + IsEscalated + " - Reference_ID=319 - N - Y"); +if (IsEscalated != null && IsEscalated.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsEscalated = IsEscalated.substring(0,0); +} +set_ValueNoCheck ("IsEscalated", IsEscalated); +} +/** Get Escalated. +@return This request has been escalated */ +public String getIsEscalated() +{ +return (String)get_Value("IsEscalated"); +} + +/** IsInvoiced AD_Reference_ID=319 */ +public static final int ISINVOICED_AD_Reference_ID=319; +/** No = N */ +public static final String ISINVOICED_No = "N"; +/** Yes = Y */ +public static final String ISINVOICED_Yes = "Y"; +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (String IsInvoiced) +{ +if (IsInvoiced == null) throw new IllegalArgumentException ("IsInvoiced is mandatory"); +if (IsInvoiced == null || IsInvoiced.equals("N") || IsInvoiced.equals("Y")); + else throw new IllegalArgumentException ("IsInvoiced Invalid value - " + IsInvoiced + " - Reference_ID=319 - N - Y"); +if (IsInvoiced != null && IsInvoiced.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsInvoiced = IsInvoiced.substring(0,0); +} +set_ValueNoCheck ("IsInvoiced", IsInvoiced); +} +/** Get Invoiced. +@return Is this invoiced? */ +public String getIsInvoiced() +{ +return (String)get_Value("IsInvoiced"); +} + +/** IsSelfService AD_Reference_ID=319 */ +public static final int ISSELFSERVICE_AD_Reference_ID=319; +/** No = N */ +public static final String ISSELFSERVICE_No = "N"; +/** Yes = Y */ +public static final String ISSELFSERVICE_Yes = "Y"; +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (String IsSelfService) +{ +if (IsSelfService == null) throw new IllegalArgumentException ("IsSelfService is mandatory"); +if (IsSelfService == null || IsSelfService.equals("N") || IsSelfService.equals("Y")); + else throw new IllegalArgumentException ("IsSelfService Invalid value - " + IsSelfService + " - Reference_ID=319 - N - Y"); +if (IsSelfService != null && IsSelfService.length() > 1) +{ +log.warning("Length > 1 - truncated"); +IsSelfService = IsSelfService.substring(0,0); +} +set_ValueNoCheck ("IsSelfService", IsSelfService); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public String getIsSelfService() +{ +return (String)get_Value("IsSelfService"); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID <= 0) set_ValueNoCheck ("M_InOut_ID", null); + else +set_ValueNoCheck ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_ProductSpent_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTSPENT_ID_AD_Reference_ID=162; +/** Set Product Used. +@param M_ProductSpent_ID Product/Resource/Service used in Request */ +public void setM_ProductSpent_ID (int M_ProductSpent_ID) +{ +if (M_ProductSpent_ID <= 0) set_Value ("M_ProductSpent_ID", null); + else +set_Value ("M_ProductSpent_ID", new Integer(M_ProductSpent_ID)); +} +/** Get Product Used. +@return Product/Resource/Service used in Request */ +public int getM_ProductSpent_ID() +{ +Integer ii = (Integer)get_Value("M_ProductSpent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_ValueNoCheck ("M_Product_ID", null); + else +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set RMA. +@param M_RMA_ID Return Material Authorization */ +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID <= 0) set_ValueNoCheck ("M_RMA_ID", null); + else +set_ValueNoCheck ("M_RMA_ID", new Integer(M_RMA_ID)); +} +/** Get RMA. +@return Return Material Authorization */ +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Null Columns. +@param NullColumns Columns with NULL value */ +public void setNullColumns (String NullColumns) +{ +if (NullColumns != null && NullColumns.length() > 255) +{ +log.warning("Length > 255 - truncated"); +NullColumns = NullColumns.substring(0,254); +} +set_ValueNoCheck ("NullColumns", NullColumns); +} +/** Get Null Columns. +@return Columns with NULL value */ +public String getNullColumns() +{ +return (String)get_Value("NullColumns"); +} + +/** Priority AD_Reference_ID=154 */ +public static final int PRIORITY_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITY_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITY_High = "3"; +/** Medium = 5 */ +public static final String PRIORITY_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITY_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITY_Minor = "9"; +/** Set Priority. +@param Priority Indicates if this request is of a high, medium or low priority. */ +public void setPriority (String Priority) +{ +if (Priority == null) throw new IllegalArgumentException ("Priority is mandatory"); +if (Priority == null || Priority.equals("1") || Priority.equals("3") || Priority.equals("5") || Priority.equals("7") || Priority.equals("9")); + else throw new IllegalArgumentException ("Priority Invalid value - " + Priority + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (Priority != null && Priority.length() > 1) +{ +log.warning("Length > 1 - truncated"); +Priority = Priority.substring(0,0); +} +set_ValueNoCheck ("Priority", Priority); +} +/** Get Priority. +@return Indicates if this request is of a high, medium or low priority. */ +public String getPriority() +{ +return (String)get_Value("Priority"); +} + +/** PriorityUser AD_Reference_ID=154 */ +public static final int PRIORITYUSER_AD_Reference_ID=154; +/** Urgent = 1 */ +public static final String PRIORITYUSER_Urgent = "1"; +/** High = 3 */ +public static final String PRIORITYUSER_High = "3"; +/** Medium = 5 */ +public static final String PRIORITYUSER_Medium = "5"; +/** Low = 7 */ +public static final String PRIORITYUSER_Low = "7"; +/** Minor = 9 */ +public static final String PRIORITYUSER_Minor = "9"; +/** Set User Importance. +@param PriorityUser Priority of the issue for the User */ +public void setPriorityUser (String PriorityUser) +{ +if (PriorityUser == null) throw new IllegalArgumentException ("PriorityUser is mandatory"); +if (PriorityUser == null || PriorityUser.equals("1") || PriorityUser.equals("3") || PriorityUser.equals("5") || PriorityUser.equals("7") || PriorityUser.equals("9")); + else throw new IllegalArgumentException ("PriorityUser Invalid value - " + PriorityUser + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); +if (PriorityUser != null && PriorityUser.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityUser = PriorityUser.substring(0,0); +} +set_ValueNoCheck ("PriorityUser", PriorityUser); +} +/** Get User Importance. +@return Priority of the issue for the User */ +public String getPriorityUser() +{ +return (String)get_Value("PriorityUser"); +} +/** Set Quantity Invoiced. +@param QtyInvoiced Invoiced Quantity */ +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +set_Value ("QtyInvoiced", QtyInvoiced); +} +/** Get Quantity Invoiced. +@return Invoiced Quantity */ +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Plan. +@param QtyPlan Planned Quantity */ +public void setQtyPlan (BigDecimal QtyPlan) +{ +set_Value ("QtyPlan", QtyPlan); +} +/** Get Quantity Plan. +@return Planned Quantity */ +public BigDecimal getQtyPlan() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyPlan"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Used. +@param QtySpent Quantity used for this event */ +public void setQtySpent (BigDecimal QtySpent) +{ +set_Value ("QtySpent", QtySpent); +} +/** Get Quantity Used. +@return Quantity used for this event */ +public BigDecimal getQtySpent() +{ +BigDecimal bd = (BigDecimal)get_Value("QtySpent"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Category. +@param R_Category_ID Request Category */ +public void setR_Category_ID (int R_Category_ID) +{ +if (R_Category_ID <= 0) set_ValueNoCheck ("R_Category_ID", null); + else +set_ValueNoCheck ("R_Category_ID", new Integer(R_Category_ID)); +} +/** Get Category. +@return Request Category */ +public int getR_Category_ID() +{ +Integer ii = (Integer)get_Value("R_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Group. +@param R_Group_ID Request Group */ +public void setR_Group_ID (int R_Group_ID) +{ +if (R_Group_ID <= 0) set_ValueNoCheck ("R_Group_ID", null); + else +set_ValueNoCheck ("R_Group_ID", new Integer(R_Group_ID)); +} +/** Get Group. +@return Request Group */ +public int getR_Group_ID() +{ +Integer ii = (Integer)get_Value("R_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request History. +@param R_RequestAction_ID Request has been changed */ +public void setR_RequestAction_ID (int R_RequestAction_ID) +{ +if (R_RequestAction_ID < 1) throw new IllegalArgumentException ("R_RequestAction_ID is mandatory."); +set_ValueNoCheck ("R_RequestAction_ID", new Integer(R_RequestAction_ID)); +} +/** Get Request History. +@return Request has been changed */ +public int getR_RequestAction_ID() +{ +Integer ii = (Integer)get_Value("R_RequestAction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_ValueNoCheck ("R_RequestType_ID", null); + else +set_ValueNoCheck ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request. +@param R_Request_ID Request from a Business Partner or Prospect */ +public void setR_Request_ID (int R_Request_ID) +{ +if (R_Request_ID < 1) throw new IllegalArgumentException ("R_Request_ID is mandatory."); +set_ValueNoCheck ("R_Request_ID", new Integer(R_Request_ID)); +} +/** Get Request. +@return Request from a Business Partner or Prospect */ +public int getR_Request_ID() +{ +Integer ii = (Integer)get_Value("R_Request_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resolution. +@param R_Resolution_ID Request Resolution */ +public void setR_Resolution_ID (int R_Resolution_ID) +{ +if (R_Resolution_ID <= 0) set_ValueNoCheck ("R_Resolution_ID", null); + else +set_ValueNoCheck ("R_Resolution_ID", new Integer(R_Resolution_ID)); +} +/** Get Resolution. +@return Request Resolution */ +public int getR_Resolution_ID() +{ +Integer ii = (Integer)get_Value("R_Resolution_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Status. +@param R_Status_ID Request Status */ +public void setR_Status_ID (int R_Status_ID) +{ +if (R_Status_ID <= 0) set_ValueNoCheck ("R_Status_ID", null); + else +set_ValueNoCheck ("R_Status_ID", new Integer(R_Status_ID)); +} +/** Get Status. +@return Request Status */ +public int getR_Status_ID() +{ +Integer ii = (Integer)get_Value("R_Status_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** SalesRep_ID AD_Reference_ID=110 */ +public static final int SALESREP_ID_AD_Reference_ID=110; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_ValueNoCheck ("SalesRep_ID", null); + else +set_ValueNoCheck ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_ValueNoCheck ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} + +/** TaskStatus AD_Reference_ID=366 */ +public static final int TASKSTATUS_AD_Reference_ID=366; +/** 0% Not Started = 0 */ +public static final String TASKSTATUS_0NotStarted = "0"; +/** 20% Started = 2 */ +public static final String TASKSTATUS_20Started = "2"; +/** 40% Busy = 4 */ +public static final String TASKSTATUS_40Busy = "4"; +/** 60% Good Progress = 6 */ +public static final String TASKSTATUS_60GoodProgress = "6"; +/** 80% Nearly Done = 8 */ +public static final String TASKSTATUS_80NearlyDone = "8"; +/** 90% Finishing = 9 */ +public static final String TASKSTATUS_90Finishing = "9"; +/** 95% Almost Done = A */ +public static final String TASKSTATUS_95AlmostDone = "A"; +/** 99% Cleaning up = C */ +public static final String TASKSTATUS_99CleaningUp = "C"; +/** 100% Complete = D */ +public static final String TASKSTATUS_100Complete = "D"; +/** Set Task Status. +@param TaskStatus Status of the Task */ +public void setTaskStatus (String TaskStatus) +{ +if (TaskStatus == null) throw new IllegalArgumentException ("TaskStatus is mandatory"); +if (TaskStatus == null || TaskStatus.equals("0") || TaskStatus.equals("2") || TaskStatus.equals("4") || TaskStatus.equals("6") || TaskStatus.equals("8") || TaskStatus.equals("9") || TaskStatus.equals("A") || TaskStatus.equals("C") || TaskStatus.equals("D")); + else throw new IllegalArgumentException ("TaskStatus Invalid value - " + TaskStatus + " - Reference_ID=366 - 0 - 2 - 4 - 6 - 8 - 9 - A - C - D"); +if (TaskStatus != null && TaskStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +TaskStatus = TaskStatus.substring(0,0); +} +set_Value ("TaskStatus", TaskStatus); +} +/** Get Task Status. +@return Status of the Task */ +public String getTaskStatus() +{ +return (String)get_Value("TaskStatus"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestProcessor.java b/dbPort/src/org/compiere/model/X_R_RequestProcessor.java new file mode 100644 index 0000000000..43f827b916 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestProcessor.java @@ -0,0 +1,342 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestProcessor + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.14 */ +public class X_R_RequestProcessor extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestProcessor_ID id +@param trxName transaction +*/ +public X_R_RequestProcessor (Properties ctx, int R_RequestProcessor_ID, String trxName) +{ +super (ctx, R_RequestProcessor_ID, trxName); +/** if (R_RequestProcessor_ID == 0) +{ +setFrequency (0); // 1 +setFrequencyType (null); +setInactivityAlertDays (0); // 0 +setKeepLogDays (0); // 7 +setName (null); +setOverdueAlertDays (0); // 0 +setOverdueAssignDays (0); // 0 +setR_RequestProcessor_ID (0); +setRemindDays (0); // 0 +setSupervisor_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestProcessor (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=420 */ +public static final int Table_ID=420; + +/** TableName=R_RequestProcessor */ +public static final String Table_Name="R_RequestProcessor"; + +protected static KeyNamePair Model = new KeyNamePair(420,"R_RequestProcessor"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestProcessor[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Date last run. +@param DateLastRun Date the process was last run. */ +public void setDateLastRun (Timestamp DateLastRun) +{ +set_Value ("DateLastRun", DateLastRun); +} +/** Get Date last run. +@return Date the process was last run. */ +public Timestamp getDateLastRun() +{ +return (Timestamp)get_Value("DateLastRun"); +} +/** Set Date next run. +@param DateNextRun Date the process will run next */ +public void setDateNextRun (Timestamp DateNextRun) +{ +set_Value ("DateNextRun", DateNextRun); +} +/** Get Date next run. +@return Date the process will run next */ +public Timestamp getDateNextRun() +{ +return (Timestamp)get_Value("DateNextRun"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Frequency. +@param Frequency Frequency of events */ +public void setFrequency (int Frequency) +{ +set_Value ("Frequency", new Integer(Frequency)); +} +/** Get Frequency. +@return Frequency of events */ +public int getFrequency() +{ +Integer ii = (Integer)get_Value("Frequency"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** FrequencyType AD_Reference_ID=221 */ +public static final int FREQUENCYTYPE_AD_Reference_ID=221; +/** Day = D */ +public static final String FREQUENCYTYPE_Day = "D"; +/** Hour = H */ +public static final String FREQUENCYTYPE_Hour = "H"; +/** Minute = M */ +public static final String FREQUENCYTYPE_Minute = "M"; +/** Set Frequency Type. +@param FrequencyType Frequency of event */ +public void setFrequencyType (String FrequencyType) +{ +if (FrequencyType == null) throw new IllegalArgumentException ("FrequencyType is mandatory"); +if (FrequencyType.equals("D") || FrequencyType.equals("H") || FrequencyType.equals("M")); + else throw new IllegalArgumentException ("FrequencyType Invalid value - " + FrequencyType + " - Reference_ID=221 - D - H - M"); +if (FrequencyType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FrequencyType = FrequencyType.substring(0,0); +} +set_Value ("FrequencyType", FrequencyType); +} +/** Get Frequency Type. +@return Frequency of event */ +public String getFrequencyType() +{ +return (String)get_Value("FrequencyType"); +} +/** Set Inactivity Alert Days. +@param InactivityAlertDays Send Alert when there is no activity after days (0= no alert) */ +public void setInactivityAlertDays (int InactivityAlertDays) +{ +set_Value ("InactivityAlertDays", new Integer(InactivityAlertDays)); +} +/** Get Inactivity Alert Days. +@return Send Alert when there is no activity after days (0= no alert) */ +public int getInactivityAlertDays() +{ +Integer ii = (Integer)get_Value("InactivityAlertDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Days to keep Log. +@param KeepLogDays Number of days to keep the log entries */ +public void setKeepLogDays (int KeepLogDays) +{ +set_Value ("KeepLogDays", new Integer(KeepLogDays)); +} +/** Get Days to keep Log. +@return Number of days to keep the log entries */ +public int getKeepLogDays() +{ +Integer ii = (Integer)get_Value("KeepLogDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Alert after Days Due. +@param OverdueAlertDays Send email alert after number of days due (0=no alerts) */ +public void setOverdueAlertDays (int OverdueAlertDays) +{ +set_Value ("OverdueAlertDays", new Integer(OverdueAlertDays)); +} +/** Get Alert after Days Due. +@return Send email alert after number of days due (0=no alerts) */ +public int getOverdueAlertDays() +{ +Integer ii = (Integer)get_Value("OverdueAlertDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Escalate after Days Due. +@param OverdueAssignDays Escalation to superior after number of due days (0 = no) */ +public void setOverdueAssignDays (int OverdueAssignDays) +{ +set_Value ("OverdueAssignDays", new Integer(OverdueAssignDays)); +} +/** Get Escalate after Days Due. +@return Escalation to superior after number of due days (0 = no) */ +public int getOverdueAssignDays() +{ +Integer ii = (Integer)get_Value("OverdueAssignDays"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Request Processor. +@param R_RequestProcessor_ID Processor for Requests */ +public void setR_RequestProcessor_ID (int R_RequestProcessor_ID) +{ +if (R_RequestProcessor_ID < 1) throw new IllegalArgumentException ("R_RequestProcessor_ID is mandatory."); +set_ValueNoCheck ("R_RequestProcessor_ID", new Integer(R_RequestProcessor_ID)); +} +/** Get Request Processor. +@return Processor for Requests */ +public int getR_RequestProcessor_ID() +{ +Integer ii = (Integer)get_Value("R_RequestProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_Value ("R_RequestType_ID", null); + else +set_Value ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Reminder Days. +@param RemindDays Days between sending Reminder Emails for a due or inactive Document */ +public void setRemindDays (int RemindDays) +{ +set_Value ("RemindDays", new Integer(RemindDays)); +} +/** Get Reminder Days. +@return Days between sending Reminder Emails for a due or inactive Document */ +public int getRemindDays() +{ +Integer ii = (Integer)get_Value("RemindDays"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Supervisor_ID AD_Reference_ID=286 */ +public static final int SUPERVISOR_ID_AD_Reference_ID=286; +/** Set Supervisor. +@param Supervisor_ID Supervisor for this user/organization - used for escalation and approval */ +public void setSupervisor_ID (int Supervisor_ID) +{ +if (Supervisor_ID < 1) throw new IllegalArgumentException ("Supervisor_ID is mandatory."); +set_Value ("Supervisor_ID", new Integer(Supervisor_ID)); +} +/** Get Supervisor. +@return Supervisor for this user/organization - used for escalation and approval */ +public int getSupervisor_ID() +{ +Integer ii = (Integer)get_Value("Supervisor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestProcessorLog.java b/dbPort/src/org/compiere/model/X_R_RequestProcessorLog.java new file mode 100644 index 0000000000..b0f9ecdea3 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestProcessorLog.java @@ -0,0 +1,218 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestProcessorLog + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.187 */ +public class X_R_RequestProcessorLog extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestProcessorLog_ID id +@param trxName transaction +*/ +public X_R_RequestProcessorLog (Properties ctx, int R_RequestProcessorLog_ID, String trxName) +{ +super (ctx, R_RequestProcessorLog_ID, trxName); +/** if (R_RequestProcessorLog_ID == 0) +{ +setIsError (false); +setR_RequestProcessorLog_ID (0); +setR_RequestProcessor_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestProcessorLog (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=659 */ +public static final int Table_ID=659; + +/** TableName=R_RequestProcessorLog */ +public static final String Table_Name="R_RequestProcessorLog"; + +protected static KeyNamePair Model = new KeyNamePair(659,"R_RequestProcessorLog"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestProcessorLog[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (byte[] BinaryData) +{ +set_Value ("BinaryData", BinaryData); +} +/** Get BinaryData. +@return Binary Data */ +public byte[] getBinaryData() +{ +return (byte[])get_Value("BinaryData"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Error. +@param IsError An Error occured in the execution */ +public void setIsError (boolean IsError) +{ +set_Value ("IsError", new Boolean(IsError)); +} +/** Get Error. +@return An Error occured in the execution */ +public boolean isError() +{ +Object oo = get_Value("IsError"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Request Processor Log. +@param R_RequestProcessorLog_ID Result of the execution of the Request Processor */ +public void setR_RequestProcessorLog_ID (int R_RequestProcessorLog_ID) +{ +if (R_RequestProcessorLog_ID < 1) throw new IllegalArgumentException ("R_RequestProcessorLog_ID is mandatory."); +set_ValueNoCheck ("R_RequestProcessorLog_ID", new Integer(R_RequestProcessorLog_ID)); +} +/** Get Request Processor Log. +@return Result of the execution of the Request Processor */ +public int getR_RequestProcessorLog_ID() +{ +Integer ii = (Integer)get_Value("R_RequestProcessorLog_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Processor. +@param R_RequestProcessor_ID Processor for Requests */ +public void setR_RequestProcessor_ID (int R_RequestProcessor_ID) +{ +if (R_RequestProcessor_ID < 1) throw new IllegalArgumentException ("R_RequestProcessor_ID is mandatory."); +set_ValueNoCheck ("R_RequestProcessor_ID", new Integer(R_RequestProcessor_ID)); +} +/** Get Request Processor. +@return Processor for Requests */ +public int getR_RequestProcessor_ID() +{ +Integer ii = (Integer)get_Value("R_RequestProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Reference. +@param Reference Reference for this record */ +public void setReference (String Reference) +{ +if (Reference != null && Reference.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Reference = Reference.substring(0,59); +} +set_Value ("Reference", Reference); +} +/** Get Reference. +@return Reference for this record */ +public String getReference() +{ +return (String)get_Value("Reference"); +} +/** Set Summary. +@param Summary Textual summary of this request */ +public void setSummary (String Summary) +{ +if (Summary != null && Summary.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Summary = Summary.substring(0,1999); +} +set_Value ("Summary", Summary); +} +/** Get Summary. +@return Textual summary of this request */ +public String getSummary() +{ +return (String)get_Value("Summary"); +} +/** Set Text Message. +@param TextMsg Text Message */ +public void setTextMsg (String TextMsg) +{ +if (TextMsg != null && TextMsg.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +TextMsg = TextMsg.substring(0,1999); +} +set_Value ("TextMsg", TextMsg); +} +/** Get Text Message. +@return Text Message */ +public String getTextMsg() +{ +return (String)get_Value("TextMsg"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestProcessor_Route.java b/dbPort/src/org/compiere/model/X_R_RequestProcessor_Route.java new file mode 100644 index 0000000000..74970f6bbf --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestProcessor_Route.java @@ -0,0 +1,191 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestProcessor_Route + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.187 */ +public class X_R_RequestProcessor_Route extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestProcessor_Route_ID id +@param trxName transaction +*/ +public X_R_RequestProcessor_Route (Properties ctx, int R_RequestProcessor_Route_ID, String trxName) +{ +super (ctx, R_RequestProcessor_Route_ID, trxName); +/** if (R_RequestProcessor_Route_ID == 0) +{ +setAD_User_ID (0); +setR_RequestProcessor_ID (0); +setR_RequestProcessor_Route_ID (0); +setSeqNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestProcessor_Route (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=474 */ +public static final int Table_ID=474; + +/** TableName=R_RequestProcessor_Route */ +public static final String Table_Name="R_RequestProcessor_Route"; + +protected static KeyNamePair Model = new KeyNamePair(474,"R_RequestProcessor_Route"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestProcessor_Route[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Keyword. +@param Keyword Case insensitive keyword */ +public void setKeyword (String Keyword) +{ +if (Keyword != null && Keyword.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Keyword = Keyword.substring(0,59); +} +set_Value ("Keyword", Keyword); +} +/** Get Keyword. +@return Case insensitive keyword */ +public String getKeyword() +{ +return (String)get_Value("Keyword"); +} +/** Set Request Processor. +@param R_RequestProcessor_ID Processor for Requests */ +public void setR_RequestProcessor_ID (int R_RequestProcessor_ID) +{ +if (R_RequestProcessor_ID < 1) throw new IllegalArgumentException ("R_RequestProcessor_ID is mandatory."); +set_ValueNoCheck ("R_RequestProcessor_ID", new Integer(R_RequestProcessor_ID)); +} +/** Get Request Processor. +@return Processor for Requests */ +public int getR_RequestProcessor_ID() +{ +Integer ii = (Integer)get_Value("R_RequestProcessor_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Routing. +@param R_RequestProcessor_Route_ID Automatic routing of requests */ +public void setR_RequestProcessor_Route_ID (int R_RequestProcessor_Route_ID) +{ +if (R_RequestProcessor_Route_ID < 1) throw new IllegalArgumentException ("R_RequestProcessor_Route_ID is mandatory."); +set_ValueNoCheck ("R_RequestProcessor_Route_ID", new Integer(R_RequestProcessor_Route_ID)); +} +/** Get Request Routing. +@return Automatic routing of requests */ +public int getR_RequestProcessor_Route_ID() +{ +Integer ii = (Integer)get_Value("R_RequestProcessor_Route_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID <= 0) set_Value ("R_RequestType_ID", null); + else +set_Value ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestType.java b/dbPort/src/org/compiere/model/X_R_RequestType.java new file mode 100644 index 0000000000..fec7180b5a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestType.java @@ -0,0 +1,373 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.421 */ +public class X_R_RequestType extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestType_ID id +@param trxName transaction +*/ +public X_R_RequestType (Properties ctx, int R_RequestType_ID, String trxName) +{ +super (ctx, R_RequestType_ID, trxName); +/** if (R_RequestType_ID == 0) +{ +setConfidentialType (null); // C +setDueDateTolerance (0); // 7 +setIsAutoChangeRequest (false); +setIsConfidentialInfo (false); // N +setIsDefault (false); // N +setIsEMailWhenDue (false); +setIsEMailWhenOverdue (false); +setIsIndexed (false); +setIsSelfService (true); // Y +setName (null); +setR_RequestType_ID (0); +setR_StatusCategory_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=529 */ +public static final int Table_ID=529; + +/** TableName=R_RequestType */ +public static final String Table_Name="R_RequestType"; + +protected static KeyNamePair Model = new KeyNamePair(529,"R_RequestType"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Auto Due Date Days. +@param AutoDueDateDays Automatic Due Date Days */ +public void setAutoDueDateDays (int AutoDueDateDays) +{ +set_Value ("AutoDueDateDays", new Integer(AutoDueDateDays)); +} +/** Get Auto Due Date Days. +@return Automatic Due Date Days */ +public int getAutoDueDateDays() +{ +Integer ii = (Integer)get_Value("AutoDueDateDays"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** ConfidentialType AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPE_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPE_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPE_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPE_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPE_PrivateInformation = "P"; +/** Set Confidentiality. +@param ConfidentialType Type of Confidentiality */ +public void setConfidentialType (String ConfidentialType) +{ +if (ConfidentialType == null) throw new IllegalArgumentException ("ConfidentialType is mandatory"); +if (ConfidentialType.equals("A") || ConfidentialType.equals("C") || ConfidentialType.equals("I") || ConfidentialType.equals("P")); + else throw new IllegalArgumentException ("ConfidentialType Invalid value - " + ConfidentialType + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialType = ConfidentialType.substring(0,0); +} +set_Value ("ConfidentialType", ConfidentialType); +} +/** Get Confidentiality. +@return Type of Confidentiality */ +public String getConfidentialType() +{ +return (String)get_Value("ConfidentialType"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Due Date Tolerance. +@param DueDateTolerance Tolerance in days between the Date Next Action and the date the request is regarded as overdue */ +public void setDueDateTolerance (int DueDateTolerance) +{ +set_Value ("DueDateTolerance", new Integer(DueDateTolerance)); +} +/** Get Due Date Tolerance. +@return Tolerance in days between the Date Next Action and the date the request is regarded as overdue */ +public int getDueDateTolerance() +{ +Integer ii = (Integer)get_Value("DueDateTolerance"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Create Change Request. +@param IsAutoChangeRequest Automatically create BOM (Engineering) Change Request */ +public void setIsAutoChangeRequest (boolean IsAutoChangeRequest) +{ +set_Value ("IsAutoChangeRequest", new Boolean(IsAutoChangeRequest)); +} +/** Get Create Change Request. +@return Automatically create BOM (Engineering) Change Request */ +public boolean isAutoChangeRequest() +{ +Object oo = get_Value("IsAutoChangeRequest"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Confidential Info. +@param IsConfidentialInfo Can enter confidential information */ +public void setIsConfidentialInfo (boolean IsConfidentialInfo) +{ +set_Value ("IsConfidentialInfo", new Boolean(IsConfidentialInfo)); +} +/** Get Confidential Info. +@return Can enter confidential information */ +public boolean isConfidentialInfo() +{ +Object oo = get_Value("IsConfidentialInfo"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set EMail when Due. +@param IsEMailWhenDue Send EMail when Request becomes due */ +public void setIsEMailWhenDue (boolean IsEMailWhenDue) +{ +set_Value ("IsEMailWhenDue", new Boolean(IsEMailWhenDue)); +} +/** Get EMail when Due. +@return Send EMail when Request becomes due */ +public boolean isEMailWhenDue() +{ +Object oo = get_Value("IsEMailWhenDue"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set EMail when Overdue. +@param IsEMailWhenOverdue Send EMail when Request becomes overdue */ +public void setIsEMailWhenOverdue (boolean IsEMailWhenOverdue) +{ +set_Value ("IsEMailWhenOverdue", new Boolean(IsEMailWhenOverdue)); +} +/** Get EMail when Overdue. +@return Send EMail when Request becomes overdue */ +public boolean isEMailWhenOverdue() +{ +Object oo = get_Value("IsEMailWhenOverdue"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Indexed. +@param IsIndexed Index the document for the internal search engine */ +public void setIsIndexed (boolean IsIndexed) +{ +set_Value ("IsIndexed", new Boolean(IsIndexed)); +} +/** Get Indexed. +@return Index the document for the internal search engine */ +public boolean isIndexed() +{ +Object oo = get_Value("IsIndexed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (boolean IsInvoiced) +{ +set_Value ("IsInvoiced", new Boolean(IsInvoiced)); +} +/** Get Invoiced. +@return Is this invoiced? */ +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID < 1) throw new IllegalArgumentException ("R_RequestType_ID is mandatory."); +set_ValueNoCheck ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Status Category. +@param R_StatusCategory_ID Request Status Category */ +public void setR_StatusCategory_ID (int R_StatusCategory_ID) +{ +if (R_StatusCategory_ID < 1) throw new IllegalArgumentException ("R_StatusCategory_ID is mandatory."); +set_Value ("R_StatusCategory_ID", new Integer(R_StatusCategory_ID)); +} +/** Get Status Category. +@return Request Status Category */ +public int getR_StatusCategory_ID() +{ +Integer ii = (Integer)get_Value("R_StatusCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestTypeUpdates.java b/dbPort/src/org/compiere/model/X_R_RequestTypeUpdates.java new file mode 100644 index 0000000000..fd810aa92b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestTypeUpdates.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestTypeUpdates + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.453 */ +public class X_R_RequestTypeUpdates extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestTypeUpdates_ID id +@param trxName transaction +*/ +public X_R_RequestTypeUpdates (Properties ctx, int R_RequestTypeUpdates_ID, String trxName) +{ +super (ctx, R_RequestTypeUpdates_ID, trxName); +/** if (R_RequestTypeUpdates_ID == 0) +{ +setAD_User_ID (0); +setIsSelfService (false); +setR_RequestType_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestTypeUpdates (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=784 */ +public static final int Table_ID=784; + +/** TableName=R_RequestTypeUpdates */ +public static final String Table_Name="R_RequestTypeUpdates"; + +protected static KeyNamePair Model = new KeyNamePair(784,"R_RequestTypeUpdates"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestTypeUpdates[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Request Type. +@param R_RequestType_ID Type of request (e.g. Inquiry, Complaint, ..) */ +public void setR_RequestType_ID (int R_RequestType_ID) +{ +if (R_RequestType_ID < 1) throw new IllegalArgumentException ("R_RequestType_ID is mandatory."); +set_ValueNoCheck ("R_RequestType_ID", new Integer(R_RequestType_ID)); +} +/** Get Request Type. +@return Type of request (e.g. Inquiry, Complaint, ..) */ +public int getR_RequestType_ID() +{ +Integer ii = (Integer)get_Value("R_RequestType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestUpdate.java b/dbPort/src/org/compiere/model/X_R_RequestUpdate.java new file mode 100644 index 0000000000..6814527f18 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestUpdate.java @@ -0,0 +1,245 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestUpdate + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.453 */ +public class X_R_RequestUpdate extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestUpdate_ID id +@param trxName transaction +*/ +public X_R_RequestUpdate (Properties ctx, int R_RequestUpdate_ID, String trxName) +{ +super (ctx, R_RequestUpdate_ID, trxName); +/** if (R_RequestUpdate_ID == 0) +{ +setConfidentialTypeEntry (null); +setR_RequestUpdate_ID (0); +setR_Request_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestUpdate (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=802 */ +public static final int Table_ID=802; + +/** TableName=R_RequestUpdate */ +public static final String Table_Name="R_RequestUpdate"; + +protected static KeyNamePair Model = new KeyNamePair(802,"R_RequestUpdate"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestUpdate[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** ConfidentialTypeEntry AD_Reference_ID=340 */ +public static final int CONFIDENTIALTYPEENTRY_AD_Reference_ID=340; +/** Public Information = A */ +public static final String CONFIDENTIALTYPEENTRY_PublicInformation = "A"; +/** Partner Confidential = C */ +public static final String CONFIDENTIALTYPEENTRY_PartnerConfidential = "C"; +/** Internal = I */ +public static final String CONFIDENTIALTYPEENTRY_Internal = "I"; +/** Private Information = P */ +public static final String CONFIDENTIALTYPEENTRY_PrivateInformation = "P"; +/** Set Entry Confidentiality. +@param ConfidentialTypeEntry Confidentiality of the individual entry */ +public void setConfidentialTypeEntry (String ConfidentialTypeEntry) +{ +if (ConfidentialTypeEntry == null) throw new IllegalArgumentException ("ConfidentialTypeEntry is mandatory"); +if (ConfidentialTypeEntry.equals("A") || ConfidentialTypeEntry.equals("C") || ConfidentialTypeEntry.equals("I") || ConfidentialTypeEntry.equals("P")); + else throw new IllegalArgumentException ("ConfidentialTypeEntry Invalid value - " + ConfidentialTypeEntry + " - Reference_ID=340 - A - C - I - P"); +if (ConfidentialTypeEntry.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ConfidentialTypeEntry = ConfidentialTypeEntry.substring(0,0); +} +set_Value ("ConfidentialTypeEntry", ConfidentialTypeEntry); +} +/** Get Entry Confidentiality. +@return Confidentiality of the individual entry */ +public String getConfidentialTypeEntry() +{ +return (String)get_Value("ConfidentialTypeEntry"); +} +/** Set End Time. +@param EndTime End of the time span */ +public void setEndTime (Timestamp EndTime) +{ +set_Value ("EndTime", EndTime); +} +/** Get End Time. +@return End of the time span */ +public Timestamp getEndTime() +{ +return (Timestamp)get_Value("EndTime"); +} + +/** M_ProductSpent_ID AD_Reference_ID=162 */ +public static final int M_PRODUCTSPENT_ID_AD_Reference_ID=162; +/** Set Product Used. +@param M_ProductSpent_ID Product/Resource/Service used in Request */ +public void setM_ProductSpent_ID (int M_ProductSpent_ID) +{ +if (M_ProductSpent_ID <= 0) set_Value ("M_ProductSpent_ID", null); + else +set_Value ("M_ProductSpent_ID", new Integer(M_ProductSpent_ID)); +} +/** Get Product Used. +@return Product/Resource/Service used in Request */ +public int getM_ProductSpent_ID() +{ +Integer ii = (Integer)get_Value("M_ProductSpent_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Quantity Invoiced. +@param QtyInvoiced Invoiced Quantity */ +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +set_Value ("QtyInvoiced", QtyInvoiced); +} +/** Get Quantity Invoiced. +@return Invoiced Quantity */ +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Used. +@param QtySpent Quantity used for this event */ +public void setQtySpent (BigDecimal QtySpent) +{ +set_Value ("QtySpent", QtySpent); +} +/** Get Quantity Used. +@return Quantity used for this event */ +public BigDecimal getQtySpent() +{ +BigDecimal bd = (BigDecimal)get_Value("QtySpent"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Request Update. +@param R_RequestUpdate_ID Request Updates */ +public void setR_RequestUpdate_ID (int R_RequestUpdate_ID) +{ +if (R_RequestUpdate_ID < 1) throw new IllegalArgumentException ("R_RequestUpdate_ID is mandatory."); +set_ValueNoCheck ("R_RequestUpdate_ID", new Integer(R_RequestUpdate_ID)); +} +/** Get Request Update. +@return Request Updates */ +public int getR_RequestUpdate_ID() +{ +Integer ii = (Integer)get_Value("R_RequestUpdate_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getR_RequestUpdate_ID())); +} +/** Set Request. +@param R_Request_ID Request from a Business Partner or Prospect */ +public void setR_Request_ID (int R_Request_ID) +{ +if (R_Request_ID < 1) throw new IllegalArgumentException ("R_Request_ID is mandatory."); +set_ValueNoCheck ("R_Request_ID", new Integer(R_Request_ID)); +} +/** Get Request. +@return Request from a Business Partner or Prospect */ +public int getR_Request_ID() +{ +Integer ii = (Integer)get_Value("R_Request_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Result. +@param Result Result of the action taken */ +public void setResult (String Result) +{ +if (Result != null && Result.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Result = Result.substring(0,1999); +} +set_ValueNoCheck ("Result", Result); +} +/** Get Result. +@return Result of the action taken */ +public String getResult() +{ +return (String)get_Value("Result"); +} +/** Set Start Time. +@param StartTime Time started */ +public void setStartTime (Timestamp StartTime) +{ +set_Value ("StartTime", StartTime); +} +/** Get Start Time. +@return Time started */ +public Timestamp getStartTime() +{ +return (Timestamp)get_Value("StartTime"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_RequestUpdates.java b/dbPort/src/org/compiere/model/X_R_RequestUpdates.java new file mode 100644 index 0000000000..015bbdc8c6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_RequestUpdates.java @@ -0,0 +1,138 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_RequestUpdates + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.468 */ +public class X_R_RequestUpdates extends PO +{ +/** Standard Constructor +@param ctx context +@param R_RequestUpdates_ID id +@param trxName transaction +*/ +public X_R_RequestUpdates (Properties ctx, int R_RequestUpdates_ID, String trxName) +{ +super (ctx, R_RequestUpdates_ID, trxName); +/** if (R_RequestUpdates_ID == 0) +{ +setAD_User_ID (0); +setIsSelfService (false); +setR_Request_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_RequestUpdates (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=783 */ +public static final int Table_ID=783; + +/** TableName=R_RequestUpdates */ +public static final String Table_Name="R_RequestUpdates"; + +protected static KeyNamePair Model = new KeyNamePair(783,"R_RequestUpdates"); + +protected BigDecimal accessLevel = new BigDecimal(7); +/** AccessLevel +@return 7 - System - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_RequestUpdates[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_ValueNoCheck ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Request. +@param R_Request_ID Request from a Business Partner or Prospect */ +public void setR_Request_ID (int R_Request_ID) +{ +if (R_Request_ID < 1) throw new IllegalArgumentException ("R_Request_ID is mandatory."); +set_ValueNoCheck ("R_Request_ID", new Integer(R_Request_ID)); +} +/** Get Request. +@return Request from a Business Partner or Prospect */ +public int getR_Request_ID() +{ +Integer ii = (Integer)get_Value("R_Request_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_Resolution.java b/dbPort/src/org/compiere/model/X_R_Resolution.java new file mode 100644 index 0000000000..bf45910087 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_Resolution.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_Resolution + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.468 */ +public class X_R_Resolution extends PO +{ +/** Standard Constructor +@param ctx context +@param R_Resolution_ID id +@param trxName transaction +*/ +public X_R_Resolution (Properties ctx, int R_Resolution_ID, String trxName) +{ +super (ctx, R_Resolution_ID, trxName); +/** if (R_Resolution_ID == 0) +{ +setName (null); +setR_Resolution_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_Resolution (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=774 */ +public static final int Table_ID=774; + +/** TableName=R_Resolution */ +public static final String Table_Name="R_Resolution"; + +protected static KeyNamePair Model = new KeyNamePair(774,"R_Resolution"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_Resolution[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Resolution. +@param R_Resolution_ID Request Resolution */ +public void setR_Resolution_ID (int R_Resolution_ID) +{ +if (R_Resolution_ID < 1) throw new IllegalArgumentException ("R_Resolution_ID is mandatory."); +set_ValueNoCheck ("R_Resolution_ID", new Integer(R_Resolution_ID)); +} +/** Get Resolution. +@return Request Resolution */ +public int getR_Resolution_ID() +{ +Integer ii = (Integer)get_Value("R_Resolution_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_StandardResponse.java b/dbPort/src/org/compiere/model/X_R_StandardResponse.java new file mode 100644 index 0000000000..146ae28de4 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_StandardResponse.java @@ -0,0 +1,147 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_StandardResponse + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.484 */ +public class X_R_StandardResponse extends PO +{ +/** Standard Constructor +@param ctx context +@param R_StandardResponse_ID id +@param trxName transaction +*/ +public X_R_StandardResponse (Properties ctx, int R_StandardResponse_ID, String trxName) +{ +super (ctx, R_StandardResponse_ID, trxName); +/** if (R_StandardResponse_ID == 0) +{ +setName (null); +setR_StandardResponse_ID (0); +setResponseText (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_StandardResponse (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=775 */ +public static final int Table_ID=775; + +/** TableName=R_StandardResponse */ +public static final String Table_Name="R_StandardResponse"; + +protected static KeyNamePair Model = new KeyNamePair(775,"R_StandardResponse"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_StandardResponse[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Standard Response. +@param R_StandardResponse_ID Request Standard Response */ +public void setR_StandardResponse_ID (int R_StandardResponse_ID) +{ +if (R_StandardResponse_ID < 1) throw new IllegalArgumentException ("R_StandardResponse_ID is mandatory."); +set_ValueNoCheck ("R_StandardResponse_ID", new Integer(R_StandardResponse_ID)); +} +/** Get Standard Response. +@return Request Standard Response */ +public int getR_StandardResponse_ID() +{ +Integer ii = (Integer)get_Value("R_StandardResponse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Response Text. +@param ResponseText Request Response Text */ +public void setResponseText (String ResponseText) +{ +if (ResponseText == null) throw new IllegalArgumentException ("ResponseText is mandatory."); +if (ResponseText.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +ResponseText = ResponseText.substring(0,1999); +} +set_Value ("ResponseText", ResponseText); +} +/** Get Response Text. +@return Request Response Text */ +public String getResponseText() +{ +return (String)get_Value("ResponseText"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_Status.java b/dbPort/src/org/compiere/model/X_R_Status.java new file mode 100644 index 0000000000..2127219e75 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_Status.java @@ -0,0 +1,361 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_Status + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.5 */ +public class X_R_Status extends PO +{ +/** Standard Constructor +@param ctx context +@param R_Status_ID id +@param trxName transaction +*/ +public X_R_Status (Properties ctx, int R_Status_ID, String trxName) +{ +super (ctx, R_Status_ID, trxName); +/** if (R_Status_ID == 0) +{ +setIsClosed (false); // N +setIsDefault (false); +setIsFinalClose (false); // N +setIsOpen (false); +setIsWebCanUpdate (false); +setName (null); +setR_StatusCategory_ID (0); +setR_Status_ID (0); +setSeqNo (0); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_Status (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=776 */ +public static final int Table_ID=776; + +/** TableName=R_Status */ +public static final String Table_Name="R_Status"; + +protected static KeyNamePair Model = new KeyNamePair(776,"R_Status"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_Status[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Closed Status. +@param IsClosed The status is closed */ +public void setIsClosed (boolean IsClosed) +{ +set_Value ("IsClosed", new Boolean(IsClosed)); +} +/** Get Closed Status. +@return The status is closed */ +public boolean isClosed() +{ +Object oo = get_Value("IsClosed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Final Close. +@param IsFinalClose Entries with Final Close cannot be re-opened */ +public void setIsFinalClose (boolean IsFinalClose) +{ +set_Value ("IsFinalClose", new Boolean(IsFinalClose)); +} +/** Get Final Close. +@return Entries with Final Close cannot be re-opened */ +public boolean isFinalClose() +{ +Object oo = get_Value("IsFinalClose"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Open Status. +@param IsOpen The status is closed */ +public void setIsOpen (boolean IsOpen) +{ +set_Value ("IsOpen", new Boolean(IsOpen)); +} +/** Get Open Status. +@return The status is closed */ +public boolean isOpen() +{ +Object oo = get_Value("IsOpen"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Web Can Update. +@param IsWebCanUpdate Entry can be updated from the Web */ +public void setIsWebCanUpdate (boolean IsWebCanUpdate) +{ +set_Value ("IsWebCanUpdate", new Boolean(IsWebCanUpdate)); +} +/** Get Web Can Update. +@return Entry can be updated from the Web */ +public boolean isWebCanUpdate() +{ +Object oo = get_Value("IsWebCanUpdate"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} + +/** Next_Status_ID AD_Reference_ID=345 */ +public static final int NEXT_STATUS_ID_AD_Reference_ID=345; +/** Set Next Status. +@param Next_Status_ID Move to next status automatically after timeout */ +public void setNext_Status_ID (int Next_Status_ID) +{ +if (Next_Status_ID <= 0) set_Value ("Next_Status_ID", null); + else +set_Value ("Next_Status_ID", new Integer(Next_Status_ID)); +} +/** Get Next Status. +@return Move to next status automatically after timeout */ +public int getNext_Status_ID() +{ +Integer ii = (Integer)get_Value("Next_Status_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Status Category. +@param R_StatusCategory_ID Request Status Category */ +public void setR_StatusCategory_ID (int R_StatusCategory_ID) +{ +if (R_StatusCategory_ID < 1) throw new IllegalArgumentException ("R_StatusCategory_ID is mandatory."); +set_Value ("R_StatusCategory_ID", new Integer(R_StatusCategory_ID)); +} +/** Get Status Category. +@return Request Status Category */ +public int getR_StatusCategory_ID() +{ +Integer ii = (Integer)get_Value("R_StatusCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Status. +@param R_Status_ID Request Status */ +public void setR_Status_ID (int R_Status_ID) +{ +if (R_Status_ID < 1) throw new IllegalArgumentException ("R_Status_ID is mandatory."); +set_ValueNoCheck ("R_Status_ID", new Integer(R_Status_ID)); +} +/** Get Status. +@return Request Status */ +public int getR_Status_ID() +{ +Integer ii = (Integer)get_Value("R_Status_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_Value ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSeqNo())); +} +/** Set Timeout in Days. +@param TimeoutDays Timeout in Days to change Status automatically */ +public void setTimeoutDays (int TimeoutDays) +{ +set_Value ("TimeoutDays", new Integer(TimeoutDays)); +} +/** Get Timeout in Days. +@return Timeout in Days to change Status automatically */ +public int getTimeoutDays() +{ +Integer ii = (Integer)get_Value("TimeoutDays"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Update_Status_ID AD_Reference_ID=345 */ +public static final int UPDATE_STATUS_ID_AD_Reference_ID=345; +/** Set Update Status. +@param Update_Status_ID Automatically change the status after entry from web */ +public void setUpdate_Status_ID (int Update_Status_ID) +{ +if (Update_Status_ID <= 0) set_Value ("Update_Status_ID", null); + else +set_Value ("Update_Status_ID", new Integer(Update_Status_ID)); +} +/** Get Update Status. +@return Automatically change the status after entry from web */ +public int getUpdate_Status_ID() +{ +Integer ii = (Integer)get_Value("Update_Status_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_R_StatusCategory.java b/dbPort/src/org/compiere/model/X_R_StatusCategory.java new file mode 100644 index 0000000000..55a9638ddc --- /dev/null +++ b/dbPort/src/org/compiere/model/X_R_StatusCategory.java @@ -0,0 +1,181 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for R_StatusCategory + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.515 */ +public class X_R_StatusCategory extends PO +{ +/** Standard Constructor +@param ctx context +@param R_StatusCategory_ID id +@param trxName transaction +*/ +public X_R_StatusCategory (Properties ctx, int R_StatusCategory_ID, String trxName) +{ +super (ctx, R_StatusCategory_ID, trxName); +/** if (R_StatusCategory_ID == 0) +{ +setIsDefault (false); +setName (null); +setR_StatusCategory_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_R_StatusCategory (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=844 */ +public static final int Table_ID=844; + +/** TableName=R_StatusCategory */ +public static final String Table_Name="R_StatusCategory"; + +protected static KeyNamePair Model = new KeyNamePair(844,"R_StatusCategory"); + +protected BigDecimal accessLevel = new BigDecimal(6); +/** AccessLevel +@return 6 - System - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_R_StatusCategory[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Name = Name.substring(0,119); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Status Category. +@param R_StatusCategory_ID Request Status Category */ +public void setR_StatusCategory_ID (int R_StatusCategory_ID) +{ +if (R_StatusCategory_ID < 1) throw new IllegalArgumentException ("R_StatusCategory_ID is mandatory."); +set_ValueNoCheck ("R_StatusCategory_ID", new Integer(R_StatusCategory_ID)); +} +/** Get Status Category. +@return Request Status Category */ +public int getR_StatusCategory_ID() +{ +Integer ii = (Integer)get_Value("R_StatusCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_ExpenseType.java b/dbPort/src/org/compiere/model/X_S_ExpenseType.java new file mode 100644 index 0000000000..601a373a5e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_ExpenseType.java @@ -0,0 +1,231 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_ExpenseType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.515 */ +public class X_S_ExpenseType extends PO +{ +/** Standard Constructor +@param ctx context +@param S_ExpenseType_ID id +@param trxName transaction +*/ +public X_S_ExpenseType (Properties ctx, int S_ExpenseType_ID, String trxName) +{ +super (ctx, S_ExpenseType_ID, trxName); +/** if (S_ExpenseType_ID == 0) +{ +setC_TaxCategory_ID (0); +setC_UOM_ID (0); +setIsInvoiced (false); +setM_Product_Category_ID (0); +setName (null); +setS_ExpenseType_ID (0); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_ExpenseType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=481 */ +public static final int Table_ID=481; + +/** TableName=S_ExpenseType */ +public static final String Table_Name="S_ExpenseType"; + +protected static KeyNamePair Model = new KeyNamePair(481,"S_ExpenseType"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_ExpenseType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_Value ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (boolean IsInvoiced) +{ +set_Value ("IsInvoiced", new Boolean(IsInvoiced)); +} +/** Get Invoiced. +@return Is this invoiced? */ +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID < 1) throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Expense Type. +@param S_ExpenseType_ID Expense report type */ +public void setS_ExpenseType_ID (int S_ExpenseType_ID) +{ +if (S_ExpenseType_ID < 1) throw new IllegalArgumentException ("S_ExpenseType_ID is mandatory."); +set_ValueNoCheck ("S_ExpenseType_ID", new Integer(S_ExpenseType_ID)); +} +/** Get Expense Type. +@return Expense report type */ +public int getS_ExpenseType_ID() +{ +Integer ii = (Integer)get_Value("S_ExpenseType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_Resource.java b/dbPort/src/org/compiere/model/X_S_Resource.java new file mode 100644 index 0000000000..2bd50feeea --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_Resource.java @@ -0,0 +1,245 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_Resource + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.531 */ +public class X_S_Resource extends PO +{ +/** Standard Constructor +@param ctx context +@param S_Resource_ID id +@param trxName transaction +*/ +public X_S_Resource (Properties ctx, int S_Resource_ID, String trxName) +{ +super (ctx, S_Resource_ID, trxName); +/** if (S_Resource_ID == 0) +{ +setIsAvailable (true); // Y +setM_Warehouse_ID (0); +setName (null); +setS_ResourceType_ID (0); +setS_Resource_ID (0); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_Resource (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=487 */ +public static final int Table_ID=487; + +/** TableName=S_Resource */ +public static final String Table_Name="S_Resource"; + +protected static KeyNamePair Model = new KeyNamePair(487,"S_Resource"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_Resource[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chargeable Quantity. +@param ChargeableQty Chargeable Quantity */ +public void setChargeableQty (BigDecimal ChargeableQty) +{ +set_Value ("ChargeableQty", ChargeableQty); +} +/** Get Chargeable Quantity. +@return Chargeable Quantity */ +public BigDecimal getChargeableQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeableQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Available. +@param IsAvailable Resource is available */ +public void setIsAvailable (boolean IsAvailable) +{ +set_Value ("IsAvailable", new Boolean(IsAvailable)); +} +/** Get Available. +@return Resource is available */ +public boolean isAvailable() +{ +Object oo = get_Value("IsAvailable"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Resource Type. +@param S_ResourceType_ID Resource Type */ +public void setS_ResourceType_ID (int S_ResourceType_ID) +{ +if (S_ResourceType_ID < 1) throw new IllegalArgumentException ("S_ResourceType_ID is mandatory."); +set_Value ("S_ResourceType_ID", new Integer(S_ResourceType_ID)); +} +/** Get Resource Type. +@return Resource Type */ +public int getS_ResourceType_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resource. +@param S_Resource_ID Resource */ +public void setS_Resource_ID (int S_Resource_ID) +{ +if (S_Resource_ID < 1) throw new IllegalArgumentException ("S_Resource_ID is mandatory."); +set_ValueNoCheck ("S_Resource_ID", new Integer(S_Resource_ID)); +} +/** Get Resource. +@return Resource */ +public int getS_Resource_ID() +{ +Integer ii = (Integer)get_Value("S_Resource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_ResourceAssignment.java b/dbPort/src/org/compiere/model/X_S_ResourceAssignment.java new file mode 100644 index 0000000000..b1cb694f4d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_ResourceAssignment.java @@ -0,0 +1,220 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_ResourceAssignment + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.546 */ +public class X_S_ResourceAssignment extends PO +{ +/** Standard Constructor +@param ctx context +@param S_ResourceAssignment_ID id +@param trxName transaction +*/ +public X_S_ResourceAssignment (Properties ctx, int S_ResourceAssignment_ID, String trxName) +{ +super (ctx, S_ResourceAssignment_ID, trxName); +/** if (S_ResourceAssignment_ID == 0) +{ +setAssignDateFrom (new Timestamp(System.currentTimeMillis())); +setIsConfirmed (false); +setName (null); +setS_ResourceAssignment_ID (0); +setS_Resource_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_ResourceAssignment (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=485 */ +public static final int Table_ID=485; + +/** TableName=S_ResourceAssignment */ +public static final String Table_Name="S_ResourceAssignment"; + +protected static KeyNamePair Model = new KeyNamePair(485,"S_ResourceAssignment"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_ResourceAssignment[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Assign From. +@param AssignDateFrom Assign resource from */ +public void setAssignDateFrom (Timestamp AssignDateFrom) +{ +if (AssignDateFrom == null) throw new IllegalArgumentException ("AssignDateFrom is mandatory."); +set_ValueNoCheck ("AssignDateFrom", AssignDateFrom); +} +/** Get Assign From. +@return Assign resource from */ +public Timestamp getAssignDateFrom() +{ +return (Timestamp)get_Value("AssignDateFrom"); +} +/** Set Assign To. +@param AssignDateTo Assign resource until */ +public void setAssignDateTo (Timestamp AssignDateTo) +{ +set_ValueNoCheck ("AssignDateTo", AssignDateTo); +} +/** Get Assign To. +@return Assign resource until */ +public Timestamp getAssignDateTo() +{ +return (Timestamp)get_Value("AssignDateTo"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Confirmed. +@param IsConfirmed Assignment is confirmed */ +public void setIsConfirmed (boolean IsConfirmed) +{ +set_ValueNoCheck ("IsConfirmed", new Boolean(IsConfirmed)); +} +/** Get Confirmed. +@return Assignment is confirmed */ +public boolean isConfirmed() +{ +Object oo = get_Value("IsConfirmed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_ValueNoCheck ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Resource Assignment. +@param S_ResourceAssignment_ID Resource Assignment */ +public void setS_ResourceAssignment_ID (int S_ResourceAssignment_ID) +{ +if (S_ResourceAssignment_ID < 1) throw new IllegalArgumentException ("S_ResourceAssignment_ID is mandatory."); +set_ValueNoCheck ("S_ResourceAssignment_ID", new Integer(S_ResourceAssignment_ID)); +} +/** Get Resource Assignment. +@return Resource Assignment */ +public int getS_ResourceAssignment_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resource. +@param S_Resource_ID Resource */ +public void setS_Resource_ID (int S_Resource_ID) +{ +if (S_Resource_ID < 1) throw new IllegalArgumentException ("S_Resource_ID is mandatory."); +set_ValueNoCheck ("S_Resource_ID", new Integer(S_Resource_ID)); +} +/** Get Resource. +@return Resource */ +public int getS_Resource_ID() +{ +Integer ii = (Integer)get_Value("S_Resource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getS_Resource_ID())); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_ResourceType.java b/dbPort/src/org/compiere/model/X_S_ResourceType.java new file mode 100644 index 0000000000..edf454943e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_ResourceType.java @@ -0,0 +1,459 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_ResourceType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.562 */ +public class X_S_ResourceType extends PO +{ +/** Standard Constructor +@param ctx context +@param S_ResourceType_ID id +@param trxName transaction +*/ +public X_S_ResourceType (Properties ctx, int S_ResourceType_ID, String trxName) +{ +super (ctx, S_ResourceType_ID, trxName); +/** if (S_ResourceType_ID == 0) +{ +setAllowUoMFractions (false); // N +setC_TaxCategory_ID (0); +setC_UOM_ID (0); +setIsDateSlot (false); +setIsSingleAssignment (false); +setIsTimeSlot (false); +setM_Product_Category_ID (0); +setName (null); +setOnFriday (true); // Y +setOnMonday (true); // Y +setOnSaturday (false); +setOnSunday (false); +setOnThursday (true); // Y +setOnTuesday (true); // Y +setOnWednesday (true); // Y +setS_ResourceType_ID (0); +setValue (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_ResourceType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=480 */ +public static final int Table_ID=480; + +/** TableName=S_ResourceType */ +public static final String Table_Name="S_ResourceType"; + +protected static KeyNamePair Model = new KeyNamePair(480,"S_ResourceType"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_ResourceType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Allow UoM Fractions. +@param AllowUoMFractions Allow Unit of Measure Fractions */ +public void setAllowUoMFractions (boolean AllowUoMFractions) +{ +set_Value ("AllowUoMFractions", new Boolean(AllowUoMFractions)); +} +/** Get Allow UoM Fractions. +@return Allow Unit of Measure Fractions */ +public boolean isAllowUoMFractions() +{ +Object oo = get_Value("AllowUoMFractions"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_Value ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Chargeable Quantity. +@param ChargeableQty Chargeable Quantity */ +public void setChargeableQty (int ChargeableQty) +{ +set_Value ("ChargeableQty", new Integer(ChargeableQty)); +} +/** Get Chargeable Quantity. +@return Chargeable Quantity */ +public int getChargeableQty() +{ +Integer ii = (Integer)get_Value("ChargeableQty"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Day Slot. +@param IsDateSlot Resource has day slot availability */ +public void setIsDateSlot (boolean IsDateSlot) +{ +set_Value ("IsDateSlot", new Boolean(IsDateSlot)); +} +/** Get Day Slot. +@return Resource has day slot availability */ +public boolean isDateSlot() +{ +Object oo = get_Value("IsDateSlot"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Single Assignment only. +@param IsSingleAssignment Only one assignment at a time (no double-booking or overlapping) */ +public void setIsSingleAssignment (boolean IsSingleAssignment) +{ +set_Value ("IsSingleAssignment", new Boolean(IsSingleAssignment)); +} +/** Get Single Assignment only. +@return Only one assignment at a time (no double-booking or overlapping) */ +public boolean isSingleAssignment() +{ +Object oo = get_Value("IsSingleAssignment"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Time Slot. +@param IsTimeSlot Resource has time slot availability */ +public void setIsTimeSlot (boolean IsTimeSlot) +{ +set_Value ("IsTimeSlot", new Boolean(IsTimeSlot)); +} +/** Get Time Slot. +@return Resource has time slot availability */ +public boolean isTimeSlot() +{ +Object oo = get_Value("IsTimeSlot"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID < 1) throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Friday. +@param OnFriday Available on Fridays */ +public void setOnFriday (boolean OnFriday) +{ +set_Value ("OnFriday", new Boolean(OnFriday)); +} +/** Get Friday. +@return Available on Fridays */ +public boolean isOnFriday() +{ +Object oo = get_Value("OnFriday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Monday. +@param OnMonday Available on Mondays */ +public void setOnMonday (boolean OnMonday) +{ +set_Value ("OnMonday", new Boolean(OnMonday)); +} +/** Get Monday. +@return Available on Mondays */ +public boolean isOnMonday() +{ +Object oo = get_Value("OnMonday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Saturday. +@param OnSaturday Available on Saturday */ +public void setOnSaturday (boolean OnSaturday) +{ +set_Value ("OnSaturday", new Boolean(OnSaturday)); +} +/** Get Saturday. +@return Available on Saturday */ +public boolean isOnSaturday() +{ +Object oo = get_Value("OnSaturday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sunday. +@param OnSunday Available on Sundays */ +public void setOnSunday (boolean OnSunday) +{ +set_Value ("OnSunday", new Boolean(OnSunday)); +} +/** Get Sunday. +@return Available on Sundays */ +public boolean isOnSunday() +{ +Object oo = get_Value("OnSunday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Thursday. +@param OnThursday Available on Thursdays */ +public void setOnThursday (boolean OnThursday) +{ +set_Value ("OnThursday", new Boolean(OnThursday)); +} +/** Get Thursday. +@return Available on Thursdays */ +public boolean isOnThursday() +{ +Object oo = get_Value("OnThursday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Tuesday. +@param OnTuesday Available on Tuesdays */ +public void setOnTuesday (boolean OnTuesday) +{ +set_Value ("OnTuesday", new Boolean(OnTuesday)); +} +/** Get Tuesday. +@return Available on Tuesdays */ +public boolean isOnTuesday() +{ +Object oo = get_Value("OnTuesday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Wednesday. +@param OnWednesday Available on Wednesdays */ +public void setOnWednesday (boolean OnWednesday) +{ +set_Value ("OnWednesday", new Boolean(OnWednesday)); +} +/** Get Wednesday. +@return Available on Wednesdays */ +public boolean isOnWednesday() +{ +Object oo = get_Value("OnWednesday"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Resource Type. +@param S_ResourceType_ID Resource Type */ +public void setS_ResourceType_ID (int S_ResourceType_ID) +{ +if (S_ResourceType_ID < 1) throw new IllegalArgumentException ("S_ResourceType_ID is mandatory."); +set_ValueNoCheck ("S_ResourceType_ID", new Integer(S_ResourceType_ID)); +} +/** Get Resource Type. +@return Resource Type */ +public int getS_ResourceType_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Slot End. +@param TimeSlotEnd Time when timeslot ends */ +public void setTimeSlotEnd (Timestamp TimeSlotEnd) +{ +set_Value ("TimeSlotEnd", TimeSlotEnd); +} +/** Get Slot End. +@return Time when timeslot ends */ +public Timestamp getTimeSlotEnd() +{ +return (Timestamp)get_Value("TimeSlotEnd"); +} +/** Set Slot Start. +@param TimeSlotStart Time when timeslot starts */ +public void setTimeSlotStart (Timestamp TimeSlotStart) +{ +set_Value ("TimeSlotStart", TimeSlotStart); +} +/** Get Slot Start. +@return Time when timeslot starts */ +public Timestamp getTimeSlotStart() +{ +return (Timestamp)get_Value("TimeSlotStart"); +} +/** Set Search Key. +@param Value Search key for the record in the format required - must be unique */ +public void setValue (String Value) +{ +if (Value == null) throw new IllegalArgumentException ("Value is mandatory."); +if (Value.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Value = Value.substring(0,39); +} +set_Value ("Value", Value); +} +/** Get Search Key. +@return Search key for the record in the format required - must be unique */ +public String getValue() +{ +return (String)get_Value("Value"); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_ResourceUnAvailable.java b/dbPort/src/org/compiere/model/X_S_ResourceUnAvailable.java new file mode 100644 index 0000000000..64e3725fbb --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_ResourceUnAvailable.java @@ -0,0 +1,168 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_ResourceUnAvailable + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.578 */ +public class X_S_ResourceUnAvailable extends PO +{ +/** Standard Constructor +@param ctx context +@param S_ResourceUnAvailable_ID id +@param trxName transaction +*/ +public X_S_ResourceUnAvailable (Properties ctx, int S_ResourceUnAvailable_ID, String trxName) +{ +super (ctx, S_ResourceUnAvailable_ID, trxName); +/** if (S_ResourceUnAvailable_ID == 0) +{ +setDateFrom (new Timestamp(System.currentTimeMillis())); +setS_ResourceUnAvailable_ID (0); +setS_Resource_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_ResourceUnAvailable (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=482 */ +public static final int Table_ID=482; + +/** TableName=S_ResourceUnAvailable */ +public static final String Table_Name="S_ResourceUnAvailable"; + +protected static KeyNamePair Model = new KeyNamePair(482,"S_ResourceUnAvailable"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_ResourceUnAvailable[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Date From. +@param DateFrom Starting date for a range */ +public void setDateFrom (Timestamp DateFrom) +{ +if (DateFrom == null) throw new IllegalArgumentException ("DateFrom is mandatory."); +set_Value ("DateFrom", DateFrom); +} +/** Get Date From. +@return Starting date for a range */ +public Timestamp getDateFrom() +{ +return (Timestamp)get_Value("DateFrom"); +} +/** Set Date To. +@param DateTo End date of a date range */ +public void setDateTo (Timestamp DateTo) +{ +set_Value ("DateTo", DateTo); +} +/** Get Date To. +@return End date of a date range */ +public Timestamp getDateTo() +{ +return (Timestamp)get_Value("DateTo"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Resource Unavailability. +@param S_ResourceUnAvailable_ID Resource Unavailability */ +public void setS_ResourceUnAvailable_ID (int S_ResourceUnAvailable_ID) +{ +if (S_ResourceUnAvailable_ID < 1) throw new IllegalArgumentException ("S_ResourceUnAvailable_ID is mandatory."); +set_ValueNoCheck ("S_ResourceUnAvailable_ID", new Integer(S_ResourceUnAvailable_ID)); +} +/** Get Resource Unavailability. +@return Resource Unavailability */ +public int getS_ResourceUnAvailable_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceUnAvailable_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Resource. +@param S_Resource_ID Resource */ +public void setS_Resource_ID (int S_Resource_ID) +{ +if (S_Resource_ID < 1) throw new IllegalArgumentException ("S_Resource_ID is mandatory."); +set_ValueNoCheck ("S_Resource_ID", new Integer(S_Resource_ID)); +} +/** Get Resource. +@return Resource */ +public int getS_Resource_ID() +{ +Integer ii = (Integer)get_Value("S_Resource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getS_Resource_ID())); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_TimeExpense.java b/dbPort/src/org/compiere/model/X_S_TimeExpense.java new file mode 100644 index 0000000000..76c93c1821 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_TimeExpense.java @@ -0,0 +1,380 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_TimeExpense + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.578 */ +public class X_S_TimeExpense extends PO +{ +/** Standard Constructor +@param ctx context +@param S_TimeExpense_ID id +@param trxName transaction +*/ +public X_S_TimeExpense (Properties ctx, int S_TimeExpense_ID, String trxName) +{ +super (ctx, S_TimeExpense_ID, trxName); +/** if (S_TimeExpense_ID == 0) +{ +setC_BPartner_ID (0); +setDateReport (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setIsApproved (false); +setM_PriceList_ID (0); +setM_Warehouse_ID (0); +setProcessed (false); +setS_TimeExpense_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_TimeExpense (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=486 */ +public static final int Table_ID=486; + +/** TableName=S_TimeExpense */ +public static final String Table_Name="S_TimeExpense"; + +protected static KeyNamePair Model = new KeyNamePair(486,"S_TimeExpense"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_TimeExpense[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Approval Amount. +@param ApprovalAmt Document Approval Amount */ +public void setApprovalAmt (BigDecimal ApprovalAmt) +{ +set_Value ("ApprovalAmt", ApprovalAmt); +} +/** Get Approval Amount. +@return Document Approval Amount */ +public BigDecimal getApprovalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ApprovalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** C_BPartner_ID AD_Reference_ID=277 */ +public static final int C_BPARTNER_ID_AD_Reference_ID=277; +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Report Date. +@param DateReport Expense/Time Report Date */ +public void setDateReport (Timestamp DateReport) +{ +if (DateReport == null) throw new IllegalArgumentException ("DateReport is mandatory."); +set_Value ("DateReport", DateReport); +} +/** Get Report Date. +@return Expense/Time Report Date */ +public Timestamp getDateReport() +{ +return (Timestamp)get_Value("DateReport"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** DocAction AD_Reference_ID=135 */ +public static final int DOCACTION_AD_Reference_ID=135; +/** = -- */ +public static final String DOCACTION_None = "--"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Complete = CO */ +public static final String DOCACTION_Complete = "CO"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** Reject = RJ */ +public static final String DOCACTION_Reject = "RJ"; +/** Void = VO */ +public static final String DOCACTION_Void = "VO"; +/** Wait Complete = WC */ +public static final String DOCACTION_WaitComplete = "WC"; +/** Unlock = XL */ +public static final String DOCACTION_Unlock = "XL"; +/** Set Document Action. +@param DocAction The targeted status of the document */ +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} +/** Get Document Action. +@return The targeted status of the document */ +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} + +/** DocStatus AD_Reference_ID=131 */ +public static final int DOCSTATUS_AD_Reference_ID=131; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Waiting Confirmation = WC */ +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Waiting Payment = WP */ +public static final String DOCSTATUS_WaitingPayment = "WP"; +/** Set Document Status. +@param DocStatus The current status of the document */ +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} +/** Get Document Status. +@return The current status of the document */ +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} +/** Set Document No. +@param DocumentNo Document sequence number of the document */ +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} +/** Get Document No. +@return Document sequence number of the document */ +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", new Boolean(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Expense Report. +@param S_TimeExpense_ID Time and Expense Report */ +public void setS_TimeExpense_ID (int S_TimeExpense_ID) +{ +if (S_TimeExpense_ID < 1) throw new IllegalArgumentException ("S_TimeExpense_ID is mandatory."); +set_ValueNoCheck ("S_TimeExpense_ID", new Integer(S_TimeExpense_ID)); +} +/** Get Expense Report. +@return Time and Expense Report */ +public int getS_TimeExpense_ID() +{ +Integer ii = (Integer)get_Value("S_TimeExpense_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_TimeExpenseLine.java b/dbPort/src/org/compiere/model/X_S_TimeExpenseLine.java new file mode 100644 index 0000000000..a604af623a --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_TimeExpenseLine.java @@ -0,0 +1,566 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_TimeExpenseLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.609 */ +public class X_S_TimeExpenseLine extends PO +{ +/** Standard Constructor +@param ctx context +@param S_TimeExpenseLine_ID id +@param trxName transaction +*/ +public X_S_TimeExpenseLine (Properties ctx, int S_TimeExpenseLine_ID, String trxName) +{ +super (ctx, S_TimeExpenseLine_ID, trxName); +/** if (S_TimeExpenseLine_ID == 0) +{ +setDateExpense (new Timestamp(System.currentTimeMillis())); // @DateExpense@; +@DateReport@ +setIsInvoiced (false); +setIsTimeReport (false); +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM S_TimeExpenseLine WHERE S_TimeExpense_ID=@S_TimeExpense_ID@ +setProcessed (false); +setS_TimeExpenseLine_ID (0); +setS_TimeExpense_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_TimeExpenseLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=488 */ +public static final int Table_ID=488; + +/** TableName=S_TimeExpenseLine */ +public static final String Table_Name="S_TimeExpenseLine"; + +protected static KeyNamePair Model = new KeyNamePair(488,"S_TimeExpenseLine"); + +protected BigDecimal accessLevel = new BigDecimal(1); +/** AccessLevel +@return 1 - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_TimeExpenseLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Line. +@param C_InvoiceLine_ID Invoice Detail Line */ +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID <= 0) set_ValueNoCheck ("C_InvoiceLine_ID", null); + else +set_ValueNoCheck ("C_InvoiceLine_ID", new Integer(C_InvoiceLine_ID)); +} +/** Get Invoice Line. +@return Invoice Detail Line */ +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sales Order Line. +@param C_OrderLine_ID Sales Order Line */ +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); + else +set_ValueNoCheck ("C_OrderLine_ID", new Integer(C_OrderLine_ID)); +} +/** Get Sales Order Line. +@return Sales Order Line */ +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Phase. +@param C_ProjectPhase_ID Phase of a Project */ +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_Value ("C_ProjectPhase_ID", null); + else +set_Value ("C_ProjectPhase_ID", new Integer(C_ProjectPhase_ID)); +} +/** Get Project Phase. +@return Phase of a Project */ +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Task. +@param C_ProjectTask_ID Actual Project Task in a Phase */ +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_Value ("C_ProjectTask_ID", null); + else +set_Value ("C_ProjectTask_ID", new Integer(C_ProjectTask_ID)); +} +/** Get Project Task. +@return Actual Project Task in a Phase */ +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Converted Amount. +@param ConvertedAmt Converted Amount */ +public void setConvertedAmt (BigDecimal ConvertedAmt) +{ +set_Value ("ConvertedAmt", ConvertedAmt); +} +/** Get Converted Amount. +@return Converted Amount */ +public BigDecimal getConvertedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ConvertedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Expense Date. +@param DateExpense Date of expense */ +public void setDateExpense (Timestamp DateExpense) +{ +if (DateExpense == null) throw new IllegalArgumentException ("DateExpense is mandatory."); +set_Value ("DateExpense", DateExpense); +} +/** Get Expense Date. +@return Date of expense */ +public Timestamp getDateExpense() +{ +return (Timestamp)get_Value("DateExpense"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Expense Amount. +@param ExpenseAmt Amount for this expense */ +public void setExpenseAmt (BigDecimal ExpenseAmt) +{ +set_Value ("ExpenseAmt", ExpenseAmt); +} +/** Get Expense Amount. +@return Amount for this expense */ +public BigDecimal getExpenseAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ExpenseAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoice Price. +@param InvoicePrice Unit price to be invoiced or 0 for default price */ +public void setInvoicePrice (BigDecimal InvoicePrice) +{ +set_Value ("InvoicePrice", InvoicePrice); +} +/** Get Invoice Price. +@return Unit price to be invoiced or 0 for default price */ +public BigDecimal getInvoicePrice() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoicePrice"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Invoiced. +@param IsInvoiced Is this invoiced? */ +public void setIsInvoiced (boolean IsInvoiced) +{ +set_Value ("IsInvoiced", new Boolean(IsInvoiced)); +} +/** Get Invoiced. +@return Is this invoiced? */ +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Time Report. +@param IsTimeReport Line is a time report only (no expense) */ +public void setIsTimeReport (boolean IsTimeReport) +{ +set_Value ("IsTimeReport", new Boolean(IsTimeReport)); +} +/** Get Time Report. +@return Line is a time report only (no expense) */ +public boolean isTimeReport() +{ +Object oo = get_Value("IsTimeReport"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Note. +@param Note Optional additional user defined information */ +public void setNote (String Note) +{ +if (Note != null && Note.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Note = Note.substring(0,254); +} +set_Value ("Note", Note); +} +/** Get Note. +@return Optional additional user defined information */ +public String getNote() +{ +return (String)get_Value("Note"); +} +/** Set Price Invoiced. +@param PriceInvoiced The priced invoiced to the customer (in the currency of the customer's AR price list) - 0 for default price */ +public void setPriceInvoiced (BigDecimal PriceInvoiced) +{ +set_Value ("PriceInvoiced", PriceInvoiced); +} +/** Get Price Invoiced. +@return The priced invoiced to the customer (in the currency of the customer's AR price list) - 0 for default price */ +public BigDecimal getPriceInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Price Reimbursed. +@param PriceReimbursed The reimbursed price (in currency of the employee's AP price list) */ +public void setPriceReimbursed (BigDecimal PriceReimbursed) +{ +set_Value ("PriceReimbursed", PriceReimbursed); +} +/** Get Price Reimbursed. +@return The reimbursed price (in currency of the employee's AP price list) */ +public BigDecimal getPriceReimbursed() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceReimbursed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Invoiced. +@param QtyInvoiced Invoiced Quantity */ +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +set_Value ("QtyInvoiced", QtyInvoiced); +} +/** Get Quantity Invoiced. +@return Invoiced Quantity */ +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity Reimbursed. +@param QtyReimbursed The reimbursed quantity */ +public void setQtyReimbursed (BigDecimal QtyReimbursed) +{ +set_Value ("QtyReimbursed", QtyReimbursed); +} +/** Get Quantity Reimbursed. +@return The reimbursed quantity */ +public BigDecimal getQtyReimbursed() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyReimbursed"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Resource Assignment. +@param S_ResourceAssignment_ID Resource Assignment */ +public void setS_ResourceAssignment_ID (int S_ResourceAssignment_ID) +{ +if (S_ResourceAssignment_ID <= 0) set_Value ("S_ResourceAssignment_ID", null); + else +set_Value ("S_ResourceAssignment_ID", new Integer(S_ResourceAssignment_ID)); +} +/** Get Resource Assignment. +@return Resource Assignment */ +public int getS_ResourceAssignment_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Expense Line. +@param S_TimeExpenseLine_ID Time and Expense Report Line */ +public void setS_TimeExpenseLine_ID (int S_TimeExpenseLine_ID) +{ +if (S_TimeExpenseLine_ID < 1) throw new IllegalArgumentException ("S_TimeExpenseLine_ID is mandatory."); +set_ValueNoCheck ("S_TimeExpenseLine_ID", new Integer(S_TimeExpenseLine_ID)); +} +/** Get Expense Line. +@return Time and Expense Report Line */ +public int getS_TimeExpenseLine_ID() +{ +Integer ii = (Integer)get_Value("S_TimeExpenseLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Expense Report. +@param S_TimeExpense_ID Time and Expense Report */ +public void setS_TimeExpense_ID (int S_TimeExpense_ID) +{ +if (S_TimeExpense_ID < 1) throw new IllegalArgumentException ("S_TimeExpense_ID is mandatory."); +set_ValueNoCheck ("S_TimeExpense_ID", new Integer(S_TimeExpense_ID)); +} +/** Get Expense Report. +@return Time and Expense Report */ +public int getS_TimeExpense_ID() +{ +Integer ii = (Integer)get_Value("S_TimeExpense_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Time Type. +@param S_TimeType_ID Type of time recorded */ +public void setS_TimeType_ID (int S_TimeType_ID) +{ +if (S_TimeType_ID <= 0) set_Value ("S_TimeType_ID", null); + else +set_Value ("S_TimeType_ID", new Integer(S_TimeType_ID)); +} +/** Get Time Type. +@return Type of time recorded */ +public int getS_TimeType_ID() +{ +Integer ii = (Integer)get_Value("S_TimeType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_TimeType.java b/dbPort/src/org/compiere/model/X_S_TimeType.java new file mode 100644 index 0000000000..4d5258592e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_TimeType.java @@ -0,0 +1,162 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_TimeType + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.625 */ +public class X_S_TimeType extends PO +{ +/** Standard Constructor +@param ctx context +@param S_TimeType_ID id +@param trxName transaction +*/ +public X_S_TimeType (Properties ctx, int S_TimeType_ID, String trxName) +{ +super (ctx, S_TimeType_ID, trxName); +/** if (S_TimeType_ID == 0) +{ +setName (null); +setS_TimeType_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_TimeType (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=581 */ +public static final int Table_ID=581; + +/** TableName=S_TimeType */ +public static final String Table_Name="S_TimeType"; + +protected static KeyNamePair Model = new KeyNamePair(581,"S_TimeType"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_TimeType[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Time Type. +@param S_TimeType_ID Type of time recorded */ +public void setS_TimeType_ID (int S_TimeType_ID) +{ +if (S_TimeType_ID < 1) throw new IllegalArgumentException ("S_TimeType_ID is mandatory."); +set_ValueNoCheck ("S_TimeType_ID", new Integer(S_TimeType_ID)); +} +/** Get Time Type. +@return Type of time recorded */ +public int getS_TimeType_ID() +{ +Integer ii = (Integer)get_Value("S_TimeType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_Training.java b/dbPort/src/org/compiere/model/X_S_Training.java new file mode 100644 index 0000000000..14c5be363d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_Training.java @@ -0,0 +1,279 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_Training + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.64 */ +public class X_S_Training extends PO +{ +/** Standard Constructor +@param ctx context +@param S_Training_ID id +@param trxName transaction +*/ +public X_S_Training (Properties ctx, int S_Training_ID, String trxName) +{ +super (ctx, S_Training_ID, trxName); +/** if (S_Training_ID == 0) +{ +setC_TaxCategory_ID (0); +setC_UOM_ID (0); +setM_Product_Category_ID (0); +setName (null); +setS_Training_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_Training (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=538 */ +public static final int Table_ID=538; + +/** TableName=S_Training */ +public static final String Table_Name="S_Training"; + +protected static KeyNamePair Model = new KeyNamePair(538,"S_Training"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_Training[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Tax Category. +@param C_TaxCategory_ID Tax Category */ +public void setC_TaxCategory_ID (int C_TaxCategory_ID) +{ +if (C_TaxCategory_ID < 1) throw new IllegalArgumentException ("C_TaxCategory_ID is mandatory."); +set_Value ("C_TaxCategory_ID", new Integer(C_TaxCategory_ID)); +} +/** Get Tax Category. +@return Tax Category */ +public int getC_TaxCategory_ID() +{ +Integer ii = (Integer)get_Value("C_TaxCategory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Description URL. +@param DescriptionURL URL for the description */ +public void setDescriptionURL (String DescriptionURL) +{ +if (DescriptionURL != null && DescriptionURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +DescriptionURL = DescriptionURL.substring(0,119); +} +set_Value ("DescriptionURL", DescriptionURL); +} +/** Get Description URL. +@return URL for the description */ +public String getDescriptionURL() +{ +return (String)get_Value("DescriptionURL"); +} +/** Set Document Note. +@param DocumentNote Additional information for a Document */ +public void setDocumentNote (String DocumentNote) +{ +if (DocumentNote != null && DocumentNote.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +DocumentNote = DocumentNote.substring(0,1999); +} +set_Value ("DocumentNote", DocumentNote); +} +/** Get Document Note. +@return Additional information for a Document */ +public String getDocumentNote() +{ +return (String)get_Value("DocumentNote"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Product Category. +@param M_Product_Category_ID Category of a Product */ +public void setM_Product_Category_ID (int M_Product_Category_ID) +{ +if (M_Product_Category_ID < 1) throw new IllegalArgumentException ("M_Product_Category_ID is mandatory."); +set_Value ("M_Product_Category_ID", new Integer(M_Product_Category_ID)); +} +/** Get Product Category. +@return Category of a Product */ +public int getM_Product_Category_ID() +{ +Integer ii = (Integer)get_Value("M_Product_Category_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Training. +@param S_Training_ID Repeated Training */ +public void setS_Training_ID (int S_Training_ID) +{ +if (S_Training_ID < 1) throw new IllegalArgumentException ("S_Training_ID is mandatory."); +set_ValueNoCheck ("S_Training_ID", new Integer(S_Training_ID)); +} +/** Get Training. +@return Repeated Training */ +public int getS_Training_ID() +{ +Integer ii = (Integer)get_Value("S_Training_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_S_Training_Class.java b/dbPort/src/org/compiere/model/X_S_Training_Class.java new file mode 100644 index 0000000000..4f0ebacc4c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_S_Training_Class.java @@ -0,0 +1,169 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for S_Training_Class + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.656 */ +public class X_S_Training_Class extends PO +{ +/** Standard Constructor +@param ctx context +@param S_Training_Class_ID id +@param trxName transaction +*/ +public X_S_Training_Class (Properties ctx, int S_Training_Class_ID, String trxName) +{ +super (ctx, S_Training_Class_ID, trxName); +/** if (S_Training_Class_ID == 0) +{ +setEndDate (new Timestamp(System.currentTimeMillis())); +setM_Product_ID (0); +setS_Training_Class_ID (0); +setS_Training_ID (0); +setStartDate (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_S_Training_Class (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=537 */ +public static final int Table_ID=537; + +/** TableName=S_Training_Class */ +public static final String Table_Name="S_Training_Class"; + +protected static KeyNamePair Model = new KeyNamePair(537,"S_Training_Class"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_S_Training_Class[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set End Date. +@param EndDate Last effective date (inclusive) */ +public void setEndDate (Timestamp EndDate) +{ +if (EndDate == null) throw new IllegalArgumentException ("EndDate is mandatory."); +set_Value ("EndDate", EndDate); +} +/** Get End Date. +@return Last effective date (inclusive) */ +public Timestamp getEndDate() +{ +return (Timestamp)get_Value("EndDate"); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Training Class. +@param S_Training_Class_ID The actual training class instance */ +public void setS_Training_Class_ID (int S_Training_Class_ID) +{ +if (S_Training_Class_ID < 1) throw new IllegalArgumentException ("S_Training_Class_ID is mandatory."); +set_ValueNoCheck ("S_Training_Class_ID", new Integer(S_Training_Class_ID)); +} +/** Get Training Class. +@return The actual training class instance */ +public int getS_Training_Class_ID() +{ +Integer ii = (Integer)get_Value("S_Training_Class_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Training. +@param S_Training_ID Repeated Training */ +public void setS_Training_ID (int S_Training_ID) +{ +if (S_Training_ID < 1) throw new IllegalArgumentException ("S_Training_ID is mandatory."); +set_ValueNoCheck ("S_Training_ID", new Integer(S_Training_ID)); +} +/** Get Training. +@return Repeated Training */ +public int getS_Training_ID() +{ +Integer ii = (Integer)get_Value("S_Training_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Start Date. +@param StartDate First effective day (inclusive) */ +public void setStartDate (Timestamp StartDate) +{ +if (StartDate == null) throw new IllegalArgumentException ("StartDate is mandatory."); +set_Value ("StartDate", StartDate); +} +/** Get Start Date. +@return First effective day (inclusive) */ +public Timestamp getStartDate() +{ +return (Timestamp)get_Value("StartDate"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getStartDate())); +} +} diff --git a/dbPort/src/org/compiere/model/X_TIRE_Storage.java b/dbPort/src/org/compiere/model/X_TIRE_Storage.java new file mode 100644 index 0000000000..d4d2a99db2 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_TIRE_Storage.java @@ -0,0 +1,444 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for TIRE_Storage + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.656 */ +public class X_TIRE_Storage extends PO +{ +/** Standard Constructor +@param ctx context +@param TIRE_Storage_ID id +@param trxName transaction +*/ +public X_TIRE_Storage (Properties ctx, int TIRE_Storage_ID, String trxName) +{ +super (ctx, TIRE_Storage_ID, trxName); +/** if (TIRE_Storage_ID == 0) +{ +setDateReceived (new Timestamp(System.currentTimeMillis())); // @#Date@ +setIsReturned (false); +setIsStored (false); +setName (null); +setTIRE_Storage_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_TIRE_Storage (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=384 */ +public static final int Table_ID=384; + +/** TableName=TIRE_Storage */ +public static final String Table_Name="TIRE_Storage"; + +protected static KeyNamePair Model = new KeyNamePair(384,"TIRE_Storage"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_TIRE_Storage[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Date received. +@param DateReceived Date a product was received */ +public void setDateReceived (Timestamp DateReceived) +{ +if (DateReceived == null) throw new IllegalArgumentException ("DateReceived is mandatory."); +set_Value ("DateReceived", DateReceived); +} +/** Get Date received. +@return Date a product was received */ +public Timestamp getDateReceived() +{ +return (Timestamp)get_Value("DateReceived"); +} +/** Set Date returned. +@param DateReturned Date a product was returned */ +public void setDateReturned (Timestamp DateReturned) +{ +set_Value ("DateReturned", DateReturned); +} +/** Get Date returned. +@return Date a product was returned */ +public Timestamp getDateReturned() +{ +return (Timestamp)get_Value("DateReturned"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Returned. +@param IsReturned Returned */ +public void setIsReturned (boolean IsReturned) +{ +set_Value ("IsReturned", new Boolean(IsReturned)); +} +/** Get Returned. +@return Returned */ +public boolean isReturned() +{ +Object oo = get_Value("IsReturned"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Moved to storage. +@param IsStored Moved to storage */ +public void setIsStored (boolean IsStored) +{ +set_Value ("IsStored", new Boolean(IsStored)); +} +/** Get Moved to storage. +@return Moved to storage */ +public boolean isStored() +{ +Object oo = get_Value("IsStored"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID <= 0) set_Value ("M_Locator_ID", null); + else +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Registration. +@param Registration Vehicle registration */ +public void setRegistration (String Registration) +{ +if (Registration != null && Registration.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Registration = Registration.substring(0,19); +} +set_Value ("Registration", Registration); +} +/** Get Registration. +@return Vehicle registration */ +public String getRegistration() +{ +return (String)get_Value("Registration"); +} +/** Set Remark. +@param Remark Remark */ +public void setRemark (String Remark) +{ +if (Remark != null && Remark.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remark = Remark.substring(0,59); +} +set_Value ("Remark", Remark); +} +/** Get Remark. +@return Remark */ +public String getRemark() +{ +return (String)get_Value("Remark"); +} +/** Set Rim. +@param Rim Stored rim */ +public void setRim (String Rim) +{ +if (Rim != null && Rim.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Rim = Rim.substring(0,19); +} +set_Value ("Rim", Rim); +} +/** Get Rim. +@return Stored rim */ +public String getRim() +{ +return (String)get_Value("Rim"); +} +/** Set Rim Back. +@param Rim_B Rim Back */ +public void setRim_B (String Rim_B) +{ +if (Rim_B != null && Rim_B.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Rim_B = Rim_B.substring(0,19); +} +set_Value ("Rim_B", Rim_B); +} +/** Get Rim Back. +@return Rim Back */ +public String getRim_B() +{ +return (String)get_Value("Rim_B"); +} +/** Set Tire Storage. +@param TIRE_Storage_ID Tire Storage */ +public void setTIRE_Storage_ID (int TIRE_Storage_ID) +{ +if (TIRE_Storage_ID < 1) throw new IllegalArgumentException ("TIRE_Storage_ID is mandatory."); +set_ValueNoCheck ("TIRE_Storage_ID", new Integer(TIRE_Storage_ID)); +} +/** Get Tire Storage. +@return Tire Storage */ +public int getTIRE_Storage_ID() +{ +Integer ii = (Integer)get_Value("TIRE_Storage_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Tire Quality. +@param TireQuality Tire Quality */ +public void setTireQuality (String TireQuality) +{ +if (TireQuality != null && TireQuality.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TireQuality = TireQuality.substring(0,19); +} +set_Value ("TireQuality", TireQuality); +} +/** Get Tire Quality. +@return Tire Quality */ +public String getTireQuality() +{ +return (String)get_Value("TireQuality"); +} +/** Set Tire Quality Back. +@param TireQuality_B Tire Quality Back */ +public void setTireQuality_B (String TireQuality_B) +{ +if (TireQuality_B != null && TireQuality_B.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TireQuality_B = TireQuality_B.substring(0,19); +} +set_Value ("TireQuality_B", TireQuality_B); +} +/** Get Tire Quality Back. +@return Tire Quality Back */ +public String getTireQuality_B() +{ +return (String)get_Value("TireQuality_B"); +} +/** Set Tire size (L/R). +@param TireSize Tire size (L/R) */ +public void setTireSize (String TireSize) +{ +if (TireSize != null && TireSize.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TireSize = TireSize.substring(0,19); +} +set_Value ("TireSize", TireSize); +} +/** Get Tire size (L/R). +@return Tire size (L/R) */ +public String getTireSize() +{ +return (String)get_Value("TireSize"); +} +/** Set Tire size Back. +@param TireSize_B Tire size Back */ +public void setTireSize_B (String TireSize_B) +{ +if (TireSize_B != null && TireSize_B.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TireSize_B = TireSize_B.substring(0,19); +} +set_Value ("TireSize_B", TireSize_B); +} +/** Get Tire size Back. +@return Tire size Back */ +public String getTireSize_B() +{ +return (String)get_Value("TireSize_B"); +} +/** Set Tire type. +@param TireType Tire type */ +public void setTireType (String TireType) +{ +if (TireType != null && TireType.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TireType = TireType.substring(0,19); +} +set_Value ("TireType", TireType); +} +/** Get Tire type. +@return Tire type */ +public String getTireType() +{ +return (String)get_Value("TireType"); +} +/** Set Tire type Back. +@param TireType_B Tire type Back */ +public void setTireType_B (String TireType_B) +{ +if (TireType_B != null && TireType_B.length() > 20) +{ +log.warning("Length > 20 - truncated"); +TireType_B = TireType_B.substring(0,19); +} +set_Value ("TireType_B", TireType_B); +} +/** Get Tire type Back. +@return Tire type Back */ +public String getTireType_B() +{ +return (String)get_Value("TireType_B"); +} +/** Set Vehicle. +@param Vehicle Vehicle */ +public void setVehicle (String Vehicle) +{ +if (Vehicle != null && Vehicle.length() > 20) +{ +log.warning("Length > 20 - truncated"); +Vehicle = Vehicle.substring(0,19); +} +set_Value ("Vehicle", Vehicle); +} +/** Get Vehicle. +@return Vehicle */ +public String getVehicle() +{ +return (String)get_Value("Vehicle"); +} +} diff --git a/dbPort/src/org/compiere/model/X_T_Aging.java b/dbPort/src/org/compiere/model/X_T_Aging.java new file mode 100644 index 0000000000..95aa3a2a92 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_Aging.java @@ -0,0 +1,663 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_Aging + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.671 */ +public class X_T_Aging extends PO +{ +/** Standard Constructor +@param ctx context +@param T_Aging_ID id +@param trxName transaction +*/ +public X_T_Aging (Properties ctx, int T_Aging_ID, String trxName) +{ +super (ctx, T_Aging_ID, trxName); +/** if (T_Aging_ID == 0) +{ +setAD_PInstance_ID (0); +setC_BP_Group_ID (0); +setC_BPartner_ID (0); +setC_Currency_ID (0); +setDue0 (Env.ZERO); +setDue0_30 (Env.ZERO); +setDue0_7 (Env.ZERO); +setDue1_7 (Env.ZERO); +setDue31_60 (Env.ZERO); +setDue31_Plus (Env.ZERO); +setDue61_90 (Env.ZERO); +setDue61_Plus (Env.ZERO); +setDue8_30 (Env.ZERO); +setDue91_Plus (Env.ZERO); +setDueAmt (Env.ZERO); +setDueDate (new Timestamp(System.currentTimeMillis())); +setInvoicedAmt (Env.ZERO); +setIsListInvoices (false); +setIsSOTrx (false); +setOpenAmt (Env.ZERO); +setPastDue1_30 (Env.ZERO); +setPastDue1_7 (Env.ZERO); +setPastDue31_60 (Env.ZERO); +setPastDue31_Plus (Env.ZERO); +setPastDue61_90 (Env.ZERO); +setPastDue61_Plus (Env.ZERO); +setPastDue8_30 (Env.ZERO); +setPastDue91_Plus (Env.ZERO); +setPastDueAmt (Env.ZERO); +setStatementDate (new Timestamp(System.currentTimeMillis())); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_Aging (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=631 */ +public static final int Table_ID=631; + +/** TableName=T_Aging */ +public static final String Table_Name="T_Aging"; + +protected static KeyNamePair Model = new KeyNamePair(631,"T_Aging"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_Aging[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Activity. +@param C_Activity_ID Business Activity */ +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); + else +set_Value ("C_Activity_ID", new Integer(C_Activity_ID)); +} +/** Get Activity. +@return Business Activity */ +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner Group. +@param C_BP_Group_ID Business Partner Group */ +public void setC_BP_Group_ID (int C_BP_Group_ID) +{ +if (C_BP_Group_ID < 1) throw new IllegalArgumentException ("C_BP_Group_ID is mandatory."); +set_Value ("C_BP_Group_ID", new Integer(C_BP_Group_ID)); +} +/** Get Business Partner Group. +@return Business Partner Group */ +public int getC_BP_Group_ID() +{ +Integer ii = (Integer)get_Value("C_BP_Group_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_ValueNoCheck ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Campaign. +@param C_Campaign_ID Marketing Campaign */ +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); + else +set_Value ("C_Campaign_ID", new Integer(C_Campaign_ID)); +} +/** Get Campaign. +@return Marketing Campaign */ +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_ValueNoCheck ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice Payment Schedule. +@param C_InvoicePaySchedule_ID Invoice Payment Schedule */ +public void setC_InvoicePaySchedule_ID (int C_InvoicePaySchedule_ID) +{ +if (C_InvoicePaySchedule_ID <= 0) set_Value ("C_InvoicePaySchedule_ID", null); + else +set_Value ("C_InvoicePaySchedule_ID", new Integer(C_InvoicePaySchedule_ID)); +} +/** Get Invoice Payment Schedule. +@return Invoice Payment Schedule */ +public int getC_InvoicePaySchedule_ID() +{ +Integer ii = (Integer)get_Value("C_InvoicePaySchedule_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); + else +set_ValueNoCheck ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Days due. +@param DaysDue Number of days due (negative: due in number of days) */ +public void setDaysDue (int DaysDue) +{ +set_Value ("DaysDue", new Integer(DaysDue)); +} +/** Get Days due. +@return Number of days due (negative: due in number of days) */ +public int getDaysDue() +{ +Integer ii = (Integer)get_Value("DaysDue"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Due Today. +@param Due0 Due Today */ +public void setDue0 (BigDecimal Due0) +{ +if (Due0 == null) throw new IllegalArgumentException ("Due0 is mandatory."); +set_Value ("Due0", Due0); +} +/** Get Due Today. +@return Due Today */ +public BigDecimal getDue0() +{ +BigDecimal bd = (BigDecimal)get_Value("Due0"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due Today-30. +@param Due0_30 Due Today-30 */ +public void setDue0_30 (BigDecimal Due0_30) +{ +if (Due0_30 == null) throw new IllegalArgumentException ("Due0_30 is mandatory."); +set_Value ("Due0_30", Due0_30); +} +/** Get Due Today-30. +@return Due Today-30 */ +public BigDecimal getDue0_30() +{ +BigDecimal bd = (BigDecimal)get_Value("Due0_30"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due Today-7. +@param Due0_7 Due Today-7 */ +public void setDue0_7 (BigDecimal Due0_7) +{ +if (Due0_7 == null) throw new IllegalArgumentException ("Due0_7 is mandatory."); +set_Value ("Due0_7", Due0_7); +} +/** Get Due Today-7. +@return Due Today-7 */ +public BigDecimal getDue0_7() +{ +BigDecimal bd = (BigDecimal)get_Value("Due0_7"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due 1-7. +@param Due1_7 Due 1-7 */ +public void setDue1_7 (BigDecimal Due1_7) +{ +if (Due1_7 == null) throw new IllegalArgumentException ("Due1_7 is mandatory."); +set_Value ("Due1_7", Due1_7); +} +/** Get Due 1-7. +@return Due 1-7 */ +public BigDecimal getDue1_7() +{ +BigDecimal bd = (BigDecimal)get_Value("Due1_7"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due 31-60. +@param Due31_60 Due 31-60 */ +public void setDue31_60 (BigDecimal Due31_60) +{ +if (Due31_60 == null) throw new IllegalArgumentException ("Due31_60 is mandatory."); +set_Value ("Due31_60", Due31_60); +} +/** Get Due 31-60. +@return Due 31-60 */ +public BigDecimal getDue31_60() +{ +BigDecimal bd = (BigDecimal)get_Value("Due31_60"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due > 31. +@param Due31_Plus Due > 31 */ +public void setDue31_Plus (BigDecimal Due31_Plus) +{ +if (Due31_Plus == null) throw new IllegalArgumentException ("Due31_Plus is mandatory."); +set_Value ("Due31_Plus", Due31_Plus); +} +/** Get Due > 31. +@return Due > 31 */ +public BigDecimal getDue31_Plus() +{ +BigDecimal bd = (BigDecimal)get_Value("Due31_Plus"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due 61-90. +@param Due61_90 Due 61-90 */ +public void setDue61_90 (BigDecimal Due61_90) +{ +if (Due61_90 == null) throw new IllegalArgumentException ("Due61_90 is mandatory."); +set_Value ("Due61_90", Due61_90); +} +/** Get Due 61-90. +@return Due 61-90 */ +public BigDecimal getDue61_90() +{ +BigDecimal bd = (BigDecimal)get_Value("Due61_90"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due > 61. +@param Due61_Plus Due > 61 */ +public void setDue61_Plus (BigDecimal Due61_Plus) +{ +if (Due61_Plus == null) throw new IllegalArgumentException ("Due61_Plus is mandatory."); +set_Value ("Due61_Plus", Due61_Plus); +} +/** Get Due > 61. +@return Due > 61 */ +public BigDecimal getDue61_Plus() +{ +BigDecimal bd = (BigDecimal)get_Value("Due61_Plus"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due 8-30. +@param Due8_30 Due 8-30 */ +public void setDue8_30 (BigDecimal Due8_30) +{ +if (Due8_30 == null) throw new IllegalArgumentException ("Due8_30 is mandatory."); +set_Value ("Due8_30", Due8_30); +} +/** Get Due 8-30. +@return Due 8-30 */ +public BigDecimal getDue8_30() +{ +BigDecimal bd = (BigDecimal)get_Value("Due8_30"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due > 91. +@param Due91_Plus Due > 91 */ +public void setDue91_Plus (BigDecimal Due91_Plus) +{ +if (Due91_Plus == null) throw new IllegalArgumentException ("Due91_Plus is mandatory."); +set_Value ("Due91_Plus", Due91_Plus); +} +/** Get Due > 91. +@return Due > 91 */ +public BigDecimal getDue91_Plus() +{ +BigDecimal bd = (BigDecimal)get_Value("Due91_Plus"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Amount due. +@param DueAmt Amount of the payment due */ +public void setDueAmt (BigDecimal DueAmt) +{ +if (DueAmt == null) throw new IllegalArgumentException ("DueAmt is mandatory."); +set_Value ("DueAmt", DueAmt); +} +/** Get Amount due. +@return Amount of the payment due */ +public BigDecimal getDueAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("DueAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Due Date. +@param DueDate Date when the payment is due */ +public void setDueDate (Timestamp DueDate) +{ +if (DueDate == null) throw new IllegalArgumentException ("DueDate is mandatory."); +set_Value ("DueDate", DueDate); +} +/** Get Due Date. +@return Date when the payment is due */ +public Timestamp getDueDate() +{ +return (Timestamp)get_Value("DueDate"); +} +/** Set Invoiced Amount. +@param InvoicedAmt The amount invoiced */ +public void setInvoicedAmt (BigDecimal InvoicedAmt) +{ +if (InvoicedAmt == null) throw new IllegalArgumentException ("InvoicedAmt is mandatory."); +set_Value ("InvoicedAmt", InvoicedAmt); +} +/** Get Invoiced Amount. +@return The amount invoiced */ +public BigDecimal getInvoicedAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("InvoicedAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Invoices. +@param IsListInvoices Include List of Invoices */ +public void setIsListInvoices (boolean IsListInvoices) +{ +set_Value ("IsListInvoices", new Boolean(IsListInvoices)); +} +/** Get List Invoices. +@return Include List of Invoices */ +public boolean isListInvoices() +{ +Object oo = get_Value("IsListInvoices"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", new Boolean(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Open Amount. +@param OpenAmt Open item amount */ +public void setOpenAmt (BigDecimal OpenAmt) +{ +if (OpenAmt == null) throw new IllegalArgumentException ("OpenAmt is mandatory."); +set_Value ("OpenAmt", OpenAmt); +} +/** Get Open Amount. +@return Open item amount */ +public BigDecimal getOpenAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OpenAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due 1-30. +@param PastDue1_30 Past Due 1-30 */ +public void setPastDue1_30 (BigDecimal PastDue1_30) +{ +if (PastDue1_30 == null) throw new IllegalArgumentException ("PastDue1_30 is mandatory."); +set_Value ("PastDue1_30", PastDue1_30); +} +/** Get Past Due 1-30. +@return Past Due 1-30 */ +public BigDecimal getPastDue1_30() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue1_30"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due 1-7. +@param PastDue1_7 Past Due 1-7 */ +public void setPastDue1_7 (BigDecimal PastDue1_7) +{ +if (PastDue1_7 == null) throw new IllegalArgumentException ("PastDue1_7 is mandatory."); +set_Value ("PastDue1_7", PastDue1_7); +} +/** Get Past Due 1-7. +@return Past Due 1-7 */ +public BigDecimal getPastDue1_7() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue1_7"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due 31-60. +@param PastDue31_60 Past Due 31-60 */ +public void setPastDue31_60 (BigDecimal PastDue31_60) +{ +if (PastDue31_60 == null) throw new IllegalArgumentException ("PastDue31_60 is mandatory."); +set_Value ("PastDue31_60", PastDue31_60); +} +/** Get Past Due 31-60. +@return Past Due 31-60 */ +public BigDecimal getPastDue31_60() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue31_60"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due > 31. +@param PastDue31_Plus Past Due > 31 */ +public void setPastDue31_Plus (BigDecimal PastDue31_Plus) +{ +if (PastDue31_Plus == null) throw new IllegalArgumentException ("PastDue31_Plus is mandatory."); +set_Value ("PastDue31_Plus", PastDue31_Plus); +} +/** Get Past Due > 31. +@return Past Due > 31 */ +public BigDecimal getPastDue31_Plus() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue31_Plus"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due 61-90. +@param PastDue61_90 Past Due 61-90 */ +public void setPastDue61_90 (BigDecimal PastDue61_90) +{ +if (PastDue61_90 == null) throw new IllegalArgumentException ("PastDue61_90 is mandatory."); +set_Value ("PastDue61_90", PastDue61_90); +} +/** Get Past Due 61-90. +@return Past Due 61-90 */ +public BigDecimal getPastDue61_90() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue61_90"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due > 61. +@param PastDue61_Plus Past Due > 61 */ +public void setPastDue61_Plus (BigDecimal PastDue61_Plus) +{ +if (PastDue61_Plus == null) throw new IllegalArgumentException ("PastDue61_Plus is mandatory."); +set_Value ("PastDue61_Plus", PastDue61_Plus); +} +/** Get Past Due > 61. +@return Past Due > 61 */ +public BigDecimal getPastDue61_Plus() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue61_Plus"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due 8-30. +@param PastDue8_30 Past Due 8-30 */ +public void setPastDue8_30 (BigDecimal PastDue8_30) +{ +if (PastDue8_30 == null) throw new IllegalArgumentException ("PastDue8_30 is mandatory."); +set_Value ("PastDue8_30", PastDue8_30); +} +/** Get Past Due 8-30. +@return Past Due 8-30 */ +public BigDecimal getPastDue8_30() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue8_30"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due > 91. +@param PastDue91_Plus Past Due > 91 */ +public void setPastDue91_Plus (BigDecimal PastDue91_Plus) +{ +if (PastDue91_Plus == null) throw new IllegalArgumentException ("PastDue91_Plus is mandatory."); +set_Value ("PastDue91_Plus", PastDue91_Plus); +} +/** Get Past Due > 91. +@return Past Due > 91 */ +public BigDecimal getPastDue91_Plus() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDue91_Plus"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Past Due. +@param PastDueAmt Past Due */ +public void setPastDueAmt (BigDecimal PastDueAmt) +{ +if (PastDueAmt == null) throw new IllegalArgumentException ("PastDueAmt is mandatory."); +set_Value ("PastDueAmt", PastDueAmt); +} +/** Get Past Due. +@return Past Due */ +public BigDecimal getPastDueAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PastDueAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Statement date. +@param StatementDate Date of the statement */ +public void setStatementDate (Timestamp StatementDate) +{ +if (StatementDate == null) throw new IllegalArgumentException ("StatementDate is mandatory."); +set_Value ("StatementDate", StatementDate); +} +/** Get Statement date. +@return Date of the statement */ +public Timestamp getStatementDate() +{ +return (Timestamp)get_Value("StatementDate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_T_DistributionRunDetail.java b/dbPort/src/org/compiere/model/X_T_DistributionRunDetail.java new file mode 100644 index 0000000000..8de5a0f55f --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_DistributionRunDetail.java @@ -0,0 +1,253 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_DistributionRunDetail + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.703 */ +public class X_T_DistributionRunDetail extends PO +{ +/** Standard Constructor +@param ctx context +@param T_DistributionRunDetail_ID id +@param trxName transaction +*/ +public X_T_DistributionRunDetail (Properties ctx, int T_DistributionRunDetail_ID, String trxName) +{ +super (ctx, T_DistributionRunDetail_ID, trxName); +/** if (T_DistributionRunDetail_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setM_DistributionListLine_ID (0); +setM_DistributionList_ID (0); +setM_DistributionRunLine_ID (0); +setM_DistributionRun_ID (0); +setM_Product_ID (0); +setMinQty (Env.ZERO); +setQty (Env.ZERO); +setRatio (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_DistributionRunDetail (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=714 */ +public static final int Table_ID=714; + +/** TableName=T_DistributionRunDetail */ +public static final String Table_Name="T_DistributionRunDetail"; + +protected static KeyNamePair Model = new KeyNamePair(714,"T_DistributionRunDetail"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_DistributionRunDetail[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Partner Location. +@param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", new Integer(C_BPartner_Location_ID)); +} +/** Get Partner Location. +@return Identifies the (ship to) address for this Business Partner */ +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution List Line. +@param M_DistributionListLine_ID Distribution List Line with Business Partner and Quantity/Percentage */ +public void setM_DistributionListLine_ID (int M_DistributionListLine_ID) +{ +if (M_DistributionListLine_ID < 1) throw new IllegalArgumentException ("M_DistributionListLine_ID is mandatory."); +set_ValueNoCheck ("M_DistributionListLine_ID", new Integer(M_DistributionListLine_ID)); +} +/** Get Distribution List Line. +@return Distribution List Line with Business Partner and Quantity/Percentage */ +public int getM_DistributionListLine_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionListLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution List. +@param M_DistributionList_ID Distribution Lists allow to distribute products to a selected list of partners */ +public void setM_DistributionList_ID (int M_DistributionList_ID) +{ +if (M_DistributionList_ID < 1) throw new IllegalArgumentException ("M_DistributionList_ID is mandatory."); +set_ValueNoCheck ("M_DistributionList_ID", new Integer(M_DistributionList_ID)); +} +/** Get Distribution List. +@return Distribution Lists allow to distribute products to a selected list of partners */ +public int getM_DistributionList_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution Run Line. +@param M_DistributionRunLine_ID Distribution Run Lines define Distribution List, the Product and Quantiries */ +public void setM_DistributionRunLine_ID (int M_DistributionRunLine_ID) +{ +if (M_DistributionRunLine_ID < 1) throw new IllegalArgumentException ("M_DistributionRunLine_ID is mandatory."); +set_ValueNoCheck ("M_DistributionRunLine_ID", new Integer(M_DistributionRunLine_ID)); +} +/** Get Distribution Run Line. +@return Distribution Run Lines define Distribution List, the Product and Quantiries */ +public int getM_DistributionRunLine_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionRunLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Distribution Run. +@param M_DistributionRun_ID Distribution Run create Orders to distribute products to a selected list of partners */ +public void setM_DistributionRun_ID (int M_DistributionRun_ID) +{ +if (M_DistributionRun_ID < 1) throw new IllegalArgumentException ("M_DistributionRun_ID is mandatory."); +set_ValueNoCheck ("M_DistributionRun_ID", new Integer(M_DistributionRun_ID)); +} +/** Get Distribution Run. +@return Distribution Run create Orders to distribute products to a selected list of partners */ +public int getM_DistributionRun_ID() +{ +Integer ii = (Integer)get_Value("M_DistributionRun_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_DistributionRun_ID())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Minimum Quantity. +@param MinQty Minimum quantity for the business partner */ +public void setMinQty (BigDecimal MinQty) +{ +if (MinQty == null) throw new IllegalArgumentException ("MinQty is mandatory."); +set_Value ("MinQty", MinQty); +} +/** Get Minimum Quantity. +@return Minimum quantity for the business partner */ +public BigDecimal getMinQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MinQty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ratio. +@param Ratio Relative Ratio for Distributions */ +public void setRatio (BigDecimal Ratio) +{ +if (Ratio == null) throw new IllegalArgumentException ("Ratio is mandatory."); +set_Value ("Ratio", Ratio); +} +/** Get Ratio. +@return Relative Ratio for Distributions */ +public BigDecimal getRatio() +{ +BigDecimal bd = (BigDecimal)get_Value("Ratio"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_T_InventoryValue.java b/dbPort/src/org/compiere/model/X_T_InventoryValue.java new file mode 100644 index 0000000000..9d537cb6d9 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_InventoryValue.java @@ -0,0 +1,393 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_InventoryValue + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.718 */ +public class X_T_InventoryValue extends PO +{ +/** Standard Constructor +@param ctx context +@param T_InventoryValue_ID id +@param trxName transaction +*/ +public X_T_InventoryValue (Properties ctx, int T_InventoryValue_ID, String trxName) +{ +super (ctx, T_InventoryValue_ID, trxName); +/** if (T_InventoryValue_ID == 0) +{ +setAD_PInstance_ID (0); +setM_AttributeSetInstance_ID (0); +setM_Product_ID (0); +setM_Warehouse_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_InventoryValue (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=478 */ +public static final int Table_ID=478; + +/** TableName=T_InventoryValue */ +public static final String Table_Name="T_InventoryValue"; + +protected static KeyNamePair Model = new KeyNamePair(478,"T_InventoryValue"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_InventoryValue[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost. +@param Cost Cost information */ +public void setCost (BigDecimal Cost) +{ +set_Value ("Cost", Cost); +} +/** Get Cost. +@return Cost information */ +public BigDecimal getCost() +{ +BigDecimal bd = (BigDecimal)get_Value("Cost"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Cost Value. +@param CostAmt Value with Cost */ +public void setCostAmt (BigDecimal CostAmt) +{ +set_Value ("CostAmt", CostAmt); +} +/** Get Cost Value. +@return Value with Cost */ +public BigDecimal getCostAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CostAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Cost. +@param CostStandard Standard Costs */ +public void setCostStandard (BigDecimal CostStandard) +{ +set_Value ("CostStandard", CostStandard); +} +/** Get Standard Cost. +@return Standard Costs */ +public BigDecimal getCostStandard() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandard"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Cost Value. +@param CostStandardAmt Value in Standard Costs */ +public void setCostStandardAmt (BigDecimal CostStandardAmt) +{ +set_Value ("CostStandardAmt", CostStandardAmt); +} +/** Get Standard Cost Value. +@return Value in Standard Costs */ +public BigDecimal getCostStandardAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("CostStandardAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Valuation Date. +@param DateValue Date of valuation */ +public void setDateValue (Timestamp DateValue) +{ +set_Value ("DateValue", DateValue); +} +/** Get Valuation Date. +@return Date of valuation */ +public Timestamp getDateValue() +{ +return (Timestamp)get_Value("DateValue"); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Cost Element. +@param M_CostElement_ID Product Cost Element */ +public void setM_CostElement_ID (int M_CostElement_ID) +{ +if (M_CostElement_ID <= 0) set_Value ("M_CostElement_ID", null); + else +set_Value ("M_CostElement_ID", new Integer(M_CostElement_ID)); +} +/** Get Cost Element. +@return Product Cost Element */ +public int getM_CostElement_ID() +{ +Integer ii = (Integer)get_Value("M_CostElement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price List Version. +@param M_PriceList_Version_ID Identifies a unique instance of a Price List */ +public void setM_PriceList_Version_ID (int M_PriceList_Version_ID) +{ +if (M_PriceList_Version_ID <= 0) set_Value ("M_PriceList_Version_ID", null); + else +set_Value ("M_PriceList_Version_ID", new Integer(M_PriceList_Version_ID)); +} +/** Get Price List Version. +@return Identifies a unique instance of a Price List */ +public int getM_PriceList_Version_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_Version_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Limit Price. +@param PriceLimit Lowest price for a product */ +public void setPriceLimit (BigDecimal PriceLimit) +{ +set_Value ("PriceLimit", PriceLimit); +} +/** Get Limit Price. +@return Lowest price for a product */ +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Limit price Value. +@param PriceLimitAmt Value with limit price */ +public void setPriceLimitAmt (BigDecimal PriceLimitAmt) +{ +set_Value ("PriceLimitAmt", PriceLimitAmt); +} +/** Get Limit price Value. +@return Value with limit price */ +public BigDecimal getPriceLimitAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimitAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List Price. +@param PriceList List Price */ +public void setPriceList (BigDecimal PriceList) +{ +set_Value ("PriceList", PriceList); +} +/** Get List Price. +@return List Price */ +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set List price Value. +@param PriceListAmt Valuation with List Price */ +public void setPriceListAmt (BigDecimal PriceListAmt) +{ +set_Value ("PriceListAmt", PriceListAmt); +} +/** Get List price Value. +@return Valuation with List Price */ +public BigDecimal getPriceListAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceListAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set PO Price. +@param PricePO Price based on a purchase order */ +public void setPricePO (BigDecimal PricePO) +{ +set_Value ("PricePO", PricePO); +} +/** Get PO Price. +@return Price based on a purchase order */ +public BigDecimal getPricePO() +{ +BigDecimal bd = (BigDecimal)get_Value("PricePO"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set PO Price Value. +@param PricePOAmt Valuation with PO Price */ +public void setPricePOAmt (BigDecimal PricePOAmt) +{ +set_Value ("PricePOAmt", PricePOAmt); +} +/** Get PO Price Value. +@return Valuation with PO Price */ +public BigDecimal getPricePOAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PricePOAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Standard Price. +@param PriceStd Standard Price */ +public void setPriceStd (BigDecimal PriceStd) +{ +set_Value ("PriceStd", PriceStd); +} +/** Get Standard Price. +@return Standard Price */ +public BigDecimal getPriceStd() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceStd"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Std Price Value. +@param PriceStdAmt Valuation with standard price */ +public void setPriceStdAmt (BigDecimal PriceStdAmt) +{ +set_Value ("PriceStdAmt", PriceStdAmt); +} +/** Get Std Price Value. +@return Valuation with standard price */ +public BigDecimal getPriceStdAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceStdAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set On Hand Quantity. +@param QtyOnHand On Hand Quantity */ +public void setQtyOnHand (BigDecimal QtyOnHand) +{ +set_Value ("QtyOnHand", QtyOnHand); +} +/** Get On Hand Quantity. +@return On Hand Quantity */ +public BigDecimal getQtyOnHand() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOnHand"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_T_InvoiceGL.java b/dbPort/src/org/compiere/model/X_T_InvoiceGL.java new file mode 100644 index 0000000000..fbf5997c87 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_InvoiceGL.java @@ -0,0 +1,377 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_InvoiceGL + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.734 */ +public class X_T_InvoiceGL extends PO +{ +/** Standard Constructor +@param ctx context +@param T_InvoiceGL_ID id +@param trxName transaction +*/ +public X_T_InvoiceGL (Properties ctx, int T_InvoiceGL_ID, String trxName) +{ +super (ctx, T_InvoiceGL_ID, trxName); +/** if (T_InvoiceGL_ID == 0) +{ +setAD_PInstance_ID (0); +setAmtAcctBalance (Env.ZERO); +setAmtRevalCr (Env.ZERO); +setAmtRevalCrDiff (Env.ZERO); +setAmtRevalDr (Env.ZERO); +setAmtRevalDrDiff (Env.ZERO); +setAmtSourceBalance (Env.ZERO); +setC_ConversionTypeReval_ID (0); +setC_Invoice_ID (0); +setDateReval (new Timestamp(System.currentTimeMillis())); +setFact_Acct_ID (0); +setGrandTotal (Env.ZERO); +setIsAllCurrencies (false); +setOpenAmt (Env.ZERO); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_InvoiceGL (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=803 */ +public static final int Table_ID=803; + +/** TableName=T_InvoiceGL */ +public static final String Table_Name="T_InvoiceGL"; + +protected static KeyNamePair Model = new KeyNamePair(803,"T_InvoiceGL"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_InvoiceGL[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_Value ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** APAR AD_Reference_ID=332 */ +public static final int APAR_AD_Reference_ID=332; +/** Receivables & Payables = A */ +public static final String APAR_ReceivablesPayables = "A"; +/** Payables only = P */ +public static final String APAR_PayablesOnly = "P"; +/** Receivables only = R */ +public static final String APAR_ReceivablesOnly = "R"; +/** Set AP - AR. +@param APAR Include Receivables and/or Payables transactions */ +public void setAPAR (String APAR) +{ +if (APAR == null) throw new IllegalArgumentException ("APAR is mandatory"); +if (APAR == null || APAR.equals("A") || APAR.equals("P") || APAR.equals("R")); + else throw new IllegalArgumentException ("APAR Invalid value - " + APAR + " - Reference_ID=332 - A - P - R"); +if (APAR != null && APAR.length() > 1) +{ +log.warning("Length > 1 - truncated"); +APAR = APAR.substring(0,0); +} +set_Value ("APAR", APAR); +} +/** Get AP - AR. +@return Include Receivables and/or Payables transactions */ +public String getAPAR() +{ +return (String)get_Value("APAR"); +} +/** Set Accounted Balance. +@param AmtAcctBalance Accounted Balance Amount */ +public void setAmtAcctBalance (BigDecimal AmtAcctBalance) +{ +if (AmtAcctBalance == null) throw new IllegalArgumentException ("AmtAcctBalance is mandatory."); +set_Value ("AmtAcctBalance", AmtAcctBalance); +} +/** Get Accounted Balance. +@return Accounted Balance Amount */ +public BigDecimal getAmtAcctBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctBalance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revaluated Amount Cr. +@param AmtRevalCr Revaluated Cr Amount */ +public void setAmtRevalCr (BigDecimal AmtRevalCr) +{ +if (AmtRevalCr == null) throw new IllegalArgumentException ("AmtRevalCr is mandatory."); +set_Value ("AmtRevalCr", AmtRevalCr); +} +/** Get Revaluated Amount Cr. +@return Revaluated Cr Amount */ +public BigDecimal getAmtRevalCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtRevalCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revaluated Difference Cr. +@param AmtRevalCrDiff Revaluated Cr Amount Difference */ +public void setAmtRevalCrDiff (BigDecimal AmtRevalCrDiff) +{ +if (AmtRevalCrDiff == null) throw new IllegalArgumentException ("AmtRevalCrDiff is mandatory."); +set_Value ("AmtRevalCrDiff", AmtRevalCrDiff); +} +/** Get Revaluated Difference Cr. +@return Revaluated Cr Amount Difference */ +public BigDecimal getAmtRevalCrDiff() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtRevalCrDiff"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revaluated Amount Dr. +@param AmtRevalDr Revaluated Dr Amount */ +public void setAmtRevalDr (BigDecimal AmtRevalDr) +{ +if (AmtRevalDr == null) throw new IllegalArgumentException ("AmtRevalDr is mandatory."); +set_Value ("AmtRevalDr", AmtRevalDr); +} +/** Get Revaluated Amount Dr. +@return Revaluated Dr Amount */ +public BigDecimal getAmtRevalDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtRevalDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Revaluated Difference Dr. +@param AmtRevalDrDiff Revaluated Dr Amount Difference */ +public void setAmtRevalDrDiff (BigDecimal AmtRevalDrDiff) +{ +if (AmtRevalDrDiff == null) throw new IllegalArgumentException ("AmtRevalDrDiff is mandatory."); +set_Value ("AmtRevalDrDiff", AmtRevalDrDiff); +} +/** Get Revaluated Difference Dr. +@return Revaluated Dr Amount Difference */ +public BigDecimal getAmtRevalDrDiff() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtRevalDrDiff"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Source Balance. +@param AmtSourceBalance Source Balance Amount */ +public void setAmtSourceBalance (BigDecimal AmtSourceBalance) +{ +if (AmtSourceBalance == null) throw new IllegalArgumentException ("AmtSourceBalance is mandatory."); +set_Value ("AmtSourceBalance", AmtSourceBalance); +} +/** Get Source Balance. +@return Source Balance Amount */ +public BigDecimal getAmtSourceBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtSourceBalance"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** C_ConversionTypeReval_ID AD_Reference_ID=352 */ +public static final int C_CONVERSIONTYPEREVAL_ID_AD_Reference_ID=352; +/** Set Revaluation Conversion Type. +@param C_ConversionTypeReval_ID Revaluation Currency Conversion Type */ +public void setC_ConversionTypeReval_ID (int C_ConversionTypeReval_ID) +{ +if (C_ConversionTypeReval_ID < 1) throw new IllegalArgumentException ("C_ConversionTypeReval_ID is mandatory."); +set_Value ("C_ConversionTypeReval_ID", new Integer(C_ConversionTypeReval_ID)); +} +/** Get Revaluation Conversion Type. +@return Revaluation Currency Conversion Type */ +public int getC_ConversionTypeReval_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionTypeReval_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** C_DocTypeReval_ID AD_Reference_ID=170 */ +public static final int C_DOCTYPEREVAL_ID_AD_Reference_ID=170; +/** Set Revaluation Document Type. +@param C_DocTypeReval_ID Document Type for Revaluation Journal */ +public void setC_DocTypeReval_ID (int C_DocTypeReval_ID) +{ +if (C_DocTypeReval_ID <= 0) set_Value ("C_DocTypeReval_ID", null); + else +set_Value ("C_DocTypeReval_ID", new Integer(C_DocTypeReval_ID)); +} +/** Get Revaluation Document Type. +@return Document Type for Revaluation Journal */ +public int getC_DocTypeReval_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeReval_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Invoice. +@param C_Invoice_ID Invoice Identifier */ +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_Value ("C_Invoice_ID", new Integer(C_Invoice_ID)); +} +/** Get Invoice. +@return Invoice Identifier */ +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Revaluation Date. +@param DateReval Date of Revaluation */ +public void setDateReval (Timestamp DateReval) +{ +if (DateReval == null) throw new IllegalArgumentException ("DateReval is mandatory."); +set_Value ("DateReval", DateReval); +} +/** Get Revaluation Date. +@return Date of Revaluation */ +public Timestamp getDateReval() +{ +return (Timestamp)get_Value("DateReval"); +} +/** Set Accounting Fact. +@param Fact_Acct_ID Accounting Fact */ +public void setFact_Acct_ID (int Fact_Acct_ID) +{ +if (Fact_Acct_ID < 1) throw new IllegalArgumentException ("Fact_Acct_ID is mandatory."); +set_ValueNoCheck ("Fact_Acct_ID", new Integer(Fact_Acct_ID)); +} +/** Get Accounting Fact. +@return Accounting Fact */ +public int getFact_Acct_ID() +{ +Integer ii = (Integer)get_Value("Fact_Acct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Grand Total. +@param GrandTotal Total amount of document */ +public void setGrandTotal (BigDecimal GrandTotal) +{ +if (GrandTotal == null) throw new IllegalArgumentException ("GrandTotal is mandatory."); +set_Value ("GrandTotal", GrandTotal); +} +/** Get Grand Total. +@return Total amount of document */ +public BigDecimal getGrandTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("GrandTotal"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Include All Currencies. +@param IsAllCurrencies Report not just foreign currency Invoices */ +public void setIsAllCurrencies (boolean IsAllCurrencies) +{ +set_Value ("IsAllCurrencies", new Boolean(IsAllCurrencies)); +} +/** Get Include All Currencies. +@return Report not just foreign currency Invoices */ +public boolean isAllCurrencies() +{ +Object oo = get_Value("IsAllCurrencies"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Open Amount. +@param OpenAmt Open item amount */ +public void setOpenAmt (BigDecimal OpenAmt) +{ +if (OpenAmt == null) throw new IllegalArgumentException ("OpenAmt is mandatory."); +set_Value ("OpenAmt", OpenAmt); +} +/** Get Open Amount. +@return Open item amount */ +public BigDecimal getOpenAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("OpenAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Percent. +@param Percent Percentage */ +public void setPercent (BigDecimal Percent) +{ +set_Value ("Percent", Percent); +} +/** Get Percent. +@return Percentage */ +public BigDecimal getPercent() +{ +BigDecimal bd = (BigDecimal)get_Value("Percent"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_T_Replenish.java b/dbPort/src/org/compiere/model/X_T_Replenish.java new file mode 100644 index 0000000000..4a22963544 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_Replenish.java @@ -0,0 +1,363 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_Replenish + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.75 */ +public class X_T_Replenish extends PO +{ +/** Standard Constructor +@param ctx context +@param T_Replenish_ID id +@param trxName transaction +*/ +public X_T_Replenish (Properties ctx, int T_Replenish_ID, String trxName) +{ +super (ctx, T_Replenish_ID, trxName); +/** if (T_Replenish_ID == 0) +{ +setAD_PInstance_ID (0); +setC_BPartner_ID (0); +setLevel_Max (Env.ZERO); +setLevel_Min (Env.ZERO); +setM_Product_ID (0); +setM_Warehouse_ID (0); +setReplenishType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_Replenish (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=364 */ +public static final int Table_ID=364; + +/** TableName=T_Replenish */ +public static final String Table_Name="T_Replenish"; + +protected static KeyNamePair Model = new KeyNamePair(364,"T_Replenish"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_Replenish[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Document Type. +@param C_DocType_ID Document type or rules */ +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID <= 0) set_Value ("C_DocType_ID", null); + else +set_Value ("C_DocType_ID", new Integer(C_DocType_ID)); +} +/** Get Document Type. +@return Document type or rules */ +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Maximum Level. +@param Level_Max Maximum Inventory level for this product */ +public void setLevel_Max (BigDecimal Level_Max) +{ +if (Level_Max == null) throw new IllegalArgumentException ("Level_Max is mandatory."); +set_Value ("Level_Max", Level_Max); +} +/** Get Maximum Level. +@return Maximum Inventory level for this product */ +public BigDecimal getLevel_Max() +{ +BigDecimal bd = (BigDecimal)get_Value("Level_Max"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Minimum Level. +@param Level_Min Minimum Inventory level for this product */ +public void setLevel_Min (BigDecimal Level_Min) +{ +if (Level_Min == null) throw new IllegalArgumentException ("Level_Min is mandatory."); +set_Value ("Level_Min", Level_Min); +} +/** Get Minimum Level. +@return Minimum Inventory level for this product */ +public BigDecimal getLevel_Min() +{ +BigDecimal bd = (BigDecimal)get_Value("Level_Min"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_ValueNoCheck ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** M_WarehouseSource_ID AD_Reference_ID=197 */ +public static final int M_WAREHOUSESOURCE_ID_AD_Reference_ID=197; +/** Set Source Warehouse. +@param M_WarehouseSource_ID Optional Warehouse to replenish from */ +public void setM_WarehouseSource_ID (int M_WarehouseSource_ID) +{ +if (M_WarehouseSource_ID <= 0) set_Value ("M_WarehouseSource_ID", null); + else +set_Value ("M_WarehouseSource_ID", new Integer(M_WarehouseSource_ID)); +} +/** Get Source Warehouse. +@return Optional Warehouse to replenish from */ +public int getM_WarehouseSource_ID() +{ +Integer ii = (Integer)get_Value("M_WarehouseSource_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Minimum Order Qty. +@param Order_Min Minimum order quantity in UOM */ +public void setOrder_Min (BigDecimal Order_Min) +{ +set_Value ("Order_Min", Order_Min); +} +/** Get Minimum Order Qty. +@return Minimum order quantity in UOM */ +public BigDecimal getOrder_Min() +{ +BigDecimal bd = (BigDecimal)get_Value("Order_Min"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Order Pack Qty. +@param Order_Pack Package order size in UOM (e.g. order set of 5 units) */ +public void setOrder_Pack (BigDecimal Order_Pack) +{ +set_Value ("Order_Pack", Order_Pack); +} +/** Get Order Pack Qty. +@return Package order size in UOM (e.g. order set of 5 units) */ +public BigDecimal getOrder_Pack() +{ +BigDecimal bd = (BigDecimal)get_Value("Order_Pack"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set On Hand Quantity. +@param QtyOnHand On Hand Quantity */ +public void setQtyOnHand (BigDecimal QtyOnHand) +{ +set_Value ("QtyOnHand", QtyOnHand); +} +/** Get On Hand Quantity. +@return On Hand Quantity */ +public BigDecimal getQtyOnHand() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOnHand"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Ordered Quantity. +@param QtyOrdered Ordered Quantity */ +public void setQtyOrdered (BigDecimal QtyOrdered) +{ +set_Value ("QtyOrdered", QtyOrdered); +} +/** Get Ordered Quantity. +@return Ordered Quantity */ +public BigDecimal getQtyOrdered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyOrdered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Reserved Quantity. +@param QtyReserved Reserved Quantity */ +public void setQtyReserved (BigDecimal QtyReserved) +{ +set_Value ("QtyReserved", QtyReserved); +} +/** Get Reserved Quantity. +@return Reserved Quantity */ +public BigDecimal getQtyReserved() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyReserved"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Quantity to Order. +@param QtyToOrder Quantity to Order */ +public void setQtyToOrder (BigDecimal QtyToOrder) +{ +set_Value ("QtyToOrder", QtyToOrder); +} +/** Get Quantity to Order. +@return Quantity to Order */ +public BigDecimal getQtyToOrder() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyToOrder"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** ReplenishType AD_Reference_ID=164 */ +public static final int REPLENISHTYPE_AD_Reference_ID=164; +/** Manual = 0 */ +public static final String REPLENISHTYPE_Manual = "0"; +/** Reorder below Minimum Level = 1 */ +public static final String REPLENISHTYPE_ReorderBelowMinimumLevel = "1"; +/** Maintain Maximum Level = 2 */ +public static final String REPLENISHTYPE_MaintainMaximumLevel = "2"; +/** Custom = 9 */ +public static final String REPLENISHTYPE_Custom = "9"; +/** Set Replenish Type. +@param ReplenishType Method for re-ordering a product */ +public void setReplenishType (String ReplenishType) +{ +if (ReplenishType == null) throw new IllegalArgumentException ("ReplenishType is mandatory"); +if (ReplenishType.equals("0") || ReplenishType.equals("1") || ReplenishType.equals("2") || ReplenishType.equals("9")); + else throw new IllegalArgumentException ("ReplenishType Invalid value - " + ReplenishType + " - Reference_ID=164 - 0 - 1 - 2 - 9"); +if (ReplenishType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ReplenishType = ReplenishType.substring(0,0); +} +set_Value ("ReplenishType", ReplenishType); +} +/** Get Replenish Type. +@return Method for re-ordering a product */ +public String getReplenishType() +{ +return (String)get_Value("ReplenishType"); +} + +/** ReplenishmentCreate AD_Reference_ID=329 */ +public static final int REPLENISHMENTCREATE_AD_Reference_ID=329; +/** Inventory Move = MMM */ +public static final String REPLENISHMENTCREATE_InventoryMove = "MMM"; +/** Purchase Order = POO */ +public static final String REPLENISHMENTCREATE_PurchaseOrder = "POO"; +/** Requisition = POR */ +public static final String REPLENISHMENTCREATE_Requisition = "POR"; +/** Set Create. +@param ReplenishmentCreate Create from Replenishment */ +public void setReplenishmentCreate (String ReplenishmentCreate) +{ +if (ReplenishmentCreate == null) throw new IllegalArgumentException ("ReplenishmentCreate is mandatory"); +if (ReplenishmentCreate == null || ReplenishmentCreate.equals("MMM") || ReplenishmentCreate.equals("POO") || ReplenishmentCreate.equals("POR")); + else throw new IllegalArgumentException ("ReplenishmentCreate Invalid value - " + ReplenishmentCreate + " - Reference_ID=329 - MMM - POO - POR"); +if (ReplenishmentCreate != null && ReplenishmentCreate.length() > 1) +{ +log.warning("Length > 1 - truncated"); +ReplenishmentCreate = ReplenishmentCreate.substring(0,0); +} +set_Value ("ReplenishmentCreate", ReplenishmentCreate); +} +/** Get Create. +@return Create from Replenishment */ +public String getReplenishmentCreate() +{ +return (String)get_Value("ReplenishmentCreate"); +} +} diff --git a/dbPort/src/org/compiere/model/X_T_Report.java b/dbPort/src/org/compiere/model/X_T_Report.java new file mode 100644 index 0000000000..2d9a890c3d --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_Report.java @@ -0,0 +1,515 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_Report + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.765 */ +public class X_T_Report extends PO +{ +/** Standard Constructor +@param ctx context +@param T_Report_ID id +@param trxName transaction +*/ +public X_T_Report (Properties ctx, int T_Report_ID, String trxName) +{ +super (ctx, T_Report_ID, trxName); +/** if (T_Report_ID == 0) +{ +setAD_PInstance_ID (0); +setFact_Acct_ID (0); +setPA_ReportLine_ID (0); +setRecord_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_Report (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=544 */ +public static final int Table_ID=544; + +/** TableName=T_Report */ +public static final String Table_Name="T_Report"; + +protected static KeyNamePair Model = new KeyNamePair(544,"T_Report"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_Report[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Col_0. +@param Col_0 Col_0 */ +public void setCol_0 (BigDecimal Col_0) +{ +set_ValueNoCheck ("Col_0", Col_0); +} +/** Get Col_0. +@return Col_0 */ +public BigDecimal getCol_0() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_0"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_1. +@param Col_1 Col_1 */ +public void setCol_1 (BigDecimal Col_1) +{ +set_ValueNoCheck ("Col_1", Col_1); +} +/** Get Col_1. +@return Col_1 */ +public BigDecimal getCol_1() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_1"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_10. +@param Col_10 Col_10 */ +public void setCol_10 (BigDecimal Col_10) +{ +set_ValueNoCheck ("Col_10", Col_10); +} +/** Get Col_10. +@return Col_10 */ +public BigDecimal getCol_10() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_10"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_11. +@param Col_11 Col_11 */ +public void setCol_11 (BigDecimal Col_11) +{ +set_ValueNoCheck ("Col_11", Col_11); +} +/** Get Col_11. +@return Col_11 */ +public BigDecimal getCol_11() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_11"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_12. +@param Col_12 Col_12 */ +public void setCol_12 (BigDecimal Col_12) +{ +set_ValueNoCheck ("Col_12", Col_12); +} +/** Get Col_12. +@return Col_12 */ +public BigDecimal getCol_12() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_12"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_13. +@param Col_13 Col_13 */ +public void setCol_13 (BigDecimal Col_13) +{ +set_ValueNoCheck ("Col_13", Col_13); +} +/** Get Col_13. +@return Col_13 */ +public BigDecimal getCol_13() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_13"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_14. +@param Col_14 Col_14 */ +public void setCol_14 (BigDecimal Col_14) +{ +set_ValueNoCheck ("Col_14", Col_14); +} +/** Get Col_14. +@return Col_14 */ +public BigDecimal getCol_14() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_14"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_15. +@param Col_15 Col_15 */ +public void setCol_15 (BigDecimal Col_15) +{ +set_ValueNoCheck ("Col_15", Col_15); +} +/** Get Col_15. +@return Col_15 */ +public BigDecimal getCol_15() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_15"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_16. +@param Col_16 Col_16 */ +public void setCol_16 (BigDecimal Col_16) +{ +set_ValueNoCheck ("Col_16", Col_16); +} +/** Get Col_16. +@return Col_16 */ +public BigDecimal getCol_16() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_16"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_17. +@param Col_17 Col_17 */ +public void setCol_17 (BigDecimal Col_17) +{ +set_ValueNoCheck ("Col_17", Col_17); +} +/** Get Col_17. +@return Col_17 */ +public BigDecimal getCol_17() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_17"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_18. +@param Col_18 Col_18 */ +public void setCol_18 (BigDecimal Col_18) +{ +set_ValueNoCheck ("Col_18", Col_18); +} +/** Get Col_18. +@return Col_18 */ +public BigDecimal getCol_18() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_18"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_19. +@param Col_19 Col_19 */ +public void setCol_19 (BigDecimal Col_19) +{ +set_ValueNoCheck ("Col_19", Col_19); +} +/** Get Col_19. +@return Col_19 */ +public BigDecimal getCol_19() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_19"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_2. +@param Col_2 Col_2 */ +public void setCol_2 (BigDecimal Col_2) +{ +set_ValueNoCheck ("Col_2", Col_2); +} +/** Get Col_2. +@return Col_2 */ +public BigDecimal getCol_2() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_2"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_20. +@param Col_20 Col_20 */ +public void setCol_20 (BigDecimal Col_20) +{ +set_ValueNoCheck ("Col_20", Col_20); +} +/** Get Col_20. +@return Col_20 */ +public BigDecimal getCol_20() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_20"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_3. +@param Col_3 Col_3 */ +public void setCol_3 (BigDecimal Col_3) +{ +set_ValueNoCheck ("Col_3", Col_3); +} +/** Get Col_3. +@return Col_3 */ +public BigDecimal getCol_3() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_3"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_4. +@param Col_4 Col_4 */ +public void setCol_4 (BigDecimal Col_4) +{ +set_ValueNoCheck ("Col_4", Col_4); +} +/** Get Col_4. +@return Col_4 */ +public BigDecimal getCol_4() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_4"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_5. +@param Col_5 Col_5 */ +public void setCol_5 (BigDecimal Col_5) +{ +set_ValueNoCheck ("Col_5", Col_5); +} +/** Get Col_5. +@return Col_5 */ +public BigDecimal getCol_5() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_5"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_6. +@param Col_6 Col_6 */ +public void setCol_6 (BigDecimal Col_6) +{ +set_ValueNoCheck ("Col_6", Col_6); +} +/** Get Col_6. +@return Col_6 */ +public BigDecimal getCol_6() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_6"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_7. +@param Col_7 Col_7 */ +public void setCol_7 (BigDecimal Col_7) +{ +set_ValueNoCheck ("Col_7", Col_7); +} +/** Get Col_7. +@return Col_7 */ +public BigDecimal getCol_7() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_7"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_8. +@param Col_8 Col_8 */ +public void setCol_8 (BigDecimal Col_8) +{ +set_ValueNoCheck ("Col_8", Col_8); +} +/** Get Col_8. +@return Col_8 */ +public BigDecimal getCol_8() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_8"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Col_9. +@param Col_9 Col_9 */ +public void setCol_9 (BigDecimal Col_9) +{ +set_ValueNoCheck ("Col_9", Col_9); +} +/** Get Col_9. +@return Col_9 */ +public BigDecimal getCol_9() +{ +BigDecimal bd = (BigDecimal)get_Value("Col_9"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_ValueNoCheck ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Accounting Fact. +@param Fact_Acct_ID Accounting Fact */ +public void setFact_Acct_ID (int Fact_Acct_ID) +{ +if (Fact_Acct_ID < 1) throw new IllegalArgumentException ("Fact_Acct_ID is mandatory."); +set_ValueNoCheck ("Fact_Acct_ID", new Integer(Fact_Acct_ID)); +} +/** Get Accounting Fact. +@return Accounting Fact */ +public int getFact_Acct_ID() +{ +Integer ii = (Integer)get_Value("Fact_Acct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Level no. +@param LevelNo Level no */ +public void setLevelNo (int LevelNo) +{ +set_ValueNoCheck ("LevelNo", new Integer(LevelNo)); +} +/** Get Level no. +@return Level no */ +public int getLevelNo() +{ +Integer ii = (Integer)get_Value("LevelNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_ValueNoCheck ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Report Line. +@param PA_ReportLine_ID Report Line */ +public void setPA_ReportLine_ID (int PA_ReportLine_ID) +{ +if (PA_ReportLine_ID < 1) throw new IllegalArgumentException ("PA_ReportLine_ID is mandatory."); +set_ValueNoCheck ("PA_ReportLine_ID", new Integer(PA_ReportLine_ID)); +} +/** Get Report Line. +@return Report Line */ +public int getPA_ReportLine_ID() +{ +Integer ii = (Integer)get_Value("PA_ReportLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Record ID. +@param Record_ID Direct internal record ID */ +public void setRecord_ID (int Record_ID) +{ +if (Record_ID < 0) throw new IllegalArgumentException ("Record_ID is mandatory."); +set_ValueNoCheck ("Record_ID", new Integer(Record_ID)); +} +/** Get Record ID. +@return Direct internal record ID */ +public int getRecord_ID() +{ +Integer ii = (Integer)get_Value("Record_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Sequence. +@param SeqNo Method of ordering records; + lowest number comes first */ +public void setSeqNo (int SeqNo) +{ +set_ValueNoCheck ("SeqNo", new Integer(SeqNo)); +} +/** Get Sequence. +@return Method of ordering records; + lowest number comes first */ +public int getSeqNo() +{ +Integer ii = (Integer)get_Value("SeqNo"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_T_ReportStatement.java b/dbPort/src/org/compiere/model/X_T_ReportStatement.java new file mode 100644 index 0000000000..8338f98f4e --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_ReportStatement.java @@ -0,0 +1,244 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_ReportStatement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.781 */ +public class X_T_ReportStatement extends PO +{ +/** Standard Constructor +@param ctx context +@param T_ReportStatement_ID id +@param trxName transaction +*/ +public X_T_ReportStatement (Properties ctx, int T_ReportStatement_ID, String trxName) +{ +super (ctx, T_ReportStatement_ID, trxName); +/** if (T_ReportStatement_ID == 0) +{ +setAD_PInstance_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); +setFact_Acct_ID (0); +setLevelNo (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_ReportStatement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=545 */ +public static final int Table_ID=545; + +/** TableName=T_ReportStatement */ +public static final String Table_Name="T_ReportStatement"; + +protected static KeyNamePair Model = new KeyNamePair(545,"T_ReportStatement"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_ReportStatement[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_ValueNoCheck ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accounted Credit. +@param AmtAcctCr Accounted Credit Amount */ +public void setAmtAcctCr (BigDecimal AmtAcctCr) +{ +set_ValueNoCheck ("AmtAcctCr", AmtAcctCr); +} +/** Get Accounted Credit. +@return Accounted Credit Amount */ +public BigDecimal getAmtAcctCr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctCr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Accounted Debit. +@param AmtAcctDr Accounted Debit Amount */ +public void setAmtAcctDr (BigDecimal AmtAcctDr) +{ +set_ValueNoCheck ("AmtAcctDr", AmtAcctDr); +} +/** Get Accounted Debit. +@return Accounted Debit Amount */ +public BigDecimal getAmtAcctDr() +{ +BigDecimal bd = (BigDecimal)get_Value("AmtAcctDr"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Balance. +@param Balance Balance */ +public void setBalance (BigDecimal Balance) +{ +set_ValueNoCheck ("Balance", Balance); +} +/** Get Balance. +@return Balance */ +public BigDecimal getBalance() +{ +BigDecimal bd = (BigDecimal)get_Value("Balance"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Account Date. +@param DateAcct Accounting Date */ +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_ValueNoCheck ("DateAcct", DateAcct); +} +/** Get Account Date. +@return Accounting Date */ +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_ValueNoCheck ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Accounting Fact. +@param Fact_Acct_ID Accounting Fact */ +public void setFact_Acct_ID (int Fact_Acct_ID) +{ +if (Fact_Acct_ID < 1) throw new IllegalArgumentException ("Fact_Acct_ID is mandatory."); +set_ValueNoCheck ("Fact_Acct_ID", new Integer(Fact_Acct_ID)); +} +/** Get Accounting Fact. +@return Accounting Fact */ +public int getFact_Acct_ID() +{ +Integer ii = (Integer)get_Value("Fact_Acct_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Level no. +@param LevelNo Level no */ +public void setLevelNo (int LevelNo) +{ +set_ValueNoCheck ("LevelNo", new Integer(LevelNo)); +} +/** Get Level no. +@return Level no */ +public int getLevelNo() +{ +Integer ii = (Integer)get_Value("LevelNo"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name != null && Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_ValueNoCheck ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +set_ValueNoCheck ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +} diff --git a/dbPort/src/org/compiere/model/X_T_Transaction.java b/dbPort/src/org/compiere/model/X_T_Transaction.java new file mode 100644 index 0000000000..66e13485ae --- /dev/null +++ b/dbPort/src/org/compiere/model/X_T_Transaction.java @@ -0,0 +1,462 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for T_Transaction + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.796 */ +public class X_T_Transaction extends PO +{ +/** Standard Constructor +@param ctx context +@param T_Transaction_ID id +@param trxName transaction +*/ +public X_T_Transaction (Properties ctx, int T_Transaction_ID, String trxName) +{ +super (ctx, T_Transaction_ID, trxName); +/** if (T_Transaction_ID == 0) +{ +setAD_PInstance_ID (0); +setM_AttributeSetInstance_ID (0); +setM_Locator_ID (0); +setM_Product_ID (0); +setM_Transaction_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); +setMovementQty (Env.ZERO); +setMovementType (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_T_Transaction (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=758 */ +public static final int Table_ID=758; + +/** TableName=T_Transaction */ +public static final String Table_Name="T_Transaction"; + +protected static KeyNamePair Model = new KeyNamePair(758,"T_Transaction"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_T_Transaction[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Process Instance. +@param AD_PInstance_ID Instance of the process */ +public void setAD_PInstance_ID (int AD_PInstance_ID) +{ +if (AD_PInstance_ID < 1) throw new IllegalArgumentException ("AD_PInstance_ID is mandatory."); +set_Value ("AD_PInstance_ID", new Integer(AD_PInstance_ID)); +} +/** Get Process Instance. +@return Instance of the process */ +public int getAD_PInstance_ID() +{ +Integer ii = (Integer)get_Value("AD_PInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project Issue. +@param C_ProjectIssue_ID Project Issues (Material, Labor) */ +public void setC_ProjectIssue_ID (int C_ProjectIssue_ID) +{ +if (C_ProjectIssue_ID <= 0) set_Value ("C_ProjectIssue_ID", null); + else +set_Value ("C_ProjectIssue_ID", new Integer(C_ProjectIssue_ID)); +} +/** Get Project Issue. +@return Project Issues (Material, Labor) */ +public int getC_ProjectIssue_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectIssue_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Project. +@param C_Project_ID Financial Project */ +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); + else +set_Value ("C_Project_ID", new Integer(C_Project_ID)); +} +/** Get Project. +@return Financial Project */ +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Attribute Set Instance. +@param M_AttributeSetInstance_ID Product Attribute Set Instance */ +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", new Integer(M_AttributeSetInstance_ID)); +} +/** Get Attribute Set Instance. +@return Product Attribute Set Instance */ +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt Line. +@param M_InOutLine_ID Line on Shipment or Receipt document */ +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_Value ("M_InOutLine_ID", null); + else +set_Value ("M_InOutLine_ID", new Integer(M_InOutLine_ID)); +} +/** Get Shipment/Receipt Line. +@return Line on Shipment or Receipt document */ +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Shipment/Receipt. +@param M_InOut_ID Material Shipment Document */ +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID <= 0) set_Value ("M_InOut_ID", null); + else +set_Value ("M_InOut_ID", new Integer(M_InOut_ID)); +} +/** Get Shipment/Receipt. +@return Material Shipment Document */ +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory Line. +@param M_InventoryLine_ID Unique line in an Inventory document */ +public void setM_InventoryLine_ID (int M_InventoryLine_ID) +{ +if (M_InventoryLine_ID <= 0) set_Value ("M_InventoryLine_ID", null); + else +set_Value ("M_InventoryLine_ID", new Integer(M_InventoryLine_ID)); +} +/** Get Phys.Inventory Line. +@return Unique line in an Inventory document */ +public int getM_InventoryLine_ID() +{ +Integer ii = (Integer)get_Value("M_InventoryLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Phys.Inventory. +@param M_Inventory_ID Parameters for a Physical Inventory */ +public void setM_Inventory_ID (int M_Inventory_ID) +{ +if (M_Inventory_ID <= 0) set_Value ("M_Inventory_ID", null); + else +set_Value ("M_Inventory_ID", new Integer(M_Inventory_ID)); +} +/** Get Phys.Inventory. +@return Parameters for a Physical Inventory */ +public int getM_Inventory_ID() +{ +Integer ii = (Integer)get_Value("M_Inventory_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Move Line. +@param M_MovementLine_ID Inventory Move document Line */ +public void setM_MovementLine_ID (int M_MovementLine_ID) +{ +if (M_MovementLine_ID <= 0) set_Value ("M_MovementLine_ID", null); + else +set_Value ("M_MovementLine_ID", new Integer(M_MovementLine_ID)); +} +/** Get Move Line. +@return Inventory Move document Line */ +public int getM_MovementLine_ID() +{ +Integer ii = (Integer)get_Value("M_MovementLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Move. +@param M_Movement_ID Movement of Inventory */ +public void setM_Movement_ID (int M_Movement_ID) +{ +if (M_Movement_ID <= 0) set_Value ("M_Movement_ID", null); + else +set_Value ("M_Movement_ID", new Integer(M_Movement_ID)); +} +/** Get Inventory Move. +@return Movement of Inventory */ +public int getM_Movement_ID() +{ +Integer ii = (Integer)get_Value("M_Movement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID < 1) throw new IllegalArgumentException ("M_Product_ID is mandatory."); +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production Line. +@param M_ProductionLine_ID Document Line representing a production */ +public void setM_ProductionLine_ID (int M_ProductionLine_ID) +{ +if (M_ProductionLine_ID <= 0) set_Value ("M_ProductionLine_ID", null); + else +set_Value ("M_ProductionLine_ID", new Integer(M_ProductionLine_ID)); +} +/** Get Production Line. +@return Document Line representing a production */ +public int getM_ProductionLine_ID() +{ +Integer ii = (Integer)get_Value("M_ProductionLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Production. +@param M_Production_ID Plan for producing a product */ +public void setM_Production_ID (int M_Production_ID) +{ +if (M_Production_ID <= 0) set_Value ("M_Production_ID", null); + else +set_Value ("M_Production_ID", new Integer(M_Production_ID)); +} +/** Get Production. +@return Plan for producing a product */ +public int getM_Production_ID() +{ +Integer ii = (Integer)get_Value("M_Production_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Inventory Transaction. +@param M_Transaction_ID Inventory Transaction */ +public void setM_Transaction_ID (int M_Transaction_ID) +{ +if (M_Transaction_ID < 1) throw new IllegalArgumentException ("M_Transaction_ID is mandatory."); +set_Value ("M_Transaction_ID", new Integer(M_Transaction_ID)); +} +/** Get Inventory Transaction. +@return Inventory Transaction */ +public int getM_Transaction_ID() +{ +Integer ii = (Integer)get_Value("M_Transaction_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Movement Date. +@param MovementDate Date a product was moved in or out of inventory */ +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} +/** Get Movement Date. +@return Date a product was moved in or out of inventory */ +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} +/** Set Movement Quantity. +@param MovementQty Quantity of a product moved. */ +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} +/** Get Movement Quantity. +@return Quantity of a product moved. */ +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} + +/** MovementType AD_Reference_ID=189 */ +public static final int MOVEMENTTYPE_AD_Reference_ID=189; +/** Customer Returns = C+ */ +public static final String MOVEMENTTYPE_CustomerReturns = "C+"; +/** Customer Shipment = C- */ +public static final String MOVEMENTTYPE_CustomerShipment = "C-"; +/** Inventory In = I+ */ +public static final String MOVEMENTTYPE_InventoryIn = "I+"; +/** Inventory Out = I- */ +public static final String MOVEMENTTYPE_InventoryOut = "I-"; +/** Movement To = M+ */ +public static final String MOVEMENTTYPE_MovementTo = "M+"; +/** Movement From = M- */ +public static final String MOVEMENTTYPE_MovementFrom = "M-"; +/** Production + = P+ */ +public static final String MOVEMENTTYPE_ProductionPlus = "P+"; +/** Production - = P- */ +public static final String MOVEMENTTYPE_Production_ = "P-"; +/** Vendor Receipts = V+ */ +public static final String MOVEMENTTYPE_VendorReceipts = "V+"; +/** Vendor Returns = V- */ +public static final String MOVEMENTTYPE_VendorReturns = "V-"; +/** Work Order + = W+ */ +public static final String MOVEMENTTYPE_WorkOrderPlus = "W+"; +/** Work Order - = W- */ +public static final String MOVEMENTTYPE_WorkOrder_ = "W-"; +/** Set Movement Type. +@param MovementType Method of moving the inventory */ +public void setMovementType (String MovementType) +{ +if (MovementType == null) throw new IllegalArgumentException ("MovementType is mandatory"); +if (MovementType.equals("C+") || MovementType.equals("C-") || MovementType.equals("I+") || MovementType.equals("I-") || MovementType.equals("M+") || MovementType.equals("M-") || MovementType.equals("P+") || MovementType.equals("P-") || MovementType.equals("V+") || MovementType.equals("V-") || MovementType.equals("W+") || MovementType.equals("W-")); + else throw new IllegalArgumentException ("MovementType Invalid value - " + MovementType + " - Reference_ID=189 - C+ - C- - I+ - I- - M+ - M- - P+ - P- - V+ - V- - W+ - W-"); +if (MovementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +MovementType = MovementType.substring(0,1); +} +set_Value ("MovementType", MovementType); +} +/** Get Movement Type. +@return Method of moving the inventory */ +public String getMovementType() +{ +return (String)get_Value("MovementType"); +} + +/** Search_InOut_ID AD_Reference_ID=295 */ +public static final int SEARCH_INOUT_ID_AD_Reference_ID=295; +/** Set Search Shipment/Receipt. +@param Search_InOut_ID Material Shipment Document */ +public void setSearch_InOut_ID (int Search_InOut_ID) +{ +if (Search_InOut_ID <= 0) set_Value ("Search_InOut_ID", null); + else +set_Value ("Search_InOut_ID", new Integer(Search_InOut_ID)); +} +/** Get Search Shipment/Receipt. +@return Material Shipment Document */ +public int getSearch_InOut_ID() +{ +Integer ii = (Integer)get_Value("Search_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Search_Invoice_ID AD_Reference_ID=336 */ +public static final int SEARCH_INVOICE_ID_AD_Reference_ID=336; +/** Set Search Invoice. +@param Search_Invoice_ID Search Invoice Identifier */ +public void setSearch_Invoice_ID (int Search_Invoice_ID) +{ +if (Search_Invoice_ID <= 0) set_Value ("Search_Invoice_ID", null); + else +set_Value ("Search_Invoice_ID", new Integer(Search_Invoice_ID)); +} +/** Get Search Invoice. +@return Search Invoice Identifier */ +public int getSearch_Invoice_ID() +{ +Integer ii = (Integer)get_Value("Search_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} + +/** Search_Order_ID AD_Reference_ID=290 */ +public static final int SEARCH_ORDER_ID_AD_Reference_ID=290; +/** Set Search Order. +@param Search_Order_ID Order Identifier */ +public void setSearch_Order_ID (int Search_Order_ID) +{ +if (Search_Order_ID <= 0) set_Value ("Search_Order_ID", null); + else +set_Value ("Search_Order_ID", new Integer(Search_Order_ID)); +} +/** Get Search Order. +@return Order Identifier */ +public int getSearch_Order_ID() +{ +Integer ii = (Integer)get_Value("Search_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_Test.java b/dbPort/src/org/compiere/model/X_Test.java new file mode 100644 index 0000000000..f94bb43ab6 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_Test.java @@ -0,0 +1,430 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for Test + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.828 */ +public class X_Test extends PO +{ +/** Standard Constructor +@param ctx context +@param Test_ID id +@param trxName transaction +*/ +public X_Test (Properties ctx, int Test_ID, String trxName) +{ +super (ctx, Test_ID, trxName); +/** if (Test_ID == 0) +{ +setName (null); +setTest_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_Test (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=135 */ +public static final int Table_ID=135; + +/** TableName=Test */ +public static final String Table_Name="Test"; + +protected static KeyNamePair Model = new KeyNamePair(135,"Test"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_Test[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Account_Acct. +@param Account_Acct Account_Acct */ +public void setAccount_Acct (int Account_Acct) +{ +set_Value ("Account_Acct", new Integer(Account_Acct)); +} +/** Get Account_Acct. +@return Account_Acct */ +public int getAccount_Acct() +{ +Integer ii = (Integer)get_Value("Account_Acct"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set BinaryData. +@param BinaryData Binary Data */ +public void setBinaryData (int BinaryData) +{ +set_Value ("BinaryData", new Integer(BinaryData)); +} +/** Get BinaryData. +@return Binary Data */ +public int getBinaryData() +{ +Integer ii = (Integer)get_Value("BinaryData"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Currency. +@param C_Currency_ID The Currency for this record */ +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); + else +set_Value ("C_Currency_ID", new Integer(C_Currency_ID)); +} +/** Get Currency. +@return The Currency for this record */ +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Address. +@param C_Location_ID Location or Address */ +public void setC_Location_ID (int C_Location_ID) +{ +if (C_Location_ID <= 0) set_Value ("C_Location_ID", null); + else +set_Value ("C_Location_ID", new Integer(C_Location_ID)); +} +/** Get Address. +@return Location or Address */ +public int getC_Location_ID() +{ +Integer ii = (Integer)get_Value("C_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Payment. +@param C_Payment_ID Payment identifier */ +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); + else +set_Value ("C_Payment_ID", new Integer(C_Payment_ID)); +} +/** Get Payment. +@return Payment identifier */ +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set UOM. +@param C_UOM_ID Unit of Measure */ +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_Value ("C_UOM_ID", null); + else +set_Value ("C_UOM_ID", new Integer(C_UOM_ID)); +} +/** Get UOM. +@return Unit of Measure */ +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Character Data. +@param CharacterData Long Character Field */ +public void setCharacterData (String CharacterData) +{ +set_Value ("CharacterData", CharacterData); +} +/** Get Character Data. +@return Long Character Field */ +public String getCharacterData() +{ +return (String)get_Value("CharacterData"); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Locator. +@param M_Locator_ID Warehouse Locator */ +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID <= 0) set_Value ("M_Locator_ID", null); + else +set_Value ("M_Locator_ID", new Integer(M_Locator_ID)); +} +/** Get Locator. +@return Warehouse Locator */ +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Amount. +@param T_Amount Amount */ +public void setT_Amount (BigDecimal T_Amount) +{ +set_Value ("T_Amount", T_Amount); +} +/** Get Amount. +@return Amount */ +public BigDecimal getT_Amount() +{ +BigDecimal bd = (BigDecimal)get_Value("T_Amount"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Date. +@param T_Date Date */ +public void setT_Date (Timestamp T_Date) +{ +set_Value ("T_Date", T_Date); +} +/** Get Date. +@return Date */ +public Timestamp getT_Date() +{ +return (Timestamp)get_Value("T_Date"); +} +/** Set DateTime. +@param T_DateTime DateTime */ +public void setT_DateTime (Timestamp T_DateTime) +{ +set_Value ("T_DateTime", T_DateTime); +} +/** Get DateTime. +@return DateTime */ +public Timestamp getT_DateTime() +{ +return (Timestamp)get_Value("T_DateTime"); +} +/** Set Integer. +@param T_Integer Integer */ +public void setT_Integer (int T_Integer) +{ +set_Value ("T_Integer", new Integer(T_Integer)); +} +/** Get Integer. +@return Integer */ +public int getT_Integer() +{ +Integer ii = (Integer)get_Value("T_Integer"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Number. +@param T_Number Number */ +public void setT_Number (BigDecimal T_Number) +{ +set_Value ("T_Number", T_Number); +} +/** Get Number. +@return Number */ +public BigDecimal getT_Number() +{ +BigDecimal bd = (BigDecimal)get_Value("T_Number"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Qty. +@param T_Qty Qty */ +public void setT_Qty (BigDecimal T_Qty) +{ +set_Value ("T_Qty", T_Qty); +} +/** Get Qty. +@return Qty */ +public BigDecimal getT_Qty() +{ +BigDecimal bd = (BigDecimal)get_Value("T_Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Test ID. +@param Test_ID Test ID */ +public void setTest_ID (int Test_ID) +{ +if (Test_ID < 1) throw new IllegalArgumentException ("Test_ID is mandatory."); +set_ValueNoCheck ("Test_ID", new Integer(Test_ID)); +} +/** Get Test ID. +@return Test ID */ +public int getTest_ID() +{ +Integer ii = (Integer)get_Value("Test_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_Advertisement.java b/dbPort/src/org/compiere/model/X_W_Advertisement.java new file mode 100644 index 0000000000..cc65b9af1c --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_Advertisement.java @@ -0,0 +1,438 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_Advertisement + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.843 */ +public class X_W_Advertisement extends PO +{ +/** Standard Constructor +@param ctx context +@param W_Advertisement_ID id +@param trxName transaction +*/ +public X_W_Advertisement (Properties ctx, int W_Advertisement_ID, String trxName) +{ +super (ctx, W_Advertisement_ID, trxName); +/** if (W_Advertisement_ID == 0) +{ +setAD_User_ID (0); // -1 +setC_BPartner_ID (0); +setIsSelfService (true); // Y +setName (null); +setPublishStatus (null); // U +setW_Advertisement_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_Advertisement (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=579 */ +public static final int Table_ID=579; + +/** TableName=W_Advertisement */ +public static final String Table_Name="W_Advertisement"; + +protected static KeyNamePair Model = new KeyNamePair(579,"W_Advertisement"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_Advertisement[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Advertisement Text. +@param AdText Text of the Advertisement */ +public void setAdText (String AdText) +{ +if (AdText != null && AdText.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +AdText = AdText.substring(0,1999); +} +set_Value ("AdText", AdText); +} +/** Get Advertisement Text. +@return Text of the Advertisement */ +public String getAdText() +{ +return (String)get_Value("AdText"); +} + +/** C_BPartner_ID AD_Reference_ID=232 */ +public static final int C_BPARTNER_ID_AD_Reference_ID=232; +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Image URL. +@param ImageURL URL of image */ +public void setImageURL (String ImageURL) +{ +if (ImageURL != null && ImageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +ImageURL = ImageURL.substring(0,119); +} +set_Value ("ImageURL", ImageURL); +} +/** Get Image URL. +@return URL of image */ +public String getImageURL() +{ +return (String)get_Value("ImageURL"); +} +/** Set Self-Service. +@param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", new Boolean(IsSelfService)); +} +/** Get Self-Service. +@return This is a Self-Service entry or this entry can be changed via Self-Service */ +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Process Now. +@param Processing Process Now */ +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", new Boolean(Processing)); +} +/** Get Process Now. +@return Process Now */ +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} + +/** PublishStatus AD_Reference_ID=310 */ +public static final int PUBLISHSTATUS_AD_Reference_ID=310; +/** Released = R */ +public static final String PUBLISHSTATUS_Released = "R"; +/** Test = T */ +public static final String PUBLISHSTATUS_Test = "T"; +/** Under Revision = U */ +public static final String PUBLISHSTATUS_UnderRevision = "U"; +/** Void = V */ +public static final String PUBLISHSTATUS_Void = "V"; +/** Set Publication Status. +@param PublishStatus Status of Publication */ +public void setPublishStatus (String PublishStatus) +{ +if (PublishStatus == null) throw new IllegalArgumentException ("PublishStatus is mandatory"); +if (PublishStatus.equals("R") || PublishStatus.equals("T") || PublishStatus.equals("U") || PublishStatus.equals("V")); + else throw new IllegalArgumentException ("PublishStatus Invalid value - " + PublishStatus + " - Reference_ID=310 - R - T - U - V"); +if (PublishStatus.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PublishStatus = PublishStatus.substring(0,0); +} +set_Value ("PublishStatus", PublishStatus); +} +/** Get Publication Status. +@return Status of Publication */ +public String getPublishStatus() +{ +return (String)get_Value("PublishStatus"); +} +/** Set Valid from. +@param ValidFrom Valid from including this date (first day) */ +public void setValidFrom (Timestamp ValidFrom) +{ +set_Value ("ValidFrom", ValidFrom); +} +/** Get Valid from. +@return Valid from including this date (first day) */ +public Timestamp getValidFrom() +{ +return (Timestamp)get_Value("ValidFrom"); +} +/** Set Valid to. +@param ValidTo Valid to including this date (last day) */ +public void setValidTo (Timestamp ValidTo) +{ +set_Value ("ValidTo", ValidTo); +} +/** Get Valid to. +@return Valid to including this date (last day) */ +public Timestamp getValidTo() +{ +return (Timestamp)get_Value("ValidTo"); +} +/** Set Version. +@param Version Version of the table definition */ +public void setVersion (int Version) +{ +set_Value ("Version", new Integer(Version)); +} +/** Get Version. +@return Version of the table definition */ +public int getVersion() +{ +Integer ii = (Integer)get_Value("Version"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Advertisement. +@param W_Advertisement_ID Web Advertisement */ +public void setW_Advertisement_ID (int W_Advertisement_ID) +{ +if (W_Advertisement_ID < 1) throw new IllegalArgumentException ("W_Advertisement_ID is mandatory."); +set_ValueNoCheck ("W_Advertisement_ID", new Integer(W_Advertisement_ID)); +} +/** Get Advertisement. +@return Web Advertisement */ +public int getW_Advertisement_ID() +{ +Integer ii = (Integer)get_Value("W_Advertisement_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Click Count. +@param W_ClickCount_ID Web Click Management */ +public void setW_ClickCount_ID (int W_ClickCount_ID) +{ +if (W_ClickCount_ID <= 0) set_Value ("W_ClickCount_ID", null); + else +set_Value ("W_ClickCount_ID", new Integer(W_ClickCount_ID)); +} +/** Get Click Count. +@return Web Click Management */ +public int getW_ClickCount_ID() +{ +Integer ii = (Integer)get_Value("W_ClickCount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Counter Count. +@param W_CounterCount_ID Web Counter Count Management */ +public void setW_CounterCount_ID (int W_CounterCount_ID) +{ +if (W_CounterCount_ID <= 0) set_Value ("W_CounterCount_ID", null); + else +set_Value ("W_CounterCount_ID", new Integer(W_CounterCount_ID)); +} +/** Get Counter Count. +@return Web Counter Count Management */ +public int getW_CounterCount_ID() +{ +Integer ii = (Integer)get_Value("W_CounterCount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Parameter 1. +@param WebParam1 Web Site Parameter 1 (default: header image) */ +public void setWebParam1 (String WebParam1) +{ +if (WebParam1 != null && WebParam1.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam1 = WebParam1.substring(0,1999); +} +set_Value ("WebParam1", WebParam1); +} +/** Get Web Parameter 1. +@return Web Site Parameter 1 (default: header image) */ +public String getWebParam1() +{ +return (String)get_Value("WebParam1"); +} +/** Set Web Parameter 2. +@param WebParam2 Web Site Parameter 2 (default index page) */ +public void setWebParam2 (String WebParam2) +{ +if (WebParam2 != null && WebParam2.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam2 = WebParam2.substring(0,1999); +} +set_Value ("WebParam2", WebParam2); +} +/** Get Web Parameter 2. +@return Web Site Parameter 2 (default index page) */ +public String getWebParam2() +{ +return (String)get_Value("WebParam2"); +} +/** Set Web Parameter 3. +@param WebParam3 Web Site Parameter 3 (default left - menu) */ +public void setWebParam3 (String WebParam3) +{ +if (WebParam3 != null && WebParam3.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam3 = WebParam3.substring(0,1999); +} +set_Value ("WebParam3", WebParam3); +} +/** Get Web Parameter 3. +@return Web Site Parameter 3 (default left - menu) */ +public String getWebParam3() +{ +return (String)get_Value("WebParam3"); +} +/** Set Web Parameter 4. +@param WebParam4 Web Site Parameter 4 (default footer left) */ +public void setWebParam4 (String WebParam4) +{ +if (WebParam4 != null && WebParam4.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam4 = WebParam4.substring(0,1999); +} +set_Value ("WebParam4", WebParam4); +} +/** Get Web Parameter 4. +@return Web Site Parameter 4 (default footer left) */ +public String getWebParam4() +{ +return (String)get_Value("WebParam4"); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_Basket.java b/dbPort/src/org/compiere/model/X_W_Basket.java new file mode 100644 index 0000000000..f6955e9301 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_Basket.java @@ -0,0 +1,190 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_Basket + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.875 */ +public class X_W_Basket extends PO +{ +/** Standard Constructor +@param ctx context +@param W_Basket_ID id +@param trxName transaction +*/ +public X_W_Basket (Properties ctx, int W_Basket_ID, String trxName) +{ +super (ctx, W_Basket_ID, trxName); +/** if (W_Basket_ID == 0) +{ +setAD_User_ID (0); +setSession_ID (0); +setW_Basket_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_Basket (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=402 */ +public static final int Table_ID=402; + +/** TableName=W_Basket */ +public static final String Table_Name="W_Basket"; + +protected static KeyNamePair Model = new KeyNamePair(402,"W_Basket"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_Basket[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID < 1) throw new IllegalArgumentException ("AD_User_ID is mandatory."); +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID <= 0) set_Value ("M_PriceList_ID", null); + else +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Session ID. +@param Session_ID Session ID */ +public void setSession_ID (int Session_ID) +{ +if (Session_ID < 1) throw new IllegalArgumentException ("Session_ID is mandatory."); +set_Value ("Session_ID", new Integer(Session_ID)); +} +/** Get Session ID. +@return Session ID */ +public int getSession_ID() +{ +Integer ii = (Integer)get_Value("Session_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getSession_ID())); +} +/** Set W_Basket_ID. +@param W_Basket_ID Web Basket */ +public void setW_Basket_ID (int W_Basket_ID) +{ +if (W_Basket_ID < 1) throw new IllegalArgumentException ("W_Basket_ID is mandatory."); +set_ValueNoCheck ("W_Basket_ID", new Integer(W_Basket_ID)); +} +/** Get W_Basket_ID. +@return Web Basket */ +public int getW_Basket_ID() +{ +Integer ii = (Integer)get_Value("W_Basket_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_BasketLine.java b/dbPort/src/org/compiere/model/X_W_BasketLine.java new file mode 100644 index 0000000000..4c906477aa --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_BasketLine.java @@ -0,0 +1,226 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_BasketLine + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.875 */ +public class X_W_BasketLine extends PO +{ +/** Standard Constructor +@param ctx context +@param W_BasketLine_ID id +@param trxName transaction +*/ +public X_W_BasketLine (Properties ctx, int W_BasketLine_ID, String trxName) +{ +super (ctx, W_BasketLine_ID, trxName); +/** if (W_BasketLine_ID == 0) +{ +setDescription (null); +setLine (0); +setPrice (Env.ZERO); +setProduct (null); +setQty (Env.ZERO); +setW_BasketLine_ID (0); +setW_Basket_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_BasketLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=549 */ +public static final int Table_ID=549; + +/** TableName=W_BasketLine */ +public static final String Table_Name="W_BasketLine"; + +protected static KeyNamePair Model = new KeyNamePair(549,"W_BasketLine"); + +protected BigDecimal accessLevel = new BigDecimal(4); +/** AccessLevel +@return 4 - System +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_BasketLine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description == null) throw new IllegalArgumentException ("Description is mandatory."); +if (Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", new Integer(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} +/** Set Product. +@param M_Product_ID Product, Service, Item */ +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); + else +set_Value ("M_Product_ID", new Integer(M_Product_ID)); +} +/** Get Product. +@return Product, Service, Item */ +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Price. +@param Price Price */ +public void setPrice (BigDecimal Price) +{ +if (Price == null) throw new IllegalArgumentException ("Price is mandatory."); +set_Value ("Price", Price); +} +/** Get Price. +@return Price */ +public BigDecimal getPrice() +{ +BigDecimal bd = (BigDecimal)get_Value("Price"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Product. +@param Product Product */ +public void setProduct (String Product) +{ +if (Product == null) throw new IllegalArgumentException ("Product is mandatory."); +if (Product.length() > 40) +{ +log.warning("Length > 40 - truncated"); +Product = Product.substring(0,39); +} +set_Value ("Product", Product); +} +/** Get Product. +@return Product */ +public String getProduct() +{ +return (String)get_Value("Product"); +} +/** Set Quantity. +@param Qty Quantity */ +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} +/** Get Quantity. +@return Quantity */ +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Set Basket Line. +@param W_BasketLine_ID Web Basket Line */ +public void setW_BasketLine_ID (int W_BasketLine_ID) +{ +if (W_BasketLine_ID < 1) throw new IllegalArgumentException ("W_BasketLine_ID is mandatory."); +set_ValueNoCheck ("W_BasketLine_ID", new Integer(W_BasketLine_ID)); +} +/** Get Basket Line. +@return Web Basket Line */ +public int getW_BasketLine_ID() +{ +Integer ii = (Integer)get_Value("W_BasketLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set W_Basket_ID. +@param W_Basket_ID Web Basket */ +public void setW_Basket_ID (int W_Basket_ID) +{ +if (W_Basket_ID < 1) throw new IllegalArgumentException ("W_Basket_ID is mandatory."); +set_ValueNoCheck ("W_Basket_ID", new Integer(W_Basket_ID)); +} +/** Get W_Basket_ID. +@return Web Basket */ +public int getW_Basket_ID() +{ +Integer ii = (Integer)get_Value("W_Basket_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_Click.java b/dbPort/src/org/compiere/model/X_W_Click.java new file mode 100644 index 0000000000..566f6efa62 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_Click.java @@ -0,0 +1,279 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_Click + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.875 */ +public class X_W_Click extends PO +{ +/** Standard Constructor +@param ctx context +@param W_Click_ID id +@param trxName transaction +*/ +public X_W_Click (Properties ctx, int W_Click_ID, String trxName) +{ +super (ctx, W_Click_ID, trxName); +/** if (W_Click_ID == 0) +{ +setProcessed (false); +setW_Click_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_Click (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=550 */ +public static final int Table_ID=550; + +/** TableName=W_Click */ +public static final String Table_Name="W_Click"; + +protected static KeyNamePair Model = new KeyNamePair(550,"W_Click"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_Click[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accept Language. +@param AcceptLanguage Language accepted based on browser information */ +public void setAcceptLanguage (String AcceptLanguage) +{ +if (AcceptLanguage != null && AcceptLanguage.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AcceptLanguage = AcceptLanguage.substring(0,59); +} +set_Value ("AcceptLanguage", AcceptLanguage); +} +/** Get Accept Language. +@return Language accepted based on browser information */ +public String getAcceptLanguage() +{ +return (String)get_Value("AcceptLanguage"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Referrer. +@param Referrer Referring web address */ +public void setReferrer (String Referrer) +{ +if (Referrer != null && Referrer.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Referrer = Referrer.substring(0,119); +} +set_Value ("Referrer", Referrer); +} +/** Get Referrer. +@return Referring web address */ +public String getReferrer() +{ +return (String)get_Value("Referrer"); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr != null && Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_Value ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getRemote_Addr()); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host != null && Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_Value ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set Target URL. +@param TargetURL URL for the Target */ +public void setTargetURL (String TargetURL) +{ +if (TargetURL != null && TargetURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +TargetURL = TargetURL.substring(0,119); +} +set_Value ("TargetURL", TargetURL); +} +/** Get Target URL. +@return URL for the Target */ +public String getTargetURL() +{ +return (String)get_Value("TargetURL"); +} +/** Set User Agent. +@param UserAgent Browser Used */ +public void setUserAgent (String UserAgent) +{ +if (UserAgent != null && UserAgent.length() > 255) +{ +log.warning("Length > 255 - truncated"); +UserAgent = UserAgent.substring(0,254); +} +set_Value ("UserAgent", UserAgent); +} +/** Get User Agent. +@return Browser Used */ +public String getUserAgent() +{ +return (String)get_Value("UserAgent"); +} +/** Set Click Count. +@param W_ClickCount_ID Web Click Management */ +public void setW_ClickCount_ID (int W_ClickCount_ID) +{ +if (W_ClickCount_ID <= 0) set_ValueNoCheck ("W_ClickCount_ID", null); + else +set_ValueNoCheck ("W_ClickCount_ID", new Integer(W_ClickCount_ID)); +} +/** Get Click Count. +@return Web Click Management */ +public int getW_ClickCount_ID() +{ +Integer ii = (Integer)get_Value("W_ClickCount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Click. +@param W_Click_ID Individual Web Click */ +public void setW_Click_ID (int W_Click_ID) +{ +if (W_Click_ID < 1) throw new IllegalArgumentException ("W_Click_ID is mandatory."); +set_ValueNoCheck ("W_Click_ID", new Integer(W_Click_ID)); +} +/** Get Web Click. +@return Individual Web Click */ +public int getW_Click_ID() +{ +Integer ii = (Integer)get_Value("W_Click_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_ClickCount.java b/dbPort/src/org/compiere/model/X_W_ClickCount.java new file mode 100644 index 0000000000..073d16c8b5 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_ClickCount.java @@ -0,0 +1,197 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_ClickCount + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.89 */ +public class X_W_ClickCount extends PO +{ +/** Standard Constructor +@param ctx context +@param W_ClickCount_ID id +@param trxName transaction +*/ +public X_W_ClickCount (Properties ctx, int W_ClickCount_ID, String trxName) +{ +super (ctx, W_ClickCount_ID, trxName); +/** if (W_ClickCount_ID == 0) +{ +setName (null); +setTargetURL (null); +setW_ClickCount_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_ClickCount (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=553 */ +public static final int Table_ID=553; + +/** TableName=W_ClickCount */ +public static final String Table_Name="W_ClickCount"; + +protected static KeyNamePair Model = new KeyNamePair(553,"W_ClickCount"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_ClickCount[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** C_BPartner_ID AD_Reference_ID=232 */ +public static final int C_BPARTNER_ID_AD_Reference_ID=232; +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Counter. +@param Counter Count Value */ +public void setCounter (int Counter) +{ +throw new IllegalArgumentException ("Counter is virtual column"); +} +/** Get Counter. +@return Count Value */ +public int getCounter() +{ +Integer ii = (Integer)get_Value("Counter"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Target URL. +@param TargetURL URL for the Target */ +public void setTargetURL (String TargetURL) +{ +if (TargetURL == null) throw new IllegalArgumentException ("TargetURL is mandatory."); +if (TargetURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +TargetURL = TargetURL.substring(0,119); +} +set_Value ("TargetURL", TargetURL); +} +/** Get Target URL. +@return URL for the Target */ +public String getTargetURL() +{ +return (String)get_Value("TargetURL"); +} +/** Set Click Count. +@param W_ClickCount_ID Web Click Management */ +public void setW_ClickCount_ID (int W_ClickCount_ID) +{ +if (W_ClickCount_ID < 1) throw new IllegalArgumentException ("W_ClickCount_ID is mandatory."); +set_ValueNoCheck ("W_ClickCount_ID", new Integer(W_ClickCount_ID)); +} +/** Get Click Count. +@return Web Click Management */ +public int getW_ClickCount_ID() +{ +Integer ii = (Integer)get_Value("W_ClickCount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_Counter.java b/dbPort/src/org/compiere/model/X_W_Counter.java new file mode 100644 index 0000000000..1a2942dc5b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_Counter.java @@ -0,0 +1,285 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_Counter + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.906 */ +public class X_W_Counter extends PO +{ +/** Standard Constructor +@param ctx context +@param W_Counter_ID id +@param trxName transaction +*/ +public X_W_Counter (Properties ctx, int W_Counter_ID, String trxName) +{ +super (ctx, W_Counter_ID, trxName); +/** if (W_Counter_ID == 0) +{ +setPageURL (null); +setProcessed (false); +setRemote_Addr (null); +setRemote_Host (null); +setW_Counter_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_Counter (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=403 */ +public static final int Table_ID=403; + +/** TableName=W_Counter */ +public static final String Table_Name="W_Counter"; + +protected static KeyNamePair Model = new KeyNamePair(403,"W_Counter"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_Counter[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set User/Contact. +@param AD_User_ID User within the system - Internal or Business Partner Contact */ +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); + else +set_Value ("AD_User_ID", new Integer(AD_User_ID)); +} +/** Get User/Contact. +@return User within the system - Internal or Business Partner Contact */ +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Accept Language. +@param AcceptLanguage Language accepted based on browser information */ +public void setAcceptLanguage (String AcceptLanguage) +{ +if (AcceptLanguage != null && AcceptLanguage.length() > 60) +{ +log.warning("Length > 60 - truncated"); +AcceptLanguage = AcceptLanguage.substring(0,59); +} +set_Value ("AcceptLanguage", AcceptLanguage); +} +/** Get Accept Language. +@return Language accepted based on browser information */ +public String getAcceptLanguage() +{ +return (String)get_Value("AcceptLanguage"); +} +/** Set EMail Address. +@param EMail Electronic Mail Address */ +public void setEMail (String EMail) +{ +if (EMail != null && EMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +EMail = EMail.substring(0,59); +} +set_Value ("EMail", EMail); +} +/** Get EMail Address. +@return Electronic Mail Address */ +public String getEMail() +{ +return (String)get_Value("EMail"); +} +/** Set Page URL. +@param PageURL Page URL */ +public void setPageURL (String PageURL) +{ +if (PageURL == null) throw new IllegalArgumentException ("PageURL is mandatory."); +if (PageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +PageURL = PageURL.substring(0,119); +} +set_Value ("PageURL", PageURL); +} +/** Get Page URL. +@return Page URL */ +public String getPageURL() +{ +return (String)get_Value("PageURL"); +} +/** Set Processed. +@param Processed The document has been processed */ +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", new Boolean(Processed)); +} +/** Get Processed. +@return The document has been processed */ +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Referrer. +@param Referrer Referring web address */ +public void setReferrer (String Referrer) +{ +if (Referrer != null && Referrer.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Referrer = Referrer.substring(0,119); +} +set_Value ("Referrer", Referrer); +} +/** Get Referrer. +@return Referring web address */ +public String getReferrer() +{ +return (String)get_Value("Referrer"); +} +/** Set Remote Addr. +@param Remote_Addr Remote Address */ +public void setRemote_Addr (String Remote_Addr) +{ +if (Remote_Addr == null) throw new IllegalArgumentException ("Remote_Addr is mandatory."); +if (Remote_Addr.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Remote_Addr = Remote_Addr.substring(0,59); +} +set_Value ("Remote_Addr", Remote_Addr); +} +/** Get Remote Addr. +@return Remote Address */ +public String getRemote_Addr() +{ +return (String)get_Value("Remote_Addr"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getRemote_Addr()); +} +/** Set Remote Host. +@param Remote_Host Remote host Info */ +public void setRemote_Host (String Remote_Host) +{ +if (Remote_Host == null) throw new IllegalArgumentException ("Remote_Host is mandatory."); +if (Remote_Host.length() > 120) +{ +log.warning("Length > 120 - truncated"); +Remote_Host = Remote_Host.substring(0,119); +} +set_Value ("Remote_Host", Remote_Host); +} +/** Get Remote Host. +@return Remote host Info */ +public String getRemote_Host() +{ +return (String)get_Value("Remote_Host"); +} +/** Set User Agent. +@param UserAgent Browser Used */ +public void setUserAgent (String UserAgent) +{ +if (UserAgent != null && UserAgent.length() > 255) +{ +log.warning("Length > 255 - truncated"); +UserAgent = UserAgent.substring(0,254); +} +set_Value ("UserAgent", UserAgent); +} +/** Get User Agent. +@return Browser Used */ +public String getUserAgent() +{ +return (String)get_Value("UserAgent"); +} +/** Set Counter Count. +@param W_CounterCount_ID Web Counter Count Management */ +public void setW_CounterCount_ID (int W_CounterCount_ID) +{ +if (W_CounterCount_ID <= 0) set_ValueNoCheck ("W_CounterCount_ID", null); + else +set_ValueNoCheck ("W_CounterCount_ID", new Integer(W_CounterCount_ID)); +} +/** Get Counter Count. +@return Web Counter Count Management */ +public int getW_CounterCount_ID() +{ +Integer ii = (Integer)get_Value("W_CounterCount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Counter. +@param W_Counter_ID Individual Count hit */ +public void setW_Counter_ID (int W_Counter_ID) +{ +if (W_Counter_ID < 1) throw new IllegalArgumentException ("W_Counter_ID is mandatory."); +set_ValueNoCheck ("W_Counter_ID", new Integer(W_Counter_ID)); +} +/** Get Web Counter. +@return Individual Count hit */ +public int getW_Counter_ID() +{ +Integer ii = (Integer)get_Value("W_Counter_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_CounterCount.java b/dbPort/src/org/compiere/model/X_W_CounterCount.java new file mode 100644 index 0000000000..c129781e42 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_CounterCount.java @@ -0,0 +1,197 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_CounterCount + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.906 */ +public class X_W_CounterCount extends PO +{ +/** Standard Constructor +@param ctx context +@param W_CounterCount_ID id +@param trxName transaction +*/ +public X_W_CounterCount (Properties ctx, int W_CounterCount_ID, String trxName) +{ +super (ctx, W_CounterCount_ID, trxName); +/** if (W_CounterCount_ID == 0) +{ +setName (null); +setPageURL (null); +setW_CounterCount_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_CounterCount (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=552 */ +public static final int Table_ID=552; + +/** TableName=W_CounterCount */ +public static final String Table_Name="W_CounterCount"; + +protected static KeyNamePair Model = new KeyNamePair(552,"W_CounterCount"); + +protected BigDecimal accessLevel = new BigDecimal(3); +/** AccessLevel +@return 3 - Client - Org +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_CounterCount[").append(get_ID()).append("]"); +return sb.toString(); +} + +/** C_BPartner_ID AD_Reference_ID=232 */ +public static final int C_BPARTNER_ID_AD_Reference_ID=232; +/** Set Business Partner . +@param C_BPartner_ID Identifies a Business Partner */ +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); + else +set_Value ("C_BPartner_ID", new Integer(C_BPartner_ID)); +} +/** Get Business Partner . +@return Identifies a Business Partner */ +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Counter. +@param Counter Count Value */ +public void setCounter (int Counter) +{ +throw new IllegalArgumentException ("Counter is virtual column"); +} +/** Get Counter. +@return Count Value */ +public int getCounter() +{ +Integer ii = (Integer)get_Value("Counter"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Page URL. +@param PageURL Page URL */ +public void setPageURL (String PageURL) +{ +if (PageURL == null) throw new IllegalArgumentException ("PageURL is mandatory."); +if (PageURL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +PageURL = PageURL.substring(0,119); +} +set_Value ("PageURL", PageURL); +} +/** Get Page URL. +@return Page URL */ +public String getPageURL() +{ +return (String)get_Value("PageURL"); +} +/** Set Counter Count. +@param W_CounterCount_ID Web Counter Count Management */ +public void setW_CounterCount_ID (int W_CounterCount_ID) +{ +if (W_CounterCount_ID < 1) throw new IllegalArgumentException ("W_CounterCount_ID is mandatory."); +set_ValueNoCheck ("W_CounterCount_ID", new Integer(W_CounterCount_ID)); +} +/** Get Counter Count. +@return Web Counter Count Management */ +public int getW_CounterCount_ID() +{ +Integer ii = (Integer)get_Value("W_CounterCount_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_MailMsg.java b/dbPort/src/org/compiere/model/X_W_MailMsg.java new file mode 100644 index 0000000000..78ed176728 --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_MailMsg.java @@ -0,0 +1,275 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_MailMsg + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.921 */ +public class X_W_MailMsg extends PO +{ +/** Standard Constructor +@param ctx context +@param W_MailMsg_ID id +@param trxName transaction +*/ +public X_W_MailMsg (Properties ctx, int W_MailMsg_ID, String trxName) +{ +super (ctx, W_MailMsg_ID, trxName); +/** if (W_MailMsg_ID == 0) +{ +setMailMsgType (null); +setMessage (null); +setName (null); +setSubject (null); +setW_MailMsg_ID (0); +setW_Store_ID (0); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_MailMsg (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=780 */ +public static final int Table_ID=780; + +/** TableName=W_MailMsg */ +public static final String Table_Name="W_MailMsg"; + +protected static KeyNamePair Model = new KeyNamePair(780,"W_MailMsg"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_MailMsg[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} + +/** MailMsgType AD_Reference_ID=342 */ +public static final int MAILMSGTYPE_AD_Reference_ID=342; +/** Subscribe = LS */ +public static final String MAILMSGTYPE_Subscribe = "LS"; +/** UnSubscribe = LU */ +public static final String MAILMSGTYPE_UnSubscribe = "LU"; +/** Order Acknowledgement = OA */ +public static final String MAILMSGTYPE_OrderAcknowledgement = "OA"; +/** Payment Acknowledgement = PA */ +public static final String MAILMSGTYPE_PaymentAcknowledgement = "PA"; +/** Payment Error = PE */ +public static final String MAILMSGTYPE_PaymentError = "PE"; +/** User Account = UA */ +public static final String MAILMSGTYPE_UserAccount = "UA"; +/** User Password = UP */ +public static final String MAILMSGTYPE_UserPassword = "UP"; +/** User Verification = UV */ +public static final String MAILMSGTYPE_UserVerification = "UV"; +/** Request = WR */ +public static final String MAILMSGTYPE_Request = "WR"; +/** Set Message Type. +@param MailMsgType Mail Message Type */ +public void setMailMsgType (String MailMsgType) +{ +if (MailMsgType == null) throw new IllegalArgumentException ("MailMsgType is mandatory"); +if (MailMsgType.equals("LS") || MailMsgType.equals("LU") || MailMsgType.equals("OA") || MailMsgType.equals("PA") || MailMsgType.equals("PE") || MailMsgType.equals("UA") || MailMsgType.equals("UP") || MailMsgType.equals("UV") || MailMsgType.equals("WR")); + else throw new IllegalArgumentException ("MailMsgType Invalid value - " + MailMsgType + " - Reference_ID=342 - LS - LU - OA - PA - PE - UA - UP - UV - WR"); +if (MailMsgType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +MailMsgType = MailMsgType.substring(0,1); +} +set_Value ("MailMsgType", MailMsgType); +} +/** Get Message Type. +@return Mail Message Type */ +public String getMailMsgType() +{ +return (String)get_Value("MailMsgType"); +} +/** Set Message. +@param Message EMail Message */ +public void setMessage (String Message) +{ +if (Message == null) throw new IllegalArgumentException ("Message is mandatory."); +if (Message.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Message = Message.substring(0,1999); +} +set_Value ("Message", Message); +} +/** Get Message. +@return EMail Message */ +public String getMessage() +{ +return (String)get_Value("Message"); +} +/** Set Message 2. +@param Message2 Optional second part of the EMail Message */ +public void setMessage2 (String Message2) +{ +if (Message2 != null && Message2.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Message2 = Message2.substring(0,1999); +} +set_Value ("Message2", Message2); +} +/** Get Message 2. +@return Optional second part of the EMail Message */ +public String getMessage2() +{ +return (String)get_Value("Message2"); +} +/** Set Message 3. +@param Message3 Optional third part of the EMail Message */ +public void setMessage3 (String Message3) +{ +if (Message3 != null && Message3.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Message3 = Message3.substring(0,1999); +} +set_Value ("Message3", Message3); +} +/** Get Message 3. +@return Optional third part of the EMail Message */ +public String getMessage3() +{ +return (String)get_Value("Message3"); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} +/** Set Subject. +@param Subject Email Message Subject */ +public void setSubject (String Subject) +{ +if (Subject == null) throw new IllegalArgumentException ("Subject is mandatory."); +if (Subject.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Subject = Subject.substring(0,254); +} +set_Value ("Subject", Subject); +} +/** Get Subject. +@return Email Message Subject */ +public String getSubject() +{ +return (String)get_Value("Subject"); +} +/** Set Mail Message. +@param W_MailMsg_ID Web Store Mail Message Template */ +public void setW_MailMsg_ID (int W_MailMsg_ID) +{ +if (W_MailMsg_ID < 1) throw new IllegalArgumentException ("W_MailMsg_ID is mandatory."); +set_ValueNoCheck ("W_MailMsg_ID", new Integer(W_MailMsg_ID)); +} +/** Get Mail Message. +@return Web Store Mail Message Template */ +public int getW_MailMsg_ID() +{ +Integer ii = (Integer)get_Value("W_MailMsg_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Store. +@param W_Store_ID A Web Store of the Client */ +public void setW_Store_ID (int W_Store_ID) +{ +if (W_Store_ID < 1) throw new IllegalArgumentException ("W_Store_ID is mandatory."); +set_Value ("W_Store_ID", new Integer(W_Store_ID)); +} +/** Get Web Store. +@return A Web Store of the Client */ +public int getW_Store_ID() +{ +Integer ii = (Integer)get_Value("W_Store_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +} diff --git a/dbPort/src/org/compiere/model/X_W_Store.java b/dbPort/src/org/compiere/model/X_W_Store.java new file mode 100644 index 0000000000..ceb63a7e7b --- /dev/null +++ b/dbPort/src/org/compiere/model/X_W_Store.java @@ -0,0 +1,714 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; + you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; + if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.model; + +/** Generated Model - DO NOT CHANGE */ +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; +/** Generated Model for W_Store + * @author Jorg Janke (generated) + * @version Release 2.5.3d - 2006-10-10 21:56:03.937 */ +public class X_W_Store extends PO +{ +/** Standard Constructor +@param ctx context +@param W_Store_ID id +@param trxName transaction +*/ +public X_W_Store (Properties ctx, int W_Store_ID, String trxName) +{ +super (ctx, W_Store_ID, trxName); +/** if (W_Store_ID == 0) +{ +setC_PaymentTerm_ID (0); +setIsDefault (false); +setIsMenuAssets (true); // Y +setIsMenuContact (true); // Y +setIsMenuInterests (true); // Y +setIsMenuInvoices (true); // Y +setIsMenuOrders (true); // Y +setIsMenuPayments (true); // Y +setIsMenuRegistrations (true); // Y +setIsMenuRequests (true); // Y +setIsMenuRfQs (true); // Y +setIsMenuShipments (true); // Y +setM_PriceList_ID (0); +setM_Warehouse_ID (0); +setName (null); +setSalesRep_ID (0); +setURL (null); +setW_Store_ID (0); +setWebContext (null); +} + */ +} +/** Load Constructor +@param ctx context +@param rs result set +@param trxName transaction +*/ +public X_W_Store (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} +/** AD_Table_ID=778 */ +public static final int Table_ID=778; + +/** TableName=W_Store */ +public static final String Table_Name="W_Store"; + +protected static KeyNamePair Model = new KeyNamePair(778,"W_Store"); + +protected BigDecimal accessLevel = new BigDecimal(2); +/** AccessLevel +@return 2 - Client +*/ +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} +/** Load Meta Data +@param ctx context +@return PO Info +*/ +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} +/** Info +@return info +*/ +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_W_Store[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Payment Term. +@param C_PaymentTerm_ID The terms of Payment (timing, discount) */ +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_Value ("C_PaymentTerm_ID", new Integer(C_PaymentTerm_ID)); +} +/** Get Payment Term. +@return The terms of Payment (timing, discount) */ +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Description. +@param Description Optional short description of the record */ +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} +/** Get Description. +@return Optional short description of the record */ +public String getDescription() +{ +return (String)get_Value("Description"); +} +/** Set EMail Footer. +@param EMailFooter Footer added to EMails */ +public void setEMailFooter (String EMailFooter) +{ +if (EMailFooter != null && EMailFooter.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +EMailFooter = EMailFooter.substring(0,1999); +} +set_Value ("EMailFooter", EMailFooter); +} +/** Get EMail Footer. +@return Footer added to EMails */ +public String getEMailFooter() +{ +return (String)get_Value("EMailFooter"); +} +/** Set EMail Header. +@param EMailHeader Header added to EMails */ +public void setEMailHeader (String EMailHeader) +{ +if (EMailHeader != null && EMailHeader.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +EMailHeader = EMailHeader.substring(0,1999); +} +set_Value ("EMailHeader", EMailHeader); +} +/** Get EMail Header. +@return Header added to EMails */ +public String getEMailHeader() +{ +return (String)get_Value("EMailHeader"); +} +/** Set Comment/Help. +@param Help Comment or Hint */ +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} +/** Get Comment/Help. +@return Comment or Hint */ +public String getHelp() +{ +return (String)get_Value("Help"); +} +/** Set Default. +@param IsDefault Default value */ +public void setIsDefault (boolean IsDefault) +{ +set_Value ("IsDefault", new Boolean(IsDefault)); +} +/** Get Default. +@return Default value */ +public boolean isDefault() +{ +Object oo = get_Value("IsDefault"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Assets. +@param IsMenuAssets Show Menu Assets */ +public void setIsMenuAssets (boolean IsMenuAssets) +{ +set_Value ("IsMenuAssets", new Boolean(IsMenuAssets)); +} +/** Get Menu Assets. +@return Show Menu Assets */ +public boolean isMenuAssets() +{ +Object oo = get_Value("IsMenuAssets"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Contact. +@param IsMenuContact Show Menu Contact */ +public void setIsMenuContact (boolean IsMenuContact) +{ +set_Value ("IsMenuContact", new Boolean(IsMenuContact)); +} +/** Get Menu Contact. +@return Show Menu Contact */ +public boolean isMenuContact() +{ +Object oo = get_Value("IsMenuContact"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Interests. +@param IsMenuInterests Show Menu Interests */ +public void setIsMenuInterests (boolean IsMenuInterests) +{ +set_Value ("IsMenuInterests", new Boolean(IsMenuInterests)); +} +/** Get Menu Interests. +@return Show Menu Interests */ +public boolean isMenuInterests() +{ +Object oo = get_Value("IsMenuInterests"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Invoices. +@param IsMenuInvoices Show Menu Invoices */ +public void setIsMenuInvoices (boolean IsMenuInvoices) +{ +set_Value ("IsMenuInvoices", new Boolean(IsMenuInvoices)); +} +/** Get Menu Invoices. +@return Show Menu Invoices */ +public boolean isMenuInvoices() +{ +Object oo = get_Value("IsMenuInvoices"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Orders. +@param IsMenuOrders Show Menu Orders */ +public void setIsMenuOrders (boolean IsMenuOrders) +{ +set_Value ("IsMenuOrders", new Boolean(IsMenuOrders)); +} +/** Get Menu Orders. +@return Show Menu Orders */ +public boolean isMenuOrders() +{ +Object oo = get_Value("IsMenuOrders"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Payments. +@param IsMenuPayments Show Menu Payments */ +public void setIsMenuPayments (boolean IsMenuPayments) +{ +set_Value ("IsMenuPayments", new Boolean(IsMenuPayments)); +} +/** Get Menu Payments. +@return Show Menu Payments */ +public boolean isMenuPayments() +{ +Object oo = get_Value("IsMenuPayments"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Registrations. +@param IsMenuRegistrations Show Menu Registrations */ +public void setIsMenuRegistrations (boolean IsMenuRegistrations) +{ +set_Value ("IsMenuRegistrations", new Boolean(IsMenuRegistrations)); +} +/** Get Menu Registrations. +@return Show Menu Registrations */ +public boolean isMenuRegistrations() +{ +Object oo = get_Value("IsMenuRegistrations"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Requests. +@param IsMenuRequests Show Menu Requests */ +public void setIsMenuRequests (boolean IsMenuRequests) +{ +set_Value ("IsMenuRequests", new Boolean(IsMenuRequests)); +} +/** Get Menu Requests. +@return Show Menu Requests */ +public boolean isMenuRequests() +{ +Object oo = get_Value("IsMenuRequests"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu RfQs. +@param IsMenuRfQs Show Menu RfQs */ +public void setIsMenuRfQs (boolean IsMenuRfQs) +{ +set_Value ("IsMenuRfQs", new Boolean(IsMenuRfQs)); +} +/** Get Menu RfQs. +@return Show Menu RfQs */ +public boolean isMenuRfQs() +{ +Object oo = get_Value("IsMenuRfQs"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Menu Shipments. +@param IsMenuShipments Show Menu Shipments */ +public void setIsMenuShipments (boolean IsMenuShipments) +{ +set_Value ("IsMenuShipments", new Boolean(IsMenuShipments)); +} +/** Get Menu Shipments. +@return Show Menu Shipments */ +public boolean isMenuShipments() +{ +Object oo = get_Value("IsMenuShipments"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Set Price List. +@param M_PriceList_ID Unique identifier of a Price List */ +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", new Integer(M_PriceList_ID)); +} +/** Get Price List. +@return Unique identifier of a Price List */ +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Warehouse. +@param M_Warehouse_ID Storage Warehouse and Service Point */ +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_Value ("M_Warehouse_ID", new Integer(M_Warehouse_ID)); +} +/** Get Warehouse. +@return Storage Warehouse and Service Point */ +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Name. +@param Name Alphanumeric identifier of the entity */ +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} +/** Get Name. +@return Alphanumeric identifier of the entity */ +public String getName() +{ +return (String)get_Value("Name"); +} +/** Get Record ID/ColumnName +@return ID/ColumnName pair +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getName()); +} + +/** SalesRep_ID AD_Reference_ID=190 */ +public static final int SALESREP_ID_AD_Reference_ID=190; +/** Set Sales Representative. +@param SalesRep_ID Sales Representative or Company Agent */ +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", new Integer(SalesRep_ID)); +} +/** Get Sales Representative. +@return Sales Representative or Company Agent */ +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Stylesheet. +@param Stylesheet CSS (Stylesheet) used */ +public void setStylesheet (String Stylesheet) +{ +if (Stylesheet != null && Stylesheet.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Stylesheet = Stylesheet.substring(0,59); +} +set_Value ("Stylesheet", Stylesheet); +} +/** Get Stylesheet. +@return CSS (Stylesheet) used */ +public String getStylesheet() +{ +return (String)get_Value("Stylesheet"); +} +/** Set URL. +@param URL Full URL address - e.g. http://www.adempiere.org */ +public void setURL (String URL) +{ +if (URL == null) throw new IllegalArgumentException ("URL is mandatory."); +if (URL.length() > 120) +{ +log.warning("Length > 120 - truncated"); +URL = URL.substring(0,119); +} +set_Value ("URL", URL); +} +/** Get URL. +@return Full URL address - e.g. http://www.adempiere.org */ +public String getURL() +{ +return (String)get_Value("URL"); +} +/** Set Web Store EMail. +@param WStoreEMail EMail address used as the sender (From) */ +public void setWStoreEMail (String WStoreEMail) +{ +if (WStoreEMail != null && WStoreEMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +WStoreEMail = WStoreEMail.substring(0,59); +} +set_Value ("WStoreEMail", WStoreEMail); +} +/** Get Web Store EMail. +@return EMail address used as the sender (From) */ +public String getWStoreEMail() +{ +return (String)get_Value("WStoreEMail"); +} +/** Set WebStore User. +@param WStoreUser User ID of the Web Store EMail address */ +public void setWStoreUser (String WStoreUser) +{ +if (WStoreUser != null && WStoreUser.length() > 60) +{ +log.warning("Length > 60 - truncated"); +WStoreUser = WStoreUser.substring(0,59); +} +set_Value ("WStoreUser", WStoreUser); +} +/** Get WebStore User. +@return User ID of the Web Store EMail address */ +public String getWStoreUser() +{ +return (String)get_Value("WStoreUser"); +} +/** Set WebStore Password. +@param WStoreUserPW Password of the Web Store EMail address */ +public void setWStoreUserPW (String WStoreUserPW) +{ +if (WStoreUserPW != null && WStoreUserPW.length() > 20) +{ +log.warning("Length > 20 - truncated"); +WStoreUserPW = WStoreUserPW.substring(0,19); +} +set_Value ("WStoreUserPW", WStoreUserPW); +} +/** Get WebStore Password. +@return Password of the Web Store EMail address */ +public String getWStoreUserPW() +{ +return (String)get_Value("WStoreUserPW"); +} +/** Set Web Store. +@param W_Store_ID A Web Store of the Client */ +public void setW_Store_ID (int W_Store_ID) +{ +if (W_Store_ID < 1) throw new IllegalArgumentException ("W_Store_ID is mandatory."); +set_ValueNoCheck ("W_Store_ID", new Integer(W_Store_ID)); +} +/** Get Web Store. +@return A Web Store of the Client */ +public int getW_Store_ID() +{ +Integer ii = (Integer)get_Value("W_Store_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Set Web Context. +@param WebContext Web Server Context - e.g. /wstore */ +public void setWebContext (String WebContext) +{ +if (WebContext == null) throw new IllegalArgumentException ("WebContext is mandatory."); +if (WebContext.length() > 20) +{ +log.warning("Length > 20 - truncated"); +WebContext = WebContext.substring(0,19); +} +set_Value ("WebContext", WebContext); +} +/** Get Web Context. +@return Web Server Context - e.g. /wstore */ +public String getWebContext() +{ +return (String)get_Value("WebContext"); +} +/** Set Web Store Info. +@param WebInfo Web Store Header Information */ +public void setWebInfo (String WebInfo) +{ +if (WebInfo != null && WebInfo.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebInfo = WebInfo.substring(0,1999); +} +set_Value ("WebInfo", WebInfo); +} +/** Get Web Store Info. +@return Web Store Header Information */ +public String getWebInfo() +{ +return (String)get_Value("WebInfo"); +} +/** Set Web Order EMail. +@param WebOrderEMail EMail address to receive notifications when web orders were processed */ +public void setWebOrderEMail (String WebOrderEMail) +{ +if (WebOrderEMail != null && WebOrderEMail.length() > 60) +{ +log.warning("Length > 60 - truncated"); +WebOrderEMail = WebOrderEMail.substring(0,59); +} +set_Value ("WebOrderEMail", WebOrderEMail); +} +/** Get Web Order EMail. +@return EMail address to receive notifications when web orders were processed */ +public String getWebOrderEMail() +{ +return (String)get_Value("WebOrderEMail"); +} +/** Set Web Parameter 1. +@param WebParam1 Web Site Parameter 1 (default: header image) */ +public void setWebParam1 (String WebParam1) +{ +if (WebParam1 != null && WebParam1.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam1 = WebParam1.substring(0,1999); +} +set_Value ("WebParam1", WebParam1); +} +/** Get Web Parameter 1. +@return Web Site Parameter 1 (default: header image) */ +public String getWebParam1() +{ +return (String)get_Value("WebParam1"); +} +/** Set Web Parameter 2. +@param WebParam2 Web Site Parameter 2 (default index page) */ +public void setWebParam2 (String WebParam2) +{ +if (WebParam2 != null && WebParam2.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam2 = WebParam2.substring(0,1999); +} +set_Value ("WebParam2", WebParam2); +} +/** Get Web Parameter 2. +@return Web Site Parameter 2 (default index page) */ +public String getWebParam2() +{ +return (String)get_Value("WebParam2"); +} +/** Set Web Parameter 3. +@param WebParam3 Web Site Parameter 3 (default left - menu) */ +public void setWebParam3 (String WebParam3) +{ +if (WebParam3 != null && WebParam3.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam3 = WebParam3.substring(0,1999); +} +set_Value ("WebParam3", WebParam3); +} +/** Get Web Parameter 3. +@return Web Site Parameter 3 (default left - menu) */ +public String getWebParam3() +{ +return (String)get_Value("WebParam3"); +} +/** Set Web Parameter 4. +@param WebParam4 Web Site Parameter 4 (default footer left) */ +public void setWebParam4 (String WebParam4) +{ +if (WebParam4 != null && WebParam4.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam4 = WebParam4.substring(0,1999); +} +set_Value ("WebParam4", WebParam4); +} +/** Get Web Parameter 4. +@return Web Site Parameter 4 (default footer left) */ +public String getWebParam4() +{ +return (String)get_Value("WebParam4"); +} +/** Set Web Parameter 5. +@param WebParam5 Web Site Parameter 5 (default footer center) */ +public void setWebParam5 (String WebParam5) +{ +if (WebParam5 != null && WebParam5.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam5 = WebParam5.substring(0,1999); +} +set_Value ("WebParam5", WebParam5); +} +/** Get Web Parameter 5. +@return Web Site Parameter 5 (default footer center) */ +public String getWebParam5() +{ +return (String)get_Value("WebParam5"); +} +/** Set Web Parameter 6. +@param WebParam6 Web Site Parameter 6 (default footer right) */ +public void setWebParam6 (String WebParam6) +{ +if (WebParam6 != null && WebParam6.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +WebParam6 = WebParam6.substring(0,1999); +} +set_Value ("WebParam6", WebParam6); +} +/** Get Web Parameter 6. +@return Web Site Parameter 6 (default footer right) */ +public String getWebParam6() +{ +return (String)get_Value("WebParam6"); +} +} diff --git a/dbPort/src/org/compiere/package.html b/dbPort/src/org/compiere/package.html new file mode 100644 index 0000000000..d16bf7708c --- /dev/null +++ b/dbPort/src/org/compiere/package.html @@ -0,0 +1,34 @@ + + + + + + + +Provides System Startup and Info + +

Package Specification

+ + + +

Related Documentation

+ +For overviews, tutorials, examples, guides, and tool documentation, please see: + + + + + + diff --git a/dbPort/src/org/compiere/process/AdempiereServer.java b/dbPort/src/org/compiere/process/AdempiereServer.java new file mode 100644 index 0000000000..e3428fb484 --- /dev/null +++ b/dbPort/src/org/compiere/process/AdempiereServer.java @@ -0,0 +1,257 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.sql.*; + +import java.util.logging.*; +import org.compiere.util.*; +import org.compiere.model.*; + + +/** + * Adempiere Server Base + * + * @author Jorg Janke + * @version $Id: AdempiereServer.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public abstract class AdempiereServer extends Thread +{ + /** + * AdempiereServer + * @param name server name + */ + public AdempiereServer (String name) + { + super (s_threadGroup, name); + } // AdempiereServer + + /** Thread Group */ + private static ThreadGroup s_threadGroup = new ThreadGroup("AdempiereServer"); + + /** Logger */ + protected CLogger log = CLogger.getCLogger(getClass()); + /** Working Status */ + private volatile boolean m_working = false; + /** Working Count */ + private int m_count = 0; + /** Poll Count */ + private int m_pollCount = 0; + /** Working Time (ms) */ + private volatile int m_time = 0; + /** Work Start */ + private volatile long m_start = 0; + /** Last Work Start */ + private volatile long m_lastStart = 0; + /** Sleep Seconds */ + private int m_sleepSeconds = 10; + /** Processor Instance */ + protected PO p_processor = null; + /** Server can continue */ + private boolean m_canContinue = true; + + + /** + * Is Working + * @return true if working + */ + public boolean isWorking() + { + return m_working; + } // isWorking + + /** + * Get Poll Count + * @return number of polls + */ + public int getPollCount() + { + return m_pollCount; + } // getPollCount + + /** + * Get Work Count + * @return number of work runs + */ + public int getWorkCount() + { + return m_count; + } // getWorkCount + + /** + * Get Working Time + * @return working time in ms + */ + public int getWorkTime() + { + return m_time; + } // getWorkTime + + /** + * Get Start of Server + * @return start of server + */ + public Timestamp getStart() + { + if (m_start == 0) + return null; + return new Timestamp (m_start); + } // getStart + + /** + * Get Last Start of Server + * @return last start of server + */ + public Timestamp getLastStart() + { + if (m_lastStart == 0) + return null; + return new Timestamp (m_lastStart); + } // getLastStart + + /** + * Get Sleep Seconds + * @return sleep seconds + */ + public int getSleepSeconds () + { + return m_sleepSeconds; + } // getSleepSeconds + + /** + * Set Sleep Seconds + * @param sleepSeconds sleep seconds + */ + public void setSleepSeconds (int sleepSeconds) + { + m_sleepSeconds = sleepSeconds; + } // setSleepSeconds + + /** + * Set Server Processor + * @param processor processor + */ + public void setProcessor (PO processor) + { + p_processor = processor; + setName(getProcessorName()); + } // setProcessor + + + + /** + * Statistics + * @return info + */ + public String getStatistics () + { + StringBuffer sb = new StringBuffer (); + sb.append("Alive=").append(isAlive()) + .append(", Start=").append(getStart()) + .append(", WorkCount=").append(getWorkCount()) + .append(", WorkTime=").append(getWorkTime()) + .append(", PollCount=").append(getPollCount()) + .append(", Working=").append(isWorking()) + .append(", Last=").append(getLastStart()) + // .append(", SleepSec=").append(getSleepSeconds()) + ; + return sb.toString (); + } // toString + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("AdempiereServer["); + sb.append(getStatistics()).append ("]"); + return sb.toString (); + } // toString + + /************************************************************************** + * Run - Do the Work + * @see java.lang.Runnable#run() + */ + public final void run () + { + if (m_start == 0) + m_start = System.currentTimeMillis(); + + m_canContinue = true; + while (m_canContinue) + { + if (isInterrupted()) + return; + + /********************/ + m_lastStart = System.currentTimeMillis(); + m_working = true; + try + { + m_pollCount++; + if (canDoWork()) + { + m_canContinue = doWork(); + m_count++; + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "run", e); + } + m_working = false; + long end = System.currentTimeMillis(); + m_time += (end - m_lastStart); + /********************/ + + if (isInterrupted()) + return; + + try + { + log.fine("sleeping ... " + m_sleepSeconds); + sleep (m_sleepSeconds*1000); + } + catch (InterruptedException e1) + { + log.warning("run - " + e1.getLocalizedMessage()); + return; + } + } // while + } // run + + /** + * Get Processor Name + * @return Processor Name + */ + public abstract String getProcessorName(); + + /** + * Is there work for the Worker? + * @return true if doWork should be called + */ + public abstract boolean canDoWork(); + + /** + * Worker - do the work + * @return true if worker can continue + */ + public abstract boolean doWork(); + + +} // AdempiereServer diff --git a/dbPort/src/org/compiere/process/AdempiereService.java b/dbPort/src/org/compiere/process/AdempiereService.java new file mode 100644 index 0000000000..8455a2479c --- /dev/null +++ b/dbPort/src/org/compiere/process/AdempiereService.java @@ -0,0 +1,251 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.util.logging.*; +import org.compiere.model.*; + +/** + * Adempiere Service. + * Instanciates and Controls the Adempiere Server, + * which actually does the work in separate thread + * + * @author Jorg Janke + * @version $Id: AdempiereService.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class AdempiereService extends StateEngine +{ + /** + * Adempiere Service + * @param processor Processor instance + * @param serverClass server class + */ + public AdempiereService (PO processor, Class serverClass) + { + super (); + m_processor = processor; + m_serverClass = serverClass; + } // AdempiereServer + + /** Adempiere Server(s) */ + private AdempiereServer m_server = null; + /** Adempiere Server Class */ + private Class m_serverClass = null; + /** Adempiere Server Processor Instance */ + private PO m_processor = null; + + + /** + * Get Compier Server + * @return Adempiere Server + */ + public AdempiereServer getCompierServer() + { + getState(); + return m_server; + } // getAdempiereServer + + /** + * Get/Check State + * @return state + */ + public String getState () + { + if (isRunning()) + { + if (m_server == null || !m_server.isAlive()) + terminate(); + } + return super.getState (); + } // getState + + /** + * Start: not started -> running + * @return true if set to running + */ + public boolean start() + { + if (!super.start()) + return false; + + boolean ok = false; + try + { + m_server = (AdempiereServer)m_serverClass.newInstance(); + m_server.setProcessor (m_processor); + m_server.start(); + ok = true; + } + catch (Exception e) + { + log.log(Level.SEVERE, "start", e); + ok = false; + } + if (!ok) + return abort(); + log.info("start - " + ok); + getState(); + return ok; + } // start + + /** + * Resume: suspended -> running + * @return true if set to sunning + */ + public boolean resume() + { + if (!super.resume()) + return false; + + boolean ok = false; + try + { + m_server = (AdempiereServer)m_serverClass.newInstance(); + m_server.setProcessor (m_processor); + m_server.start(); + ok = true; + } + catch (Exception e) + { + log.log(Level.SEVERE, "resume", e); + ok = false; + } + if (!ok) + return abort(); + log.info("resume - " + ok); + getState(); + return ok; + } // resume + + + /** + * Complete: running -> completed + * @return true if set to completed + */ + public boolean complete() + { + if (!super.complete()) + return false; + + boolean ok = false; + if (m_server != null && m_server.isAlive()) + { + try + { + m_server.interrupt(); + m_server.join(); + ok = true; + } + catch (Exception e) + { + return abort(); + } + } + log.info("complete - " + ok); + return ok; + } // complete + + /** + * Suspend: running -> suspended + * @return true if suspended + */ + public boolean suspend() + { + if (!super.suspend()) + return false; + + boolean ok = false; + if (m_server != null && m_server.isAlive()) + { + try + { + m_server.interrupt(); + m_server.join(); + ok = true; + } + catch (Exception e) + { + return abort(); + } + } + log.info("suspend - " + ok); + return ok; + } // suspend + + + /** + * Abort: open -> aborted + * @return true if set to aborted + */ + public boolean abort() // raises CannotStop, NotRunning + { + if (super.abort()) + { + if (m_server != null && m_server.isAlive()) + { + try + { + m_server.interrupt(); + } + catch (Exception e) + { + } + } + log.info("abort - done"); + return true; + } + return false; + } // abort + + /** + * Terminate (System Error): open -> terminated + * @return true if set to terminated + */ + public boolean terminate() + { + if (super.terminate()) + { + if (m_server != null && m_server.isAlive()) + { + try + { + m_server.interrupt(); + } + catch (Exception e) + { + } + } + log.info("terminate - done"); + return true; + } + return false; + } // terminate + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("AdempiereService["); + sb.append(getStateInfo()) + .append(" - ").append(m_server); + sb.append ("]"); + return sb.toString (); + } // toString + +} // AdempiereService diff --git a/dbPort/src/org/compiere/process/DocAction.java b/dbPort/src/org/compiere/process/DocAction.java new file mode 100644 index 0000000000..3cf3cccc91 --- /dev/null +++ b/dbPort/src/org/compiere/process/DocAction.java @@ -0,0 +1,268 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.util.*; +import java.io.*; +import java.math.*; +import org.compiere.util.*; + +/** + * Document Action Interface + * + * @author Jorg Janke + * @version $Id: DocAction.java,v 1.3 2006/07/30 00:54:44 jjanke Exp $ + */ +public interface DocAction +{ + /** Complete = CO */ + public static final String ACTION_Complete = "CO"; + /** Wait Complete = WC */ + public static final String ACTION_WaitComplete = "WC"; + /** Approve = AP */ + public static final String ACTION_Approve = "AP"; + /** Reject = RJ */ + public static final String ACTION_Reject = "RJ"; + /** Post = PO */ + public static final String ACTION_Post = "PO"; + /** Void = VO */ + public static final String ACTION_Void = "VO"; + /** Close = CL */ + public static final String ACTION_Close = "CL"; + /** Reverse - Correct = RC */ + public static final String ACTION_Reverse_Correct = "RC"; + /** Reverse - Accrual = RA */ + public static final String ACTION_Reverse_Accrual = "RA"; + /** ReActivate = RE */ + public static final String ACTION_ReActivate = "RE"; + /** = -- */ + public static final String ACTION_None = "--"; + /** Prepare = PR */ + public static final String ACTION_Prepare = "PR"; + /** Unlock = XL */ + public static final String ACTION_Unlock = "XL"; + /** Invalidate = IN */ + public static final String ACTION_Invalidate = "IN"; + /** ReOpen = OP */ + public static final String ACTION_ReOpen = "OP"; + + /** Drafted = DR */ + public static final String STATUS_Drafted = "DR"; + /** Completed = CO */ + public static final String STATUS_Completed = "CO"; + /** Approved = AP */ + public static final String STATUS_Approved = "AP"; + /** Invalid = IN */ + public static final String STATUS_Invalid = "IN"; + /** Not Approved = NA */ + public static final String STATUS_NotApproved = "NA"; + /** Voided = VO */ + public static final String STATUS_Voided = "VO"; + /** Reversed = RE */ + public static final String STATUS_Reversed = "RE"; + /** Closed = CL */ + public static final String STATUS_Closed = "CL"; + /** Unknown = ?? */ + public static final String STATUS_Unknown = "??"; + /** In Progress = IP */ + public static final String STATUS_InProgress = "IP"; + /** Waiting Payment = WP */ + public static final String STATUS_WaitingPayment = "WP"; + /** Waiting Confirmation = WC */ + public static final String STATUS_WaitingConfirmation = "WC"; + + + /** + * Set Doc Status + * @param newStatus new Status + */ + public void setDocStatus (String newStatus); + + /** + * Get Doc Status + * @return Document Status + */ + public String getDocStatus(); + + + /************************************************************************* + * Process document + * @param action document action + * @return true if performed + * @throws Exception + */ + public boolean processIt (String action) throws Exception; + + /** + * Unlock Document. + * @return true if success + */ + public boolean unlockIt(); + /** + * Invalidate Document + * @return true if success + */ + public boolean invalidateIt(); + /** + * Prepare Document + * @return new status (In Progress or Invalid) + */ + public String prepareIt(); + /** + * Approve Document + * @return true if success + */ + public boolean approveIt(); + /** + * Reject Approval + * @return true if success + */ + public boolean rejectIt(); + /** + * Complete Document + * @return new status (Complete, In Progress, Invalid, Waiting ..) + */ + public String completeIt(); + /** + * Void Document + * @return true if success + */ + public boolean voidIt(); + /** + * Close Document + * @return true if success + */ + public boolean closeIt(); + /** + * Reverse Correction + * @return true if success + */ + public boolean reverseCorrectIt(); + /** + * Reverse Accrual + * @return true if success + */ + public boolean reverseAccrualIt(); + /** + * Re-activate + * @return true if success + */ + public boolean reActivateIt(); + + /************************************************************************** + * Get Summary + * @return Summary of Document + */ + public String getSummary(); + + /** + * Get Document No + * @return Document No + */ + public String getDocumentNo(); + + /** + * Get Document Info + * @return Type and Document No + */ + public String getDocumentInfo(); + + /** + * Create PDF + * @return file + */ + public File createPDF (); + + /** + * Get Process Message + * @return clear text message + */ + public String getProcessMsg (); + + /** + * Get Document Owner + * @return AD_User_ID + */ + public int getDoc_User_ID(); + + /** + * Get Document Currency + * @return C_Currency_ID + */ + public int getC_Currency_ID(); + + /** + * Get Document Approval Amount + * @return amount + */ + public BigDecimal getApprovalAmt(); + + /** + * Get Document Client + * @return AD_Client_ID + */ + public int getAD_Client_ID(); + + /** + * Get Document Organization + * @return AD_Org_ID + */ + public int getAD_Org_ID(); + + /** + * Get Doc Action + * @return Document Action + */ + public String getDocAction(); + + /** + * Save Document + * @return true if saved + */ + public boolean save(); + + /** + * Get Context + * @return context + */ + public Properties getCtx(); + + /** + * Get ID of record + * @return ID + */ + public int get_ID(); + + /** + * Get AD_Table_ID + * @return AD_Table_ID + */ + public int get_Table_ID(); + + /** + * Get Logger + * @return logger + */ + public CLogger get_Logger(); + + /** + * Get Transaction + * @return trx name + */ + public String get_TrxName(); + +} // DocAction diff --git a/dbPort/src/org/compiere/process/DocActionTemplate.java b/dbPort/src/org/compiere/process/DocActionTemplate.java new file mode 100644 index 0000000000..69574e5055 --- /dev/null +++ b/dbPort/src/org/compiere/process/DocActionTemplate.java @@ -0,0 +1,387 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.io.*; +import java.math.*; +import java.util.*; +import org.compiere.model.*; + +/** + * Template for DocAction + * + * @author Jorg Janke + * @version $Id: DocActionTemplate.java,v 1.3 2006/07/30 00:54:44 jjanke Exp $ + */ +public class DocActionTemplate extends PO implements DocAction +{ + /** + * DocActionTemplate + */ + private DocActionTemplate() + { + super(null); + } // DocActionTemplate + /** + * Init PO + * @param ctx ctx + * @return null + */ + protected POInfo initPO (Properties ctx) + { + return null; + } // initPO + + protected int get_AccessLevel () + { + return 0; + } + + /** + * Get Document Info + * @return document info (untranslated) + */ + public String getDocumentInfo() + { + MDocType dt = MDocType.get(getCtx(), 0); + return dt.getName() + " " + getDocumentNo(); + } // getDocumentInfo + + /** + * Create PDF + * @return File or null + */ + public File createPDF () + { + try + { + File temp = File.createTempFile(get_TableName()+get_ID()+"_", ".pdf"); + return createPDF (temp); + } + catch (Exception e) + { + log.severe("Could not create PDF - " + e.getMessage()); + } + return null; + } // getPDF + + /** + * Create PDF file + * @param file output file + * @return file if success + */ + public File createPDF (File file) + { + // ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID()); + // if (re == null) + return null; + // return re.getPDF(file); + } // createPDF + + + /************************************************************************** + * Process document + * @param processAction document action + * @return true if performed + */ + public boolean processIt (String processAction) + { + m_processMsg = null; + DocumentEngine engine = new DocumentEngine (this, getDocStatus()); + return engine.processIt (processAction, getDocAction()); + } // processIt + + /** Process Message */ + private String m_processMsg = null; + /** Just Prepared Flag */ + private boolean m_justPrepared = false; + + /** + * Unlock Document. + * @return true if success + */ + public boolean unlockIt() + { + log.info("unlockIt - " + toString()); + // setProcessing(false); + return true; + } // unlockIt + + /** + * Invalidate Document + * @return true if success + */ + public boolean invalidateIt() + { + log.info("invalidateIt - " + toString()); + // setDocAction(DOCACTION_Prepare); + return true; + } // invalidateIt + + /** + * Prepare Document + * @return new status (In Progress or Invalid) + */ + public String prepareIt() + { + log.info(toString()); + m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_PREPARE); + if (m_processMsg != null) + return DocAction.STATUS_Invalid; + /** + MDocType dt = MDocType.get(getCtx(), getC_DocTypeTarget_ID()); + + // Std Period open? + if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType())) + { + m_processMsg = "@PeriodClosed@"; + return DocAction.STATUS_Invalid; + } + MLine[] lines = getLines(false); + if (lines.length == 0) + { + m_processMsg = "@NoLines@"; + return DocAction.STATUS_Invalid; + } + **/ + // Add up Amounts + m_justPrepared = true; + // if (!DOCACTION_Complete.equals(getDocAction())) + // setDocAction(DOCACTION_Complete); + return DocAction.STATUS_InProgress; + } // prepareIt + + /** + * Approve Document + * @return true if success + */ + public boolean approveIt() + { + log.info("approveIt - " + toString()); + // setIsApproved(true); + return true; + } // approveIt + + /** + * Reject Approval + * @return true if success + */ + public boolean rejectIt() + { + log.info("rejectIt - " + toString()); + // setIsApproved(false); + return true; + } // rejectIt + + /** + * Complete Document + * @return new status (Complete, In Progress, Invalid, Waiting ..) + */ + public String completeIt() + { + // Re-Check + if (!m_justPrepared) + { + String status = prepareIt(); + if (!DocAction.STATUS_InProgress.equals(status)) + return status; + } + // Implicit Approval + // if (!isApproved()) + approveIt(); + log.info(toString()); + // + + // User Validation + String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); + if (valid != null) + { + m_processMsg = valid; + return DocAction.STATUS_Invalid; + } + // setProcessed(true); + // setDocAction(DOCACTION_Close); + return DocAction.STATUS_Completed; + } // completeIt + + /** + * Void Document. + * Same as Close. + * @return true if success + */ + public boolean voidIt() + { + log.info("voidIt - " + toString()); + return closeIt(); + } // voidIt + + /** + * Close Document. + * Cancel not delivered Qunatities + * @return true if success + */ + public boolean closeIt() + { + log.info("closeIt - " + toString()); + + // Close Not delivered Qty + // setDocAction(DOCACTION_None); + return true; + } // closeIt + + /** + * Reverse Correction + * @return true if success + */ + public boolean reverseCorrectIt() + { + log.info("reverseCorrectIt - " + toString()); + return false; + } // reverseCorrectionIt + + /** + * Reverse Accrual - none + * @return true if success + */ + public boolean reverseAccrualIt() + { + log.info("reverseAccrualIt - " + toString()); + return false; + } // reverseAccrualIt + + /** + * Re-activate + * @return true if success + */ + public boolean reActivateIt() + { + log.info("reActivateIt - " + toString()); + // setProcessed(false); + if (reverseCorrectIt()) + return true; + return false; + } // reActivateIt + + + /************************************************************************* + * Get Summary + * @return Summary of Document + */ + public String getSummary() + { + StringBuffer sb = new StringBuffer(); + // sb.append(getDocumentNo()); + // : Total Lines = 123.00 (#1) + // sb.append(": ") + // .append(Msg.translate(getCtx(),"TotalLines")).append("=").append(getTotalLines()) + // .append(" (#").append(getLines(false).length).append(")"); + // - Description + // if (getDescription() != null && getDescription().length() > 0) + // sb.append(" - ").append(getDescription()); + return sb.toString(); + } // getSummary + + /** + * Get Document no + * @return Document No + */ + public String getDocumentNo() + { + return "-"; + } // getDocumentNo + + /** + * Get Process Message + * @return clear text error message + */ + public String getProcessMsg() + { + return m_processMsg; + } // getProcessMsg + + /** + * Get Document Owner (Responsible) + * @return AD_User_ID + */ + public int getDoc_User_ID() + { + // return getSalesRep_ID(); + return 0; + } // getDoc_User_ID + + /** + * Get Document Approval Amount + * @return amount + */ + public BigDecimal getApprovalAmt() + { + return null; //getTotalLines(); + } // getApprovalAmt + + + + + + /** + * Get Document Currency + * @return C_Currency_ID + */ + public int getC_Currency_ID() + { + // MPriceList pl = MPriceList.get(getCtx(), getM_PriceList_ID()); + // return pl.getC_Currency_ID(); + return 0; + } // getC_Currency_ID + + + + + + + /** + * Set Doc Status + * @param newStatus status + */ + public void setDocStatus (String newStatus) + { + } + /** + * Get Doc Status + * @return doc status + */ + public String getDocStatus () + { + return null; + } + /** + * Get Doc Action + * @return doc action + */ + public String getDocAction () + { + return null; + } + /** + * Save + * @return true if saved + */ + public boolean save () + { + return false; + } + +} // DocActionTemplate diff --git a/dbPort/src/org/compiere/process/DocumentEngine.java b/dbPort/src/org/compiere/process/DocumentEngine.java new file mode 100644 index 0000000000..7ce7990156 --- /dev/null +++ b/dbPort/src/org/compiere/process/DocumentEngine.java @@ -0,0 +1,826 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.io.*; +import java.math.*; +import java.util.*; +import javax.naming.*; + +import org.compiere.db.*; +import org.compiere.interfaces.*; +import org.compiere.model.*; +import org.compiere.util.*; + +/** + * Document Action Engine + * + * @author Jorg Janke + * @version $Id: DocumentEngine.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class DocumentEngine implements DocAction +{ + /** + * Doc Engine (Drafted) + * @param po document + */ + public DocumentEngine (DocAction po) + { + this (po, STATUS_Drafted); + } // DocActionEngine + + /** + * Doc Engine + * @param po document + * @param docStatus initial document status + */ + public DocumentEngine (DocAction po, String docStatus) + { + m_document = po; + if (docStatus != null) + m_status = docStatus; + } // DocActionEngine + + /** Persistent Document */ + private DocAction m_document; + /** Document Status */ + private String m_status = STATUS_Drafted; + /** Process Message */ + private String m_message = null; + /** Actual Doc Action */ + private String m_action = null; + + /** + * Get Doc Status + * @return document status + */ + public String getDocStatus() + { + return m_status; + } // getDocStatus + + /** + * Set Doc Status - Ignored + * @param ignored Status is not set directly + * @see org.compiere.process.DocAction#setDocStatus(String) + */ + public void setDocStatus(String ignored) + { + } // setDocStatus + + /** + * Document is Drafted + * @return true if drafted + */ + public boolean isDrafted() + { + return STATUS_Drafted.equals(m_status); + } // isDrafted + + /** + * Document is Invalid + * @return true if Invalid + */ + public boolean isInvalid() + { + return STATUS_Invalid.equals(m_status); + } // isInvalid + + /** + * Document is In Progress + * @return true if In Progress + */ + public boolean isInProgress() + { + return STATUS_InProgress.equals(m_status); + } // isInProgress + + /** + * Document is Approved + * @return true if Approved + */ + public boolean isApproved() + { + return STATUS_Approved.equals(m_status); + } // isApproved + + /** + * Document is Not Approved + * @return true if Not Approved + */ + public boolean isNotApproved() + { + return STATUS_NotApproved.equals(m_status); + } // isNotApproved + + /** + * Document is Waiting Payment or Confirmation + * @return true if Waiting Payment + */ + public boolean isWaiting() + { + return STATUS_WaitingPayment.equals(m_status) + || STATUS_WaitingConfirmation.equals(m_status); + } // isWaitingPayment + + /** + * Document is Completed + * @return true if Completed + */ + public boolean isCompleted() + { + return STATUS_Completed.equals(m_status); + } // isCompleted + + /** + * Document is Reversed + * @return true if Reversed + */ + public boolean isReversed() + { + return STATUS_Reversed.equals(m_status); + } // isReversed + + /** + * Document is Closed + * @return true if Closed + */ + public boolean isClosed() + { + return STATUS_Closed.equals(m_status); + } // isClosed + + /** + * Document is Voided + * @return true if Voided + */ + public boolean isVoided() + { + return STATUS_Voided.equals(m_status); + } // isVoided + + /** + * Document Status is Unknown + * @return true if unknown + */ + public boolean isUnknown() + { + return STATUS_Unknown.equals(m_status) || + !(isDrafted() || isInvalid() || isInProgress() || isNotApproved() + || isApproved() || isWaiting() || isCompleted() + || isReversed() || isClosed() || isVoided() ); + } // isUnknown + + + /** + * Process actual document. + * Checks if user (document) action is valid and then process action + * Calls the individual actions which call the document action + * @param processAction document action based on workflow + * @param docAction document action based on document + * @return true if performed + */ + public boolean processIt (String processAction, String docAction) + { + m_message = null; + m_action = null; + // Std User Workflows - see MWFNodeNext.isValidFor + + if (isValidAction(processAction)) // WF Selection first + m_action = processAction; + // + else if (isValidAction(docAction)) // User Selection second + m_action = docAction; + // Nothing to do + else if (processAction.equals(ACTION_None) + || docAction.equals(ACTION_None)) + { + if (m_document != null) + m_document.get_Logger().info ("**** No Action (Prc=" + processAction + "/Doc=" + docAction + ") " + m_document); + return true; + } + else + { + throw new IllegalStateException("Status=" + getDocStatus() + + " - Invalid Actions: Process=" + processAction + ", Doc=" + docAction); + } + if (m_document != null) + m_document.get_Logger().info ("**** Action=" + m_action + " (Prc=" + processAction + "/Doc=" + docAction + ") " + m_document); + boolean success = processIt (m_action); + if (m_document != null) + m_document.get_Logger().fine("**** Action=" + m_action + " - Success=" + success); + return success; + } // process + + /** + * Process actual document - do not call directly. + * Calls the individual actions which call the document action + * @param action document action + * @return true if performed + */ + public boolean processIt (String action) + { + m_message = null; + m_action = action; + // + if (ACTION_Unlock.equals(m_action)) + return unlockIt(); + if (ACTION_Invalidate.equals(m_action)) + return invalidateIt(); + if (ACTION_Prepare.equals(m_action)) + return STATUS_InProgress.equals(prepareIt()); + if (ACTION_Approve.equals(m_action)) + return approveIt(); + if (ACTION_Reject.equals(m_action)) + return rejectIt(); + if (ACTION_Complete.equals(m_action) || ACTION_WaitComplete.equals(m_action)) + { + String status = null; + if (isDrafted() || isInvalid()) // prepare if not prepared yet + { + status = prepareIt(); + if (!STATUS_InProgress.equals(status)) + return false; + } + status = completeIt(); + if (m_document != null + && !Ini.isClient()) // Post Immediate if on Server + { + MClient client = MClient.get(m_document.getCtx(), m_document.getAD_Client_ID()); + if (STATUS_Completed.equals(status) && client.isPostImmediate()) + { + m_document.save(); + postIt(); + } + } + return STATUS_Completed.equals(status) + || STATUS_InProgress.equals(status) + || STATUS_WaitingPayment.equals(status) + || STATUS_WaitingConfirmation.equals(status); + } + if (ACTION_ReActivate.equals(m_action)) + return reActivateIt(); + if (ACTION_Reverse_Accrual.equals(m_action)) + return reverseAccrualIt(); + if (ACTION_Reverse_Correct.equals(m_action)) + return reverseCorrectIt(); + if (ACTION_Close.equals(m_action)) + return closeIt(); + if (ACTION_Void.equals(m_action)) + return voidIt(); + if (ACTION_Post.equals(m_action)) + return postIt(); + // + return false; + } // processDocument + + /** + * Unlock Document. + * Status: Drafted + * @return true if success + * @see org.compiere.process.DocAction#unlockIt() + */ + public boolean unlockIt() + { + if (!isValidAction(ACTION_Unlock)) + return false; + if (m_document != null) + { + if (m_document.unlockIt()) + { + m_status = STATUS_Drafted; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Drafted; + return true; + } // unlockIt + + /** + * Invalidate Document. + * Status: Invalid + * @return true if success + * @see org.compiere.process.DocAction#invalidateIt() + */ + public boolean invalidateIt() + { + if (!isValidAction(ACTION_Invalidate)) + return false; + if (m_document != null) + { + if (m_document.invalidateIt()) + { + m_status = STATUS_Invalid; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Invalid; + return true; + } // invalidateIt + + /** + * Process Document. + * Status is set by process + * @return new status (In Progress or Invalid) + * @see org.compiere.process.DocAction#prepareIt() + */ + public String prepareIt() + { + if (!isValidAction(ACTION_Prepare)) + return m_status; + if (m_document != null) + { + m_status = m_document.prepareIt(); + m_document.setDocStatus(m_status); + } + return m_status; + } // processIt + + /** + * Approve Document. + * Status: Approved + * @return true if success + * @see org.compiere.process.DocAction#approveIt() + */ + public boolean approveIt() + { + if (!isValidAction(ACTION_Approve)) + return false; + if (m_document != null) + { + if (m_document.approveIt()) + { + m_status = STATUS_Approved; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Approved; + return true; + } // approveIt + + /** + * Reject Approval. + * Status: Not Approved + * @return true if success + * @see org.compiere.process.DocAction#rejectIt() + */ + public boolean rejectIt() + { + if (!isValidAction(ACTION_Reject)) + return false; + if (m_document != null) + { + if (m_document.rejectIt()) + { + m_status = STATUS_NotApproved; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_NotApproved; + return true; + } // rejectIt + + /** + * Complete Document. + * Status is set by process + * @return new document status (Complete, In Progress, Invalid, Waiting ..) + * @see org.compiere.process.DocAction#completeIt() + */ + public String completeIt() + { + if (!isValidAction(ACTION_Complete)) + return m_status; + if (m_document != null) + { + m_status = m_document.completeIt(); + m_document.setDocStatus(m_status); + } + return m_status; + } // completeIt + + /** + * Post Document + * Does not change status + * @return true if success + */ + public boolean postIt() + { + if (!isValidAction(ACTION_Post) + || m_document == null) + return false; + try + { + // Should work on Client and Server + InitialContext ctx = CConnection.get().getInitialContext(true); + ServerHome serverHome = (ServerHome)ctx.lookup (ServerHome.JNDI_NAME); + if (serverHome != null) + { + Server server = serverHome.create(); + if (server != null) + { + String error = server.postImmediate(Env.getCtx(), + m_document.getAD_Client_ID(), + m_document.get_Table_ID(), m_document.get_ID(), + true, m_document.get_TrxName()); + m_document.get_Logger().config("Server: " + error == null ? "OK" : error); + return error == null; + } + } + else + m_document.get_Logger().config("NoServerHome"); + } + catch (Exception e) + { + m_document.get_Logger().config("(ex) " + e.getMessage()); + } + return false; + } // postIt + + /** + * Void Document. + * Status: Voided + * @return true if success + * @see org.compiere.process.DocAction#voidIt() + */ + public boolean voidIt() + { + if (!isValidAction(ACTION_Void)) + return false; + if (m_document != null) + { + if (m_document.voidIt()) + { + m_status = STATUS_Voided; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Voided; + return true; + } // voidIt + + /** + * Close Document. + * Status: Closed + * @return true if success + * @see org.compiere.process.DocAction#closeIt() + */ + public boolean closeIt() + { + if (m_document != null // orders can be closed any time + && m_document.get_Table_ID() == X_C_Order.Table_ID) + ; + else if (!isValidAction(ACTION_Close)) + return false; + if (m_document != null) + { + if (m_document.closeIt()) + { + m_status = STATUS_Closed; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Closed; + return true; + } // closeIt + + /** + * Reverse Correct Document. + * Status: Reversed + * @return true if success + * @see org.compiere.process.DocAction#reverseCorrectIt() + */ + public boolean reverseCorrectIt() + { + if (!isValidAction(ACTION_Reverse_Correct)) + return false; + if (m_document != null) + { + if (m_document.reverseCorrectIt()) + { + m_status = STATUS_Reversed; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Reversed; + return true; + } // reverseCorrectIt + + /** + * Reverse Accrual Document. + * Status: Reversed + * @return true if success + * @see org.compiere.process.DocAction#reverseAccrualIt() + */ + public boolean reverseAccrualIt() + { + if (!isValidAction(ACTION_Reverse_Accrual)) + return false; + if (m_document != null) + { + if (m_document.reverseAccrualIt()) + { + m_status = STATUS_Reversed; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_Reversed; + return true; + } // reverseAccrualIt + + /** + * Re-activate Document. + * Status: In Progress + * @return true if success + * @see org.compiere.process.DocAction#reActivateIt() + */ + public boolean reActivateIt() + { + if (!isValidAction(ACTION_ReActivate)) + return false; + if (m_document != null) + { + if (m_document.reActivateIt()) + { + m_status = STATUS_InProgress; + m_document.setDocStatus(m_status); + return true; + } + return false; + } + m_status = STATUS_InProgress; + return true; + } // reActivateIt + + + /** + * Set Document Status to new Status + * @param newStatus new status + */ + void setStatus (String newStatus) + { + m_status = newStatus; + } // setStatus + + + /************************************************************************** + * Get Action Options based on current Status + * @return array of actions + */ + public String[] getActionOptions() + { + if (isInvalid()) + return new String[] {ACTION_Prepare, ACTION_Invalidate, + ACTION_Unlock, ACTION_Void}; + + if (isDrafted()) + return new String[] {ACTION_Prepare, ACTION_Invalidate, ACTION_Complete, + ACTION_Unlock, ACTION_Void}; + + if (isInProgress() || isApproved()) + return new String[] {ACTION_Complete, ACTION_WaitComplete, + ACTION_Approve, ACTION_Reject, + ACTION_Unlock, ACTION_Void, ACTION_Prepare}; + + if (isNotApproved()) + return new String[] {ACTION_Reject, ACTION_Prepare, + ACTION_Unlock, ACTION_Void}; + + if (isWaiting()) + return new String[] {ACTION_Complete, ACTION_WaitComplete, + ACTION_ReActivate, ACTION_Void, ACTION_Close}; + + if (isCompleted()) + return new String[] {ACTION_Close, ACTION_ReActivate, + ACTION_Reverse_Accrual, ACTION_Reverse_Correct, + ACTION_Post, ACTION_Void}; + + if (isClosed()) + return new String[] {ACTION_Post, ACTION_ReOpen}; + + if (isReversed() || isVoided()) + return new String[] {ACTION_Post}; + + return new String[] {}; + } // getActionOptions + + /** + * Is The Action Valid based on current state + * @param action action + * @return true if valid + */ + public boolean isValidAction (String action) + { + String[] options = getActionOptions(); + for (int i = 0; i < options.length; i++) + { + if (options[i].equals(action)) + return true; + } + return false; + } // isValidAction + + /** + * Get Process Message + * @return clear text error message + */ + public String getProcessMsg () + { + return m_message; + } // getProcessMsg + + /** + * Get Process Message + * @param msg clear text error message + */ + public void setProcessMsg (String msg) + { + m_message = msg; + } // setProcessMsg + + + /** Document Exception Message */ + private static String EXCEPTION_MSG = "Document Engine is no Document"; + + /************************************************************************* + * Get Summary + * @return throw exception + */ + public String getSummary() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document No + * @return throw exception + */ + public String getDocumentNo() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document Info + * @return throw exception + */ + public String getDocumentInfo() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document Owner + * @return throw exception + */ + public int getDoc_User_ID() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document Currency + * @return throw exception + */ + public int getC_Currency_ID() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document Approval Amount + * @return throw exception + */ + public BigDecimal getApprovalAmt() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document Client + * @return throw exception + */ + public int getAD_Client_ID() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Document Organization + * @return throw exception + */ + public int getAD_Org_ID() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Doc Action + * @return Document Action + */ + public String getDocAction() + { + return m_action; + } + + /** + * Save Document + * @return throw exception + */ + public boolean save() + { + throw new IllegalStateException(EXCEPTION_MSG); + } + + /** + * Get Context + * @return context + */ + public Properties getCtx() + { + if (m_document != null) + return m_document.getCtx(); + throw new IllegalStateException(EXCEPTION_MSG); + } // getCtx + + /** + * Get ID of record + * @return ID + */ + public int get_ID() + { + if (m_document != null) + return m_document.get_ID(); + throw new IllegalStateException(EXCEPTION_MSG); + } // get_ID + + /** + * Get AD_Table_ID + * @return AD_Table_ID + */ + public int get_Table_ID() + { + if (m_document != null) + return m_document.get_Table_ID(); + throw new IllegalStateException(EXCEPTION_MSG); + } // get_Table_ID + + /** + * Get Logger + * @return logger + */ + public CLogger get_Logger() + { + if (m_document != null) + return m_document.get_Logger(); + throw new IllegalStateException(EXCEPTION_MSG); + } // get_Logger + + /** + * Get Transaction + * @return trx name + */ + public String get_TrxName() + { + return null; + } // get_TrxName + + /** + * CreatePDF + * @return null + */ + public File createPDF () + { + return null; + } + +} // DocumentEnine diff --git a/dbPort/src/org/compiere/process/IssueReport.java b/dbPort/src/org/compiere/process/IssueReport.java new file mode 100644 index 0000000000..958df4f324 --- /dev/null +++ b/dbPort/src/org/compiere/process/IssueReport.java @@ -0,0 +1,64 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import org.compiere.model.*; +import org.compiere.util.*; + +/** + * Report System Issue + * + * @author Jorg Janke + * @version $Id: IssueReport.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class IssueReport extends SvrProcess +{ + /** Issue to report */ + private int m_AD_Issue_ID = 0; + + /** + * Prepare + */ + protected void prepare () + { + m_AD_Issue_ID = getRecord_ID(); + } // prepare + + /** + * Do It + * @return info + * @throws Exception + */ + protected String doIt () throws Exception + { + log.info("AD_Issue_ID=" + m_AD_Issue_ID); + if (!MSystem.get(getCtx()).isAutoErrorReport()) + return "NOT reported - Enable Error Reporting in Window System"; + // + MIssue issue = new MIssue(getCtx(), m_AD_Issue_ID, get_TrxName()); + if (issue.get_ID() == 0) + return "No Issue to report - ID=" + m_AD_Issue_ID; + // + String error = issue.report(); + if (error != null) + throw new AdempiereSystemError(error); + if (issue.save()) + return "Issue Reported: " + issue.getRequestDocumentNo(); + throw new AdempiereSystemError("Issue Not Saved"); + } // doIt + +} // IssueReport diff --git a/dbPort/src/org/compiere/process/ProcessCall.java b/dbPort/src/org/compiere/process/ProcessCall.java new file mode 100644 index 0000000000..7e5a0c0e43 --- /dev/null +++ b/dbPort/src/org/compiere/process/ProcessCall.java @@ -0,0 +1,48 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.util.*; + +import org.compiere.util.Trx; + +/** + * Interface for user started processes. + * + * ProcessCtrl.startClass creates the Object and calls startProcess + * before executing the optional SQL procedure and Report. + * + * see ProcessCtl#startClass + * @author Jorg Janke + * @version $Id: ProcessCall.java,v 1.3 2006/07/30 00:54:44 jjanke Exp $ + */ +public interface ProcessCall +{ + /** + * Start the process. + * Called when pressing the ... button in ... + * It should only return false, if the function could not be performed + * as this causes the process to abort. + * + * @param ctx Context + * @param pi Process Info + * @param trx transaction + * @return true if the next process should be performed + */ + public boolean startProcess (Properties ctx, ProcessInfo pi, Trx trx); + +} // ProcessCall diff --git a/dbPort/src/org/compiere/process/ProcessInfo.java b/dbPort/src/org/compiere/process/ProcessInfo.java new file mode 100644 index 0000000000..8a165a4a72 --- /dev/null +++ b/dbPort/src/org/compiere/process/ProcessInfo.java @@ -0,0 +1,585 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.text.*; +import java.util.*; +import org.compiere.util.*; + +/** + * Process Information (Value Object) + * + * @author Jorg Janke + * @version $Id: ProcessInfo.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class ProcessInfo implements Serializable +{ + /** + * Constructor + * @param Title Title + * @param AD_Process_ID AD_Process_ID + * @param Table_ID AD_Table_ID + * @param Record_ID Record_ID + */ + public ProcessInfo (String Title, int AD_Process_ID, int Table_ID, int Record_ID) + { + setTitle (Title); + setAD_Process_ID(AD_Process_ID); + setTable_ID (Table_ID); + setRecord_ID (Record_ID); + } // ProcessInfo + + /** + * Constructor + * @param Title Title + * @param AD_Process_ID AD_Process_ID + * */ + public ProcessInfo (String Title, int AD_Process_ID) + { + this (Title, AD_Process_ID, 0, 0); + } // ProcessInfo + + /** Serialization Info **/ + static final long serialVersionUID = -1993220053515488725L; + + + /** Title of the Process/Report */ + private String m_Title; + /** Process ID */ + private int m_AD_Process_ID; + /** Table ID if the Process */ + private int m_Table_ID; + /** Record ID if the Process */ + private int m_Record_ID; + /** User_ID */ + private Integer m_AD_User_ID; + /** Client_ID */ + private Integer m_AD_Client_ID; + /** Class Name */ + private String m_ClassName = null; + + // -- Optional -- + + /** Pricess Instance ID */ + private int m_AD_PInstance_ID = 0; + + /** Summary of Execution */ + private String m_Summary = ""; + /** Execution had an error */ + private boolean m_Error = false; + + + /* General Data Object */ + private Serializable m_SerializableObject = null; + /* General Data Object */ + private transient Object m_TransientObject = null; + /** Estimated Runtime */ + private int m_EstSeconds = 5; + /** Batch */ + private boolean m_batch = false; + /** Process timed out */ + private boolean m_timeout = false; + + /** Log Info */ + private ArrayList m_logs = null; + + /** Log Info */ + private ProcessInfoParameter[] m_parameter = null; + + + /** + * String representation + * @return String representation + */ + public String toString() + { + StringBuffer sb = new StringBuffer("ProcessInfo["); + sb.append(m_Title) + .append(",Process_ID=").append(m_AD_Process_ID); + if (m_AD_PInstance_ID != 0) + sb.append(",AD_PInstance_ID=").append(m_AD_PInstance_ID); + if (m_Record_ID != 0) + sb.append(",Record_ID=").append(m_Record_ID); + if (m_ClassName != null) + sb.append(",ClassName=").append(m_ClassName); + sb.append(",Error=").append(isError()); + if (m_TransientObject != null) + sb.append(",Transient=").append(m_TransientObject); + if (m_SerializableObject != null) + sb.append(",Serializable=").append(m_SerializableObject); + sb.append(",Summary=").append(getSummary()) + .append(",Log=").append(m_logs == null ? 0 : m_logs.size()); + // .append(getLogInfo(false)); + sb.append("]"); + return sb.toString(); + } // toString + + + /************************************************************************** + * Set Summary + * @param summary summary (will be translated) + */ + public void setSummary (String summary) + { + m_Summary = summary; + } // setSummary + /** + * Method getSummary + * @return String + */ + public String getSummary () + { + return Util.cleanAmp(m_Summary); + } // getSummary + + /** + * Method setSummary + * @param translatedSummary String + * @param error boolean + */ + public void setSummary (String translatedSummary, boolean error) + { + setSummary (translatedSummary); + setError(error); + } // setSummary + /** + * Method addSummary + * @param additionalSummary String + */ + public void addSummary (String additionalSummary) + { + m_Summary += additionalSummary; + } // addSummary + + /** + * Method setError + * @param error boolean + */ + public void setError (boolean error) + { + m_Error = error; + } // setError + /** + * Method isError + * @return boolean + */ + public boolean isError () + { + return m_Error; + } // isError + + /** + * Batch + * @param batch true if batch processing + */ + public void setIsBatch (boolean batch) + { + m_batch = batch; + } // setTimeout + + /** + * Batch - i.e. UI not blocked + * @return boolean + */ + public boolean isBatch() + { + return m_batch; + } // isBatch + + /** + * Timeout + * @param timeout true still running + */ + public void setIsTimeout (boolean timeout) + { + m_timeout = timeout; + } // setTimeout + + /** + * Timeout - i.e process did not complete + * @return boolean + */ + public boolean isTimeout() + { + return m_timeout; + } // isTimeout + + /** + * Set Log of Process. + *
+	 *  - Translated Process Message
+	 *  - List of log entries
+	 *      Date - Number - Msg
+	 *  
+ * @param html if true with HTML markup + * @return Log Info + */ + public String getLogInfo (boolean html) + { + if (m_logs == null) + return ""; + // + StringBuffer sb = new StringBuffer (); + SimpleDateFormat dateFormat = DisplayType.getDateFormat(DisplayType.DateTime); + if (html) + sb.append(""); + // + for (int i = 0; i < m_logs.size(); i++) + { + if (html) + sb.append(""); + else if (i > 0) + sb.append("\n"); + // + ProcessInfoLog log = (ProcessInfoLog)m_logs.get(i); + /** + if (log.getP_ID() != 0) + sb.append(html ? "" : " \t"); **/ + // + if (log.getP_Date() != null) + sb.append(html ? "" : " \t"); + // + if (log.getP_Number() != null) + sb.append(html ? "" : " \t"); + // + if (log.getP_Msg() != null) + sb.append(html ? "" : ""); + // + if (html) + sb.append(""); + } + if (html) + sb.append("
" : "") + .append(log.getP_ID()) + .append(html ? "" : "") + .append(dateFormat.format(log.getP_Date())) + .append(html ? "" : "") + .append(log.getP_Number()) + .append(html ? "" : "") + .append(Msg.parseTranslation(Env.getCtx(), log.getP_Msg())) + .append(html ? "
"); + return sb.toString(); + } // getLogInfo + + /** + * Get ASCII Log Info + * @return Log Info + */ + public String getLogInfo () + { + return getLogInfo(false); + } // getLogInfo + + /** + * Method getAD_PInstance_ID + * @return int + */ + public int getAD_PInstance_ID() + { + return m_AD_PInstance_ID; + } + /** + * Method setAD_PInstance_ID + * @param AD_PInstance_ID int + */ + public void setAD_PInstance_ID(int AD_PInstance_ID) + { + m_AD_PInstance_ID = AD_PInstance_ID; + } + + /** + * Method getAD_Process_ID + * @return int + */ + public int getAD_Process_ID() + { + return m_AD_Process_ID; + } + /** + * Method setAD_Process_ID + * @param AD_Process_ID int + */ + public void setAD_Process_ID(int AD_Process_ID) + { + m_AD_Process_ID = AD_Process_ID; + } + + /** + * Method getClassName + * @return String or null + */ + public String getClassName() + { + return m_ClassName; + } + + /** + * Method setClassName + * @param ClassName String + */ + public void setClassName(String ClassName) + { + m_ClassName = ClassName; + if (m_ClassName != null && m_ClassName.length() == 0) + m_ClassName = null; + } // setClassName + + /** + * Method getTransientObject + * @return Object + */ + public Object getTransientObject() + { + return m_TransientObject; + } + /** + * Method setTransientObject + * @param TransientObject Object + */ + public void setTransientObject (Object TransientObject) + { + m_TransientObject = TransientObject; + } + + /** + * Method getSerializableObject + * @return Serializable + */ + public Serializable getSerializableObject() + { + return m_SerializableObject; + } + /** + * Method setSerializableObject + * @param SerializableObject Serializable + */ + public void setSerializableObject (Serializable SerializableObject) + { + m_SerializableObject = SerializableObject; + } + + /** + * Method getEstSeconds + * @return int + */ + public int getEstSeconds() + { + return m_EstSeconds; + } + /** + * Method setEstSeconds + * @param EstSeconds int + */ + public void setEstSeconds (int EstSeconds) + { + m_EstSeconds = EstSeconds; + } + + + /** + * Method getTable_ID + * @return int + */ + public int getTable_ID() + { + return m_Table_ID; + } + /** + * Method setTable_ID + * @param AD_Table_ID int + */ + public void setTable_ID(int AD_Table_ID) + { + m_Table_ID = AD_Table_ID; + } + + /** + * Method getRecord_ID + * @return int + */ + public int getRecord_ID() + { + return m_Record_ID; + } + /** + * Method setRecord_ID + * @param Record_ID int + */ + public void setRecord_ID(int Record_ID) + { + m_Record_ID = Record_ID; + } + + /** + * Method getTitle + * @return String + */ + public String getTitle() + { + return m_Title; + } + /** + * Method setTitle + * @param Title String + */ + public void setTitle (String Title) + { + m_Title = Title; + } // setTitle + + + /** + * Method setAD_Client_ID + * @param AD_Client_ID int + */ + public void setAD_Client_ID (int AD_Client_ID) + { + m_AD_Client_ID = new Integer (AD_Client_ID); + } + /** + * Method getAD_Client_ID + * @return Integer + */ + public Integer getAD_Client_ID() + { + return m_AD_Client_ID; + } + + /** + * Method setAD_User_ID + * @param AD_User_ID int + */ + public void setAD_User_ID (int AD_User_ID) + { + m_AD_User_ID = new Integer (AD_User_ID); + } + /** + * Method getAD_User_ID + * @return Integer + */ + public Integer getAD_User_ID() + { + return m_AD_User_ID; + } + + + /************************************************************************** + * Get Parameter + * @return Parameter Array + */ + public ProcessInfoParameter[] getParameter() + { + return m_parameter; + } // getParameter + + /** + * Set Parameter + * @param parameter Parameter Array + */ + public void setParameter (ProcessInfoParameter[] parameter) + { + m_parameter = parameter; + } // setParameter + + + /************************************************************************** + * Add to Log + * @param Log_ID Log ID + * @param P_ID Process ID + * @param P_Date Process Date + * @param P_Number Process Number + * @param P_Msg Process Message + */ + public void addLog (int Log_ID, int P_ID, Timestamp P_Date, BigDecimal P_Number, String P_Msg) + { + addLog (new ProcessInfoLog (Log_ID, P_ID, P_Date, P_Number, P_Msg)); + } // addLog + + /** + * Add to Log + * @param P_ID Process ID + * @param P_Date Process Date + * @param P_Number Process Number + * @param P_Msg Process Message + */ + public void addLog (int P_ID, Timestamp P_Date, BigDecimal P_Number, String P_Msg) + { + addLog (new ProcessInfoLog (P_ID, P_Date, P_Number, P_Msg)); + } // addLog + + /** + * Add to Log + * @param logEntry log entry + */ + public void addLog (ProcessInfoLog logEntry) + { + if (logEntry == null) + return; + if (m_logs == null) + m_logs = new ArrayList(); + m_logs.add (logEntry); + } // addLog + + + /** + * Method getLogs + * @return ProcessInfoLog[] + */ + public ProcessInfoLog[] getLogs() + { + if (m_logs == null) + return null; + ProcessInfoLog[] logs = new ProcessInfoLog[m_logs.size()]; + m_logs.toArray (logs); + return logs; + } // getLogs + + /** + * Method getIDs + * @return int[] + */ + public int[] getIDs() + { + if (m_logs == null) + return null; + int[] ids = new int[m_logs.size()]; + for (int i = 0; i < m_logs.size(); i++) + ids[i] = ((ProcessInfoLog)m_logs.get(i)).getP_ID(); + return ids; + } // getIDs + + /** + * Method getLogList + * @return ArrayList + */ + public ArrayList getLogList() + { + return m_logs; + } + /** + * Method setLogList + * @param logs ArrayList + */ + public void setLogList (ArrayList logs) + { + m_logs = logs; + } + +} // ProcessInfo diff --git a/dbPort/src/org/compiere/process/ProcessInfoLog.java b/dbPort/src/org/compiere/process/ProcessInfoLog.java new file mode 100644 index 0000000000..38c3439b2d --- /dev/null +++ b/dbPort/src/org/compiere/process/ProcessInfoLog.java @@ -0,0 +1,155 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.io.*; +import java.sql.*; +import java.math.*; + +/** + * Process Info Log (VO) + * + * @author Jorg Janke + * @version $Id: ProcessInfoLog.java,v 1.3 2006/07/30 00:54:44 jjanke Exp $ + */ +public class ProcessInfoLog implements Serializable +{ + /** + * Create Process Info Log. + * @param P_ID Process ID + * @param P_Date Process Date + * @param P_Number Process Number + * @param P_Msg Process Messagre + */ + public ProcessInfoLog (int P_ID, Timestamp P_Date, BigDecimal P_Number, String P_Msg) + { + this (s_Log_ID++, P_ID, P_Date, P_Number, P_Msg); + } // ProcessInfoLog + + /** + * Create Process Info Log. + * @param Log_ID Log ID + * @param P_ID Process ID + * @param P_Date Process Date + * @param P_Number Process Number + * @param P_Msg Process Messagre + */ + public ProcessInfoLog (int Log_ID, int P_ID, Timestamp P_Date, BigDecimal P_Number, String P_Msg) + { + setLog_ID (Log_ID); + setP_ID (P_ID); + setP_Date (P_Date); + setP_Number (P_Number); + setP_Msg (P_Msg); + } // ProcessInfoLog + + private static int s_Log_ID = 0; + + private int m_Log_ID; + private int m_P_ID; + private Timestamp m_P_Date; + private BigDecimal m_P_Number; + private String m_P_Msg; + + + + /** + * Get Log_ID + * @return id + */ + public int getLog_ID() + { + return m_Log_ID; + } + /** + * Set Log_ID + * @param Log_ID id + */ + public void setLog_ID (int Log_ID) + { + m_Log_ID = Log_ID; + } + + /** + * Method getP_ID + * @return int + */ + public int getP_ID() + { + return m_P_ID; + } + /** + * Method setP_ID + * @param P_ID int + */ + public void setP_ID (int P_ID) + { + m_P_ID = P_ID; + } + + /** + * Method getP_Date + * @return Timestamp + */ + public Timestamp getP_Date() + { + return m_P_Date; + } + /** + * Method setP_Date + * @param P_Date Timestamp + */ + public void setP_Date (Timestamp P_Date) + { + m_P_Date = P_Date; + } + + /** + * Method getP_Number + * @return BigDecimal + */ + public BigDecimal getP_Number() + { + return m_P_Number; + } + /** + * Method setP_Number + * @param P_Number BigDecimal + */ + public void setP_Number (BigDecimal P_Number) + { + m_P_Number = P_Number; + } + + /** + * Method getP_Msg + * @return String + */ + public String getP_Msg() + { + return m_P_Msg; + } + /** + * Method setP_Msg + * @param P_Msg String + */ + public void setP_Msg (String P_Msg) + { + m_P_Msg = P_Msg; + } + +} // ProcessInfoLog diff --git a/dbPort/src/org/compiere/process/ProcessInfoParameter.java b/dbPort/src/org/compiere/process/ProcessInfoParameter.java new file mode 100644 index 0000000000..7dabaa5fd6 --- /dev/null +++ b/dbPort/src/org/compiere/process/ProcessInfoParameter.java @@ -0,0 +1,200 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.io.*; +import java.math.*; + + +/** + * Process Parameter + * + * @author Jorg Janke + * @version $Id: ProcessInfoParameter.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class ProcessInfoParameter implements Serializable +{ + /** + * Construct Parameter + * @param parameterName parameter name + * @param parameter parameter + * @param parameter_To to parameter + * @param info info + * @param info_To to info + */ + public ProcessInfoParameter (String parameterName, Object parameter, Object parameter_To, String info, String info_To) + { + setParameterName (parameterName); + setParameter (parameter); + setParameter_To (parameter_To); + setInfo (info); + setInfo_To (info_To); + } // ProcessInfoParameter + + private String m_ParameterName; + private Object m_Parameter; + private Object m_Parameter_To; + private String m_Info = ""; + private String m_Info_To = ""; + + /** + * String Representation + * @return info + */ + public String toString() + { + // From .. To + if (m_Parameter_To != null || m_Info_To.length() > 0) + return "ProcessInfoParameter[" + m_ParameterName + "=" + m_Parameter + + (m_Parameter==null ? "" : "{" + m_Parameter.getClass().getName() + "}") + + " (" + m_Info + ") - " + + m_Parameter_To + + (m_Parameter_To==null ? "" : "{" + m_Parameter_To.getClass().getName() + "}") + + " (" + m_Info_To + ")"; + // Value + return "ProcessInfoParameter[" + m_ParameterName + "=" + m_Parameter + + (m_Parameter==null ? "" : "{" + m_Parameter.getClass().getName() + "}") + + " (" + m_Info + ")"; + } // toString + + + /** + * Method getInfo + * @return String + */ + public String getInfo () + { + return m_Info; + } + + /** + * Method getInfo_To + * @return String + */ + public String getInfo_To () + { + return m_Info_To; + } + + /** + * Method getParameter + * @return Object + */ + public Object getParameter () + { + return m_Parameter; + } + + /** + * Method getParameter as Int + * @return Object + */ + public int getParameterAsInt () + { + if (m_Parameter == null) + return 0; + if (m_Parameter instanceof Number) + return ((Number)m_Parameter).intValue(); + BigDecimal bd = new BigDecimal(m_Parameter.toString()); + return bd.intValue(); + } // getParameterAsInt + + /** + * Method getParameter_To + * @return Object + */ + public Object getParameter_To () + { + return m_Parameter_To; + } + + /** + * Method getParameter as Int + * @return Object + */ + public int getParameter_ToAsInt () + { + if (m_Parameter_To == null) + return 0; + if (m_Parameter_To instanceof Number) + return ((Number)m_Parameter_To).intValue(); + BigDecimal bd = new BigDecimal(m_Parameter_To.toString()); + return bd.intValue(); + } // getParameter_ToAsInt + + + /** + * Method getParameterName + * @return String + */ + public String getParameterName () + { + return m_ParameterName; + } + + /** + * Method setInfo + * @param Info String + */ + public void setInfo (String Info) + { + if (Info == null) + m_Info = ""; + else + m_Info = Info; + } + + /** + * Method setInfo_To + * @param Info_To String + */ + public void setInfo_To (String Info_To) + { + if (Info_To == null) + m_Info_To = ""; + else + m_Info_To = Info_To; + } + + /** + * Method setParameter + * @param Parameter Object + */ + public void setParameter (Object Parameter) + { + m_Parameter = Parameter; + } + + /** + * Method setParameter_To + * @param Parameter_To Object + */ + public void setParameter_To (Object Parameter_To) + { + m_Parameter_To = Parameter_To; + } + + /** + * Method setParameterName + * @param ParameterName String + */ + public void setParameterName (String ParameterName) + { + m_ParameterName = ParameterName; + } + +} // ProcessInfoParameter diff --git a/dbPort/src/org/compiere/process/ProcessInfoUtil.java b/dbPort/src/org/compiere/process/ProcessInfoUtil.java new file mode 100644 index 0000000000..01629e8327 --- /dev/null +++ b/dbPort/src/org/compiere/process/ProcessInfoUtil.java @@ -0,0 +1,244 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.sql.*; +import java.util.*; + +import java.util.logging.*; +import org.compiere.util.*; + +/** + * Process Info with Utilities + * + * @author Jorg Janke + * @version $Id: ProcessInfoUtil.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class ProcessInfoUtil +{ + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (ProcessInfoUtil.class); + + + /************************************************************************** + * Query PInstance for result. + * Fill Summary and success in ProcessInfo + * @param pi process info + */ + public static void setSummaryFromDB (ProcessInfo pi) + { + // s_log.fine("setSummaryFromDB - AD_PInstance_ID=" + pi.getAD_PInstance_ID()); + // + int sleepTime = 2000; // 2 secomds + int noRetry = 5; // 10 seconds total + // + String sql = "SELECT Result, ErrorMsg FROM AD_PInstance " + + "WHERE AD_PInstance_ID=?" + + " AND Result IS NOT NULL"; + + try + { + PreparedStatement pstmt = DB.prepareStatement (sql, + ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, null); + for (int noTry = 0; noTry < noRetry; noTry++) + { + pstmt.setInt(1, pi.getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + // we have a result + int i = rs.getInt(1); + if (i == 1) + { + pi.setSummary(Msg.getMsg(Env.getCtx(), "Success")); + } + else + { + pi.setSummary(Msg.getMsg(Env.getCtx(), "Failure"), true); + } + String Message = rs.getString(2); + rs.close(); + pstmt.close(); + // + if (Message != null) + pi.addSummary (" (" + Msg.parseTranslation(Env.getCtx(), Message) + ")"); + // s_log.fine("setSummaryFromDB - " + Message); + return; + } + + rs.close(); + // sleep + try + { + s_log.fine("sleeping"); + Thread.sleep(sleepTime); + } + catch (InterruptedException ie) + { + s_log.log(Level.SEVERE, "Sleep Thread", ie); + } + } + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + pi.setSummary (e.getLocalizedMessage(), true); + return; + } + pi.setSummary (Msg.getMsg(Env.getCtx(), "Timeout"), true); + } // setSummaryFromDB + + /** + * Set Log of Process. + * @param pi process info + */ + public static void setLogFromDB (ProcessInfo pi) + { + // s_log.fine("setLogFromDB - AD_PInstance_ID=" + pi.getAD_PInstance_ID()); + String sql = "SELECT Log_ID, P_ID, P_Date, P_Number, P_Msg " + + "FROM AD_PInstance_Log " + + "WHERE AD_PInstance_ID=? " + + "ORDER BY Log_ID"; + + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, pi.getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + // int Log_ID, int P_ID, Timestamp P_Date, BigDecimal P_Number, String P_Msg + pi.addLog (rs.getInt(1), rs.getInt(2), rs.getTimestamp(3), rs.getBigDecimal(4), rs.getString(5)); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, "setLogFromDB", e); + } + } // getLogFromDB + + /** + * Create Process Log + * @param pi process info + */ + public static void saveLogToDB (ProcessInfo pi) + { + ProcessInfoLog[] logs = pi.getLogs(); + if (logs == null || logs.length == 0) + { + // s_log.fine("saveLogToDB - No Log"); + return; + } + if (pi.getAD_PInstance_ID() == 0) + { + // s_log.log(Level.WARNING,"saveLogToDB - not saved - AD_PInstance_ID==0"); + return; + } + for (int i = 0; i < logs.length; i++) + { + StringBuffer sql = new StringBuffer ("INSERT INTO AD_PInstance_Log " + + "(AD_PInstance_ID, Log_ID, P_Date, P_ID, P_Number, P_Msg)" + + " VALUES ("); + sql.append(pi.getAD_PInstance_ID()).append(",") + .append(logs[i].getLog_ID()).append(","); + if (logs[i].getP_Date() == null) + sql.append("NULL,"); + else + sql.append(DB.TO_DATE(logs[i].getP_Date(), false)).append(","); + if (logs[i].getP_ID() == 0) + sql.append("NULL,"); + else + sql.append(logs[i].getP_ID()).append(","); + if (logs[i].getP_Number() == null) + sql.append("NULL,"); + else + sql.append(logs[i].getP_Number()).append(","); + if (logs[i].getP_Msg() == null) + sql.append("NULL)"); + else + sql.append(DB.TO_STRING(logs[i].getP_Msg(),2000)).append(")"); + // + DB.executeUpdate(sql.toString(), null); + } + pi.setLogList(null); // otherwise log entries are twice + } // saveLogToDB + + /** + * Set Parameter of Process (and Client/User) + * @param pi Process Info + */ + public static void setParameterFromDB (ProcessInfo pi) + { + ArrayList list = new ArrayList(); + String sql = "SELECT p.ParameterName," // 1 + + " p.P_String,p.P_String_To, p.P_Number,p.P_Number_To," // 2/3 4/5 + + " p.P_Date,p.P_Date_To, p.Info,p.Info_To, " // 6/7 8/9 + + " i.AD_Client_ID, i.AD_Org_ID, i.AD_User_ID " // 10..12 + + "FROM AD_PInstance_Para p" + + " INNER JOIN AD_PInstance i ON (p.AD_PInstance_ID=i.AD_PInstance_ID) " + + "WHERE p.AD_PInstance_ID=? " + + "ORDER BY p.SeqNo"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, pi.getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String ParameterName = rs.getString(1); + // String + Object Parameter = rs.getString(2); + Object Parameter_To = rs.getString(3); + // Big Decimal + if (Parameter == null && Parameter_To == null) + { + Parameter = rs.getBigDecimal(4); + Parameter_To = rs.getBigDecimal(5); + } + // Timestamp + if (Parameter == null && Parameter_To == null) + { + Parameter = rs.getTimestamp(6); + Parameter_To = rs.getTimestamp(7); + } + // Info + String Info = rs.getString(8); + String Info_To = rs.getString(9); + // + list.add (new ProcessInfoParameter(ParameterName, Parameter, Parameter_To, Info, Info_To)); + // + if (pi.getAD_Client_ID() == null) + pi.setAD_Client_ID (rs.getInt(10)); + if (pi.getAD_User_ID() == null) + pi.setAD_User_ID(rs.getInt(12)); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, sql, e); + } + // + ProcessInfoParameter[] pars = new ProcessInfoParameter[list.size()]; + list.toArray(pars); + pi.setParameter(pars); + } // setParameterFromDB + + +} // ProcessInfoUtil diff --git a/dbPort/src/org/compiere/process/SequenceCheck.java b/dbPort/src/org/compiere/process/SequenceCheck.java new file mode 100644 index 0000000000..9fdacf893a --- /dev/null +++ b/dbPort/src/org/compiere/process/SequenceCheck.java @@ -0,0 +1,294 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.model.*; +import org.compiere.util.*; + +/** + * System + Document Sequence Check + * + * @author Jorg Janke + * @version $Id: SequenceCheck.java,v 1.3 2006/07/30 00:54:44 jjanke Exp $ + */ +public class SequenceCheck extends SvrProcess +{ + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (SequenceCheck.class); + + /** + * Prepare - e.g., get Parameters. + */ + protected void prepare() + { + } // prepare + + /** + * Perform process. + * (see also MSequenve.validate) + * @return Message to be translated + * @throws Exception + */ + protected String doIt() throws java.lang.Exception + { + log.info(""); + // + checkTableSequences (Env.getCtx(), this); + checkTableID (Env.getCtx(), this); + checkClientSequences (Env.getCtx(), this); + return "Sequence Check"; + } // doIt + + /** + * Validate Sequences + * @param ctx context + */ + public static void validate(Properties ctx) + { + try + { + checkTableSequences (ctx, null); + checkTableID (ctx, null); + checkClientSequences (ctx, null); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, "validate", e); + } + } // validate + + + + /************************************************************************** + * Check existence of Table Sequences. + * @param ctx context + * @param sp server process or null + */ + private static void checkTableSequences (Properties ctx, SvrProcess sp) + { + String trxName = null; + if (sp != null) + trxName = sp.get_TrxName(); + String sql = "SELECT TableName " + + "FROM AD_Table t " + + "WHERE IsActive='Y' AND IsView='N'" + + " AND NOT EXISTS (SELECT * FROM AD_Sequence s " + + "WHERE UPPER(s.Name)=UPPER(t.TableName) AND s.IsTableID='Y')"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String tableName = rs.getString(1); + if (MSequence.createTableSequence (ctx, tableName, trxName)) + { + if (sp != null) + sp.addLog(0, null, null, tableName); + else + s_log.fine(tableName); + } + else + { + rs.close(); + throw new Exception ("Error creating Table Sequence for " + tableName); + } + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // Sync Table Name case + sql = "UPDATE AD_Sequence s " + + "SET Name = (SELECT TableName FROM AD_Table t " + + "WHERE t.IsView='N' AND UPPER(s.Name)=UPPER(t.TableName)) " + + "WHERE s.IsTableID='Y'" + + " AND EXISTS (SELECT * FROM AD_Table t " + + "WHERE t.IsActive='Y' AND t.IsView='N'" + + " AND UPPER(s.Name)=UPPER(t.TableName) AND s.Name<>t.TableName)"; + int no = DB.executeUpdate(sql, trxName); + if (no > 0) + { + if (sp != null) + sp.addLog(0, null, null, "SyncName #" + no); + else + s_log.fine("Sync #" + no); + } + if (no >= 0) + return; + + /** Find Duplicates */ + sql = "SELECT TableName, s.Name " + + "FROM AD_Table t, AD_Sequence s " + + "WHERE t.IsActive='Y' AND t.IsView='N'" + + " AND UPPER(s.Name)=UPPER(t.TableName) AND s.Name<>t.TableName"; + // + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + String TableName = rs.getString(1); + String SeqName = rs.getString(2); + sp.addLog(0, null, null, "ERROR: TableName=" + TableName + " - Sequence=" + SeqName); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + s_log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // checkTableSequences + + + /** + * Check Table Sequence ID values + * @param ctx context + * @param sp server process or null + */ + private static void checkTableID (Properties ctx, SvrProcess sp) + { + int IDRangeEnd = DB.getSQLValue(null, + "SELECT IDRangeEnd FROM AD_System"); + if (IDRangeEnd <= 0) + IDRangeEnd = DB.getSQLValue(null, + "SELECT MIN(IDRangeStart)-1 FROM AD_Replication"); + s_log.info("IDRangeEnd = " + IDRangeEnd); + // + String sql = "SELECT * FROM AD_Sequence " + + "WHERE IsTableID='Y' " + + "ORDER BY Name"; + int counter = 0; + PreparedStatement pstmt = null; + String trxName = null; + if (sp != null) + trxName = sp.get_TrxName(); + try + { + pstmt = DB.prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + MSequence seq = new MSequence (ctx, rs, trxName); + int old = seq.getCurrentNext(); + int oldSys = seq.getCurrentNextSys(); + if (seq.validateTableIDValue()) + { + if (seq.getCurrentNext() != old) + { + String msg = seq.getName() + " ID " + + old + " -> " + seq.getCurrentNext(); + if (sp != null) + sp.addLog(0, null, null, msg); + else + s_log.fine(msg); + } + if (seq.getCurrentNextSys() != oldSys) + { + String msg = seq.getName() + " Sys " + + oldSys + " -> " + seq.getCurrentNextSys(); + if (sp != null) + sp.addLog(0, null, null, msg); + else + s_log.fine(msg); + } + if (seq.save()) + counter++; + else + s_log.severe("Not updated: " + seq); + } + // else if (CLogMgt.isLevel(6)) + // log.fine("checkTableID - skipped " + tableName); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + s_log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + s_log.fine("#" + counter); + } // checkTableID + + + /** + * Check/Initialize DocumentNo/Value Sequences for all Clients + * @param ctx context + * @param sp server process or null + */ + private static void checkClientSequences (Properties ctx, SvrProcess sp) + { + String trxName = null; + if (sp != null) + trxName = sp.get_TrxName(); + // Sequence for DocumentNo/Value + MClient[] clients = MClient.getAll(ctx); + for (int i = 0; i < clients.length; i++) + { + MClient client = clients[i]; + if (!client.isActive()) + continue; + MSequence.checkClientSequences (ctx, client.getAD_Client_ID(), trxName); + } // for all clients + + } // checkClientSequences + +} // SequenceCheck diff --git a/dbPort/src/org/compiere/process/StateEngine.java b/dbPort/src/org/compiere/process/StateEngine.java new file mode 100644 index 0000000000..7a7c79dd86 --- /dev/null +++ b/dbPort/src/org/compiere/process/StateEngine.java @@ -0,0 +1,504 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import org.compiere.util.*; + + +/** + * Process State Engine. + * Based on OMG Workflow State + * + * @author Jorg Janke + * @version $Id: StateEngine.java,v 1.3 2006/07/30 00:54:44 jjanke Exp $ + */ +public class StateEngine +{ + /** + * Default Constructor (not started) + */ + public StateEngine () + { + this (STATE_NotStarted); + log = CLogger.getCLogger(getClass()); + } // State + + /** + * Initialized Constructor + * @param startState start state + */ + public StateEngine (String startState) + { + if (startState != null) + m_state = startState; + } // State + + // Same as AD_WF_Process.WFSTATE + + /** Open - Not Started */ + public static final String STATE_NotStarted = "ON"; + /** Open - Running */ + public static final String STATE_Running = "OR"; + /** Open - Suspended */ + public static final String STATE_Suspended = "OS"; + /** Closed - Completed - normal exit */ + public static final String STATE_Completed = "CC"; + /** Closed - Aborted - Environment/Setup Error */ + public static final String STATE_Aborted = "CA"; + /** Closed - Teminated - Execution Error */ + public static final String STATE_Terminated = "CT"; + + /** Suspend */ + public static final String ACTION_Suspend = "Suspend"; + /** Start */ + public static final String ACTION_Start = "Start"; + /** Resume */ + public static final String ACTION_Resume = "Resume"; + /** Complete */ + public static final String ACTION_Complete = "Complete"; + /** Abort */ + public static final String ACTION_Abort = "Abort"; + /** Terminate */ + public static final String ACTION_Terminate = "Terminate"; + + /** Internal State */ + private String m_state = STATE_NotStarted; + + /** If true throw exceptions */ + private boolean m_throwException = false; + + /** Logger */ + protected CLogger log = null; + + /** + * Are Exception Thrown + * @return trie if exceptions thrown + */ + public boolean isThrowException() + { + return m_throwException; + } // isThrowException + + /** + * Set if Exceptions are Thrown + * * @param throwException boolean + */ + public void setThrowException(boolean throwException) + { + m_throwException = throwException; + } // setThrowException + + + /** + * Get State + * @return state + */ + public String getState() + { + return m_state; + } // getState + + /** + * Get clear text State Info. + * @return state info + */ + public String getStateInfo() + { + String state = getState(); // is overwritten to update + /** + int AD_Reference_ID = 305; + MRefList.getList(AD_Reference_ID, false); + **/ + if (STATE_Running.equals(state)) + return "Running"; + else if (STATE_NotStarted.equals(state)) + return "Not Started"; + else if (STATE_Suspended.equals(state)) + return "Suspended"; + else if (STATE_Completed.equals(state)) + return "Completed"; + else if (STATE_Aborted.equals(state)) + return "Aborted"; + else if (STATE_Terminated.equals(state)) + return "Terminated"; + return state; + } // getStateInfo + + /** + * State is Open + * @return true if open (running, not started, suspended) + */ + public boolean isOpen() + { + return STATE_Running.equals(m_state) + || STATE_NotStarted.equals(m_state) + || STATE_Suspended.equals(m_state); + } // isOpen + + /** + * State is Not Running + * @return true if not running (not started, suspended) + */ + public boolean isNotRunning() + { + return STATE_NotStarted.equals(m_state) + || STATE_Suspended.equals(m_state); + } // isNotRunning + + /** + * State is Closed + * @return true if closed (completed, aborted, terminated) + */ + public boolean isClosed() + { + return STATE_Completed.equals(m_state) + || STATE_Aborted.equals(m_state) + || STATE_Terminated.equals(m_state); + } // isClosed + + /** + * State is Not Started + * @return true if Not Started + */ + public boolean isNotStarted() + { + return STATE_NotStarted.equals(m_state); + } // isNotStarted + + /** + * State is Running + * @return true if Running + */ + public boolean isRunning() + { + return STATE_Running.equals(m_state); + } // isRunning + + /** + * State is Suspended + * @return true if Suspended + */ + public boolean isSuspended() + { + return STATE_Suspended.equals(m_state); + } // isSuspended + + /** + * State is Completed + * @return true if Completed + */ + public boolean isCompleted() + { + return STATE_Completed.equals(m_state); + } // isCompleted + + /** + * State is Aborted (Environment/Setup issue) + * @return true if Aborted + */ + public boolean isAborted() + { + return STATE_Aborted.equals(m_state); + } // isAborted + + /** + * State is Terminated (Execution issue) + * @return true if Terminated + */ + public boolean isTerminated() + { + return STATE_Terminated.equals(m_state); + } // isTerminated + + + + + /************************************************************************** + * Start: not started -> running + * @return true if set to running + */ + public boolean start() + { + if (log == null) + log = CLogger.getCLogger(getClass()); + if (isNotStarted()) + { + m_state = STATE_Running; + log.info("starting ..."); + return true; + } + String msg = "start failed: Not Not Started (" + getState() + ")"; + if (m_throwException) + throw new IllegalStateException (msg); + log.warning(msg); + return false; + } // start + + /** + * Resume: suspended -> running + * @return true if set to sunning + */ + public boolean resume() // raises CannotResume, NotRunning, NotSuspended + { + if (log == null) + log = CLogger.getCLogger(getClass()); + if (isSuspended()) + { + m_state = STATE_Running; + log.info("resuming ..."); + return true; + } + String msg = "resume failed: Not Suspended (" + getState() + ")"; + if (m_throwException) + throw new IllegalStateException (msg); + log.warning(msg); + return false; + } // resume + + /** + * Suspend: running -> suspended + * @return true if suspended + */ + public boolean suspend() // raises CannotSuspend, NotRunning, AlreadySuspended + { + if (log == null) + log = CLogger.getCLogger(getClass()); + if (isRunning()) + { + m_state = STATE_Suspended; + log.info("suspending ..."); + return true; + } + String msg = "suspend failed: Not Running (" + getState() + ")"; + if (m_throwException) + throw new IllegalStateException (msg); + log.warning(msg); + return false; + } // suspend + + /** + * Complete: running -> completed + * @return true if set to completed + */ + public boolean complete() + { + if (log == null) + log = CLogger.getCLogger(getClass()); + if (isRunning()) + { + m_state = STATE_Completed; + log.info("completing ..."); + return true; + } + String msg = "complete failed: Not Running (" + getState() + ")"; + if (m_throwException) + throw new IllegalStateException (msg); + log.warning(msg); + return false; + } // complete + + /** + * Abort: open -> aborted + * @return true if set to aborted + */ + public boolean abort() // raises CannotStop, NotRunning + { + if (log == null) + log = CLogger.getCLogger(getClass()); + if (isOpen()) + { + m_state = STATE_Aborted; + log.info("aborting ..."); + return true; + } + String msg = "abort failed: Not Open (" + getState() + ")"; + if (m_throwException) + throw new IllegalStateException (msg); + log.warning(msg); + return false; + } // abort + + /** + * Terminate: open -> terminated + * @return true if set to terminated + */ + public boolean terminate() // raises CannotStop, NotRunning + { + if (log == null) + log = CLogger.getCLogger(getClass()); + if (isOpen()) + { + m_state = STATE_Terminated; + log.info("terminating ..."); + return true; + } + String msg = "terminate failed: Not Open (" + getState() + ")"; + if (m_throwException) + throw new IllegalStateException (msg); + log.warning(msg); + return false; + } // terminate + + + /** + * Get New State Options based on current State + * @return array of new states + */ + public String[] getNewStateOptions() + { + if (isNotStarted()) + return new String[] {STATE_Running, STATE_Aborted, STATE_Terminated}; + if (isRunning()) + return new String[] {STATE_Suspended, STATE_Completed, STATE_Aborted, STATE_Terminated}; + if (isSuspended()) + return new String[] {STATE_Running, STATE_Aborted, STATE_Terminated}; + // + return new String[] {}; + } // getNewStateOptions + + /** + * Is the new State valid based on current state + * @param newState new state + * @return true valid new state + */ + public boolean isValidNewState (String newState) + { + String[] options = getNewStateOptions(); + for (int i = 0; i < options.length; i++) + { + if (options[i].equals(newState)) + return true; + } + return false; + } // isValidNewState + + + /** + * Set State to new State + * @param newState new state + * @return true if set to new state + */ + public boolean setState (String newState) // raises InvalidState, TransitionNotAllowed + { + if (STATE_Running.equals(newState)) + { + if (isNotStarted()) + return start(); + else + return resume(); + } + else if (STATE_Suspended.equals(newState)) + return suspend(); + else if (STATE_Completed.equals(newState)) + return complete(); + else if (STATE_Aborted.equals(newState)) + return abort(); + else if (STATE_Terminated.equals(newState)) + return terminate(); + return false; + } // setState + + /** + * Get Action Options based on current State + * @return array of actions + */ + public String[] getActionOptions() + { + if (isNotStarted()) + return new String[] {ACTION_Start, ACTION_Abort, ACTION_Terminate}; + if (isRunning()) + return new String[] {ACTION_Suspend, ACTION_Complete, ACTION_Abort, ACTION_Terminate}; + if (isSuspended()) + return new String[] {ACTION_Resume, ACTION_Abort, ACTION_Terminate}; + // + return new String[] {}; + } // getActionOptions + + /** + * Is The Action Valid based on current state + * @param action action + * @return true if valid + */ + public boolean isValidAction (String action) + { + String[] options = getActionOptions(); + for (int i = 0; i < options.length; i++) + { + if (options[i].equals(action)) + return true; + } + return false; + } // isValidAction + + /** + * Process + * @param action action + * @return true if set to new state + */ + public boolean process (String action) // raises InvalidState, TransitionNotAllowed + { + if (ACTION_Start.equals(action)) + return start(); + else if (ACTION_Complete.equals(action)) + return complete(); + else if (ACTION_Suspend.equals(action)) + return suspend(); + else if (ACTION_Resume.equals(action)) + return resume(); + else if (ACTION_Abort.equals(action)) + return abort(); + else if (ACTION_Terminate.equals(action)) + return terminate(); + return false; + } // process + + /** + * Get New State If Action performed + * @param action action + * @return potential new state + */ + public String getNewStateIfAction (String action) + { + if (isValidAction(action)) + { + if (ACTION_Start.equals(action)) + return STATE_Running; + else if (ACTION_Complete.equals(action)) + return STATE_Completed; + else if (ACTION_Suspend.equals(action)) + return STATE_Suspended; + else if (ACTION_Resume.equals(action)) + return STATE_Running; + else if (ACTION_Abort.equals(action)) + return STATE_Aborted; + else if (ACTION_Terminate.equals(action)) + return STATE_Terminated; + } + // Unchanged + return getState(); + } // getNewStateIfAction + + /** + * String Representation + * @return info + */ + public String toString () + { + return getStateInfo(); + } // toString + +} // State diff --git a/dbPort/src/org/compiere/process/SvrProcess.java b/dbPort/src/org/compiere/process/SvrProcess.java new file mode 100644 index 0000000000..49c50e3f53 --- /dev/null +++ b/dbPort/src/org/compiere/process/SvrProcess.java @@ -0,0 +1,442 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +import java.lang.reflect.*; +import java.math.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.model.*; +import org.compiere.util.*; + +/** + * Server Process Template + * + * @author Jorg Janke + * @version $Id: SvrProcess.java,v 1.4 2006/08/10 01:00:44 jjanke Exp $ + */ +public abstract class SvrProcess implements ProcessCall +{ + /** + * Server Process. + * Note that the class is initiated by startProcess. + */ + public SvrProcess() + { + // Env.ZERO.divide(Env.ZERO); + } // SvrProcess + + private Properties m_ctx; + private ProcessInfo m_pi; + + /** Logger */ + protected CLogger log = CLogger.getCLogger (getClass()); + + /** Is the Object locked */ + private boolean m_locked = false; + /** Loacked Object */ + private PO m_lockedObject = null; + /** Process Main transaction */ + private Trx m_trx; + + /** Common Error Message */ + protected static String MSG_SaveErrorRowNotFound = "@SaveErrorRowNotFound@"; + protected static String MSG_InvalidArguments = "@InvalidArguments@"; + + + /** + * Start the process. + * Calls the abstract methods process. + * It should only return false, if the function could not be performed + * as this causes the process to abort. + * + * @param ctx Context + * @param pi Process Info + * @return true if the next process should be performed + * @see org.compiere.process.ProcessCall#startProcess(Properties, ProcessInfo, Trx) + */ + public final boolean startProcess (Properties ctx, ProcessInfo pi, Trx trx) + { + // Preparation + m_ctx = ctx == null ? Env.getCtx() : ctx; + m_pi = pi; + m_trx = trx; + //*** Trx + boolean localTrx = m_trx == null; + if (localTrx) + m_trx = Trx.get(Trx.createTrxName("SvrProcess"), true); + // + boolean success = process(); + // + if (localTrx) + { + if (success) + m_trx.commit(); + else + m_trx.rollback(); + m_trx.close(); + m_trx = null; + } + return !m_pi.isError(); + } // startProcess + + + /************************************************************************** + * Process + * @return true if success + */ + private boolean process() + { + String msg = null; + boolean success = true; + try + { + lock(); + prepare(); + msg = doIt(); + } + catch (Exception e) + { + msg = e.getMessage(); + if (msg == null) + msg = e.toString(); + if (e.getCause() != null) + log.log(Level.SEVERE, msg, e.getCause()); + else if (CLogMgt.isLevelFine()) + log.log(Level.WARNING, msg, e); + else + log.warning(msg); + success = false; + // throw new RuntimeException(e); + } + unlock(); + + // Parse Variables + msg = Msg.parseTranslation(m_ctx, msg); + m_pi.setSummary (msg, !success); + ProcessInfoUtil.saveLogToDB(m_pi); + return success; + } // process + + /** + * Prepare - e.g., get Parameters. + * + ProcessInfoParameter[] para = getParameter(); + for (int i = 0; i < para.length; i++) + { + String name = para[i].getParameterName(); + if (para[i].getParameter() == null) + ; + else if (name.equals("A_Asset_Group_ID")) + p_A_Asset_Group_ID = para[i].getParameterAsInt(); + else if (name.equals("GuaranteeDate")) + p_GuaranteeDate = (Timestamp)para[i].getParameter(); + else if (name.equals("AttachAsset")) + p_AttachAsset = "Y".equals(para[i].getParameter()); + else + log.log(Level.SEVERE, "Unknown Parameter: " + name); + } + * + */ + abstract protected void prepare(); + + /** + * Perform process. + * @return Message (variables are parsed) + * @throws Exception if not successful e.g. + * throw new AdempiereUserError ("@FillMandatory@ @C_BankAccount_ID@"); + */ + abstract protected String doIt() throws Exception; + + /** + * Commit + */ + protected void commit() + { + if (m_trx != null) + m_trx.commit(); + } // commit + + /** + * Rollback + */ + protected void rollback() + { + if (m_trx != null) + m_trx.rollback(); + } // rollback + + + /************************************************************************** + * Lock Object. + * Needs to be explicitly called. Unlock is automatic. + * @param po object + * @return true if locked + */ + protected boolean lockObject (PO po) + { + // Unlock existing + if (m_locked || m_lockedObject != null) + unlockObject(); + // Nothing to lock + if (po == null) + return false; + m_lockedObject = po; + m_locked = m_lockedObject.lock(); + return m_locked; + } // lockObject + + /** + * Is an object Locked? + * @return true if object locked + */ + protected boolean isLocked() + { + return m_locked; + } // isLocked + + /** + * Unlock Object. + * Is automatically called at the end of process. + * @return true if unlocked or if there was nothing to unlock + */ + protected boolean unlockObject() + { + boolean success = true; + if (m_locked || m_lockedObject != null) + { + success = m_lockedObject.unlock(null); + } + m_locked = false; + m_lockedObject = null; + return success; + } // unlock + + + /************************************************************************** + * Get Process Info + * @return Process Info + */ + public ProcessInfo getProcessInfo() + { + return m_pi; + } // getProcessInfo + + /** + * Get Properties + * @return Properties + */ + public Properties getCtx() + { + return m_ctx; + } // getCtx + + /** + * Get Name/Title + * @return Name + */ + protected String getName() + { + return m_pi.getTitle(); + } // getName + + /** + * Get Process Instance + * @return Process Instance + */ + protected int getAD_PInstance_ID() + { + return m_pi.getAD_PInstance_ID(); + } // getAD_PInstance_ID + + /** + * Get Table_ID + * @return AD_Table_ID + */ + protected int getTable_ID() + { + return m_pi.getTable_ID(); + } // getRecord_ID + + /** + * Get Record_ID + * @return Record_ID + */ + protected int getRecord_ID() + { + return m_pi.getRecord_ID(); + } // getRecord_ID + + /** + * Get AD_User_ID + * @return AD_User_ID of Process owner + */ + protected int getAD_User_ID() + { + if (m_pi.getAD_User_ID() == null || m_pi.getAD_Client_ID() == null) + { + String sql = "SELECT AD_User_ID, AD_Client_ID FROM AD_PInstance WHERE AD_PInstance_ID=?"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, m_pi.getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + m_pi.setAD_User_ID (rs.getInt (1)); + m_pi.setAD_Client_ID (rs.getInt(2)); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql, e); + } + } + if (m_pi.getAD_User_ID() == null) + return 0; + return m_pi.getAD_User_ID().intValue(); + } // getAD_User_ID + + /** + * Get AD_User_ID + * @return AD_User_ID of Process owner + */ + protected int getAD_Client_ID() + { + if (m_pi.getAD_Client_ID() == null) + { + getAD_User_ID(); // sets also Client + if (m_pi.getAD_Client_ID() == null) + return 0; + } + return m_pi.getAD_Client_ID().intValue(); + } // getAD_Client_ID + + + /************************************************************************** + * Get Parameter + * @return parameter + */ + protected ProcessInfoParameter[] getParameter() + { + ProcessInfoParameter[] retValue = m_pi.getParameter(); + if (retValue == null) + { + ProcessInfoUtil.setParameterFromDB(m_pi); + retValue = m_pi.getParameter(); + } + return retValue; + } // getParameter + + + /************************************************************************** + * Add Log Entry + * @param date date or null + * @param id record id or 0 + * @param number number or null + * @param msg message or null + */ + public void addLog (int id, Timestamp date, BigDecimal number, String msg) + { + if (m_pi != null) + m_pi.addLog(id, date, number, msg); + log.info(id + " - " + date + " - " + number + " - " + msg); + } // addLog + + /** + * Add Log + * @param msg message + */ + public void addLog (String msg) + { + if (msg != null) + addLog (0, null, null, msg); + } // addLog + + /************************************************************************** + * Execute function + * @param className class + * @param methodName method + * @param args arguments + * @return result + */ + public Object doIt (String className, String methodName, Object args[]) + { + try + { + Class clazz = Class.forName(className); + Object object = clazz.newInstance(); + Method[] methods = clazz.getMethods(); + for (int i = 0; i < methods.length; i++) + { + if (methods[i].getName().equals(methodName)) + return methods[i].invoke(object, args); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "doIt", ex); + throw new RuntimeException(ex); + } + return null; + } // doIt + + + /************************************************************************** + * Lock Process Instance + */ + private void lock() + { + log.fine("AD_PInstance_ID=" + m_pi.getAD_PInstance_ID()); + DB.executeUpdate("UPDATE AD_PInstance SET IsProcessing='Y' WHERE AD_PInstance_ID=" + + m_pi.getAD_PInstance_ID(), null); // outside trx + } // lock + + /** + * Unlock Process Instance. + * Update Process Instance DB and write option return message + */ + private void unlock () + { + MPInstance mpi = new MPInstance (getCtx(), m_pi.getAD_PInstance_ID(), null); + if (mpi.get_ID() == 0) + { + log.log(Level.SEVERE, "Did not find PInstance " + m_pi.getAD_PInstance_ID()); + return; + } + mpi.setIsProcessing(false); + mpi.setResult(m_pi.isError()); + mpi.setErrorMsg(m_pi.getSummary()); + mpi.save(); + log.fine(mpi.toString()); + } // unlock + + /** + * Return the main transaction of the current process. + * @return the transaction name + */ + protected String get_TrxName() + { + if (m_trx != null) + return m_trx.getTrxName(); + return null; + } // get_TrxName + +} // SvrProcess diff --git a/dbPort/src/org/compiere/process/SystemValidate.java b/dbPort/src/org/compiere/process/SystemValidate.java new file mode 100644 index 0000000000..80e8ca11fc --- /dev/null +++ b/dbPort/src/org/compiere/process/SystemValidate.java @@ -0,0 +1,46 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.process; + +//import org.compiere.util.*; + +/** + * Validate Support + * + * @author Jorg Janke + * @version $Id: SystemValidate.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $ + */ +public class SystemValidate extends SvrProcess +{ + /** + * Prepare + */ + protected void prepare () + { + } // prepare + + /** + * Process + * @return - + * @throws Exception + */ + protected String doIt () throws Exception + { + return ""; + } // doIt + +} // SystemValidate diff --git a/dbPort/src/org/compiere/process/package.html b/dbPort/src/org/compiere/process/package.html new file mode 100644 index 0000000000..386603d73a --- /dev/null +++ b/dbPort/src/org/compiere/process/package.html @@ -0,0 +1,29 @@ + + + + + + +Provides Processes used in Server and optionally Client Level. +

Package Specification

+ +
    +
  • Classes in this package are run either on the Server or on the Client
  • +
  • When started, at runtime it is determied if the Server is available. If + yes, the classes are invoked via the Application Server otherwise they are + executed locally.
  • +
+ +

Related Documentation

+

Steps

+

@since R2.4.1

+ + diff --git a/dbPort/src/org/compiere/util/AdempiereSystemError.java b/dbPort/src/org/compiere/util/AdempiereSystemError.java new file mode 100644 index 0000000000..02cbd2e558 --- /dev/null +++ b/dbPort/src/org/compiere/util/AdempiereSystemError.java @@ -0,0 +1,93 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + + +/** + * Adempiere System Error. + * Error caused by invalid configurations, etc. + * (No program error) + * + * @author Jorg Janke + * @version $Id: AdempiereSystemError.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class AdempiereSystemError extends Exception +{ + /** + * Adempiere System Error + * @param message message + */ + public AdempiereSystemError (String message) + { + super (message); + } // AdempiereSystemError + + /** + * Adempiere System Error + * @param message message + * @param detail detail + */ + public AdempiereSystemError (String message, Object detail) + { + super (message); + setDetail (detail); + } // AdempiereSystemError + + /** + * Adempiere System Error + * @param message + * @param cause + */ + public AdempiereSystemError (String message, Throwable cause) + { + super (message, cause); + } // AdempiereSystemError + + /** Details */ + private Object m_detail = null; + + /** + * @return Returns the detail. + */ + public Object getDetail () + { + return m_detail; + } + + /** + * @param detail The detail to set. + */ + public void setDetail (Object detail) + { + m_detail = detail; + } + + /** + * String Representation + * @return info + */ + public String toString () + { + super.toString(); + StringBuffer sb = new StringBuffer ("SystemError: "); + sb.append(getLocalizedMessage()); + if (m_detail != null) + sb.append(" (").append(m_detail).append (")"); + return sb.toString (); + } // toString + +} // AdempiereSystemError diff --git a/dbPort/src/org/compiere/util/AdempiereUserError.java b/dbPort/src/org/compiere/util/AdempiereUserError.java new file mode 100644 index 0000000000..8a1394c4de --- /dev/null +++ b/dbPort/src/org/compiere/util/AdempiereUserError.java @@ -0,0 +1,95 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + + +/** + * Adempiere User Error. + * Cuased by (lack of) user input/selection. + * (No program error) + * + * @author Jorg Janke + * @version $Id: AdempiereUserError.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class AdempiereUserError extends Exception +{ + /** + * Adempiere User Error + * @param message message + */ + public AdempiereUserError (String message) + { + super (message); + } // AdempiereUserError + + /** + * Adempiere User Error + * @param message message + * @param fixHint fix hint + */ + public AdempiereUserError (String message, String fixHint) + { + super (message); + setFixHint(fixHint); + } // AdempiereUserError + + /** + * AdempiereUserError + * @param message + * @param cause + */ + public AdempiereUserError (String message, Throwable cause) + { + super (message, cause); + } // AdempiereUserError + + /** Additional Info how to fix **/ + private String m_fixHint = null; + + /** + * @return Returns the fixHint. + */ + public String getFixHint () + { + return m_fixHint; + } // getFixHint + + /** + * Set Fix Hint + * @param fixHint fix hint + */ + public void setFixHint (String fixHint) + { + m_fixHint = fixHint; + } // setFixHint + + + /** + * String Representation + * @return info + */ + public String toString () + { + super.toString(); + StringBuffer sb = new StringBuffer ("UserError: "); + sb.append(getLocalizedMessage()); + if (m_fixHint != null && m_fixHint.length() > 0) + sb.append(" (").append(m_fixHint).append (")"); + return sb.toString (); + } // toString + +} // AdempiereUserError diff --git a/dbPort/src/org/compiere/util/AmtInWords.java b/dbPort/src/org/compiere/util/AmtInWords.java new file mode 100644 index 0000000000..f048a94cd2 --- /dev/null +++ b/dbPort/src/org/compiere/util/AmtInWords.java @@ -0,0 +1,35 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +/** + * Amount in Words. + * See Msg.getAmtInWords + * @author Jorg Janke + * @version $Id: AmtInWords.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public interface AmtInWords +{ + /** + * Get Amount in Words + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + * @throws Exception + */ + public String getAmtInWords (String amount) throws Exception; + +} // AmtInWords diff --git a/dbPort/src/org/compiere/util/AmtInWords_EN.java b/dbPort/src/org/compiere/util/AmtInWords_EN.java new file mode 100644 index 0000000000..41560a6b21 --- /dev/null +++ b/dbPort/src/org/compiere/util/AmtInWords_EN.java @@ -0,0 +1,214 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + + +/** + * Amount in Words for English + * + * @author Jorg Janke - http://www.rgagnon.com/javadetails/java-0426.html + * @version $Id: AmtInWords_EN.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $ + */ +public class AmtInWords_EN implements AmtInWords +{ + /** + * AmtInWords_EN + */ + public AmtInWords_EN () + { + super (); + } // AmtInWords_EN + + /** Thousands plus */ + private static final String[] majorNames = { + "", + "Thousand-", + "Million-", + "Billion-", + "Trillion-", + "Quadrillion-", + "Quintillion-" + }; + + /** Ten to Ninety */ + private static final String[] tensNames = { + "", + "Ten", + "Twenty", + "Thirty", + "Fourty", + "Fifty", + "Sixty", + "Seventy", + "Eighty", + "Ninety" + }; + + /** numbers to 19 */ + private static final String[] numNames = { + "", + "One", + "Two", + "Three", + "Four", + "Five", + "Six", + "Seven", + "Eight", + "Nine", + "Ten", + "Eleven", + "Twelve", + "Thirteen", + "Fourteen", + "Fifteen", + "Sixteen", + "Seventeen", + "Eighteen", + "Nineteen" + }; + + /** + * Convert Less Than One Thousand + * @param number + * @return amt + */ + private String convertLessThanOneThousand (int number) + { + String soFar; + // Below 20 + if (number % 100 < 20) + { + soFar = numNames[number % 100]; + number /= 100; + } + else + { + soFar = numNames[number % 10]; + number /= 10; + soFar = tensNames[number % 10] + soFar; + number /= 10; + } + if (number == 0) + return soFar; + return numNames[number] + "Hundred-" + soFar; + } // convertLessThanOneThousand + + /** + * Convert + * @param number + * @return amt + */ + private String convert (long number) + { + /* special case */ + if (number == 0) + { + return "Zero"; + } + String prefix = ""; + if (number < 0) + { + number = -number; + prefix = "Negative "; + } + String soFar = ""; + int place = 0; + do + { + long n = number % 1000; + if (n != 0) + { + String s = convertLessThanOneThousand ((int)n); + soFar = s + majorNames[place] + soFar; + } + place++; + number /= 1000; + } + while (number > 0); + return (prefix + soFar).trim (); + } // convert + + + /************************************************************************** + * Get Amount in Words + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + * @throws Exception + */ + public String getAmtInWords (String amount) throws Exception + { + if (amount == null) + return amount; + // + StringBuffer sb = new StringBuffer (); + int pos = amount.lastIndexOf ('.'); + int pos2 = amount.lastIndexOf (','); + if (pos2 > pos) + pos = pos2; + String oldamt = amount; + amount = amount.replaceAll (",", ""); + int newpos = amount.lastIndexOf ('.'); + long dollars = Long.parseLong(amount.substring (0, newpos)); + sb.append (convert (dollars)); + for (int i = 0; i < oldamt.length (); i++) + { + if (pos == i) // we are done + { + String cents = oldamt.substring (i + 1); + sb.append (' ').append (cents).append ("/100"); + break; + } + } + return sb.toString (); + } // getAmtInWords + + /** + * Test Print + * @param amt amount + */ + private void print (String amt) + { + try + { + System.out.println(amt + " = " + getAmtInWords(amt)); + } + catch (Exception e) + { + e.printStackTrace(); + } + } // print + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + AmtInWords_EN aiw = new AmtInWords_EN(); + // aiw.print (".23"); Error + aiw.print ("0.23"); + aiw.print ("1.23"); + aiw.print ("12.345"); + aiw.print ("123.45"); + aiw.print ("1234.56"); + aiw.print ("12345.78"); + aiw.print ("123457.89"); + aiw.print ("1,234,578.90"); + } // main + +} // AmtInWords_EN diff --git a/dbPort/src/org/compiere/util/AmtInWords_ES.java b/dbPort/src/org/compiere/util/AmtInWords_ES.java new file mode 100644 index 0000000000..f5e8be6944 --- /dev/null +++ b/dbPort/src/org/compiere/util/AmtInWords_ES.java @@ -0,0 +1,204 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +/** + * Spanish Amount in Words + * + * @author Jorg Janke - http://www.rgagnon.com/javadetails/java-0426.html + * @version $Id: AmtInWords_ES.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class AmtInWords_ES implements AmtInWords +{ + /** + * AmtInWords_ES + */ + public AmtInWords_ES () + { + super (); + } // AmtInWords_ES + + private static final String[] majorNames = { + "", + " MIL", + " MILLON", + " BILLON", + " TRILLON", + " CUATRILLON", + " QUINTRILLON" + }; + + private static final String[] tensNames = { + "", + " DIEZ", + " VEINTE", + " TREINTA", + " CUARENTA", + " CINCUENTA", + " SESENTA", + " SETENTA", + " OCHENTA", + " NOVENTA" + }; + + private static final String[] numNames = { + "", + " UNO", + " DOS", + " TRES", + " CUATRO", + " CINCO", + " SEIS", + " SIETE", + " OCHO", + " NUEVE", + " DIEZ", + " ONCE", + " DOCE", + " TRECE", + " CATORCE", + " QUINCE", + " DIECISEIS", + " DIECISIETE", + " DIECIOCHO", + " DIECINUEVE" + }; + + /** + * Convert Less Than One Thousand + * @param number + * @return amt + */ + private String convertLessThanOneThousand (int number) + { + String soFar; + // Esta dentro de los 1os. diecinueve?? ISCAP + if (number % 100 < 20) + { + soFar = numNames[number % 100]; + number /= 100; + } + else + { + soFar = numNames[number % 10]; + number /= 10; + String s = Integer.toString (number); + if (s.endsWith ("2") && soFar != "") + soFar = " VEINTI" + soFar.trim (); + else if (soFar == "") + soFar = tensNames[number % 10] + soFar; + else + soFar = tensNames[number % 10] + " Y" + soFar; + number /= 10; + } + if (number == 0) + return soFar; + if (number > 1) + soFar = "S" + soFar; + if (number == 1 && soFar != "") + number = 0; + return numNames[number] + " CIENTO" + soFar; + } // convertLessThanOneThousand + + /** + * Convert + * @param number + * @return amt + */ + private String convert (int number) + { + /* special case */ + if (number == 0) + return "CERO"; + String prefix = ""; + if (number < 0) + { + number = -number; + prefix = "MENOS"; + } + String soFar = ""; + int place = 0; + do + { + int n = number % 1000; + if (n != 0) + { + String s = convertLessThanOneThousand (n); + if (s.startsWith ("CINCO CIENTOS", 1)) + { + s = s.replaceFirst ("CINCO CIENTOS", "QUINIENTOS"); + } + if (s.startsWith ("SIETE CIENTOS", 1)) + { + s = s.replaceFirst ("SIETE CIENTOS", "SETECIENTOS"); + } + if (s.startsWith ("NUEVE CIENTOS", 1)) + { + s = s.replaceFirst ("NUEVE CIENTOS", "NOVECIENTOS"); + } + if (s == " UNO") + { + soFar = majorNames[place] + soFar; + } + else + soFar = s + majorNames[place] + soFar; + } + place++; + number /= 1000; + } + while (number > 0); + return (prefix + soFar).trim (); + } // convert + + + /************************************************************************** + * Get Amount in Words + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + * @throws Exception + */ + public String getAmtInWords (String amount) throws Exception + { + if (amount == null) + return amount; + // + StringBuffer sb = new StringBuffer (); + int pos = amount.lastIndexOf ('.'); + int pos2 = amount.lastIndexOf (','); + if (pos2 > pos) + pos = pos2; + String oldamt = amount; + amount = amount.replaceAll (",", ""); + int newpos = amount.lastIndexOf ('.'); + int pesos = Integer.parseInt (amount.substring (0, newpos)); + sb.append (convert (pesos)); + for (int i = 0; i < oldamt.length (); i++) + { + if (pos == i) // we are done + { + String cents = oldamt.substring (i + 1); + sb.append (' ') + .append (cents) + .append ("/100"); + // .append ("/100 PESOS"); + break; + } + } + return sb.toString (); + } // getAmtInWords + +} // AmtInWords_ES diff --git a/dbPort/src/org/compiere/util/AmtInWords_FR.java b/dbPort/src/org/compiere/util/AmtInWords_FR.java new file mode 100644 index 0000000000..6a35a943ed --- /dev/null +++ b/dbPort/src/org/compiere/util/AmtInWords_FR.java @@ -0,0 +1,220 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +/** + * Amount in Words for French + * + * @author Jorg Janke - http://www.rgagnon.com/javadetails/java-0426.html + * @version $Id: AmtInWords_FR.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $ + */ +public class AmtInWords_FR implements AmtInWords +{ + + /** + * AmtInWords_FR + */ + public AmtInWords_FR () + { + super (); + } // AmtInWords_FR + + private static final String[] majorNames = { + "", + " mille", + " million", + " milliard", + " trillion", + " quadrillion", + " quintillion" + }; + + private static final String[] tensNames = { + "", + " dix", + " vingt", + " trente", + " quarante", + " cinquante", + " soixante", + " soixante-dix", + " quatre-vingt", + " quatre-vingt-dix" + }; + + private static final String[] numNames = { + "", + " un", + " deux", + " trois", + " quatre", + " cinq", + " six", + " sept", + " huit", + " neuf", + " dix", + " onze", + " douze", + " treize", + " quatorze", + " quinze", + " seize", + " dix-sept", + " dix-huit", + " dix-neuf" + }; + + /** + * Convert Less Than One Thousand + * @param number number + * @return string + */ + private String convertLessThanOneThousand (int number) + { + String soFar; + if (number % 100 < 20) + { + // 19 et moins + soFar = numNames[number % 100]; + number /= 100; + } + else + { + // 9 et moins + soFar = numNames[number % 10]; + number /= 10; + // 90, 80, ... 20 + soFar = tensNames[number % 10] + soFar; + number /= 10; + } + // reste les centaines + // y'en a pas + if (number == 0) + return soFar; + if (number == 1) + // on ne retourne "un cent xxxx" mais "cent xxxx" + return " cent" + soFar; + else + return numNames[number] + " cent" + soFar; + } // convertLessThanOneThousand + + /** + * Convert + * @param number number + * @return string + */ + private String convert (int number) + { + if (number == 0) + return "zero"; + String prefix = ""; + if (number < 0) + { + number = -number; + prefix = "moins"; + } + String soFar = ""; + int place = 0; + boolean pluralPossible = true; + boolean pluralForm = false; + do + { + int n = number % 1000; + // par tranche de 1000 + if (n != 0) + { + String s = convertLessThanOneThousand (n); + if (s.trim ().equals ("un") && place == 1) + { + // on donne pas le un pour mille + soFar = majorNames[place] + soFar; + } + else + { + if (place == 0) + { + if (s.trim ().endsWith ("cent") + && !s.trim ().startsWith ("cent")) + { + // nnn200 ... nnn900 avec "s" + pluralForm = true; + } + else + { + // pas de "s" jamais + pluralPossible = false; + } + } + if (place > 0 && pluralPossible) + { + if (!s.trim ().startsWith ("un")) + { + // avec "s" + pluralForm = true; + } + else + { + // jamis de "s" + pluralPossible = false; + } + } + soFar = s + majorNames[place] + soFar; + } + } + place++; + number /= 1000; + } + while (number > 0); + String result = (prefix + soFar).trim (); + return (pluralForm ? result + "s" : result); + } // convert + + /************************************************************************** + * Get Amount in Words + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + * @throws Exception + */ + public String getAmtInWords (String amount) throws Exception + { + if (amount == null) + return amount; + // + StringBuffer sb = new StringBuffer (); + int pos = amount.lastIndexOf ('.'); + int pos2 = amount.lastIndexOf (','); + if (pos2 > pos) + pos = pos2; + String oldamt = amount; + amount = amount.replaceAll (",", ""); + int newpos = amount.lastIndexOf ('.'); + int pesos = Integer.parseInt (amount.substring (0, newpos)); + sb.append (convert (pesos)); + for (int i = 0; i < oldamt.length (); i++) + { + if (pos == i) // we are done + { + String cents = oldamt.substring (i + 1); + sb.append (' ').append (cents).append ("/100"); + break; + } + } + return sb.toString (); + } // getAmtInWords + +} // AmtInWords_FR diff --git a/dbPort/src/org/compiere/util/AmtInWords_IN.java b/dbPort/src/org/compiere/util/AmtInWords_IN.java new file mode 100644 index 0000000000..c06c0763bc --- /dev/null +++ b/dbPort/src/org/compiere/util/AmtInWords_IN.java @@ -0,0 +1,248 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +/** + * Amount in Words for Bahasa Indonesia + * + * @author Halim Englen + * @version $Id: AmtInWords_IN.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class AmtInWords_IN implements AmtInWords +{ + /** + * AmtInWords_IN + */ + public AmtInWords_IN () + { + super (); + } // AmtInWords_IN + + private static final String[] basenumbers = new String[]{ + "Nol", + "Satu", + "Dua", + "Tiga", + "Empat", + "Lima", + "Enam", + "Tujuh", + "Delapan", + "Sembilan", + "Sepuluh", + "Sebelas", + }; + private static final long POWER_THREE = 1000L; + private static final long POWER_SIX = 1000000L; + private static final long POWER_NINE = 1000000000L; + private static final long POWER_TWELVE = 1000000000000L; + private static final long POWER_FIFTEEN = 1000000000000000L; + +//-------------------------- STATIC METHODS -------------------------- + + /** + * Convenient method for {@link #sayNumber(StringBuffer, long)}. + * + * @param number number to say + * @return said number + */ + public static String sayNumber(long number) { + StringBuffer result = new StringBuffer(); + sayNumber(result, number); + return result.toString(); + } + + /** + * Say a number. This method will append the result to the given string buffer. + * + * @param appendTo the string buffer + * @param number number to say + * @return said number + * @throws IllegalArgumentException if the number equals to {@link Long#MIN_VALUE} + */ + public static String sayNumber(StringBuffer appendTo, long number) + throws IllegalArgumentException { + if (number == Long.MIN_VALUE) { + throw new IllegalArgumentException("Out of range"); + } + if (number < 0) { + appendTo.append("Minus "); + } + long abs = Math.abs(number); + if (abs < POWER_THREE) { + saySimpleNumber(appendTo, (int) abs); + } else if (abs < POWER_SIX) { + int thousand = (int) (abs % POWER_SIX / POWER_THREE); + saySimpleNumber(appendTo, thousand); + appendTo.append(" Ribu"); + long remainder = abs - thousand * POWER_THREE; + if (remainder > 0) { + appendTo.append(' '); + sayNumber(appendTo, remainder); + } + } else if (abs < POWER_NINE) { + int million = (int) (abs % POWER_NINE / POWER_SIX); + saySimpleNumber(appendTo, million); + appendTo.append(" Juta"); + long remainder = abs - million * POWER_SIX; + if (remainder > 0) { + appendTo.append(' '); + sayNumber(appendTo, remainder); + } + } else if (abs < POWER_TWELVE) { + int billion = (int) (abs % POWER_TWELVE / POWER_NINE); + saySimpleNumber(appendTo, billion); + appendTo.append(" Milyar"); + long remainder = abs - billion * POWER_NINE; + if (remainder > 0) { + appendTo.append(' '); + sayNumber(appendTo, remainder); + } + } else if (abs < POWER_FIFTEEN) { + int trillion = (int) (abs % POWER_FIFTEEN / POWER_TWELVE); + saySimpleNumber(appendTo, trillion); + appendTo.append(" Trilyun"); + long remainder = abs - trillion * POWER_TWELVE; + if (remainder > 0) { + appendTo.append(' '); + sayNumber(appendTo, remainder); + } + } else { + int log = (int) Math.floor(Math.log(abs) / Math.log(10)); + + // we want to break the number to several billions. + int logWhole = log - log % 12; + + long powerWhole = (long) Math.pow(10, logWhole); + + long part = abs / powerWhole; + sayNumber(appendTo, part); + appendTo.append(" Trilyun"); + + long remainder = abs - part * powerWhole; + if (remainder > 0) { + appendTo.append(' '); + sayNumber(appendTo, remainder); + } + } + return appendTo.toString(); + } + + + + static void saySimpleNumber(StringBuffer appendTo, int number) { + + + assert number < 1000 && number >= 0: "Must be between 0 and 1000"; + + if (number < 12) { + assert number < 12 && number >= 0: "Must be between 0 and 11"; + appendTo.append(basenumbers[number]); + } else if (number < 20) { + assert number >= 12 && number <= 19: "Must be between 12 and 19"; + int belasan = number % 10; + appendTo.append(basenumbers[belasan]); + appendTo.append(" Belas"); + } else if (number < 100) { + assert number >= 20 && number <= 99: "Must be between 20 and 99"; + int puluhan = number / 10; + appendTo.append(basenumbers[puluhan]); + appendTo.append(" Puluh"); + int remainder = number - puluhan * 10; + if (remainder > 0) { + appendTo.append(' '); + saySimpleNumber(appendTo, remainder); + } + } else if (number < 200) { + assert number >= 100 && number <= 199: "Must be between 100 and 199"; + appendTo.append("Seratus"); + + int remainder = number - 100; + if (remainder > 0) { + appendTo.append(' '); + saySimpleNumber(appendTo, remainder); + } + } else if (number != 0) { + assert number >= 200 && number <= 999: "Must be between 200 and 999"; + + int ratusan = number % 1000 / 100; + assert ratusan > 0 && ratusan < 10 :"1-9"; + appendTo.append(basenumbers[ratusan]); + appendTo.append(" Ratus"); + int remainder = number - ratusan * 100; + if (remainder > 0) { + appendTo.append(' '); + saySimpleNumber(appendTo, remainder); + } + } + } + + + /************************************************************************** + * Get Amount in Words + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + * @throws Exception + */ + public String getAmtInWords (String amount) throws Exception + { + if (amount == null) + return amount; + // + amount = amount.replaceAll (",", ""); + float numFloat = Float.parseFloat(amount); + long number = 0L; + number = (long)numFloat; + return AmtInWords_IN.sayNumber(number); + } // getAmtInWords + + /** + * Test Print + * @param amt amount + */ + private void print (String amt) + { + try + { + System.out.println(amt + " = " + getAmtInWords(amt)); + } + catch (Exception e) + { + e.printStackTrace(); + } + } // print + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + AmtInWords_IN aiw = new AmtInWords_IN(); + // I doubt decimal support for rupiah is still needed ;) + aiw.print (".23"); + aiw.print ("948,776,477,778,778,778"); + aiw.print ("1.79"); + // aiw.print ("12.345"); + // aiw.print ("123.45"); + // aiw.print ("1234.56"); + // aiw.print ("12345.78"); + // aiw.print ("123457.89"); + aiw.print ("1,234,578.90"); + } // main + +} // AmtInWords_IN diff --git a/dbPort/src/org/compiere/util/AmtInWords_TH.java b/dbPort/src/org/compiere/util/AmtInWords_TH.java new file mode 100644 index 0000000000..49ef58711d --- /dev/null +++ b/dbPort/src/org/compiere/util/AmtInWords_TH.java @@ -0,0 +1,306 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + + +/** + * Amount in Words for Thai + * + * @author Sureeraya Limpaibul - http://www.rgagnon.com/javadetails/java-0426.html + * @version $Id: AmtInWords_TH.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $ + */ +public class AmtInWords_TH implements AmtInWords +{ + /** + * AmtInWords_TH + * + * 0.23 = ïŋ―Ųđïŋ―ïŋ― 23/100 + * 1.23 = Ëđïŋ―觚Ō· 23/100 + * 11.45 = ïŋ―Ôšïŋ―ïŋ―įīšŌ· 45/100 + * 121.45 = Ëđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 45/100 + * 1231.56 = Ëđïŋ―č§ūŅđïŋ―ͧïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 56/100 + * 12341.78 = Ëđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ͧïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 78/100 + * 123451.89 = Ëđïŋ―ïŋ―ïŋ―Ęđïŋ―ͧïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―~Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 89/100 + * 12234571.90 = ïŋ―Ôšïŋ―ͧïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 123234571.90 = Ëđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 1987234571.90 = Ëđïŋ―č§ūŅđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―áŧīïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 11123234571.90 = Ëđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ëđïŋ―č§ūŅđËđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 123123234571.90 = Ëđïŋ―ïŋ―ïŋ―Ęđïŋ―ͧïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―~ŅđËđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 2123123234571.90 = ïŋ―ͧïŋ―ïŋ―Ōđ Ëđïŋ―ïŋ―ïŋ―Ęđïŋ―ͧïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―~ŅđËđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 23,123,123,234,571.90 = ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđ Ëđïŋ―ïŋ―ïŋ―Ęđïŋ―ͧïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―~ŅđËđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđ ïŋ―ͧïŋ―Ęđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ņđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ôšïŋ―ïŋ―įīšŌ· 90/100 + * 100,000,000,000,000.90 = Ëđïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―ïŋ―Ōđïŋ―ïŋ―Ōđ ïŋ―Ō· 90/100 + * 0.00 = ïŋ―Ųđïŋ―ïŋ― 00/100 + * + */ + public AmtInWords_TH () + { + super (); + } // AmtInWords_TH + + private static final String[] majorNames = { + "", + "\u0e25\u0e49\u0e32\u0e19 ", + }; + private static final String[] hundredThousandNames = { + "", + "\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e41\u0e2a\u0e19", + "\u0e2a\u0e2d\u0e07\u0e41\u0e2a\u0e19", + "\u0e2a\u0e32\u0e21\u0e41\u0e2a\u0e19", + "\u0e2a\u0e35\u0e48\u0e41\u0e2a\u0e19", + "\u0e2b\u0e49\u0e32\u0e41\u0e2a\u0e19", + "\u0e2b\u0e01\u0e41\u0e2a\u0e19", + "\u0e40\u0e08\u0e47\u0e14\u0e41\u0e2a\u0e19", + "\u0e41\u0e1b\u0e14\u0e41\u0e2a\u0e19", + "\u0e40\u0e01\u0e49\u0e32\u0e41\u0e2a\u0e19" + }; + + private static final String[] tenThousandNames = { + "", + "\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e2a\u0e2d\u0e07\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e2a\u0e32\u0e21\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e2a\u0e35\u0e48\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e2b\u0e49\u0e32\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e2b\u0e01\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e40\u0e08\u0e47\u0e14\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e41\u0e1b\u0e14\u0e2b\u0e21\u0e37\u0e48\u0e19", + "\u0e40\u0e01\u0e49\u0e32\u0e2b\u0e21\u0e37\u0e48\u0e19" + }; + + private static final String[] thousandNames = { + "", + "\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e1e\u0e31\u0e19", + "\u0e2a\u0e2d\u0e07\u0e1e\u0e31\u0e19", + "\u0e2a\u0e32\u0e21\u0e1e\u0e31\u0e19", + "\u0e2a\u0e35\u0e48\u0e1e\u0e31\u0e19", + "\u0e2b\u0e49\u0e32\u0e1e\u0e31\u0e19", + "\u0e2b\u0e01\u0e1e\u0e31\u0e19", + "\u0e40\u0e08\u0e47\u0e14\u0e1e\u0e31\u0e19", + "\u0e41\u0e1b\u0e14\u0e1e\u0e31\u0e19", + "\u0e40\u0e01\u0e49\u0e32\u0e1e\u0e31\u0e19" + }; + + private static final String[] hundredNames = { + "", + "\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e23\u0e49\u0e2d\u0e22", + "\u0e2a\u0e2d\u0e07\u0e23\u0e49\u0e2d\u0e22", + "\u0e2a\u0e32\u0e21\u0e23\u0e49\u0e2d\u0e22", + "\u0e2a\u0e35\u0e48\u0e23\u0e49\u0e2d\u0e22", + "\u0e2b\u0e49\u0e32\u0e23\u0e49\u0e2d\u0e22", + "\u0e2b\u0e01\u0e23\u0e49\u0e2d\u0e22", + "\u0e40\u0e08\u0e47\u0e14\u0e23\u0e49\u0e2d\u0e22", + "\u0e41\u0e1b\u0e14\u0e23\u0e49\u0e2d\u0e22", + "\u0e40\u0e01\u0e49\u0e32\u0e23\u0e49\u0e2d\u0e22" + }; + + private static final String[] tensNames = { + "", + "\u0e2a\u0e34\u0e1a", + "\u0e22\u0e35\u0e48\u0e2a\u0e34\u0e1a", + "\u0e2a\u0e32\u0e21\u0e2a\u0e34\u0e1a", + "\u0e2a\u0e35\u0e48\u0e2a\u0e34\u0e1a", + "\u0e2b\u0e49\u0e32\u0e2a\u0e34\u0e1a", + "\u0e2b\u0e01\u0e2a\u0e34\u0e1a", + "\u0e40\u0e08\u0e47\u0e14\u0e2a\u0e34\u0e1a", + "\u0e41\u0e1b\u0e14\u0e2a\u0e34\u0e1a", + "\u0e40\u0e01\u0e49\u0e32\u0e2a\u0e34\u0e1a" + }; + + private static final String[] numNames = { + "", + "\u0e2b\u0e19\u0e36\u0e48\u0e07", + "\u0e2a\u0e2d\u0e07", + "\u0e2a\u0e32\u0e21", + "\u0e2a\u0e35\u0e48", + "\u0e2b\u0e49\u0e32", + "\u0e2b\u0e01", + "\u0e40\u0e08\u0e47\u0e14", + "\u0e41\u0e1b\u0e14", + "\u0e40\u0e01\u0e49\u0e32", + "\u0e2a\u0e34\u0e1a", + "\u0e2a\u0e34\u0e1a\u0e40\u0e2d\u0e47\u0e14", + "\u0e2a\u0e34\u0e1a\u0e2a\u0e2d\u0e07", + "\u0e2a\u0e34\u0e1a\u0e2a\u0e32\u0e21", + "\u0e2a\u0e34\u0e1a\u0e2a\u0e35\u0e48", + "\u0e2a\u0e34\u0e1a\u0e2b\u0e49\u0e32", + "\u0e2a\u0e34\u0e1a\u0e2b\u0e01", + "\u0e2a\u0e34\u0e1a\u0e40\u0e08\u0e47\u0e14", + "\u0e2a\u0e34\u0e1a\u0e41\u0e1b\u0e14", + "\u0e2a\u0e34\u0e1a\u0e40\u0e01\u0e49\u0e32" + }; + + /** + * Convert Less Than One Thousand + * @param number + * @return amt + */ + private String convertLessThanOneMillion (int number) + { + String soFar; + // Esta dentro de los 1os. diecinueve?? ISCAP + if (number % 100 < 20) + { + soFar = numNames[(number % 100)]; + number /= 100; + } + else + { + soFar = numNames[number % 10]; + if (number != 1 && soFar.equals("\u0e2b\u0e19\u0e36\u0e48\u0e07")) { + soFar = "\u0e40\u0e2d\u0e47\u0e14"; + } + number /= 10; + + soFar = tensNames[number % 10] + soFar; + number /= 10; + + soFar = hundredNames[number % 10] + soFar; + number /= 10; + + soFar = thousandNames[number % 10] + soFar; + number /= 10; + + soFar = tenThousandNames[number % 10] + soFar; + number /= 10; + + soFar = hundredThousandNames[number % 10] + soFar; + number /= 10; + + } + if (number == 0) + return soFar; + + return numNames[number] + "\u0e23\u0e49\u0e2d\u0e22\u0e25\u0e49\u0e32\u0e19" + soFar; + } // convertLessThanOneThousand + + /** + * Convert + * @param number + * @return amt + */ + private String convert (double number) + { + /* special case */ + if (number == 0) + { + return "\u0e28\u0e39\u0e19\u0e22\u0e4c"; + } + String prefix = ""; + String subfix = "\u0e1a\u0e32\u0e17"; + + if (number < 0) + { + number = -number; + prefix = "\u0e25\u0e1a "; + } + String soFar = ""; + int place = 0; + do + { + double d = number % 1000000; + int n = (int) d; + if (n != 0) + { + String s = convertLessThanOneMillion (n); + place = place > 0 ? 1 : 0; + + soFar = s + majorNames[place] + soFar; + } + place++; + number /= 1000000d; + } while (number > 0); + + return (prefix + soFar + subfix).trim (); + } // convert + + + /********************************************************************** + * Get Amount in Words + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + * @throws Exception + */ + public String getAmtInWords (String amount) throws Exception + { + if (amount == null) + return amount; + // + StringBuffer sb = new StringBuffer (); + double pos = (double)amount.lastIndexOf ('.'); + double pos2 = (double)amount.lastIndexOf (','); + if (pos2 > pos) + pos = pos2; + String oldamt = amount; + amount = amount.replaceAll (",", ""); + int newpos = amount.lastIndexOf ('.'); + double pesos = Double.parseDouble (amount.substring (0, newpos)); + sb.append (convert (pesos)); + for (int i = 0; i < oldamt.length (); i++) + { + if (pos == i) // we are done + { + String cents = oldamt.substring (i + 1); + sb.append (' ').append (cents).append ("/100"); + break; + } + } + return sb.toString (); + } // getAmtInWords + + /** + * Test Print + * @param amt amount + */ + private void print (String amt) + { + try + { + System.out.println(amt + " = " + getAmtInWords(amt)); + } + catch (Exception e) + { + e.printStackTrace(); + } + } // print + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + AmtInWords_TH aiw = new AmtInWords_TH(); + // aiw.print (".23"); Error + aiw.print ("0.23"); + aiw.print ("1.23"); + aiw.print ("11.45"); + aiw.print ("121.45"); + aiw.print ("1231.56"); + aiw.print ("12341.78"); + aiw.print ("123451.89"); + aiw.print ("12234571.90"); + aiw.print ("123234571.90"); + aiw.print ("1987234571.90"); + aiw.print ("11123234571.90"); + aiw.print ("123123234571.90"); + aiw.print ("2123123234571.90"); + aiw.print ("23,123,123,234,571.90"); + aiw.print ("100,000,000,000,000.90"); + aiw.print ("0.00"); + } // main + +} // AmtInWords_TH diff --git a/dbPort/src/org/compiere/util/ByteArrayDataSource.java b/dbPort/src/org/compiere/util/ByteArrayDataSource.java new file mode 100644 index 0000000000..00aa6f1d3a --- /dev/null +++ b/dbPort/src/org/compiere/util/ByteArrayDataSource.java @@ -0,0 +1,164 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.util.logging.*; +import javax.activation.*; + +/** + * A DataSource based on the Java Mail Example. + * This class implements a DataSource from: + * an InputStream + * a byte array + * a String + * @author John Mani + * @author Bill Shannon + * @author Max Spivak + */ +public class ByteArrayDataSource + implements DataSource +{ + /** + * Create a DataSource from an input stream + * @param is stream + * @param type optional MIME type e.g. text/html + */ + public ByteArrayDataSource (InputStream is, String type) + { + try + { + ByteArrayOutputStream os = new ByteArrayOutputStream (); + int ch; + + while ((ch = is.read ()) != -1) + { + // XXX - must be made more efficient by + // doing buffered reads, rather than one byte reads + os.write (ch); + } + m_data = os.toByteArray (); + } + catch (IOException ioex) + { + log.log(Level.WARNING, "", ioex); + } + if (type != null && type.length() > 0) + m_type = type; + } // ByteArrayDataSource + + /** + * Create a DataSource from a byte array + * @param data data + * @param type type e.g. text/html + */ + public ByteArrayDataSource (byte[] data, String type) + { + m_data = data; + if (type != null && type.length() > 0) + m_type = type; + } // ByteArrayDataSource + + /** + * Create a DataSource from a String + * @param stringData content + * @param charSetName optional if null/empty uses UTF-8 + * @param type optional MIME type e.g. text/html + */ + public ByteArrayDataSource (String stringData, String charSetName, String type) + { + if (charSetName == null || charSetName.length() == 0) + charSetName = "UTF-8"; // WebEnv.ENCODING - alternatibe iso-8859-1 + try + { + m_data = stringData.getBytes (charSetName); + } + catch (UnsupportedEncodingException uex) + { + log.log(Level.WARNING, "CharSetName=" + charSetName, uex); + } + if (type != null && type.length() > 0) + m_type = type; + } // ByteArrayDataSource + + /** Data **/ + private byte[] m_data = null; + /** Content Type **/ + private String m_type = "text/plain"; + /** Name **/ + private String m_name = null; + + /** Logger */ + private static CLogger log = CLogger.getCLogger (ByteArrayDataSource.class); + + /** + * Return an InputStream for the data. + * @return inputstream + * @throws IOException + */ + public InputStream getInputStream () + throws IOException + { + if (m_data == null) + throw new IOException ("no data"); + // a new stream must be returned each time. + return new ByteArrayInputStream (m_data); + } // getInputStream + + /** + * Throws exception + * @return null + * @throws IOException + */ + public OutputStream getOutputStream () + throws IOException + { + throw new IOException ("cannot do this"); + } // getOutputStream + + /** + * Get Content Type + * @return MIME type e.g. text/html + */ + public String getContentType () + { + return m_type; + } // getContentType + + /** + * Set Name + * @param name name + * @return this + */ + public ByteArrayDataSource setName(String name) + { + m_name = name; + return this; + } // setName + + /** + * Return Name or Class Name & Content Type + * @return dummy + */ + public String getName () + { + if (m_name != null) + return m_name; + return "ByteArrayDataStream " + m_type; + } // getName + +} // ByteArrayDataStream diff --git a/dbPort/src/org/compiere/util/CCache.java b/dbPort/src/org/compiere/util/CCache.java new file mode 100644 index 0000000000..27f70efa6c --- /dev/null +++ b/dbPort/src/org/compiere/util/CCache.java @@ -0,0 +1,318 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.beans.*; +import java.util.*; + +/** + * Adempiere Cache. + * @param Key + * @param Value + * + * @author Jorg Janke + * @version $Id: CCache.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class CCache extends HashMap implements CacheInterface +{ + /** + * Adempiere Cache - expires after 2 hours + * @param name (table) name of the cache + * @param initialCapacity initial capacity + */ + public CCache (String name, int initialCapacity) + { + this (name, initialCapacity, 120); + } // CCache + + + /** + * Adempiere Cache + * @param name (table) name of the cache + * @param initialCapacity initial capacity + * @param expireMinutes expire after minutes (0=no expire) + */ + public CCache (String name, int initialCapacity, int expireMinutes) + { + super(initialCapacity); + m_name = name; + setExpireMinutes(expireMinutes); + CacheMgt.get().register(this); + } // CCache + + /** Name */ + private String m_name = null; + /** Expire after minutes */ + private int m_expire = 0; + /** Time */ + private volatile long m_timeExp = 0; + /** Just reset - not used */ + private boolean m_justReset = true; + + /** Vetoable Change Support */ + private VetoableChangeSupport m_changeSupport = null; + /** Vetoable Change Support Name */ + private static String PROPERTYNAME = "cache"; + + /** + * Get (table) Name + * @return name + */ + public String getName() + { + return m_name; + } // getName + + /** + * Set Expire Minutes and start it + * @param expireMinutes minutes or 0 + */ + public void setExpireMinutes (int expireMinutes) + { + if (expireMinutes > 0) + { + m_expire = expireMinutes; + long addMS = 60000L * m_expire; + m_timeExp = System.currentTimeMillis() + addMS; + } + else + { + m_expire = 0; + m_timeExp = 0; + } + } // setExpireMinutes + + /** + * Get Expire Minutes + * @return expire minutes + */ + public int getExpireMinutes() + { + return m_expire; + } // getExpireMinutes + + /** + * Cache was reset + * @return true if reset + */ + public boolean isReset() + { + return m_justReset; + } // isReset + + /** + * Resets the Reset flag + */ + public void setUsed() + { + m_justReset = false; + } // setUsed + + /** + * Reset Cache + * @return number of items cleared + * @see org.compiere.util.CacheInterface#reset() + */ + public int reset() + { + int no = super.size(); + clear(); + return no; + } // reset + + /** + * Expire Cache if enabled + */ + private void expire() + { + if (m_expire != 0 && m_timeExp < System.currentTimeMillis()) + { + // System.out.println ("------------ Expired: " + getName() + " --------------------"); + reset(); + } + } // expire + + /** + * String Representation + * @return info + */ + public String toString() + { + return "CCache[" + m_name + + ",Exp=" + getExpireMinutes() + + ", #" + super.size() + "]"; + } // toString + + /** + * Clear cache and calculate new expiry time + * @see java.util.Map#clear() + */ + public void clear() + { + if (m_changeSupport != null) + { + try + { + m_changeSupport.fireVetoableChange(PROPERTYNAME, super.size(), 0); + } + catch (Exception e) + { + System.out.println ("CCache.clear - " + e); + return; + } + } + // Clear + super.clear(); + if (m_expire != 0) + { + long addMS = 60000L * m_expire; + m_timeExp = System.currentTimeMillis() + addMS; + } + m_justReset = true; + } // clear + + + /** + * @see java.util.Map#containsKey(java.lang.Object) + */ + public boolean containsKey(Object key) + { + expire(); + return super.containsKey(key); + } // containsKey + + /** + * @see java.util.Map#containsValue(java.lang.Object) + */ + public boolean containsValue(Object value) + { + expire(); + return super.containsValue(value); + } // containsValue + + /** + * @see java.util.Map#entrySet() + */ + public Set> entrySet() + { + expire(); + return super.entrySet(); + } // entrySet + + /** + * @see java.util.Map#get(java.lang.Object) + */ + public V get(Object key) + { + expire(); + return super.get(key); + } // get + + /** + * Put value + * @param key key + * @param value value + * @return previous value + */ + public V put (K key, V value) + { + expire(); + m_justReset = false; + return super.put (key, value); + } // put + + /** + * Put All + * @param m map + */ + public void putAll (Map m) + { + expire(); + m_justReset = false; + super.putAll (m); + } // putAll + + /** + * @see java.util.Map#isEmpty() + */ + public boolean isEmpty() + { + expire(); + return super.isEmpty(); + } // isEmpty + + /** + * @see java.util.Map#keySet() + */ + public Set keySet() + { + expire(); + return super.keySet(); + } // keySet + + /** + * @see java.util.Map#size() + */ + public int size() + { + expire(); + return super.size(); + } // size + + /** + * Get Size w/o Expire + * @see java.util.Map#size() + * @return size + */ + public int sizeNoExpire() + { + return super.size(); + } // size + + /** + * @see java.util.Map#values() + */ + public Collection values() + { + expire(); + return super.values(); + } // values + + + /** + * Add Vetoable Change Listener + * @param listener listner + */ + public void addVetoableChangeListener (VetoableChangeListener listener) + { + if (m_changeSupport == null) + m_changeSupport = new VetoableChangeSupport (this); + if (listener != null) + m_changeSupport.addVetoableChangeListener(listener); + } // addVetoableChangeListener + + /** + * Remove Vetoable Change Listener + * @param listener listener + */ + public void removeVetoableChangeListener (VetoableChangeListener listener) + { + if (m_changeSupport != null && listener != null) + m_changeSupport.removeVetoableChangeListener(listener); + } // removeVetoableChangeListener + +} // CCache diff --git a/dbPort/src/org/compiere/util/CCachedRowSet.java b/dbPort/src/org/compiere/util/CCachedRowSet.java new file mode 100644 index 0000000000..ed1e1c4b4a --- /dev/null +++ b/dbPort/src/org/compiere/util/CCachedRowSet.java @@ -0,0 +1,216 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.sql.*; +import java.util.*; +import javax.sql.*; +import javax.sql.rowset.*; +import org.compiere.db.*; +import oracle.jdbc.rowset.*; +import com.sun.rowset.*; + + +/** + * Adempiere Cached Row Set Implementation + * + * @author Jorg Janke + * @version $Id: CCachedRowSet.java,v 1.6 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CCachedRowSet extends CachedRowSetImpl implements CachedRowSet +{ + /** + * Get Cached Row Set. + * Required due to Java Sun bug 393865 + * @return Cached Row Set + * @throws SQLException + */ + public static CCachedRowSet get() throws SQLException + { + CCachedRowSet crs = null; + // only first time call + if (s_loc == null) + { + s_loc = Locale.getDefault(); + Locale.setDefault(Locale.US); + crs = new CCachedRowSet(); + Locale.setDefault(s_loc); + } + else + crs = new CCachedRowSet(); + // + return crs; + } // get + + /** + * Get Row Set. + * Read-Only, Scroll Insensitive + * Need to set parameters and call execute(Commection) + * @param sql sql + * @return row set + * @throws SQLException + */ + public static RowSet getRowSet (String sql) throws SQLException + { + CachedRowSet crs = get(); + crs.setConcurrency(ResultSet.CONCUR_READ_ONLY); + crs.setType(ResultSet.TYPE_SCROLL_INSENSITIVE); + crs.setCommand(sql); + // Set Parameters + // crs.execute(conn); + return crs; + } // get + + /** + * Get and Execute Row Set. + * No parameters, Read-Only, Scroll Insensitive + * @param sql sql + * @param conn connection + * @param db database + * @return row set + * @throws SQLException + */ + public static RowSet getRowSet (String sql, Connection conn, AdempiereDatabase db) throws SQLException + { + if (db.getName().equals(Database.DB_ORACLE)) + { + Statement stmt = conn.createStatement + (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + ResultSet rs = stmt.executeQuery(sql); + OracleCachedRowSet crs = new OracleCachedRowSet(); + crs.populate(rs); + stmt.close(); + return crs; + } + CachedRowSet crs = get(); + crs.setConcurrency(ResultSet.CONCUR_READ_ONLY); + crs.setType(ResultSet.TYPE_SCROLL_INSENSITIVE); + crs.setCommand(sql); + crs.execute(conn); + return crs; + } // get + + /** + * Get Cached Row Set. + * Required due to Java Sun bug 393865. + * Also, Oracle NUMBER returns scale -127 + * @param rs result set + * @param db database + * @return Cached Row Set + * @throws SQLException + */ + public static RowSet getRowSet (ResultSet rs, AdempiereDatabase db) throws SQLException + { + if (db.getName().equals(Database.DB_ORACLE)) + { + OracleCachedRowSet crs = new OracleCachedRowSet(); + crs.populate(rs); + return crs; + } + CachedRowSet crs = get(); + crs.populate(rs); + return crs; + } // getRowSet + + /** + * Get Cached Row Set. + * Gets Database from DB + * Required due to Java Sun bug 393865. + * Also, Oracle NUMBER returns scale -127 + * @param rs result set + * @return Cached Row Set + * @throws SQLException + */ + public static RowSet getRowSet (ResultSet rs) throws SQLException + { + return getRowSet(rs, DB.getDatabase()); + } // getRowSet + + + /** Private Locale Marker */ + private static Locale s_loc = null; + + + /************************************************************************** + * Adempiere Cached RowSet + * @throws java.sql.SQLException + */ + private CCachedRowSet() throws SQLException + { + super (); + setSyncProvider("com.sun.rowset.providers.RIOptimisticProvider"); + } // CCachedRowSet + + + /************************************************************************** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + try + { + Locale.setDefault(Locale.CANADA); + get(); + System.out.println("OK 1"); + get(); + System.out.println("OK 1a"); + new CachedRowSetImpl(); + System.out.println("OK 2"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } // main + + /** + * To Collection + * @return a Collection object that contains the values in + * each row in this CachedRowSet object + * @throws SQLException + */ + public Collection toCollection () throws SQLException + { + return super.toCollection (); + } + /** + * To Collection + * @param column an int indicating the column whose values + * are to be represented in a Collection object + * @return a Collection object that contains the values + * stored in the specified column of this CachedRowSet object + * @throws SQLException + */ + public Collection toCollection (int column) throws SQLException + { + return super.toCollection (column); + } + /** + * To Collection + * @param column a String object giving the name of the + * column whose values are to be represented in a collection + * @return a Collection object that contains the values + * stored in the specified column of this CachedRowSet object + * @throws SQLException if an error occurs generating the collection or + * an invalid column id is provided + */ + public Collection toCollection (String column) throws SQLException + { + return super.toCollection (column); + } +} // CCachedRowSet diff --git a/dbPort/src/org/compiere/util/CLogConsole.java b/dbPort/src/org/compiere/util/CLogConsole.java new file mode 100644 index 0000000000..eb5b7df5b3 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogConsole.java @@ -0,0 +1,266 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.sql.*; +import java.util.logging.*; + +/** + * Adempiere Console Logger + * @author Jorg Janke + * @version $Id: CLogConsole.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class CLogConsole extends Handler +{ + /** + * Get Console Handler + * @param create create if not exists + * @return console hander or null + */ + public static CLogConsole get (boolean create) + { + if (s_console == null && create) + s_console = new CLogConsole(); + return s_console; + } // get + + private static CLogConsole s_console = null; + + /** + * Constructor + */ + public CLogConsole () + { + if (s_console == null) + s_console = this; + else + reportError("Console Handler exists already", + new IllegalStateException("Existing Handler"), + ErrorManager.GENERIC_FAILURE); + initialize(); + } // CLogConsole + + /** Printed header */ + private boolean m_doneHeader = false; + /** Normal Writer */ + private PrintWriter m_writerOut = null; + /** Error Writer */ + private PrintWriter m_writerErr = null; + + /** + * Initialize + */ + private void initialize() + { + // System.out.println("CLogConsole.initialize"); + // Set Writers + String encoding = getEncoding(); + if (encoding != null) + { + try + { + m_writerOut = new PrintWriter(new OutputStreamWriter(System.out, encoding)); + m_writerErr = new PrintWriter(new OutputStreamWriter(System.err, encoding)); + } + catch (UnsupportedEncodingException ex) + { + reportError ("Opening encoded Writers", ex, ErrorManager.OPEN_FAILURE); + } + } + if (m_writerOut == null) + m_writerOut = new PrintWriter(System.out); + if (m_writerErr == null) + m_writerErr = new PrintWriter(System.err); + + // Foratting + setFormatter(CLogFormatter.get()); + // Default Level + setLevel(Level.INFO); + // Filter + setFilter(CLogFilter.get()); + // + } // initialize + + /** + * Set Encoding + * @param encoding encoding + * @throws SecurityException + * @throws java.io.UnsupportedEncodingException + */ + public void setEncoding (String encoding) + throws SecurityException, java.io.UnsupportedEncodingException + { + super.setEncoding (encoding); + // Replace the current writer with a writer for the new encoding. + flush (); + initialize(); + } // setEncoding + + + /** + * Set Level + * @see java.util.logging.Handler#setLevel(java.util.logging.Level) + * @param newLevel new Level + * @throws java.lang.SecurityException + */ + public synchronized void setLevel (Level newLevel) + throws SecurityException + { + if (newLevel == null) + return; + super.setLevel (newLevel); + boolean enableJDBC = newLevel == Level.FINEST; + if (enableJDBC) + DriverManager.setLogWriter(m_writerOut); // lists Statements + else + DriverManager.setLogWriter(null); + } // setLevel + + /** + * Publish + * @see java.util.logging.Handler#publish(java.util.logging.LogRecord) + * @param record log record + */ + public void publish (LogRecord record) + { + if (!isLoggable (record) || m_writerOut == null) + return; + + // Format + String msg = null; + try + { + msg = getFormatter().format (record); + } + catch (Exception ex) + { + reportError ("formatting", ex, ErrorManager.FORMAT_FAILURE); + return; + } + // Output + try + { + if (!m_doneHeader) + { + m_writerOut.write (getFormatter().getHead (this)); + m_doneHeader = true; + } + if (record.getLevel() == Level.SEVERE + || record.getLevel() == Level.WARNING) + { + flush(); + m_writerErr.write (msg); + flush(); + } + else + { + m_writerOut.write (msg); + m_writerOut.flush(); + } + } + catch (Exception ex) + { + reportError ("writing", ex, ErrorManager.WRITE_FAILURE); + } + } // publish + + /** + * Flush + * @see java.util.logging.Handler#flush() + */ + public void flush () + { + try + { + if (m_writerOut != null) + m_writerOut.flush(); + } + catch (Exception ex) + { + reportError ("flush out", ex, ErrorManager.FLUSH_FAILURE); + } + try + { + if (m_writerErr != null) + m_writerErr.flush(); + } + catch (Exception ex) + { + reportError ("flush err", ex, ErrorManager.FLUSH_FAILURE); + } + } // flush + + /** + * Close + * + * @see java.util.logging.Handler#close() + * @throws SecurityException + */ + public void close () throws SecurityException + { + if (m_writerOut == null) + return; + + // Write Tail + try + { + if (!m_doneHeader) + m_writerOut.write (getFormatter().getHead(this)); + // + m_writerOut.write (getFormatter().getTail(this)); + } + catch (Exception ex) + { + reportError ("tail", ex, ErrorManager.WRITE_FAILURE); + } + // + flush(); + // Close + try + { + m_writerOut.close(); + } + catch (Exception ex) + { + reportError ("close out", ex, ErrorManager.CLOSE_FAILURE); + } + m_writerOut = null; + try + { + m_writerErr.close(); + } + catch (Exception ex) + { + reportError ("close err", ex, ErrorManager.CLOSE_FAILURE); + } + m_writerErr = null; + } // close + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("CLogConsole["); + sb.append("Level=").append(getLevel()) + .append ("]"); + return sb.toString (); + } // toString + +} // CLogConsole diff --git a/dbPort/src/org/compiere/util/CLogErrorBuffer.java b/dbPort/src/org/compiere/util/CLogErrorBuffer.java new file mode 100644 index 0000000000..8ed0969d90 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogErrorBuffer.java @@ -0,0 +1,384 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.sql.*; +import java.util.*; +import java.util.logging.*; + +import org.compiere.model.*; + +/** + * Client Error Buffer + * + * @author Jorg Janke + * @version $Id: CLogErrorBuffer.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CLogErrorBuffer extends Handler +{ + /** + * Get Client Log Handler + * @param create create if not exists + * @return handler + */ + public static CLogErrorBuffer get(boolean create) + { + if (s_handler == null && create) + s_handler = new CLogErrorBuffer(); + return s_handler; + } // get + + /** Appender */ + private static CLogErrorBuffer s_handler; + + + /************************************************************************** + * Constructor + */ + public CLogErrorBuffer () + { + if (s_handler == null) + s_handler = this; + else + reportError("Error Handler exists already", + new IllegalStateException("Existing Handler"), + ErrorManager.GENERIC_FAILURE); + initialize(); + } // CLogErrorBuffer + + /** Error Buffer Size */ + private static final int ERROR_SIZE = 20; + /** The Error Buffer */ + private LinkedList m_errors = new LinkedList(); + /** The Error Buffer History */ + private LinkedList m_history = new LinkedList(); + + /** Log Size */ + private static final int LOG_SIZE = 100; + /** The Log Buffer */ + private LinkedList m_logs = new LinkedList(); + /** Issue Error */ + private volatile boolean m_issueError = true; + + /** + * Initialize + */ + private void initialize() + { + // System.out.println("CLogConsole.initialize"); + + // Foratting + setFormatter(CLogFormatter.get()); + // Default Level + super.setLevel(Level.INFO); + // Filter + setFilter(CLogFilter.get()); + } // initialize + + /** + * Issue Error + * @return true if issue error + */ + public boolean isIssueError() + { + return m_issueError; + } // isIssueError + + /** + * Set Issue Error + * @param issueError issue error + */ + public void setIssueError(boolean issueError) + { + m_issueError = issueError; + } // setIssueError + + /** + * Set Level. + * Ignore OFF - and higer then FINE + * @see java.util.logging.Handler#setLevel(java.util.logging.Level) + * @param newLevel ignored + * @throws java.lang.SecurityException + */ + public synchronized void setLevel (Level newLevel) + throws SecurityException + { + if (newLevel == null) + return; + if (newLevel == Level.OFF) + super.setLevel(Level.SEVERE); + else if (newLevel == Level.ALL || newLevel == Level.FINEST || newLevel == Level.FINER) + super.setLevel(Level.FINE); + else + super.setLevel(newLevel); + } // SetLevel + + /** + * Publish + * @see java.util.logging.Handler#publish(java.util.logging.LogRecord) + * @param record log record + */ + public void publish (LogRecord record) + { + if (!isLoggable (record) || m_logs == null) + return; + + // Output + synchronized (m_logs) + { + if (m_logs.size() >= LOG_SIZE) + m_logs.removeFirst(); + m_logs.add(record); + } + + // We have an error + if (record.getLevel() == Level.SEVERE) + { + if (m_errors.size() >= ERROR_SIZE) + { + m_errors.removeFirst(); + m_history.removeFirst(); + } + // Add Error + m_errors.add(record); + record.getSourceClassName(); // forces Class Name eval + + // Create History + ArrayList history = new ArrayList(); + for (int i = m_logs.size()-1; i >= 0; i--) + { + LogRecord rec = (LogRecord)m_logs.get(i); + if (rec.getLevel() == Level.SEVERE) + { + if (history.size() == 0) + history.add(rec); + else + break; // don't incluse previous error + } + else + { + history.add(rec); + if (history.size() > 10) + break; // no more then 10 history records + } + + } + LogRecord[] historyArray = new LogRecord[history.size()]; + int no = 0; + for (int i = history.size()-1; i >= 0; i--) + historyArray[no++] = (LogRecord)history.get(i); + m_history.add(historyArray); + // Issue Reporting + if (m_issueError) + { + String loggerName = record.getLoggerName(); // class name + String className = record.getSourceClassName(); // physical class + String methodName = record.getSourceMethodName(); // + if (DB.isConnected() + && !methodName.equals("saveError") + && !methodName.equals("get_Value") + && !methodName.equals("dataSave") + && loggerName.indexOf("Issue") == -1 + && loggerName.indexOf("CConnection") == -1 + ) + { + m_issueError = false; + MIssue.create(record); + m_issueError = true; + } + } + } + } // publish + + /** + * Flush (NOP) + * @see java.util.logging.Handler#flush() + */ + public void flush () + { + } // flush + + /** + * Close + * @see java.util.logging.Handler#close() + * @throws SecurityException + */ + public void close () throws SecurityException + { + if (m_logs != null) + m_logs.clear(); + m_logs = null; + if (m_errors != null) + m_errors.clear(); + m_errors = null; + if (m_history != null) + m_history.clear(); + m_history = null; + } // close + + + /************************************************************************** + * Get ColumnNames of Log Entries + * @param ctx context (not used) + * @return string vector + */ + public Vector getColumnNames(Properties ctx) + { + Vector cn = new Vector(); + cn.add("Time"); + cn.add("Level"); + // + cn.add("Class.Method"); + cn.add("Message"); + //2 + cn.add("Parameter"); + cn.add("Trace"); + // + return cn; + } // getColumnNames + + /** + * Get Log Data + * @param errorsOnly if true errors otherwise log + * @return data array + */ + public Vector getLogData (boolean errorsOnly) + { + LogRecord[] records = getRecords(errorsOnly); + // System.out.println("getLogData - " + events.length); + Vector rows = new Vector(records.length); + + for (int i = 0; i < records.length; i++) + { + LogRecord record = records[i]; + Vector cols = new Vector(); + // + cols.add(new Timestamp(record.getMillis())); + cols.add(record.getLevel().getName()); + // + cols.add(CLogFormatter.getClassMethod(record)); + cols.add(record.getMessage()); + // + cols.add(CLogFormatter.getParameters(record)); + cols.add(CLogFormatter.getExceptionTrace(record)); + // + rows.add(cols); + } + return rows; + } // getData + + /** + * Get Array of events with most recent first + * @param errorsOnly if true errors otherwise log + * @return array of events + */ + public LogRecord[] getRecords (boolean errorsOnly) + { + LogRecord[] retValue = null; + if (errorsOnly) + { + synchronized (m_errors) + { + retValue = new LogRecord[m_errors.size()]; + m_errors.toArray(retValue); + } + } + else + { + synchronized (m_logs) + { + retValue = new LogRecord[m_logs.size()]; + m_logs.toArray(retValue); + } + } + return retValue; + } // getEvents + + /** + * Reset Error Buffer + * @param errorsOnly if true errors otherwise log + */ + public void resetBuffer (boolean errorsOnly) + { + synchronized (m_errors) + { + m_errors.clear(); + m_history.clear(); + } + if (!errorsOnly) + { + synchronized (m_logs) + { + m_logs.clear(); + } + } + } // resetBuffer + + /** + * Get/Put Error Info in String + * @param ctx context + * @param errorsOnly if true errors otherwise log + * @return error info + */ + public String getErrorInfo (Properties ctx, boolean errorsOnly) + { + StringBuffer sb = new StringBuffer(); + // + if (errorsOnly) + { + for (int i = 0; i < m_history.size(); i++) + { + sb.append("-------------------------------\n"); + LogRecord[] records = (LogRecord[])m_history.get(i); + for (int j = 0; j < records.length; j++) + { + LogRecord record = records[j]; + sb.append(getFormatter().format(record)); + } + } + } + else + { + for (int i = 0; i < m_logs.size(); i++) + { + LogRecord record = (LogRecord)m_logs.get(i); + sb.append(getFormatter().format(record)); + } + } + sb.append("\n"); + CLogMgt.getInfo(sb); + CLogMgt.getInfoDetail(sb, ctx); + // + return sb.toString(); + } // getErrorInfo + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("CLogErrorBuffer["); + sb.append("Errors=").append(m_errors.size()) + .append(",History=").append(m_history.size()) + .append(",Logs=").append(m_logs.size()) + .append(",Level=").append(getLevel()) + .append ("]"); + return sb.toString (); + } // toString + +} // CLogErrorBuffer diff --git a/dbPort/src/org/compiere/util/CLogFile.java b/dbPort/src/org/compiere/util/CLogFile.java new file mode 100644 index 0000000000..200436d180 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogFile.java @@ -0,0 +1,368 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.sql.*; +import java.util.logging.*; + + +/** + * Adempiere Lof File Handler + * + * @author Jorg Janke + * @version $Id: CLogFile.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $ + */ +public class CLogFile extends Handler +{ + /** + * Get File Logger + * @param create create if not exists + * @param adempiereHome adempiere home + * @param isClient client + * @return file logger + */ + public static CLogFile get (boolean create, String adempiereHome, boolean isClient) + { + if (s_logFile == null && create) + s_logFile = new CLogFile(adempiereHome, true, isClient); + return s_logFile; + } // get + + private static CLogFile s_logFile = null; + + /************************************************************************** + * Constructor + * @param adempiereHome adempiere home + * @param createLogDir create log directory if missing + * @param isClient client + */ + public CLogFile (String adempiereHome, boolean createLogDir, boolean isClient) + { + if (s_logFile == null) + s_logFile = this; + else + reportError("File Handler exists already", + new IllegalStateException("Existing Handler"), + ErrorManager.GENERIC_FAILURE); + // + if (adempiereHome != null && adempiereHome.length() > 0) + m_adempiereHome = adempiereHome; + else + m_adempiereHome = Ini.findAdempiereHome(); + initialize(m_adempiereHome, createLogDir, isClient); + } // CLogFile + + /** Adempiere Home */ + private String m_adempiereHome = null; + /** Printed header */ + private boolean m_doneHeader = false; + /** Output file */ + private File m_file = null; + /** File writer */ + private FileWriter m_writer = null; + /** Current File Name Date */ + private String m_fileNameDate = ""; + /** Record Counter */ + private int m_records = 0; + + /** + * Initialize + * @param adempiereHome log file base directory name + * @param createLogDir create log directory + * @param isClient client + */ + private void initialize(String adempiereHome, boolean createLogDir, boolean isClient) + { + // System.out.println("CLogFile.initialize"); + // Close Old File + if (m_writer != null) + close(); + m_doneHeader = false; + // New File Name + if (!createFile(adempiereHome, createLogDir, isClient)) + return; + // New Writer + try + { + m_writer = new FileWriter (m_file, true); + m_records = 0; + } + catch (Exception ex) + { + reportError ("writer", ex, ErrorManager.OPEN_FAILURE); + m_writer = null; + } + // System.out.println(getFileName()); + + // Foratting + setFormatter(CLogFormatter.get()); + // Level + setLevel(Level.ALL); + // Filter + setFilter(CLogFilter.get()); + } // initialize + + /** + * Create Log File + * @param baseDirName base log file directory name + * @param createLogDir create log directory + * @param isClient client + * @return true if cerated + */ + private boolean createFile(String baseDirName, boolean createLogDir, boolean isClient) + { + String fileName = baseDirName; + try + { + // Test AdempiereHome + if (fileName != null) + { + File dir = new File(fileName); + if (!dir.exists() || !dir.isDirectory()) + { + reportError ("Invalid base directory: " + fileName, null, ErrorManager.OPEN_FAILURE); + fileName = null; + } + } + // Test/Create AdempiereHome/log + if (fileName != null && createLogDir) + { + fileName += File.separator + "log"; + File dir = new File(fileName); + if (!dir.exists()) + dir.mkdir(); + if (!dir.exists() || !dir.isDirectory()) + { + reportError ("Invalid log directory: " + fileName, null, ErrorManager.OPEN_FAILURE); + fileName = null; + } + } + // Test/Create AdempiereHome/log/file + if (fileName != null) + { + fileName += File.separator; + if (isClient) + fileName += "client"; + m_fileNameDate = getFileNameDate(System.currentTimeMillis()); + fileName += m_fileNameDate + "_"; + for (int i = 0; i < 100; i++) + { + String finalName = fileName + i + ".log"; + File file = new File(finalName); + if (!file.exists()) + { + m_file = file; + break; + } + } + } + if (m_file == null) // Fallback create temp file + m_file = File.createTempFile("adempiere", ".log"); + } + catch (Exception ex) + { + reportError ("file", ex, ErrorManager.OPEN_FAILURE); + m_file = null; + return false; + } + return true; + } // createFile + + /** + * Get File Name Date portion + * @param time time in ms + * @return Date String + */ + public static String getFileNameDate (long time) + { + Timestamp ts = new Timestamp(time); + String s = ts.toString(); + return s.substring(0, 10); + } // getFileNameDate + + /** + * Rotate Log when day changes + * @param time time + */ + private void rotateLog (long time) + { + if (m_fileNameDate == null + || m_fileNameDate.equals(getFileNameDate(time))) + return; + rotateLog(); + } // rotateLog + + /** + * Rotate Log + * Called after Initialization + */ + public void rotateLog () + { + initialize(m_adempiereHome, true, Ini.isClient()); + } // rotateLog + + /** + * Get File Name + * @return file name + */ + public String getFileName() + { + if (m_file != null) + return m_file.getAbsolutePath(); + return ""; + } // getFileName + + /** + * Get Log Directory + * @return log directory or null + */ + public File getLogDirectory() + { + if (m_file != null) + return m_file.getParentFile(); + return null; + } // getLogDirectory + + + /** + * Set Level + * @see java.util.logging.Handler#setLevel(java.util.logging.Level) + * @param newLevel new Level + * @throws java.lang.SecurityException + */ + public synchronized void setLevel (Level newLevel) + throws SecurityException + { + if (newLevel == null) + return; + super.setLevel (newLevel); + } // setLevel + + /** + * Publish + * @see java.util.logging.Handler#publish(java.util.logging.LogRecord) + * @param record log record + */ + public void publish (LogRecord record) + { + if (!isLoggable (record) || m_writer == null) + return; + + rotateLog(record.getMillis()); + + // Format + String msg = null; + try + { + msg = getFormatter().format (record); + } + catch (Exception ex) + { + reportError ("formatting", ex, ErrorManager.FORMAT_FAILURE); + return; + } + // Output + try + { + if (!m_doneHeader) + { + m_writer.write (getFormatter().getHead (this)); + m_doneHeader = true; + } + // + m_writer.write (msg); + m_records++; + // + if (record.getLevel() == Level.SEVERE + || record.getLevel() == Level.WARNING + || m_records % 10 == 0) // flush every 10 records + flush(); + } + catch (Exception ex) + { + reportError ("writing", ex, ErrorManager.WRITE_FAILURE); + } + } // publish + + /** + * Flush + * @see java.util.logging.Handler#flush() + */ + public void flush () + { + try + { + if (m_writer != null) + m_writer.flush(); + } + catch (Exception ex) + { + reportError ("flush", ex, ErrorManager.FLUSH_FAILURE); + } + } // flush + + /** + * Close + * @see java.util.logging.Handler#close() + * @throws java.lang.SecurityException + */ + public void close () throws SecurityException + { + if (m_writer == null) + return; + + // Write Tail + try + { + if (!m_doneHeader) + m_writer.write (getFormatter().getHead(this)); + // + m_writer.write (getFormatter().getTail(this)); + } + catch (Exception ex) + { + reportError ("tail", ex, ErrorManager.WRITE_FAILURE); + } + // + flush(); + // Close + try + { + m_writer.close(); + } + catch (Exception ex) + { + reportError ("close", ex, ErrorManager.CLOSE_FAILURE); + } + m_writer = null; + m_file = null; + } // close + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("CLogFile["); + sb.append(getFileName()).append(",Level=").append(getLevel()) + .append ("]"); + return sb.toString (); + } // toString + +} // CLogFile diff --git a/dbPort/src/org/compiere/util/CLogFilter.java b/dbPort/src/org/compiere/util/CLogFilter.java new file mode 100644 index 0000000000..bf062d4cb9 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogFilter.java @@ -0,0 +1,85 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.util.logging.*; + + +/** + * Adempiere Log Filter + * + * @author Jorg Janke + * @version $Id: CLogFilter.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CLogFilter implements Filter +{ + /** + * Get Filter + * @return singleton + */ + public static CLogFilter get() + { + if (s_filter == null) + s_filter = new CLogFilter(); + return s_filter; + } + + /** Singleton */ + private static CLogFilter s_filter = null; + + /************************************************************************** + * Constructor + */ + public CLogFilter () + { + } // CLogFilter + + /** + * Loggable - Don't log core java classes + * @param record log record + * @return true + */ + public boolean isLoggable (LogRecord record) + { + if (record.getLevel() == Level.SEVERE + || record.getLevel() == Level.WARNING) + return true; + // + String loggerName = record.getLoggerName(); + if (loggerName != null) + { + // if (loggerName.toLowerCase().indexOf("focus") != -1) + // return true; + if (loggerName.startsWith("sun.") + || loggerName.startsWith("java.awt.") + || loggerName.startsWith("javax.") + ) + return false; + } + String className = record.getSourceClassName(); + if (className != null) + { + if (className.startsWith("sun.") + || className.startsWith("java.awt.") + || className.startsWith("javax.") + ) + return false; + } + return true; + } // isLoggable + +} // CLogFilter diff --git a/dbPort/src/org/compiere/util/CLogFormatter.java b/dbPort/src/org/compiere/util/CLogFormatter.java new file mode 100644 index 0000000000..8b3ac30b58 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogFormatter.java @@ -0,0 +1,317 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.awt.*; +import java.rmi.*; +import java.sql.*; +import java.util.logging.*; + + +/** + * Adempiere Log Formatter + * + * @author Jorg Janke + * @version $Id: CLogFormatter.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CLogFormatter extends Formatter +{ + /** + * Get Formatter + * @return singleton + */ + public static CLogFormatter get() + { + if (s_formatter == null) + s_formatter = new CLogFormatter(); + return s_formatter; + } // get + + /** Singleton */ + private static CLogFormatter s_formatter = null; + /** New Line */ + public static String NL = System.getProperty("line.separator"); + + /************************************************************************** + * CLogFormatter + */ + private CLogFormatter() + { + super (); + } // CLogFormatter + + /** Short Format */ + private boolean m_shortFormat = false; + + /** + * Format + * @param record log record + * @return formatted string + */ + public String format (LogRecord record) + { + StringBuffer sb = new StringBuffer(); + + long ms = record.getMillis(); + Timestamp ts = null; + if (ms == 0) + ts = new Timestamp(System.currentTimeMillis()); + else + ts = new Timestamp(ms); + String tsStr = ""; + try + { + tsStr = ts.toString() + "00"; + } + catch (Exception e) + { + System.err.println("CLogFormatter.format: Millis=" + + ms + " - " + e.toString() + " - " + record.getMessage()); + // 1 5 1 5 2 5 + tsStr = "_________________________"; + } + + + /** Time/Error */ + if (record.getLevel() == Level.SEVERE) + { // 12:12:12.123 + sb.append("===========> "); + if (Ini.isClient()) + Toolkit.getDefaultToolkit().beep(); + } + else if (record.getLevel() == Level.WARNING) + { // 12:12:12.123 + sb.append("-----------> "); + } + else + { + sb.append(tsStr.substring(11, 23)); + int spaces = 11; + if (record.getLevel() == Level.INFO) + spaces = 1; + else if (record.getLevel() == Level.CONFIG) + spaces = 3; + else if (record.getLevel() == Level.FINE) + spaces = 5; + else if (record.getLevel() == Level.FINER) + spaces = 7; + else if (record.getLevel() == Level.FINEST) + spaces = 9; + sb.append(" ".substring(0, spaces)); + } + + /** Class.method **/ + if (!m_shortFormat) + sb.append(getClassMethod(record)).append(": "); + + /** Message **/ + sb.append(record.getMessage()); + /** Parameters **/ + String parameters = getParameters(record); + if (parameters.length() > 0) + sb.append(" (").append(parameters).append(")"); + + /** Level ** + sb.append(" ") + .append(record.getLevel().getLocalizedName()); + /** Thread **/ + if (record.getThreadID() != 10) + sb.append(" [").append(record.getThreadID()).append("]"); + + // + sb.append(NL); + if (record.getThrown() != null) + sb.append(getExceptionTrace(record)).append(NL); + return sb.toString(); + } // format + + + /** + * Return the header string for a set of formatted records. + * @param h The target handler. + * @return header string + */ + public String getHead(Handler h) + { + String className = h.getClass().getName(); + int index = className.lastIndexOf('.'); + if (index != -1) + className = className.substring(index+1); + StringBuffer sb = new StringBuffer() + .append("*** ") + .append(new Timestamp(System.currentTimeMillis())) + .append(" Adempiere Log (").append(className) + .append(") ***").append(NL); + return sb.toString(); + } // getHead + + /** + * Return the tail string for a set of formatted records. + * @param h The target handler. + * @return tail string + */ + public String getTail(Handler h) + { + String className = h.getClass().getName(); + int index = className.lastIndexOf('.'); + if (index != -1) + className = className.substring(index+1); + StringBuffer sb = new StringBuffer() + .append(NL) + .append("*** ") + .append(new Timestamp(System.currentTimeMillis())) + .append(" Adempiere Log (").append(className) + .append(") ***").append(NL); + return sb.toString(); + } // getTail + + /** + * Set Format + * @param shortFormat format + */ + public void setFormat (boolean shortFormat) + { + m_shortFormat = shortFormat; + } // setFormat + + /************************************************************************** + * Get Class Method from Log Record + * @param record record + * @return class.method + */ + public static String getClassMethod (LogRecord record) + { + StringBuffer sb = new StringBuffer(); + String className = record.getLoggerName(); + if (className == null + || className.indexOf("default") != -1 // anonymous logger + || className.indexOf("global") != -1) // global logger + className = record.getSourceClassName(); + if (className != null) + { + int index = className.lastIndexOf('.'); + if (index != -1) + sb.append(className.substring(index+1)); + else + sb.append(className); + } + else + sb.append(record.getLoggerName()); + if (record.getSourceMethodName() != null) + sb.append(".").append(record.getSourceMethodName()); + String retValue = sb.toString(); + if (retValue.equals("Trace.printStack")) + return ""; + return retValue; + } // getClassMethod + + /** + * Get Log Parameters + * @param record log record + * @return parameters empty string or parameters + */ + public static String getParameters (LogRecord record) + { + StringBuffer sb = new StringBuffer(); + Object[] parameters = record.getParameters(); + if (parameters != null && parameters.length > 0) + { + for (int i = 0; i < parameters.length; i++) + { + if (i > 0) + sb.append(", "); + sb.append(parameters[i]); + } + } + return sb.toString(); + } // getParameters + + /** + * Get Log Exception + * @param record log record + * @return null if exists or string + */ + public static String getExceptionTrace (LogRecord record) + { + Throwable thrown = record.getThrown(); + if (thrown == null) + return null; + + StringBuffer sb = new StringBuffer(); + try + { + /** Print Stack ** + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + thrown.printStackTrace(pw); + pw.close(); + sb.append(sw.toString()); + /** Create Stack **/ + fillExceptionTrace(sb, "", thrown); + } + catch (Exception ex) + { + } + return sb.toString(); + } // getException + + /** + * Fill Exception Trace + * @param sb string buffer + * @param hdr header + * @param thrown thrown + */ + private static void fillExceptionTrace (StringBuffer sb, String hdr, Throwable thrown) + { + boolean firstError = hdr.length() == 0; + sb.append(hdr) + .append(thrown.toString()); + if (thrown instanceof SQLException) + { + SQLException ex = (SQLException)thrown; + sb.append("; State=").append(ex.getSQLState()) + .append("; ErrorCode=").append(ex.getErrorCode()); + } + sb.append(NL); + // + StackTraceElement[] trace = thrown.getStackTrace(); + boolean adempiereTrace = false; + int adempiereTraceNo = 0; + for (int i=0; i < trace.length; i++) + { + adempiereTrace = trace[i].getClassName().startsWith("org.compiere."); + if (thrown instanceof ServerException // RMI + || adempiereTrace) + { + if (adempiereTrace) + sb.append("\tat ").append(trace[i]).append(NL); + } + else if (i > 20 + || (i > 10 && adempiereTraceNo > 8)) + break; + else + sb.append("\tat ").append(trace[i]).append(NL); + if (adempiereTrace) + adempiereTraceNo++; + } + // + Throwable cause = thrown.getCause(); + if (cause != null) + fillExceptionTrace(sb, "caused by: ", cause); + } // fillExceptionTrace + +} // CLogFormatter diff --git a/dbPort/src/org/compiere/util/CLogMgt.java b/dbPort/src/org/compiere/util/CLogMgt.java new file mode 100644 index 0000000000..cd9fdfedde --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogMgt.java @@ -0,0 +1,700 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.net.*; +import java.sql.*; +import java.util.*; +import java.util.jar.*; +import java.util.logging.*; +import org.compiere.*; +import org.compiere.db.*; +import org.compiere.model.*; +import com.qoppa.pdf.*; + + +/** + * Adempiere Log Management. + * + * @author Jorg Janke + * @version $Id: CLogMgt.java,v 1.4 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CLogMgt +{ + /** + * Initialize Logging + * @param isClient client + */ + public static void initialize(boolean isClient) + { + if (s_handlers != null) + return; + + LogManager mgr = LogManager.getLogManager(); + try + { // Load Logging config from org.compiere.util.*properties + String fileName = "logClient.properties"; + if (!isClient) + fileName = "logServer.properties"; + InputStream in = CLogMgt.class.getResourceAsStream(fileName); + BufferedInputStream bin = new BufferedInputStream(in); + mgr.readConfiguration(bin); + in.close(); + } + catch (Exception e) + { + e.printStackTrace(); + } + + // Create Handler List + s_handlers = new ArrayList(); + try + { + Logger rootLogger = Logger.getLogger(""); + // System.out.println(rootLogger.getName() + " (" + rootLogger + ")"); + Handler[] handlers = rootLogger.getHandlers(); + for (int i = 0; i < handlers.length; i ++) + { + // System.out.println(" > " + handlers[i]); + if (!s_handlers.contains(handlers[i])) + s_handlers.add(handlers[i]); + } + /** + Enumeration en = mgr.getLoggerNames(); + while (en.hasMoreElements()) + { + Logger lll = Logger.getLogger(en.nextElement().toString()); + System.out.println(lll.getName() + " (" + lll + ")"); + // System.out.println("- level=" + lll.getLevel()); + // System.out.println("- parent=" + lll.getParent() + " - UseParentHandlers=" + lll.getUseParentHandlers()); + // System.out.println("- filter=" + lll.getFilter()); + handlers = lll.getHandlers(); + // System.out.println("- handlers=" + handlers.length); + for (int i = 0; i < handlers.length; i ++) + { + System.out.println(" > " + handlers[i]); + if (!s_handlers.contains(handlers[i])) + s_handlers.add(handlers[i]); + } + // System.out.println(); + } + /** **/ + } + catch (Exception e) + { + if (e instanceof ClassNotFoundException) // WebStart + ; + /** + Can't load log handler "org.compiere.util.CLogConsole" + java.lang.ClassNotFoundException: org.compiere.util.CLogConsole + java.lang.ClassNotFoundException: org.compiere.util.CLogConsole + at java.net.URLClassLoader$1.run(Unknown Source) + at java.security.AccessController.doPrivileged(Native Method) + at java.net.URLClassLoader.findClass(Unknown Source) + at java.lang.ClassLoader.loadClass(Unknown Source) + at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) + at java.lang.ClassLoader.loadClass(Unknown Source) + at java.util.logging.LogManager$7.run(Unknown Source) + at java.security.AccessController.doPrivileged(Native Method) + at java.util.logging.LogManager.initializeGlobalHandlers(Unknown Source) + at java.util.logging.LogManager.access$900(Unknown Source) + at java.util.logging.LogManager$RootLogger.getHandlers(Unknown Source) + at org.compiere.util.CLogMgt.initialize(CLogMgt.java:67) + at org.compiere.Adempiere.startup(Adempiere.java:389) + at org.compiere.Adempiere.main(Adempiere.java:500) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at com.sun.javaws.Launcher.executeApplication(Unknown Source) + at com.sun.javaws.Launcher.executeMainClass(Unknown Source) + at com.sun.javaws.Launcher.continueLaunch(Unknown Source) + at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) + at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) + at com.sun.javaws.Launcher.run(Unknown Source) + at java.lang.Thread.run(Unknown Source) + **/ + else + System.err.println(e.toString()); + } + // System.out.println("Handlers=" + s_handlers.size()); + + // Check Loggers + if (CLogErrorBuffer.get(false) == null) + addHandler(CLogErrorBuffer.get(true)); + if (CLogConsole.get(false) == null && isClient) + addHandler(CLogConsole.get(true)); + CLogFile fh = CLogFile.get (false, null, isClient); + if (fh == null && !isClient) + { + fh = CLogFile.get (true, null, isClient); + addHandler(fh); + } + if (fh != null && !isClient) + System.out.println(fh); + + setFormatter(CLogFormatter.get()); + setFilter(CLogFilter.get()); + // setLevel(s_currentLevel); + // setLoggerLevel(Level.ALL, null); + // + CLogMgtLog4J.initialize(isClient); + // System.out.println("Handlers=" + s_handlers.size() + ", Level=" + s_currentLevel); + } // initialize + + + /** Handlers */ + private static ArrayList s_handlers = null; + /** Current Log Level */ + private static Level s_currentLevel = Level.INFO; + + /** Logger */ + private static Logger log = Logger.getAnonymousLogger(); + /** LOG Levels */ + public static final Level[] LEVELS = new Level[] + {Level.OFF, Level.SEVERE, Level.WARNING, Level.INFO, + Level.CONFIG, Level.FINE, Level.FINER, Level.FINEST, Level.ALL}; + + /** New Line */ + private static final String NL = System.getProperty("line.separator"); + + /** + * Get Handlers + * @return handlers + */ + protected static Handler[] getHandlers() + { + Handler[] handlers = new Handler[s_handlers.size()]; + for (int i = 0; i < s_handlers.size(); i++) + handlers[i] = (Handler)s_handlers.get(i); + return handlers; + } // getHandlers + + /** + * Add Handler (to root logger) + * @param handler new Handler + */ + public static void addHandler(Handler handler) + { + if (handler == null) + return; + Logger rootLogger = Logger.getLogger(""); + rootLogger.addHandler(handler); + // + s_handlers.add(handler); + log.log(Level.CONFIG, "Handler=" + handler); + } // addHandler + + + /** + * Set Formatter for all handlers + * @param formatter formatter + */ + protected static void setFormatter (java.util.logging.Formatter formatter) + { + for (int i = 0; i < s_handlers.size(); i++) + { + Handler handler = (Handler)s_handlers.get(i); + handler.setFormatter(formatter); + } + log.log(Level.CONFIG, "Formatter=" + formatter); + } // setFormatter + + /** + * Set Filter for all handlers + * @param filter filter + */ + protected static void setFilter (Filter filter) + { + for (int i = 0; i < s_handlers.size(); i++) + { + Handler handler = (Handler)s_handlers.get(i); + handler.setFilter(filter); + } + log.log(Level.CONFIG, "Filter=" + filter); + } // setFilter + + /** + * Set Level for all Loggers + * @param level log level + * @param loggerNamePart optional partial class/logger name + */ + public static void setLoggerLevel (Level level, String loggerNamePart) + { + if (level == null) + return; + LogManager mgr = LogManager.getLogManager(); + Enumeration en = mgr.getLoggerNames(); + while (en.hasMoreElements()) + { + String name = en.nextElement().toString(); + if (loggerNamePart == null + || name.indexOf(loggerNamePart) != -1) + { + Logger lll = Logger.getLogger(name); + lll.setLevel(level); + } + } + } // setLoggerLevel + + /** + * Set Level for all handlers + * @param level log level + */ + public static void setLevel (Level level) + { + if (level == null) + return; + if (s_handlers == null) + initialize(true); + // + for (int i = 0; i < s_handlers.size(); i++) + { + Handler handler = (Handler)s_handlers.get(i); + handler.setLevel(level); + } + // JDBC if ALL + setJDBCDebug(s_currentLevel.intValue() == Level.ALL.intValue()); + // + if (level.intValue() != s_currentLevel.intValue()) + { + setLoggerLevel(level, null); + log.config(level.toString()); + } + s_currentLevel = level; + } // setHandlerLevel + + /** + * Set Level + * @param intLevel integer value of level + */ + public static void setLevel (int intLevel) + { + setLevel(String.valueOf(intLevel)); + } // setLevel + + /** + * Set Level + * @param levelString string representation of level + */ + public static void setLevel (String levelString) + { + if (levelString == null) + return; + // + for (int i = 0; i < LEVELS.length; i++) + { + if (LEVELS[i].getName().equals(levelString)) + { + setLevel(LEVELS[i]); + return; + } + } + log.log(Level.CONFIG, "Ignored: " + levelString); + } // setLevel + + /** + * Set JDBC Debug + * @param enable + */ + public static void setJDBCDebug(boolean enable) + { + if (enable) + DriverManager.setLogWriter(new PrintWriter(System.err)); + else + DriverManager.setLogWriter(null); + } // setJDBCDebug + + /** + * Get logging Level of handlers + * @return logging level + */ + public static Level getLevel() + { + return s_currentLevel; + } // getLevel + + /** + * Get logging Level of handlers + * @return logging level + */ + public static int getLevelAsInt() + { + return s_currentLevel.intValue(); + } // getLevel + + /** + * Is Logging Level logged + * @param level level + * @return true if it is logged + */ + public static boolean isLevel (Level level) + { + if (level == null) + return false; + return level.intValue() >= s_currentLevel.intValue(); + } // isLevel + + /** + * Is Logging Level FINEST logged + * @return true if it is logged + */ + public static boolean isLevelAll () + { + return Level.ALL.intValue() == s_currentLevel.intValue(); + } // isLevelFinest + + /** + * Is Logging Level FINEST logged + * @return true if it is logged + */ + public static boolean isLevelFinest () + { + return Level.FINEST.intValue() >= s_currentLevel.intValue(); + } // isLevelFinest + + /** + * Is Logging Level FINER logged + * @return true if it is logged + */ + public static boolean isLevelFiner () + { + return Level.FINER.intValue() >= s_currentLevel.intValue(); + } // isLevelFiner + + /** + * Is Logging Level FINE logged + * @return true if it is logged + */ + public static boolean isLevelFine () + { + return Level.FINE.intValue() >= s_currentLevel.intValue(); + } // isLevelFine + + /** + * Is Logging Level INFO logged + * @return true if it is logged + */ + public static boolean isLevelInfo () + { + return Level.INFO.intValue() >= s_currentLevel.intValue(); + } // isLevelFine + + /** + * Enable/Disable logging (of handlers) + * @param enableLogging true if logging enabled + */ + public static void enable (boolean enableLogging) + { + if (enableLogging) + setLevel(s_currentLevel); + else + { + Level level = s_currentLevel; + setLevel(Level.OFF); + s_currentLevel = level; + } + } // enable + + + + /** + * Shutdown Logging system + */ + public static void shutdown () + { + LogManager mgr = LogManager.getLogManager(); + mgr.reset(); + } // shutdown + + + /** + * Print Properties + * + * @param p Properties to print + * @param description Description of properties + * @param logIt if true write to Log (Level.Config), else to System.out + */ + public static void printProperties (Properties p, String description, boolean logIt) + { + if (p == null) + return; + if (logIt) + log.info(description + " - Size=" + p.size() + + ", Hash=" + p.hashCode() + "\n" + getLocalHost()); + else + System.out.println("Log.printProperties = " + description + ", Size=" + p.size() + + ", Hash=" + p.hashCode() + "\n" + getLocalHost()); + + Object[] pp = p.keySet().toArray(); + Arrays.sort(pp); + for (int i = 0; i < pp.length; i++) + { + String key = pp[i].toString(); + String value = p.getProperty(key); + if (logIt) + log.config(key + "=" + value); + else + System.out.println(" " + key + " = " + value); + } + } // printProperties + + + /** + * Get Adempiere System Info + * @param sb buffer to append or null + * @return Info as multiple Line String + */ + public static StringBuffer getInfo (StringBuffer sb) + { + if (sb == null) + sb = new StringBuffer(); + final String eq = " = "; + sb.append(getMsg("Host")).append(eq) .append(getServerInfo()).append(NL); + sb.append(getMsg("Database")).append(eq) .append(getDatabaseInfo()).append(NL); + sb.append(getMsg("Schema")).append(eq) .append(CConnection.get().getDbUid()).append(NL); + // + sb.append(getMsg("AD_User_ID")).append(eq) .append(Env.getContext(Env.getCtx(), "#AD_User_Name")).append(NL); + sb.append(getMsg("AD_Role_ID")).append(eq) .append(Env.getContext(Env.getCtx(), "#AD_Role_Name")).append(NL); + // + sb.append(getMsg("AD_Client_ID")).append(eq).append(Env.getContext(Env.getCtx(), "#AD_Client_Name")).append(NL); + sb.append(getMsg("AD_Org_ID")).append(eq) .append(Env.getContext(Env.getCtx(), "#AD_Org_Name")).append(NL); + // + sb.append(getMsg("Date")).append(eq) .append(Env.getContext(Env.getCtx(), "#Date")).append(NL); + sb.append(getMsg("Printer")).append(eq) .append(Env.getContext(Env.getCtx(), "#Printer")).append(NL); + // + Manifest mf = ZipUtil.getManifest("CClient.jar"); + if (mf == null) + mf = ZipUtil.getManifest("CTools.jar"); + if (mf != null) + { + Attributes atts = mf.getMainAttributes(); + if (atts != null) + { + Iterator it = atts.keySet().iterator(); + while (it.hasNext()) + { + Object key = it.next(); + if (key.toString().startsWith("Impl") || key.toString().startsWith("Spec")) + sb.append(key).append(eq).append(atts.get(key)).append(NL); + } + } + } + sb.append("AdempiereHome = ").append(Adempiere.getAdempiereHome()).append(NL); + sb.append(Env.getLanguage(Env.getCtx())).append(NL); + MClient client = MClient.get(Env.getCtx()); + sb.append(client).append(NL); + sb.append(getMsg("IsMultiLingualDocument")) + .append(eq).append(client.isMultiLingualDocument()).append(NL); + sb.append("BaseLanguage = ").append(Env.isBaseLanguage(Env.getCtx(), "AD_Window")) + .append("/").append(Env.isBaseLanguage(Env.getCtx(), "C_UOM")).append(NL); + sb.append("PDF License=").append(Document.isLicensed()).append(NL); + sb.append(Adempiere.getJavaInfo()).append(NL); + sb.append(Adempiere.getOSInfo()); + // + return sb; + } // getInfo + + /** + * Create System Info + * @param sb Optional string buffer + * @param ctx Environment + * @return System Info + */ + public static StringBuffer getInfoDetail (StringBuffer sb, Properties ctx) + { + if (sb == null) + sb = new StringBuffer(); + if (ctx == null) + ctx = Env.getCtx(); + // Envoronment + CConnection cc = CConnection.get(); + sb.append(NL) + .append("=== Environment === ") + .append(Adempiere.getCheckSum()).append(NL) + .append(Adempiere.getSummaryAscii()).append(NL) + .append(getLocalHost()).append(NL) + .append(cc.toStringLong()).append(NL) + .append(cc.getInfo()).append(NL); + // Context + sb.append(NL) + .append("=== Context ===").append(NL); + String[] context = Env.getEntireContext(ctx); + Arrays.sort(context); + for (int i = 0; i < context.length; i++) + sb.append(context[i]).append(NL); + // System + sb.append(NL) + .append("=== System ===").append(NL); + Object[] pp = System.getProperties().keySet().toArray(); + Arrays.sort(pp); + for (int i = 0; i < pp.length; i++) + { + String key = pp[i].toString(); + String value = System.getProperty(key); + sb.append(key).append("=").append(value).append(NL); + } + return sb; + } // getInfoDetail + + + /** + * Get translated Message, if DB connection exists + * @param msg AD_Message + * @return translated msg if connected + */ + private static String getMsg (String msg) + { + if (DB.isConnected()) + return Msg.translate(Env.getCtx(), msg); + return msg; + } // getMsg + + + /** + * Get Server Info. + * @return host : port (NotActive) via CMhost : port + */ + private static String getServerInfo() + { + StringBuffer sb = new StringBuffer(); + CConnection cc = CConnection.get(); + // Host + sb.append(cc.getAppsHost()).append(" : ") + .append(cc.getAppsPort()) + .append(" ("); + + // Server + if (cc.isAppsServerOK(false)) + sb.append(CConnection.get().getServerVersion()); + else + sb.append(getMsg("NotActive")); + // + sb.append(")\n "); + // + boolean remoteObjects = DB.isRemoteObjects(); + boolean remoteProcess = DB.isRemoteProcess(); + String realCP = CConnection.PROFILE_LAN; + if (cc.isRMIoverHTTP() && cc.isAppsServerOK(false)) + realCP = CConnection.PROFILE_WAN; + else if (remoteObjects && remoteProcess) + realCP = CConnection.PROFILE_VPN; + else if (remoteProcess) + realCP = CConnection.PROFILE_TERMINAL; + sb.append(cc.getConnectionProfileText(realCP)); + sb.append(": Tunnel=").append(cc.isRMIoverHTTP() && cc.isAppsServerOK(false)) + .append(", Objects=").append(remoteObjects) + .append(", Process=").append(remoteProcess); + + return sb.toString(); + } // getServerInfo + + /** + * Get Database Info + * @return host : port : sid + */ + private static String getDatabaseInfo() + { + StringBuffer sb = new StringBuffer(); + sb.append(CConnection.get().getDbHost()).append(" : ") + .append(CConnection.get().getDbPort()).append(" / ") + .append(CConnection.get().getDbName()); + // Connection Manager + if (CConnection.get().isViaFirewall()) + sb.append(getMsg("via")).append(" ") + .append(CConnection.get().getFwHost()).append(" : ") + .append(CConnection.get().getFwPort()); + + return sb.toString(); + } // getDatabaseInfo + + /** + * Get Localhost + * @return local host + */ + private static String getLocalHost() + { + try + { + InetAddress id = InetAddress.getLocalHost(); + return id.toString(); + } + catch (Exception e) + { + log.log(Level.SEVERE, "getLocalHost", e); + } + return "-no local host info -"; + } // getLocalHost + + + /************************************************************************** + * CLogMgt + */ + public CLogMgt () + { + testLog(); + } + + /** + * Test Log + */ + private void testLog() + { + final CLogger log1 = CLogger.getCLogger("test"); + // + log1.log(Level.SEVERE, "severe"); + log1.warning("warning"); + log1.info("Info"); + log1.config("config"); + log1.fine("fine"); + log1.finer("finer"); + log1.entering("myClass", "myMethod", "parameter"); + log1.exiting("myClass", "myMethod", "result"); + log1.finest("finest"); + + new Thread() + { + public void run() + { + log1.info("thread info"); + } + }.start(); + + try + { + Integer.parseInt("ABC"); + } + catch (Exception e) + { + log1.log(Level.SEVERE, "error message", e); + } + log1.log(Level.INFO, "info message 1", "1Param"); + log1.log(Level.INFO, "info message n", new Object[]{"1Param","2Param"}); + } // testLog + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + initialize(true); + new CLogMgt(); + } // CLogMgt + +} // CLogMgt diff --git a/dbPort/src/org/compiere/util/CLogMgtLog4J.java b/dbPort/src/org/compiere/util/CLogMgtLog4J.java new file mode 100644 index 0000000000..88ddc10185 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogMgtLog4J.java @@ -0,0 +1,66 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import org.apache.log4j.*; + +/** + * Log4J Utilities. + * Not intended to be called directly + * + * @author Jorg Janke + * @version $Id: CLogMgtLog4J.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CLogMgtLog4J +{ + /** + * Initialize Logging + * @param isClient client + */ + protected static void initialize(boolean isClient) + { + if (isClient) + { + LogManager.resetConfiguration(); + Logger rootLogger = LogManager.getRootLogger(); + rootLogger.setLevel(s_currentLevelLog4J); + } + } // initialize + + /** Current Lo4J Level */ + private static Level s_currentLevelLog4J = Level.WARN; + + + /** + * Enable/Disable Log4J logging + * @param enableLogging false assumed + */ + public static void enable (boolean enableLogging) + { + Logger rootLogger = LogManager.getRootLogger(); + if (enableLogging) + rootLogger.setLevel(s_currentLevelLog4J); + else + { + Level level = rootLogger.getLevel(); + rootLogger.setLevel(Level.OFF); + s_currentLevelLog4J = level; + } + } // enableLog4J + + +} // ClientLogMgtLog4J diff --git a/dbPort/src/org/compiere/util/CLogger.java b/dbPort/src/org/compiere/util/CLogger.java new file mode 100644 index 0000000000..d2314af190 --- /dev/null +++ b/dbPort/src/org/compiere/util/CLogger.java @@ -0,0 +1,265 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.util.logging.*; + + +/** + * Adempiere Logger + * + * @author Jorg Janke + * @version $Id: CLogger.java,v 1.3 2006/08/09 16:38:47 jjanke Exp $ + */ +public class CLogger extends Logger implements Serializable +{ + /** + * Get Logger + * @param className class name + * @return Logger + */ + public static synchronized CLogger getCLogger (String className) + { + // CLogMgt.initialize(); + LogManager manager = LogManager.getLogManager(); + if (className == null) + className = ""; + Logger result = manager.getLogger(className); + if (result != null && result instanceof CLogger) + return (CLogger)result; + // + CLogger newLogger = new CLogger(className, null); + newLogger.setLevel(CLogMgt.getLevel()); + manager.addLogger(newLogger); + return newLogger; + } // getLogger + + /** + * Get Logger + * @param clazz class name + * @return Logger + */ + public static CLogger getCLogger (Class clazz) + { + if (clazz == null) + return get(); + return getCLogger (clazz.getName()); + } // getLogger + + /** + * Get default Adempiere Logger. + * Need to be used in serialized objects + * @return logger + */ + public static CLogger get() + { + if (s_logger == null) + s_logger = getCLogger("org.compiere.default"); + return s_logger; + } // get + + /** Default Logger */ + private static CLogger s_logger = null; + + + /************************************************************************** + * Standard constructor + * @param name logger name + * @param resourceBundleName optional resource bundle (ignored) + */ + private CLogger (String name, String resourceBundleName) + { + super (name, resourceBundleName); + // setLevel(Level.ALL); + } // CLogger + + + /*************************************************************************/ + + /** Last Error Message */ + private static ValueNamePair s_lastError = null; + /** Last Exception */ + private static Exception s_lastException = null; + /** Last Warning Message */ + private static ValueNamePair s_lastWarning = null; + /** Last Info Message */ + private static ValueNamePair s_lastInfo = null; + + /** + * Set and issue Error and save as ValueNamePair + * @param AD_Message message key + * @param message clear text message + * @return true (to avoid removal of method) + */ + public boolean saveError (String AD_Message, String message) + { + return saveError (AD_Message, message, true); + } // saveError + + /** + * Set and issue Error and save as ValueNamePair + * @param AD_Message message key + * @param ex exception + * @return true (to avoid removal of method) + */ + public boolean saveError (String AD_Message, Exception ex) + { + s_lastException = ex; + return saveError (AD_Message, ex.getLocalizedMessage(), true); + } // saveError + + /** + * Set Error and save as ValueNamePair + * @param AD_Message message key + * @param message clear text message + * @param issueError print error message (default true) + * @return true + */ + public boolean saveError (String AD_Message, String message, boolean issueError) + { + s_lastError = new ValueNamePair (AD_Message, message); + // print it + if (issueError) + severe(AD_Message + " - " + message); + return true; + } // saveError + + /** + * Get Error from Stack + * @return AD_Message as Value and Message as String + */ + public static ValueNamePair retrieveError() + { + ValueNamePair vp = s_lastError; + s_lastError = null; + return vp; + } // retrieveError + + /** + * Get Error from Stack + * @return last exception + */ + public static Exception retrieveException() + { + Exception ex = s_lastException; + s_lastException = null; + return ex; + } // retrieveError + + /** + * Save Warning as ValueNamePair. + * @param AD_Message message key + * @param message clear text message + * @return true + */ + public boolean saveWarning (String AD_Message, String message) + { + s_lastWarning = new ValueNamePair (AD_Message, message); + return true; + } // saveWarning + + /** + * Get Warning from Stack + * @return AD_Message as Value and Message as String + */ + public static ValueNamePair retrieveWarning() + { + ValueNamePair vp = s_lastWarning; + s_lastWarning = null; + return vp; + } // retrieveWarning + + /** + * Save Info as ValueNamePair + * @param AD_Message message key + * @param message clear text message + * @return true + */ + public boolean saveInfo (String AD_Message, String message) + { + s_lastInfo = new ValueNamePair (AD_Message, message); + return true; + } // saveInfo + + /** + * Get Info from Stack + * @return AD_Message as Value and Message as String + */ + public static ValueNamePair retrieveInfo() + { + ValueNamePair vp = s_lastInfo; + s_lastInfo = null; + return vp; + } // retrieveInfo + + /** + * Reset Saved Messages/Errors/Info + */ + public static void resetLast() + { + s_lastError = null; + s_lastException = null; + s_lastWarning = null; + s_lastInfo = null; + } // resetLast + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("CLogger["); + sb.append (getName()) + .append (",Level=").append (getLevel()).append ("]"); + return sb.toString (); + } // toString + + /** + * Write Object - Serialization + * @param out out + * @throws IOException + * + private void writeObject (ObjectOutputStream out) throws IOException + { + out.writeObject(getName()); + System.out.println("====writeObject:" + getName()); + } // writeObject + + private String m_className = null; + + private void readObject (ObjectInputStream in) throws IOException + { + try + { + m_className = (String)in.readObject(); + } + catch (Exception e) + { + e.printStackTrace(); + } + System.out.println("====readObject:" + m_className); + } + + protected Object readResolve() throws ObjectStreamException + { + System.out.println("====readResolve:" + m_className); + return getLogger(m_className); + } + /** **/ +} // CLogger diff --git a/dbPort/src/org/compiere/util/CMemoryUsage.java b/dbPort/src/org/compiere/util/CMemoryUsage.java new file mode 100644 index 0000000000..7ceb57bb04 --- /dev/null +++ b/dbPort/src/org/compiere/util/CMemoryUsage.java @@ -0,0 +1,125 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.lang.management.*; +import java.text.*; + +/** + * Memory Usage Info + * + * @author Jorg Janke + * @version $Id: CMemoryUsage.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class CMemoryUsage extends MemoryUsage +{ + /** + * Detail Constructor + * @param init init + * @param used used + * @param committed committed + * @param max max + */ + public CMemoryUsage (long init, long used, long committed, long max) + { + super (init, used, committed, max); + } // CMemoryUsage + + /** + * Parent Constructor + * @param usage usage + */ + public CMemoryUsage (MemoryUsage usage) + { + super (usage.getInit(), usage.getUsed(), usage.getCommitted(), usage.getMax()); + } // CMemoryUsage + + /** Format */ + private static DecimalFormat s_format = DisplayType.getNumberFormat(DisplayType.Integer); + + + /** + * Get Free (Committed-Used) Memory + * @return memory + */ + public long getFree() + { + return getCommitted() - getUsed(); + } // getFree + + /** + * Get Free (Committed-Used) Memory Percent + * @return memory + */ + public int getFreePercent() + { + long base = getCommitted(); + long no = getFree() * 100; + if (no == 0) + return 0; + long percent = no/base; + return (int)percent; + } // getFree + + /** + * Get Committed (Max-Committed) Memory Percent + * @return memory + */ + public int getCommittedPercent() + { + long base = getMax(); + long no = getCommitted() * 100; + if (no == 0) + return 0; + long percent = no/base; + return (int)percent; + } // getCommittedPercent + + /** + * Format k/M + * @param info + * @return string info + */ + private String format (long info) + { + long infoK = info / 1024; + if (infoK == 0) + return String.valueOf(info); + long infoM = infoK / 1024; + if (infoM == 0) + return s_format.format(info); + return s_format.format(infoK) + "k"; + } // format + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer (); + sb.append ("Init=").append(format(getInit())) + .append (", Used=").append(format(getUsed())) + .append (", Free=").append(format(getFree())) + .append(" ").append(getFreePercent()) + .append ("%, Committed=").append(format(getCommitted())) + .append(" ").append(getCommittedPercent()) + .append ("%, Max=").append (format(getMax())); + return sb.toString (); + } // toString + +} // CMemoryUsage diff --git a/dbPort/src/org/compiere/util/CPreparedStatement.java b/dbPort/src/org/compiere/util/CPreparedStatement.java new file mode 100644 index 0000000000..ceeaa65853 --- /dev/null +++ b/dbPort/src/org/compiere/util/CPreparedStatement.java @@ -0,0 +1,1072 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.math.*; +import java.net.*; +import java.rmi.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.sql.*; +import org.compiere.db.*; +import org.compiere.interfaces.*; + +/** + * Adempiere Prepared Statement + * + * @author Jorg Janke + * @version $Id: CPreparedStatement.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CPreparedStatement extends CStatement implements PreparedStatement +{ + /** + * Prepared Statement Constructor + * + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @param sql0 unconverted sql statement + * @param trxName transaction name or null + */ + public CPreparedStatement (int resultSetType, int resultSetConcurrency, + String sql0, String trxName) + { + if (sql0 == null || sql0.length() == 0) + throw new IllegalArgumentException ("sql required"); + + p_vo = new CStatementVO (resultSetType, resultSetConcurrency, + DB.getDatabase().convertStatement(sql0)); + + // Local access + if (!DB.isRemoteObjects()) + { + try + { + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + { + if (resultSetConcurrency == ResultSet.CONCUR_UPDATABLE) + conn = DB.getConnectionRW (); + else + conn = DB.getConnectionRO(); + } + if (conn == null) + throw new DBException("No Connection"); + p_stmt = conn.prepareStatement (p_vo.getSql(), resultSetType, resultSetConcurrency); + return; + } + catch (Exception e) + { + log.log(Level.SEVERE, p_vo.getSql(), e); + } + } + } // CPreparedStatement + + /** + * Remote Constructor + * @param vo value object + */ + public CPreparedStatement (CStatementVO vo) + { + super(vo); + } // CPreparedStatement + + + /** + * Execute Query + * @return ResultSet or RowSet + * @throws SQLException + * @see java.sql.PreparedStatement#executeQuery() + */ + public ResultSet executeQuery () throws SQLException + { + if (p_stmt != null) // local + return ((PreparedStatement)p_stmt).executeQuery(); + // + // Client -> remote sever + log.finest("server => " + p_vo + ", Remote=" + DB.isRemoteObjects()); + try + { + boolean remote = DB.isRemoteObjects() && CConnection.get().isAppsServerOK(false); + if (remote && p_remoteErrors > 1) + remote = CConnection.get().isAppsServerOK(true); + if (remote) + { + Server server = CConnection.get().getServer(); + if (server != null) + { + ResultSet rs = server.pstmt_getRowSet (p_vo); + p_vo.clearParameters(); // re-use of result set + if (rs == null) + log.warning("ResultSet is null - " + p_vo); + else + p_remoteErrors = 0; + return rs; + } + log.log(Level.SEVERE, "AppsServer not found"); + p_remoteErrors++; + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + p_remoteErrors++; + } + // Try locally + log.warning("Execute locally"); + PreparedStatement pstmt = local_getPreparedStatement (false, null); // shared connection + p_vo.clearParameters(); // re-use of result set + ResultSet rs = pstmt.executeQuery(); + return rs; + } // executeQuery + + /** + * Execute Query + * @param sql0 unconverted SQL to execute + * @return ResultSet or RowSet + * @throws SQLException + * @see java.sql.Statement#executeQuery(String) + */ + public ResultSet executeQuery (String sql0) throws SQLException + { + // Convert SQL + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) // local + return p_stmt.executeQuery(p_vo.getSql()); + // + return executeQuery(); + } // executeQuery + + + /************************************************************************** + * Execute Update + * @return no of updated rows + * @throws SQLException + * @see java.sql.PreparedStatement#executeUpdate() + */ + public int executeUpdate () throws SQLException + { + if (p_stmt != null) + return ((PreparedStatement)p_stmt).executeUpdate(); + // + // Client -> remote sever + log.finest("server => " + p_vo + ", Remote=" + DB.isRemoteObjects()); + try + { + if (DB.isRemoteObjects() && CConnection.get().isAppsServerOK(false)) + { + Server server = CConnection.get().getServer(); + if (server != null) + { + int result = server.stmt_executeUpdate (p_vo); + p_vo.clearParameters(); // re-use of result set + return result; + } + log.log(Level.SEVERE, "AppsServer not found"); + } + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + // Try locally + log.warning("execute locally"); + PreparedStatement pstmt = local_getPreparedStatement (false, null); // shared connection + p_vo.clearParameters(); // re-use of result set + return pstmt.executeUpdate(); + } // executeUpdate + + /** + * Execute Update + * @param sql0 unconverted sql + * @return no of updated rows + * @throws SQLException + * @see java.sql.Statement#executeUpdate(String) + */ + public int executeUpdate (String sql0) throws SQLException + { + // Convert SQL + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) // local + return p_stmt.executeUpdate (p_vo.getSql()); + return executeUpdate(); + } // executeUpdate + + + /** + * Method execute + * @return boolean + * @throws SQLException + * @see java.sql.PreparedStatement#execute() + */ + public boolean execute () throws SQLException + { + if (p_stmt != null) + return ((PreparedStatement)p_stmt).execute(); + throw new java.lang.UnsupportedOperationException ("Method execute() not yet implemented."); + } + + + /** + * Method getMetaData + * @return ResultSetMetaData + * @throws SQLException + * @see java.sql.PreparedStatement#getMetaData() + */ + public ResultSetMetaData getMetaData () throws SQLException + { + if (p_stmt != null) + return ((PreparedStatement)p_stmt).getMetaData (); + else + throw new java.lang.UnsupportedOperationException ("Method getMetaData() not yet implemented."); + } + + /** + * Method getParameterMetaData + * @return ParameterMetaData + * @throws SQLException + * @see java.sql.PreparedStatement#getParameterMetaData() + */ + public ParameterMetaData getParameterMetaData () throws SQLException + { + if (p_stmt != null) + return ((PreparedStatement)p_stmt).getParameterMetaData(); + throw new java.lang.UnsupportedOperationException ("Method getParameterMetaData() not yet implemented."); + } + + /** + * Method addBatch + * @throws SQLException + * @see java.sql.PreparedStatement#addBatch() + */ + public void addBatch () throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).addBatch (); + else + throw new java.lang.UnsupportedOperationException ("Method addBatch() not yet implemented."); + } + + /************************************************************************** + * Set Null + * @param parameterIndex index + * @param sqlType type + * @throws SQLException + */ + public void setNull (int parameterIndex, int sqlType) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setNull (parameterIndex, sqlType); + else + p_vo.setParameter(parameterIndex, new NullParameter(sqlType)); + } // setNull + + /** + * Method setNull + * @param parameterIndex int + * @param sqlType int + * @param typeName String + * @throws SQLException + * @see java.sql.PreparedStatement#setNull(int, int, String) + */ + public void setNull (int parameterIndex, int sqlType, String typeName) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setNull (parameterIndex, sqlType); + else + p_vo.setParameter(parameterIndex, new NullParameter(sqlType)); + } + + /** + * Method setBoolean + * @param parameterIndex int + * @param x boolean + * @throws SQLException + * @see java.sql.PreparedStatement#setBoolean(int, boolean) + */ + public void setBoolean (int parameterIndex, boolean x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setBoolean (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Boolean(x)); + } + + /** + * Method setByte + * @param parameterIndex int + * @param x byte + * @throws SQLException + * @see java.sql.PreparedStatement#setByte(int, byte) + */ + public void setByte (int parameterIndex, byte x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setByte (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Byte(x)); + } + + /** + * Method setShort + * @param parameterIndex int + * @param x short + * @throws SQLException + * @see java.sql.PreparedStatement#setShort(int, short) + */ + public void setShort (int parameterIndex, short x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setShort (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Short(x)); + } + + /** + * Method setInt + * @param parameterIndex int + * @param x int + * @throws SQLException + * @see java.sql.PreparedStatement#setInt(int, int) + */ + public void setInt (int parameterIndex, int x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setInt (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Integer(x)); + } + + /** + * Method setLong + * @param parameterIndex int + * @param x long + * @throws SQLException + * @see java.sql.PreparedStatement#setLong(int, long) + */ + public void setLong (int parameterIndex, long x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setLong (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Long(x)); + } + + /** + * Method setFloat + * @param parameterIndex int + * @param x float + * @throws SQLException + * @see java.sql.PreparedStatement#setFloat(int, float) + */ + public void setFloat (int parameterIndex, float x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setFloat (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Float(x)); + } + + /** + * Method setDouble + * @param parameterIndex int + * @param x double + * @throws SQLException + * @see java.sql.PreparedStatement#setDouble(int, double) + */ + public void setDouble (int parameterIndex, double x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setDouble (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, new Double(x)); + } + + /** + * Method setBigDecimal + * @param parameterIndex int + * @param x BigDecimal + * @throws SQLException + * @see java.sql.PreparedStatement#setBigDecimal(int, BigDecimal) + */ + public void setBigDecimal (int parameterIndex, BigDecimal x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setBigDecimal (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setString + * @param parameterIndex int + * @param x String + * @throws SQLException + * @see java.sql.PreparedStatement#setString(int, String) + */ + public void setString (int parameterIndex, String x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setString (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setBytes + * @param parameterIndex int + * @param x byte[] + * @throws SQLException + * @see java.sql.PreparedStatement#setBytes(int, byte[]) + */ + public void setBytes (int parameterIndex, byte[] x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setBytes (parameterIndex, x); + else + p_vo.setParameter (parameterIndex, x); + } + + /** + * Method setDate + * @param parameterIndex int + * @param x java.sql.Date + * @throws SQLException + * @see java.sql.PreparedStatement#setDate(int, java.sql.Date) + */ + public void setDate (int parameterIndex, java.sql.Date x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setDate (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setTime + * @param parameterIndex int + * @param x Time + * @throws SQLException + * @see java.sql.PreparedStatement#setTime(int, Time) + */ + public void setTime (int parameterIndex, Time x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setTime (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setTimestamp + * @param parameterIndex int + * @param x Timestamp + * @throws SQLException + * @see java.sql.PreparedStatement#setTimestamp(int, Timestamp) + */ + public void setTimestamp (int parameterIndex, Timestamp x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setTimestamp (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setAsciiStream + * @param parameterIndex int + * @param x InputStream + * @param length int + * @throws SQLException + * @see java.sql.PreparedStatement#setAsciiStream(int, InputStream, int) + */ + public void setAsciiStream (int parameterIndex, InputStream x, int length) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setAsciiStream (parameterIndex, x, length); + else + throw new java.lang.UnsupportedOperationException ("Method setAsciiStream() not yet implemented."); + } + + /** + * @param parameterIndex the first parameter is 1, the second is 2, ... + * @param x a java.io.InputStream object that contains the + * Unicode parameter value as two-byte Unicode characters + * @param length the number of bytes in the stream + * @exception SQLException if a database access error occurs + * see java.sql.PreparedStatement#setUnicodeStream(int, InputStream, int) + * @deprecated + */ + public void setUnicodeStream (int parameterIndex, InputStream x, int length) throws SQLException + { + throw new UnsupportedOperationException ("Method setUnicodeStream() not yet implemented."); + } + + /** + * Method setBinaryStream + * @param parameterIndex int + * @param x InputStream + * @param length int + * @throws SQLException + * @see java.sql.PreparedStatement#setBinaryStream(int, InputStream, int) + */ + public void setBinaryStream (int parameterIndex, InputStream x, int length) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setBinaryStream (parameterIndex, x, length); + else + throw new java.lang.UnsupportedOperationException ("Method setBinaryStream() not yet implemented."); + } + + /** + * Method clearParameters + * @throws SQLException + * @see java.sql.PreparedStatement#clearParameters() + */ + public void clearParameters () throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).clearParameters (); + else + p_vo.clearParameters(); + } + + /** + * Method setObject + * @param parameterIndex int + * @param x Object + * @param targetSqlType int + * @param scale int + * @throws SQLException + * @see java.sql.PreparedStatement#setObject(int, Object, int, int) + */ + public void setObject (int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x, targetSqlType, scale); + else + throw new java.lang.UnsupportedOperationException ("Method setObject() not yet implemented."); + } + + /** + * Method setObject + * @param parameterIndex int + * @param x Object + * @param targetSqlType int + * @throws SQLException + * @see java.sql.PreparedStatement#setObject(int, Object, int) + */ + public void setObject (int parameterIndex, Object x, int targetSqlType) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x); + else + throw new java.lang.UnsupportedOperationException ("Method setObject() not yet implemented."); + } + + /** + * Method setObject + * @param parameterIndex int + * @param x Object + * @throws SQLException + * @see java.sql.PreparedStatement#setObject(int, Object) + */ + public void setObject (int parameterIndex, Object x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setCharacterStream + * @param parameterIndex int + * @param reader Reader + * @param length int + * @throws SQLException + * @see java.sql.PreparedStatement#setCharacterStream(int, Reader, int) + */ + public void setCharacterStream (int parameterIndex, Reader reader, int length) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setCharacterStream (parameterIndex, reader, length); + else + throw new java.lang.UnsupportedOperationException ("Method setCharacterStream() not yet implemented."); + } + + /** + * Method setRef + * @param parameterIndex int + * @param x Ref + * @throws SQLException + * @see java.sql.PreparedStatement#setRef(int, Ref) + */ + public void setRef (int parameterIndex, Ref x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setRef (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setBlob + * @param parameterIndex int + * @param x Blob + * @throws SQLException + * @see java.sql.PreparedStatement#setBlob(int, Blob) + */ + public void setBlob (int parameterIndex, Blob x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setClob + * @param parameterIndex int + * @param x Clob + * @throws SQLException + * @see java.sql.PreparedStatement#setClob(int, Clob) + */ + public void setClob (int parameterIndex, Clob x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setArray + * @param parameterIndex int + * @param x Array + * @throws SQLException + * @see java.sql.PreparedStatement#setArray(int, Array) + */ + public void setArray (int parameterIndex, Array x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * Method setDate + * @param parameterIndex int + * @param x java.sql.Date + * @param cal Calendar + * @throws SQLException + * @see java.sql.PreparedStatement#setDate(int, java.sql.Date, Calendar) + */ + public void setDate (int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setDate (parameterIndex, x, cal); + else + throw new java.lang.UnsupportedOperationException ("Method setDate() not yet implemented."); + } + + /** + * Method setTime + * @param parameterIndex int + * @param x Time + * @param cal Calendar + * @throws SQLException + * @see java.sql.PreparedStatement#setTime(int, Time, Calendar) + */ + public void setTime (int parameterIndex, Time x, Calendar cal) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setTime (parameterIndex, x, cal); + else + throw new java.lang.UnsupportedOperationException ("Method setTime() not yet implemented."); + } + + /** + * Method setTimestamp + * @param parameterIndex int + * @param x Timestamp + * @param cal Calendar + * @throws SQLException + * @see java.sql.PreparedStatement#setTimestamp(int, Timestamp, Calendar) + */ + public void setTimestamp (int parameterIndex, Timestamp x, Calendar cal) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setTimestamp (parameterIndex, x, cal); + else + throw new java.lang.UnsupportedOperationException ("Method setTimestamp() not yet implemented."); + } + + /** + * Method setURL + * @param parameterIndex int + * @param x URL + * @throws SQLException + * @see java.sql.PreparedStatement#setURL(int, URL) + */ + public void setURL (int parameterIndex, URL x) throws SQLException + { + if (p_stmt != null) + ((PreparedStatement)p_stmt).setObject (parameterIndex, x); + else + p_vo.setParameter(parameterIndex, x); + } + + /** + * String representation + * @return info + */ + public String toString() + { + if (p_stmt != null) + return "CPreparedStatement[Local=" + p_stmt + "]"; + return "CPreparedStatement[" + p_vo + "]"; + } // toString + + /************************************************************************** + * Get Prepared Statement to create RowSet and set parameters. + * Method called on Remote to execute locally. + * @param dedicatedConnection if true gets new connection - if false gets anormal RO/RW connection + * @param trxName transaction + * @return Prepared Statement + */ + private PreparedStatement local_getPreparedStatement (boolean dedicatedConnection, String trxName) + { + log.finest(p_vo.getSql()); + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + { + if (dedicatedConnection) + conn = DB.createConnection (false, Connection.TRANSACTION_READ_COMMITTED); + else + conn = local_getConnection (trxName); + } + if (conn == null) + throw new IllegalStateException("Local - No Connection"); + PreparedStatement pstmt = null; + try + { + pstmt = conn.prepareStatement(p_vo.getSql(), p_vo.getResultSetType(), p_vo.getResultSetConcurrency()); + // Set Parameters + ArrayList parameters = p_vo.getParameters(); + for (int i = 0; i < parameters.size(); i++) + { + Object o = parameters.get(i); + if (o == null) + throw new IllegalArgumentException ("Local - Null Parameter #" + i); + else if (o instanceof NullParameter) + { + int type = ((NullParameter)o).getType(); + pstmt.setNull(i+1, type); + log.finest("#" + (i+1) + " - Null"); + } + else if (o instanceof Integer) + { + pstmt.setInt(i+1, ((Integer)o).intValue()); + log.finest("#" + (i+1) + " - int=" + o); + } + else if (o instanceof String) + { + pstmt.setString(i+1, (String)o); + log.finest("#" + (i+1) + " - String=" + o); + } + else if (o instanceof Timestamp) + { + pstmt.setTimestamp(i+1, (Timestamp)o); + log.finest("#" + (i+1) + " - Timestamp=" + o); + } + else if (o instanceof BigDecimal) + { + pstmt.setBigDecimal(i+1, (BigDecimal)o); + log.finest("#" + (i+1) + " - BigDecimal=" + o); + } + else + throw new java.lang.UnsupportedOperationException ("Unknown Parameter Class=" + o.getClass()); + } + } + catch (SQLException ex) + { + log.log(Level.SEVERE, "local", ex); + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (SQLException ex1) + { + } + } + return pstmt; + } // local_getPreparedStatement + + + /** + * Get Result as RowSet for local system. + * Get explicit connection as connection is closed when closing RowSet + * @return result as RowSet + */ + public RowSet local_getRowSet() + { + log.finest("local"); + /** + try + { + AdempiereDatabase db = CConnection.get().getDatabase(); + if (db == null) + throw new IllegalStateException("No Database"); + // + PreparedStatement pstmt = local_getPreparedStatement(true, null); // decicated connection + ResultSet rs = pstmt.executeQuery(); + RowSet rowSet = db.getRowSet (rs); + rs.close(); + pstmt.close(); + // + if (rowSet == null) + throw new NullPointerException("No RowSet"); + // return rowSet; + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException(ex); + } + **/ + // dedicated connection + Connection conn = DB.createConnection (false, Connection.TRANSACTION_READ_COMMITTED); + PreparedStatement pstmt = null; + RowSet rowSet = null; + try + { + pstmt = conn.prepareStatement(p_vo.getSql(), + ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + // Set Parameters + ArrayList parameters = p_vo.getParameters(); + for (int i = 0; i < parameters.size(); i++) + { + Object o = parameters.get(i); + if (o == null) + throw new IllegalArgumentException ("Null Parameter #" + i); + else if (o instanceof NullParameter) + { + int type = ((NullParameter)o).getType(); + pstmt.setNull(i+1, type); + log.finest("#" + (i+1) + " - Null"); + } + else if (o instanceof Integer) + { + pstmt.setInt(i+1, ((Integer)o).intValue()); + log.finest("#" + (i+1) + " - int=" + o); + } + else if (o instanceof String) + { + pstmt.setString(i+1, (String)o); + log.finest("#" + (i+1) + " - String=" + o); + } + else if (o instanceof Timestamp) + { + pstmt.setTimestamp(i+1, (Timestamp)o); + log.finest("#" + (i+1) + " - Timestamp=" + o); + } + else if (o instanceof BigDecimal) + { + pstmt.setBigDecimal(i+1, (BigDecimal)o); + log.finest("#" + (i+1) + " - BigDecimal=" + o); + } + else + throw new java.lang.UnsupportedOperationException ("Unknown Parameter Class=" + o.getClass()); + } + // + ResultSet rs = pstmt.executeQuery(); + rowSet = CCachedRowSet.getRowSet(rs); + pstmt.close(); + pstmt = null; + conn.close(); + conn = null; + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + // Close Cursor + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + if (conn != null) + conn.close(); + conn = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "close", e); + } + return rowSet; + } // local_getRowSet + + /************************************************************************* + * Get Result as RowSet for Remote. + * Get shared connection for RMI! + * If RowSet is transfred via RMI, closing the RowSet does not close the connection + * @return result as RowSet + */ + public RowSet remote_getRowSet() + { + log.finest("remote"); + /** + try + { + AdempiereDatabase db = CConnection.get().getDatabase(); + if (db == null) + { + log.log(Level.SEVERE, "No Database"); + throw new NullPointerException("No Database"); + } + // + PreparedStatement pstmt = local_getPreparedStatement(false, null); // shared connection + ResultSet rs = pstmt.executeQuery(); + RowSet rowSet = db.getRowSet (rs); + rs.close(); + pstmt.close(); + // + if (rowSet != null) + return rowSet; + else + log.log(Level.SEVERE, "No RowSet"); + throw new NullPointerException("Remote - No RowSet"); + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + // return null; + **/ + // shared connection + Connection conn = local_getConnection (null); + PreparedStatement pstmt = null; + RowSet rowSet = null; + try + { + pstmt = conn.prepareStatement(p_vo.getSql(), + ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + // Set Parameters + ArrayList parameters = p_vo.getParameters(); + for (int i = 0; i < parameters.size(); i++) + { + Object o = parameters.get(i); + if (o == null) + throw new IllegalArgumentException ("Null Parameter #" + i); + else if (o instanceof NullParameter) + { + int type = ((NullParameter)o).getType(); + pstmt.setNull(i+1, type); + log.finest("#" + (i+1) + " - Null"); + } + else if (o instanceof Integer) + { + pstmt.setInt(i+1, ((Integer)o).intValue()); + log.finest("#" + (i+1) + " - int=" + o); + } + else if (o instanceof String) + { + pstmt.setString(i+1, (String)o); + log.finest("#" + (i+1) + " - String=" + o); + } + else if (o instanceof Timestamp) + { + pstmt.setTimestamp(i+1, (Timestamp)o); + log.finest("#" + (i+1) + " - Timestamp=" + o); + } + else if (o instanceof BigDecimal) + { + pstmt.setBigDecimal(i+1, (BigDecimal)o); + log.finest("#" + (i+1) + " - BigDecimal=" + o); + } + else + throw new java.lang.UnsupportedOperationException ("Unknown Parameter Class=" + o.getClass()); + } + // + // + ResultSet rs = pstmt.executeQuery(); + rowSet = CCachedRowSet.getRowSet(rs); + pstmt.close(); + pstmt = null; + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + // Close Cursor + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "close pstmt", e); + } + return rowSet; + } // remote_getRowSet + + /************************************************************************* + * Execute Update. + * @return row count + */ + public int remote_executeUpdate() + { + log.finest("Update"); + try + { + AdempiereDatabase db = CConnection.get().getDatabase(); + if (db == null) + throw new NullPointerException("Remote - No Database"); + // + PreparedStatement pstmt = local_getPreparedStatement (false, null); // shared connection + int result = pstmt.executeUpdate(); + pstmt.close(); + // + return result; + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + } // remote_executeUpdate + + +} // CPreparedStatement + diff --git a/dbPort/src/org/compiere/util/CStatement.java b/dbPort/src/org/compiere/util/CStatement.java new file mode 100644 index 0000000000..11607e0462 --- /dev/null +++ b/dbPort/src/org/compiere/util/CStatement.java @@ -0,0 +1,909 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.math.*; +import java.rmi.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.sql.*; +import org.compiere.db.*; +import org.compiere.interfaces.*; + +/** + * Adempiere Statement + * + * @author Jorg Janke + * @version $Id: CStatement.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class CStatement implements Statement +{ + /** + * Prepared Statement Constructor + * + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @param trxName transaction name or null + */ + public CStatement (int resultSetType, int resultSetConcurrency, + String trxName) + { + p_vo = new CStatementVO (resultSetType, resultSetConcurrency); + + // Local access + if (!DB.isRemoteObjects()) + { + try + { + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + { + if (resultSetConcurrency == ResultSet.CONCUR_UPDATABLE) + conn = DB.getConnectionRW (); + else + conn = DB.getConnectionRO(); + } + if (conn == null) + throw new DBException("No Connection"); + p_stmt = conn.createStatement(resultSetType, resultSetConcurrency); + return; + } + catch (SQLException e) + { + log.log(Level.SEVERE, "CStatement", e); + } + } + } // CPreparedStatement + + /** + * Minimum Constructor for sub classes + */ + protected CStatement() + { + super(); + } // CStatement + + /** + * Remote Constructor + * @param vo value object + */ + public CStatement (CStatementVO vo) + { + p_vo = vo; + } // CPreparedStatement + + + /** Logger */ + protected transient CLogger log = CLogger.getCLogger (getClass()); + /** Used if local */ + protected transient Statement p_stmt = null; + /** Value Object */ + protected CStatementVO p_vo = null; + /** Remote Errors */ + protected int p_remoteErrors = 0; + + + /** + * Execute Query + * @param sql0 unconverted SQL to execute + * @return ResultSet or RowSet + * @throws SQLException + * @see java.sql.Statement#executeQuery(String) + */ + public ResultSet executeQuery (String sql0) throws SQLException + { + // Convert SQL + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) // local + return p_stmt.executeQuery(p_vo.getSql()); + + // Client -> remote sever + log.finest("server => " + p_vo + ", Remote=" + DB.isRemoteObjects()); + try + { + boolean remote = DB.isRemoteObjects() && CConnection.get().isAppsServerOK(false); + if (remote && p_remoteErrors > 1) + remote = CConnection.get().isAppsServerOK(true); + if (remote) + { + Server server = CConnection.get().getServer(); + if (server != null) + { + ResultSet rs = server.stmt_getRowSet (p_vo); + if (rs == null) + log.warning("ResultSet is null - " + p_vo); + else + p_remoteErrors = 0; + return rs; + } + log.log(Level.SEVERE, "AppsServer not found"); + p_remoteErrors++; + } + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + p_remoteErrors++; + } + // Try locally + log.warning("execute locally"); + Statement stmt = local_getStatement (false, null); // shared connection + return stmt.executeQuery(p_vo.getSql()); + } // executeQuery + + + /** + * Execute Update + * @param sql0 unconverted sql + * @return no of updated rows + * @throws SQLException + * @see java.sql.Statement#executeUpdate(String) + */ + public int executeUpdate (String sql0) throws SQLException + { + // Convert SQL + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) // local + return p_stmt.executeUpdate (p_vo.getSql()); + + // Client -> remote sever + log.finest("server => " + p_vo + ", Remote=" + DB.isRemoteObjects()); + try + { + boolean remote = DB.isRemoteObjects() && CConnection.get().isAppsServerOK(false); + if (remote && p_remoteErrors > 1) + remote = CConnection.get().isAppsServerOK(true); + if (remote) + { + Server server = CConnection.get().getServer(); + if (server != null) + { + int result = server.stmt_executeUpdate(p_vo); + p_vo.clearParameters(); // re-use of result set + return result; + } + log.log(Level.SEVERE, "AppsServer not found"); + p_remoteErrors++; + } + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + p_remoteErrors++; + } + // Try locally + log.warning("execute locally"); + Statement pstmt = local_getStatement (false, null); // shared connection + return pstmt.executeUpdate(p_vo.getSql()); + } // executeUpdate + + /** + * Get Sql + * @return sql + */ + public String getSql() + { + if (p_vo != null) + return p_vo.getSql(); + return null; + } // getSql + + + /** + * Get Connection + * @return connection for local - or null for remote + * @throws SQLException + * @see java.sql.Statement#getConnection() + */ + public Connection getConnection () throws SQLException + { + if (p_stmt != null) + return p_stmt.getConnection(); + return null; + } // getConnection + + /** + * Commit (if local) + * @throws SQLException + */ + public void commit() throws SQLException + { + Connection conn = getConnection(); + if (conn != null && !conn.getAutoCommit()) + { + conn.commit(); + log.fine("commit"); + } + } // commit + + + /** + * Method executeUpdate + * @param sql0 String + * @param autoGeneratedKeys int + * @return int + * @throws SQLException + * @see java.sql.Statement#executeUpdate(String, int) + */ + public int executeUpdate (String sql0, int autoGeneratedKeys) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.executeUpdate(p_vo.getSql(), autoGeneratedKeys); + throw new java.lang.UnsupportedOperationException ("Method executeUpdate() not yet implemented."); + } + + /** + * Method executeUpdate + * @param sql0 String + * @param columnIndexes int[] + * @return int + * @throws SQLException + * @see java.sql.Statement#executeUpdate(String, int[]) + */ + public int executeUpdate (String sql0, int[] columnIndexes) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.executeUpdate(p_vo.getSql(), columnIndexes); + throw new java.lang.UnsupportedOperationException ("Method executeUpdate() not yet implemented."); + } + + /** + * Method executeUpdate + * @param sql0 String + * @param columnNames String[] + * @return int + * @throws SQLException + * @see java.sql.Statement#executeUpdate(String, String[]) + */ + public int executeUpdate (String sql0, String[] columnNames) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.executeUpdate(p_vo.getSql(), columnNames); + throw new java.lang.UnsupportedOperationException ("Method executeUpdate() not yet implemented."); + } + + + /** + * Method execute + * @param sql0 String + * @return boolean + * @throws SQLException + * @see java.sql.Statement#execute(String) + */ + public boolean execute (String sql0) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.execute(p_vo.getSql()); + throw new java.lang.UnsupportedOperationException ("Method execute() not yet implemented."); + } + + /** + * Method execute + * @param sql0 String + * @param autoGeneratedKeys int + * @return boolean + * @throws SQLException + * @see java.sql.Statement#execute(String, int) + */ + public boolean execute (String sql0, int autoGeneratedKeys) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.execute(p_vo.getSql(), autoGeneratedKeys); + throw new java.lang.UnsupportedOperationException ("Method execute() not yet implemented."); + } + + /** + * Method execute + * @param sql0 String + * @param columnIndexes int[] + * @return boolean + * @throws SQLException + * @see java.sql.Statement#execute(String, int[]) + */ + public boolean execute (String sql0, int[] columnIndexes) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.execute(p_vo.getSql(), columnIndexes); + throw new java.lang.UnsupportedOperationException ("Method execute() not yet implemented."); + } + + /** + * Method execute + * @param sql0 String + * @param columnNames String[] + * @return boolean + * @throws SQLException + * @see java.sql.Statement#execute(String, String[]) + */ + public boolean execute (String sql0, String[] columnNames) throws SQLException + { + p_vo.setSql(DB.getDatabase().convertStatement(sql0)); + if (p_stmt != null) + return p_stmt.execute(p_vo.getSql(), columnNames); + throw new java.lang.UnsupportedOperationException ("Method execute() not yet implemented."); + } + + + + /************************************************************************** + * Get Max Field Size + * @return field size + * @throws SQLException + * @see java.sql.Statement#getMaxFieldSize() + */ + public int getMaxFieldSize () throws SQLException + { + if (p_stmt != null) + return p_stmt.getMaxFieldSize(); + throw new java.lang.UnsupportedOperationException ("Method getMaxFieldSize() not yet implemented."); + } + + /** + * Method setMaxFieldSize + * @param max int + * @throws SQLException + * @see java.sql.Statement#setMaxFieldSize(int) + */ + public void setMaxFieldSize (int max) throws SQLException + { + if (p_stmt != null) + p_stmt.setMaxFieldSize(max); + else + throw new java.lang.UnsupportedOperationException ("Method setMaxFieldSize() not yet implemented."); + } + + /** + * Method getMaxRows + * @return int + * @throws SQLException + * @see java.sql.Statement#getMaxRows() + */ + public int getMaxRows () throws SQLException + { + if (p_stmt != null) + return p_stmt.getMaxRows(); + throw new java.lang.UnsupportedOperationException ("Method getMaxRows() not yet implemented."); + } + + /** + * Method setMaxRows + * @param max int + * @throws SQLException + * @see java.sql.Statement#setMaxRows(int) + */ + public void setMaxRows (int max) throws SQLException + { + if (p_stmt != null) + p_stmt.setMaxRows(max); + else + throw new java.lang.UnsupportedOperationException ("Method setMaxRows() not yet implemented."); + } + + /************************************************************************* + * Add Batch + * @param sql sql + * @throws SQLException + * @see java.sql.Statement#addBatch(String) + */ + public void addBatch (String sql) throws SQLException + { + if (p_stmt != null) + p_stmt.addBatch(sql); + else + throw new java.lang.UnsupportedOperationException ("Method addBatch() not yet implemented."); + } + + /** + * Method clearBatch + * @throws SQLException + * @see java.sql.Statement#clearBatch() + */ + public void clearBatch () throws SQLException + { + if (p_stmt != null) + p_stmt.clearBatch(); + else + throw new java.lang.UnsupportedOperationException ("Method clearBatch() not yet implemented."); + } + + /** + * Method executeBatch + * @return int[] + * @throws SQLException + * @see java.sql.Statement#executeBatch() + */ + public int[] executeBatch () throws SQLException + { + if (p_stmt != null) + return p_stmt.executeBatch(); + throw new java.lang.UnsupportedOperationException ("Method executeBatch() not yet implemented."); + } + + + /** + * Method getMoreResults + * @param current int + * @return boolean + * @throws SQLException + * @see java.sql.Statement#getMoreResults(int) + */ + public boolean getMoreResults (int current) throws SQLException + { + if (p_stmt != null) + return p_stmt.getMoreResults(current); + throw new java.lang.UnsupportedOperationException ("Method getMoreResults() not yet implemented."); + } + + + /** + * Method getGeneratedKeys + * @return ResultSet + * @throws SQLException + * @see java.sql.Statement#getGeneratedKeys() + */ + public ResultSet getGeneratedKeys () throws SQLException + { + if (p_stmt != null) + return p_stmt.getGeneratedKeys(); + throw new java.lang.UnsupportedOperationException ("Method getGeneratedKeys() not yet implemented."); + } + + /** + * Method getResultSetHoldability + * @return int + * @throws SQLException + * @see java.sql.Statement#getResultSetHoldability() + */ + public int getResultSetHoldability () throws SQLException + { + if (p_stmt != null) + return p_stmt.getResultSetHoldability(); + throw new java.lang.UnsupportedOperationException ("Method getResultSetHoldability() not yet implemented."); + } + + /** + * Method setEscapeProcessing + * @param enable boolean + * @throws SQLException + * @see java.sql.Statement#setEscapeProcessing(boolean) + */ + public void setEscapeProcessing (boolean enable) throws SQLException + { + if (p_stmt != null) + p_stmt.setEscapeProcessing(enable); + else + throw new java.lang.UnsupportedOperationException ("Method setEscapeProcessing() not yet implemented."); + } + + /** + * Method getQueryTimeout + * @return int + * @throws SQLException + * @see java.sql.Statement#getQueryTimeout() + */ + public int getQueryTimeout () throws SQLException + { + if (p_stmt != null) + return p_stmt.getQueryTimeout(); + throw new java.lang.UnsupportedOperationException ("Method getQueryTimeout() not yet implemented."); + } + + /** + * Method setQueryTimeout + * @param seconds int + * @throws SQLException + * @see java.sql.Statement#setQueryTimeout(int) + */ + public void setQueryTimeout (int seconds) throws SQLException + { + if (p_stmt != null) + p_stmt.setQueryTimeout (seconds); + else + throw new java.lang.UnsupportedOperationException ("Method setQueryTimeout() not yet implemented."); + } + + /** + * Method cancel + * @throws SQLException + * @see java.sql.Statement#cancel() + */ + public void cancel () throws SQLException + { + if (p_stmt != null) + p_stmt.cancel(); + else + throw new java.lang.UnsupportedOperationException ("Method cancel() not yet implemented."); + } + + /** + * Method getWarnings + * @return SQLWarning + * @throws SQLException + * @see java.sql.Statement#getWarnings() + */ + public SQLWarning getWarnings () throws SQLException + { + if (p_stmt != null) + return p_stmt.getWarnings(); + throw new java.lang.UnsupportedOperationException ("Method getWarnings() not yet implemented."); + } + + /** + * Method clearWarnings + * @throws SQLException + * @see java.sql.Statement#clearWarnings() + */ + public void clearWarnings () throws SQLException + { + if (p_stmt != null) + p_stmt.clearWarnings(); + else + throw new java.lang.UnsupportedOperationException ("Method clearWarnings() not yet implemented."); + } + + /** + * Method setCursorName + * @param name String + * @throws SQLException + * @see java.sql.Statement#setCursorName(String) + */ + public void setCursorName (String name) throws SQLException + { + if (p_stmt != null) + p_stmt.setCursorName(name); + else + throw new java.lang.UnsupportedOperationException ("Method setCursorName() not yet implemented."); + } + + + /** + * Method getResultSet + * @return ResultSet + * @throws SQLException + * @see java.sql.Statement#getResultSet() + */ + public ResultSet getResultSet () throws SQLException + { + if (p_stmt != null) + return p_stmt.getResultSet(); + throw new java.lang.UnsupportedOperationException ("Method getResultSet() not yet implemented."); + } + + /** + * Method getUpdateCount + * @return int + * @throws SQLException + * @see java.sql.Statement#getUpdateCount() + */ + public int getUpdateCount () throws SQLException + { + if (p_stmt != null) + return p_stmt.getUpdateCount(); + throw new java.lang.UnsupportedOperationException ("Method getUpdateCount() not yet implemented."); + } + + /** + * Method getMoreResults + * @return boolean + * @throws SQLException + * @see java.sql.Statement#getMoreResults() + */ + public boolean getMoreResults () throws SQLException + { + if (p_stmt != null) + return p_stmt.getMoreResults(); + throw new java.lang.UnsupportedOperationException ("Method getMoreResults() not yet implemented."); + } + + /** + * Method setFetchDirection + * @param direction int + * @throws SQLException + * @see java.sql.Statement#setFetchDirection(int) + */ + public void setFetchDirection (int direction) throws SQLException + { + if (p_stmt != null) + p_stmt.setFetchDirection(direction); + else + throw new java.lang.UnsupportedOperationException ("Method setFetchDirection() not yet implemented."); + } + + /** + * Method getFetchDirection + * @return int + * @throws SQLException + * @see java.sql.Statement#getFetchDirection() + */ + public int getFetchDirection () throws SQLException + { + if (p_stmt != null) + return p_stmt.getFetchDirection(); + throw new java.lang.UnsupportedOperationException ("Method getFetchDirection() not yet implemented."); + } + + /** + * Method setFetchSize + * @param rows int + * @throws SQLException + * @see java.sql.Statement#setFetchSize(int) + */ + public void setFetchSize (int rows) throws SQLException + { + if (p_stmt != null) + p_stmt.setFetchSize(rows); + else + throw new java.lang.UnsupportedOperationException ("Method setFetchSize() not yet implemented."); + } + + /** + * Method getFetchSize + * @return int + * @throws SQLException + * @see java.sql.Statement#getFetchSize() + */ + public int getFetchSize () throws SQLException + { + if (p_stmt != null) + return p_stmt.getFetchSize(); + throw new java.lang.UnsupportedOperationException ("Method getFetchSize() not yet implemented."); + } + + /** + * Method getResultSetConcurrency + * @return int + * @throws SQLException + * @see java.sql.Statement#getResultSetConcurrency() + */ + public int getResultSetConcurrency () throws SQLException + { + if (p_stmt != null) + return p_stmt.getResultSetConcurrency(); + throw new java.lang.UnsupportedOperationException ("Method getResultSetConcurrency() not yet implemented."); + } + + /** + * Method getResultSetType + * @return int + * @throws SQLException + * @see java.sql.Statement#getResultSetType() + */ + public int getResultSetType () throws SQLException + { + if (p_stmt != null) + return p_stmt.getResultSetType(); + throw new java.lang.UnsupportedOperationException ("Method getResultSetType() not yet implemented."); + } + + /** + * Close + * @throws SQLException + * @see java.sql.Statement#close() + */ + public void close () throws SQLException + { + if (p_stmt != null) + p_stmt.close(); + } // close + + /************************************************************************* + * Execute Update. + * @return row count + */ + public int remote_executeUpdate() + { + log.finest(""); + try + { + AdempiereDatabase db = CConnection.get().getDatabase(); + if (db == null) + throw new NullPointerException("Remote - No Database"); + // + Statement pstmt = local_getStatement (false, null); // shared connection + int result = pstmt.executeUpdate(p_vo.getSql()); + pstmt.close(); + // + return result; + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + } // remote_executeUpdate + + /************************************************************************** + * Get Prepared Statement to create RowSet. + * Method called on Remote to execute locally. + * @param dedicatedConnection if true gets new connection - if false gets anormal RO/RW connection + * @param trxName transaction + * @return Prepared Statement + */ + private Statement local_getStatement (boolean dedicatedConnection, String trxName) + { + log.finest(""); + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + { + if (dedicatedConnection) + conn = DB.createConnection (false, Connection.TRANSACTION_READ_COMMITTED); + else + conn = local_getConnection (trxName); + } + Statement stmt = null; + try + { + stmt = conn.createStatement(p_vo.getResultSetType(), p_vo.getResultSetConcurrency()); + } + catch (SQLException ex) + { + log.log(Level.SEVERE, "local", ex); + try + { + if (stmt != null) + stmt.close(); + stmt = null; + } + catch (SQLException ex1) + { + } + } + return stmt; + } // local_getStatement + + /** + * Get Local Connection + * @param trxName transaction + * @return connection + */ + protected Connection local_getConnection(String trxName) + { + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + { + if (p_vo.getResultSetConcurrency () == ResultSet.CONCUR_UPDATABLE) + conn = DB.getConnectionRW (); + else + conn = DB.getConnectionRO (); + } + return conn; + } // local_getConnection + + /************************************************************************* + * Get Result as RowSet for Remote. + * Get shared connection for RMI! + * If RowSet is transfred via RMI, closing the RowSet does not close the connection + * @return result as RowSet + */ + public RowSet remote_getRowSet() + { + log.finest("remote"); + /** + try + { + AdempiereDatabase db = CConnection.get().getDatabase(); + if (db == null) + { + log.log(Level.SEVERE, "No Database"); + throw new NullPointerException("Remote - No Database"); + } + // + Statement stmt = local_getStatement (false, null); // shared connection + ResultSet rs = stmt.executeQuery(p_vo.getSql()); + RowSet rowSet = db.getRowSet (rs); + rs.close(); + stmt.close(); + // + if (rowSet != null) + return rowSet; + else + log.log(Level.SEVERE, "No RowSet"); + throw new NullPointerException("Remore - No RowSet"); + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + // return null; + **/ + // Shared Connection + Connection conn = local_getConnection (null); + PreparedStatement pstmt = null; + RowSet rowSet = null; + try + { + pstmt = conn.prepareStatement(p_vo.getSql(), + ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); + // Set Parameters + ArrayList parameters = p_vo.getParameters(); + for (int i = 0; i < parameters.size(); i++) + { + Object o = parameters.get(i); + if (o == null) + throw new IllegalArgumentException ("Null Parameter #" + i); + else if (o instanceof NullParameter) + { + int type = ((NullParameter)o).getType(); + pstmt.setNull(i+1, type); + log.finest("#" + (i+1) + " - Null"); + } + else if (o instanceof Integer) + { + pstmt.setInt(i+1, ((Integer)o).intValue()); + log.finest("#" + (i+1) + " - int=" + o); + } + else if (o instanceof String) + { + pstmt.setString(i+1, (String)o); + log.finest("#" + (i+1) + " - String=" + o); + } + else if (o instanceof Timestamp) + { + pstmt.setTimestamp(i+1, (Timestamp)o); + log.finest("#" + (i+1) + " - Timestamp=" + o); + } + else if (o instanceof BigDecimal) + { + pstmt.setBigDecimal(i+1, (BigDecimal)o); + log.finest("#" + (i+1) + " - BigDecimal=" + o); + } + else + throw new java.lang.UnsupportedOperationException ("Unknown Parameter Class=" + o.getClass()); + } + // + ResultSet rs = pstmt.executeQuery(); + rowSet = CCachedRowSet.getRowSet(rs); + pstmt.close(); + pstmt = null; + } + catch (Exception ex) + { + log.log(Level.SEVERE, p_vo.toString(), ex); + throw new RuntimeException (ex); + } + // Close Cursor + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "close pstmt", e); + } + return rowSet; + } // remote_getRowSet + +} // CStatement diff --git a/dbPort/src/org/compiere/util/CStatementVO.java b/dbPort/src/org/compiere/util/CStatementVO.java new file mode 100644 index 0000000000..0e11d9d856 --- /dev/null +++ b/dbPort/src/org/compiere/util/CStatementVO.java @@ -0,0 +1,195 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.util.*; + +/** + * Adempiere Statement Value Object + * + * @author Jorg Janke + * @version $Id: CStatementVO.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class CStatementVO implements Serializable +{ + /** + * VO Constructor + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + */ + public CStatementVO (int resultSetType, int resultSetConcurrency) + { + setResultSetType(resultSetType); + setResultSetConcurrency(resultSetConcurrency); + } // CStatementVO + + /** + * VO Constructor + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @param sql sql + */ + public CStatementVO (int resultSetType, int resultSetConcurrency, String sql) + { + this (resultSetType, resultSetConcurrency); + setSql(sql); + } // CStatementVO + + /** Serialization Info **/ + static final long serialVersionUID = -3393389471515956399L; + + /** Type */ + private int m_resultSetType; + /** Concurrency */ + private int m_resultSetConcurrency; + /** SQL Statement */ + private String m_sql; + /** Parameters */ + private ArrayList m_parameters = new ArrayList(); + + /** + * String representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("CStatementVO["); + sb.append(getSql()); + for (int i = 0; i < m_parameters.size(); i++) + sb.append("; #").append(i+1).append("=").append(m_parameters.get(i)); + sb.append("]"); + return sb.toString(); + } // toString + + /** + * Set Parameter + * @param index1 1 based index + * @param element element + */ + public void setParameter (int index1, Object element) + { + if (element != null && !(element instanceof Serializable)) + throw new java.lang.RuntimeException("setParameter not Serializable - " + element.getClass().toString()); + int zeroIndex = index1 - 1; + if (m_parameters.size() == zeroIndex) + { + m_parameters.add(element); + } + else if (m_parameters.size() < zeroIndex) + { + while (m_parameters.size() < zeroIndex) + m_parameters.add (null); // fill with nulls + m_parameters.add(element); + } + else + m_parameters.set(zeroIndex, element); + } // setParametsr + + /** + * Clear Parameters + */ + public void clearParameters() + { + m_parameters = new ArrayList(); + } // clearParameters + + /** + * Get Parameters + * @return arraylist + */ + public ArrayList getParameters() + { + return m_parameters; + } // getParameters + + /** + * Get Parameter Count + * @return arraylist + */ + public int getParameterCount() + { + return m_parameters.size(); + } // getParameterCount + + + /** + * Get SQL + * @return sql + */ + public String getSql() + { + return m_sql; + } // getSql + + /** + * Set SQL. + * Replace ROWID with TRIM(ROWID) for remote SQL + * to convert into String as ROWID is not serialized + * @param sql sql + */ + public void setSql(String sql) + { + if (sql != null && DB.isRemoteObjects()) + { + // Handle RowID in the select part (not where clause) + int pos = sql.indexOf("ROWID"); + int posTrim = sql.indexOf("TRIM(ROWID)"); + int posWhere = sql.indexOf("WHERE"); + if (pos != -1 && posTrim == -1 && (posWhere == -1 || pos < posWhere)) + m_sql = sql.substring(0, pos) + "TRIM(ROWID)" + sql.substring(pos+5); + else + m_sql = sql; + } + else + m_sql = sql; + } // setSql + + /** + * Get ResultSet Concurrency + * @return rs concurrency + */ + public int getResultSetConcurrency() + { + return m_resultSetConcurrency; + } + /** + * Get ResultSet Type + * @return rs type + */ + public int getResultSetType() + { + return m_resultSetType; + } + /** + * Set ResultSet Type + * @param resultSetType type + */ + public void setResultSetType(int resultSetType) + { + m_resultSetType = resultSetType; + } + /** + * Set ResultSet Concurrency + * @param resultSetConcurrency concurrency + */ + public void setResultSetConcurrency(int resultSetConcurrency) + { + m_resultSetConcurrency = resultSetConcurrency; + } + +} // CStatementVO diff --git a/dbPort/src/org/compiere/util/CacheInterface.java b/dbPort/src/org/compiere/util/CacheInterface.java new file mode 100644 index 0000000000..6b1055543b --- /dev/null +++ b/dbPort/src/org/compiere/util/CacheInterface.java @@ -0,0 +1,40 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +/** + * Adempiere Cache Interface + * + * @author Jorg Janke + * @version $Id: CacheInterface.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public interface CacheInterface +{ + /** + * Reset Cache + * @return number of items reset + */ + public int reset(); + + /** + * Get Size of Cache + * @return number of items + */ + public int size(); + + +} // CacheInterface diff --git a/dbPort/src/org/compiere/util/CacheMgt.java b/dbPort/src/org/compiere/util/CacheMgt.java new file mode 100644 index 0000000000..a6c7e03192 --- /dev/null +++ b/dbPort/src/org/compiere/util/CacheMgt.java @@ -0,0 +1,244 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.rmi.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.db.*; +import org.compiere.interfaces.*; + +/** + * Adempiere Cache Manangement + * + * @author Jorg Janke + * @version $Id: CacheMgt.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class CacheMgt +{ + /** + * Get Cache Management + * @return Cache Mgr + */ + public static CacheMgt get() + { + if (s_cache == null) + s_cache = new CacheMgt(); + return s_cache; + } // get + + /** Singleton */ + private static CacheMgt s_cache = null; + + /** + * Private Constructor + */ + private CacheMgt() + { + } // CacheMgt + + /** List of Instances */ + private ArrayList m_instances = new ArrayList(); + /** List of Table Names */ + private ArrayList m_tableNames = new ArrayList(); + /** Logger */ + private static CLogger log = CLogger.getCLogger(CacheMgt.class); + + + /************************************************************************** + * Register Cache Instance + * @param instance Cache + * @return true if added + */ + @SuppressWarnings("unchecked") + public synchronized boolean register (CacheInterface instance) + { + if (instance == null) + return false; + if (instance instanceof CCache) + { + String tableName = ((CCache)instance).getName(); + m_tableNames.add(tableName); + } + return m_instances.add (instance); + } // register + + /** + * Un-Register Cache Instance + * @param instance Cache + * @return true if removed + */ + public boolean unregister (CacheInterface instance) + { + if (instance == null) + return false; + boolean found = false; + // Could be included multiple times + for (int i = m_instances.size()-1; i >= 0; i--) + { + CacheInterface stored = (CacheInterface)m_instances.get(i); + if (instance.equals(stored)) + { + m_instances.remove(i); + found = true; + } + } + return found; + } // unregister + + /************************************************************************** + * Reset All registered Cache + * @return number of deleted cache entries + */ + public int reset() + { + int counter = 0; + int total = 0; + for (int i = 0; i < m_instances.size(); i++) + { + CacheInterface stored = (CacheInterface)m_instances.get(i); + if (stored != null && stored.size() > 0) + { + log.fine(stored.toString()); + total += stored.reset(); + counter++; + } + } + log.info("#" + counter + " (" + total + ")"); + return total; + } // reset + + /** + * Reset registered Cache + * @param tableName table name + * @return number of deleted cache entries + */ + public int reset (String tableName) + { + return reset (tableName, 0); + } // reset + + /** + * Reset registered Cache + * @param tableName table name + * @param Record_ID record if applicable or 0 for all + * @return number of deleted cache entries + */ + @SuppressWarnings("unchecked") + public int reset (String tableName, int Record_ID) + { + if (tableName == null) + return reset(); + // if (tableName.endsWith("Set")) + // tableName = tableName.substring(0, tableName.length()-3); + if (!m_tableNames.contains(tableName)) + return 0; + // + int counter = 0; + int total = 0; + for (int i = 0; i < m_instances.size(); i++) + { + CacheInterface stored = (CacheInterface)m_instances.get(i); + if (stored != null && stored instanceof CCache) + { + CCache cc = (CCache)stored; + if (cc.getName().startsWith(tableName)) // reset lines/dependent too + { + // if (Record_ID == 0) + { + log.fine("(all) - " + stored); + total += stored.reset(); + counter++; + } + } + } + } + log.info(tableName + ": #" + counter + " (" + total + ")"); + // Update Server + if (DB.isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + int serverTotal = server.cacheReset(tableName, 0); + if (CLogMgt.isLevelFinest()) + log.fine("Server => " + serverTotal); + } + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + } + return total; + } // reset + + /** + * Total Cached Elements + * @return count + */ + @SuppressWarnings("unchecked") + public int getElementCount() + { + int total = 0; + for (int i = 0; i < m_instances.size(); i++) + { + CacheInterface stored = (CacheInterface)m_instances.get(i); + if (stored != null && stored.size() > 0) + { + log.fine(stored.toString()); + if (stored instanceof CCache) + total += ((CCache)stored).sizeNoExpire(); + else + total += stored.size(); + } + } + return total; + } // getElementCount + + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("CacheMgt["); + sb.append("Instances=") + .append(m_instances.size()) + .append("]"); + return sb.toString (); + } // toString + + /** + * Extended String Representation + * @return info + */ + public String toStringX () + { + StringBuffer sb = new StringBuffer ("CacheMgt["); + sb.append("Instances=") + .append(m_instances.size()) + .append(", Elements=") + .append(getElementCount()) + .append("]"); + return sb.toString (); + } // toString + +} // CCache diff --git a/dbPort/src/org/compiere/util/ConnectTest.java b/dbPort/src/org/compiere/util/ConnectTest.java new file mode 100644 index 0000000000..393e65cc92 --- /dev/null +++ b/dbPort/src/org/compiere/util/ConnectTest.java @@ -0,0 +1,191 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.net.*; +import java.util.*; +import javax.naming.*; + +import org.compiere.interfaces.*; + +/** + * Apps Server Connection Test + * + * @author Jorg Janke + * @version $Id: ConnectTest.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class ConnectTest +{ + /** + * Connection Test Constructor + * @param serverName server name or IP + */ + public ConnectTest (String serverName) + { + System.out.println("ConnectTest: " + serverName); + System.out.println(); + // + Hashtable env = new Hashtable(); + env.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); + env.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces"); + env.put(InitialContext.PROVIDER_URL, serverName); + // env.put(InitialContext.SECURITY_PROTOCOL, ""); // "ssl" + // env.put(InitialContext.SECURITY_AUTHENTICATION, "none"); // "none", "simple", "strong" + // env.put(InitialContext.SECURITY_PRINCIPAL, ""); + // env.put(InitialContext.SECURITY_CREDENTIALS, ""); + + // Get Context + System.out.println ("Creating context ..."); + System.out.println (" " + env); + InitialContext context = null; + try + { + context = new InitialContext(env); + } + catch (Exception e) + { + System.err.println("ERROR: Could not create context: " + e); + return; + } + + testJNP (serverName, context); + testEJB (serverName, context); + + } // ConnectTest + + /** + * Test JNP + * @param serverName server name + * @param context context + */ + private void testJNP (String serverName, InitialContext context) + { + // Connect to MBean + System.out.println(); + System.out.println ("Connecting to MBean ..."); + /** + try + { + String connectorName = "jmx:" + serverName + ":rmi"; + RMIAdaptor server = (RMIAdaptor) context.lookup (connectorName); + System.out.println("- have Server"); + System.out.println("- Default Domain=" + server.getDefaultDomain()); + System.out.println("- MBeanCount = " + server.getMBeanCount()); + + // ObjectName serviceName = new ObjectName ("Adempiere:service=AdempiereCtrl"); + // System.out.println("- " + serviceName + " is registered=" + server.isRegistered(serviceName)); + + // System.out.println(" - AdempiereSummary= " + // + server.getAttribute(serviceName, "AdempiereSummary")); + + Object[] params = {}; + String[] signature = {}; + } + catch (Exception e) + { + System.err.println("ERROR: Could not contact MBean: " + e); + return; + } + **/ + + // List Context + System.out.println(); + System.out.println(" Examining context ...."); + try + { + System.out.println(" Namespace=" + context.getNameInNamespace()); + System.out.println(" Environment=" + context.getEnvironment()); + System.out.println(" Context '/':"); + NamingEnumeration ne = context.list("/"); + while (ne.hasMore()) + System.out.println(" - " + ne.nextElement()); + // + System.out.println(" Context 'ejb':"); + ne = context.list("ejb"); + while (ne.hasMore()) + System.out.println(" - " + ne.nextElement()); + // + System.out.println(" Context 'ejb/adempiere':"); + ne = context.list("ejb/adempiere"); + while (ne.hasMore()) + System.out.println(" - " + ne.nextElement()); + } + catch (Exception e) + { + System.err.println("ERROR: Could not examine context: " + e); + return; + } + } // testJNP + + /** + * Test EJB + * @param serverName server name + * @param context context + */ + private void testEJB (String serverName, InitialContext context) + { + System.out.println(); + System.out.println ("Connecting to EJB server ..."); + try + { + System.out.println(" Name=" + StatusHome.JNDI_NAME); + StatusHome staHome = (StatusHome)context.lookup (StatusHome.JNDI_NAME); + System.out.println(" .. home created"); + Status sta = staHome.create(); + System.out.println(" .. bean created"); + System.out.println(" ServerVersion=" + sta.getMainVersion() + " " + sta.getDateVersion()); + sta.remove(); + System.out.println(" .. bean removed"); + } + catch (Exception e) + { + System.err.println("ERROR: Could not connect: " + e); + return; + } + + System.out.println(); + System.out.println("SUCCESS !!"); + } // testEJB + + + /************************************************************************** + * Start Method + * @param args serverName + */ + public static void main(String[] args) + { + String serverName = null; + if (args.length > 0) + serverName = args[0]; + if (serverName == null || serverName.length() == 0) + { + try + { + serverName = InetAddress.getLocalHost().getHostName(); + } + catch (UnknownHostException ex) + { + ex.printStackTrace(); + } + } + + + // Start + ConnectTest ct = new ConnectTest (serverName); + } // main + +} // ConnectionTest diff --git a/dbPort/src/org/compiere/util/DB.java b/dbPort/src/org/compiere/util/DB.java new file mode 100644 index 0000000000..6290b65f45 --- /dev/null +++ b/dbPort/src/org/compiere/util/DB.java @@ -0,0 +1,1849 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.math.*; +import java.rmi.*; +import java.sql.*; +import java.text.*; +import java.util.*; +import java.util.logging.*; +import javax.sql.*; +import javax.swing.*; +import oracle.jdbc.*; +// +import org.compiere.*; +import org.compiere.db.*; +import org.compiere.interfaces.*; +import org.compiere.model.*; +import org.compiere.process.*; + + +/** + * General Database Interface + * + * @author Jorg Janke + * @version $Id: DB.java,v 1.8 2006/10/09 00:22:29 jjanke Exp $ + */ +public final class DB +{ + /** Connection Descriptor */ + private static CConnection s_cc = null; + /** Connection Cache r/o */ + private static Connection[] s_connections = null; + /** Connection Cache Size */ + private static int s_conCacheSize = Ini.isClient() ? 3 : 3; + /** Connection counter */ + private static int s_conCount = 0; + /** Connection r/w */ + private static Connection s_connectionRW = null; + /** Connection r/w for ID */ + private static Connection s_connectionID = null; + /** Logger */ + private static CLogger log = CLogger.getCLogger (DB.class); + + /** SQL Statement Separator "; " */ + public static final String SQLSTATEMENT_SEPARATOR = "; "; + + + /************************************************************************** + * Check need for post Upgrade + * @param ctx context + * @return true if post upgrade ran - false if there was no need + */ + public static boolean afterMigration (Properties ctx) + { + // UPDATE AD_System SET IsJustMigrated='Y' + MSystem system = MSystem.get(ctx); + if (!system.isJustMigrated()) + return false; + + // Role update + log.info("Role"); + String sql = "SELECT * FROM AD_Role"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + MRole role = new MRole (ctx, rs, null); + role.updateAccessRecords(); + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, "(1)", e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + + // Release Specif stuff & Print Format + try + { + Class clazz = Class.forName("org.compiere.MigrateData"); + clazz.newInstance(); + } + catch (Exception e) + { + log.log (Level.SEVERE, "Data", e); + } + + // Language check + log.info("Language"); + MLanguage.maintain(ctx); + + // Sequence check + log.info("Sequence"); + SequenceCheck.validate(ctx); + + // Costing Setup + log.info("Costing"); + MAcctSchema[] ass = MAcctSchema.getClientAcctSchema(ctx, 0); + for (int i = 0; i < ass.length; i++) + { + ass[i].checkCosting(); + ass[i].save(); + } + + // Reset Flag + system.setIsJustMigrated(false); + return system.save(); + } // afterMigration + + /** + * Update Mail Settings for System Client and System User + */ + public static void updateMail() + { + // Get Property File + String envName = Ini.getAdempiereHome(); + if (envName == null) + return; + envName += File.separator + "AdempiereEnv.properties"; + File envFile = new File(envName); + if (!envFile.exists()) + return; + + Properties env = new Properties(); + try + { + FileInputStream in = new FileInputStream(envFile); + env.load(in); + in.close(); + } + catch (Exception e) + { + return; + } + String updated = env.getProperty("ADEMPIERE_MAIL_UPDATED"); + if (updated != null || updated.equals("Y")) + return; + + // See org.compiere.install.ConfigurationData + String server = env.getProperty("ADEMPIERE_MAIL_SERVER"); + if (server == null || server.length() == 0) + return; + String adminEMail = env.getProperty("ADEMPIERE_ADMIN_EMAIL"); + if (adminEMail == null || adminEMail.length() == 0) + return; + String mailUser = env.getProperty("ADEMPIERE_MAIL_USER"); + if (mailUser == null || mailUser.length() == 0) + return; + String mailPassword = env.getProperty("ADEMPIERE_MAIL_PASSWORD"); + // if (mailPassword == null || mailPassword.length() == 0) + // return; + // + StringBuffer sql = new StringBuffer("UPDATE AD_Client SET") + .append(" SMTPHost=").append(DB.TO_STRING(server)) + .append(", RequestEMail=").append(DB.TO_STRING(adminEMail)) + .append(", RequestUser=").append(DB.TO_STRING(mailUser)) + .append(", RequestUserPW=").append(DB.TO_STRING(mailPassword)) + .append(", IsSMTPAuthorization='Y' WHERE AD_Client_ID=0"); + int no = DB.executeUpdate(sql.toString(), null); + // + sql = new StringBuffer("UPDATE AD_User SET ") + .append(" EMail=").append(DB.TO_STRING(adminEMail)) + .append(", EMailUser=").append(DB.TO_STRING(mailUser)) + .append(", EMailUserPW=").append(DB.TO_STRING(mailUser)) + .append(" WHERE AD_User_ID IN (0,100)"); + no = DB.executeUpdate(sql.toString(), null); + // + try + { + env.setProperty("ADEMPIERE_MAIL_UPDATED", "Y"); + FileOutputStream out = new FileOutputStream(envFile); + env.store(out, ""); + out.flush(); + out.close(); + } + catch (Exception e) + { + } + + } // updateMail + + /************************************************************************** + * Set connection + * @param cc connection + */ + public static void setDBTarget (CConnection cc) + { + if (cc == null) + throw new IllegalArgumentException("Connection is NULL"); + + if (s_cc != null && s_cc.equals(cc)) + return; + + DB.closeTarget(); + // + if (s_cc == null) + s_cc = cc; + synchronized (s_cc) // use as mutex + { + s_cc = cc; + s_connections = null; + s_connectionRW = null; + } + s_cc.setDataSource(); + log.config(s_cc + " - DS=" + s_cc.isDataSource()); + // Trace.printStack(); + } // setDBTarget + + /** + * Is there a connection to the database ? + * @return true, if connected to database + */ + public static boolean isConnected() + { + boolean success = false; + CLogErrorBuffer eb = CLogErrorBuffer.get(false); + if (eb != null && eb.isIssueError()) + eb.setIssueError(false); + else + eb = null; // don't reset + try + { + success = getConnectionRW() != null; // try to get a connection + } + catch (Exception e) + { + success = false; + } + if (eb != null) + eb.setIssueError(true); + return success; + } // isConnected + + /** + * Return (pooled) r/w AutoCommit, Serializable connection. + * For Transaction control use Trx.getConnection() + * @return Connection (r/w) + */ + public static Connection getConnectionRW () + { + // check health of connection + try + { + if (s_connectionRW == null) + ; + else if (s_connectionRW.isClosed()) + { + log.finest("Closed"); + s_connectionRW = null; + } + else if (s_connectionRW instanceof OracleConnection && ((OracleConnection)s_connectionRW).pingDatabase(1) < 0) + { + log.warning("No ping"); + s_connectionRW = null; + } + else + { + if (s_connectionRW.getTransactionIsolation() != Connection.TRANSACTION_READ_COMMITTED) + s_connectionRW.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); + } + } + catch (Exception e) + { + s_connectionRW = null; + } + // Get new + if (s_connectionRW == null) + { + s_connectionRW = s_cc.getConnection (true, Connection.TRANSACTION_READ_COMMITTED); + log.finest("Con=" + s_connectionRW); + } + if (s_connectionRW == null) + throw new UnsupportedOperationException("No DBConnection"); + // + // System.err.println ("DB.getConnectionRW - " + s_connectionRW); + // Trace.printStack(); + return s_connectionRW; + } // getConnectionRW + + /** + * Return everytime a new r/w no AutoCommit, Serializable connection. + * To be used to ID + * @return Connection (r/w) + */ + public static Connection getConnectionID () + { + if (s_connectionID != null) + { + try + { + if (s_connectionID.isClosed()) + s_connectionID = null; + } + catch (Exception e) + { + s_connectionID = null; + } + } + if (s_connectionID == null) + { + s_connectionID = s_cc.getConnection (false, Connection.TRANSACTION_READ_COMMITTED); + } + if (s_connectionID == null) + throw new UnsupportedOperationException("No DBConnection"); + log.log(Level.ALL, s_connectionID.toString()); + return s_connectionID; + } // getConnectionID + + /** + * Return read committed, read/only from pool. + * @return Connection (r/o) + */ + public static Connection getConnectionRO () + { + try + { + synchronized (s_cc) // use as mutex as s_connection is null the first time + { + if (s_connections == null) + s_connections = createConnections (Connection.TRANSACTION_READ_COMMITTED); // see below + } + } + catch (Exception e) + { + log.log(Level.SEVERE, "RO", e); + } + + // check health of connection + int pos = s_conCount++; + int connectionNo = pos % s_conCacheSize; + Connection connection = s_connections[connectionNo]; + try + { + if (connection == null) + ; + else if (connection.isClosed()) + { + // RowSet.close also closes connection! + // System.out.println("DB.getConnectionRO - closed #" + connectionNo); + connection = null; + } + else if (connection instanceof OracleConnection && ((OracleConnection)connection).pingDatabase(1) < 0) + { + log.warning("No ping #" + connectionNo); + connection = null; + } + else + { + if (!connection.isReadOnly()) + connection.setReadOnly(true); + if (connection.getTransactionIsolation() != Connection.TRANSACTION_READ_COMMITTED) + connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); + } + } + catch (Exception e) + { + log.severe("#" + connectionNo + " - " + e.toString()); + connection = null; + } + // Get new + if (connection == null) + { + log.finest("Replacing connection #" + connectionNo); + connection = s_cc.getConnection (true, Connection.TRANSACTION_READ_COMMITTED); // see above + try + { + if (connection != null) + connection.setReadOnly(true); + } + catch (Exception e) + { + log.severe("Cannot set to R/O - " + e); + } + s_connections[connectionNo] = connection; + } + if (connection == null) + throw new UnsupportedOperationException("DB.getConnectionRO - @NoDBConnection@"); + log.log(Level.ALL, "#" + connectionNo + " - " + connection); + // System.err.println ("DB.getConnectionRO - " + connection); + return connection; + } // getConnectionRO + + /** + * Create new Connection. + * The connection must be closed explicitly by the application + * + * @param autoCommit auto commit + * @param trxLevel - Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_READ_COMMITTED. + * @return Connection connection + */ + public static Connection createConnection (boolean autoCommit, int trxLevel) + { + Connection conn = s_cc.getConnection (autoCommit, trxLevel); + if (CLogMgt.isLevelFinest()) + { + /** + try + { + log.finest(s_cc.getConnectionURL() + + ", UserID=" + s_cc.getDbUid() + + ", AutoCommit=" + conn.getAutoCommit() + " (" + autoCommit + ")" + + ", TrxIso=" + conn.getTransactionIsolation() + "( " + trxLevel + ")"); + } + catch (Exception e) + { + } + **/ + } + return conn; + } // createConnection + + /** + * Create new set of r/o Connections. + * R/O connection might not be supported by DB + * + * @param trxLevel - Connection.TRANSACTION_READ_UNCOMMITTED, Connection.TRANSACTION_READ_COMMITTED, Connection.TRANSACTION_REPEATABLE_READ, or Connection.TRANSACTION_READ_COMMITTED. + * @return Array of Connections (size based on s_conCacheSize) + */ + private static Connection[] createConnections (int trxLevel) + { + log.finest("(" + s_conCacheSize + ") " + s_cc.getConnectionURL() + + ", UserID=" + s_cc.getDbUid() + + ", TrxLevel=" + CConnection.getTransactionIsolationInfo(trxLevel)); + Connection cons[] = new Connection[s_conCacheSize]; + try + { + for (int i = 0; i < s_conCacheSize; i++) + { + cons[i] = s_cc.getConnection (true, trxLevel); // auto commit + if (cons[i] == null) + log.warning("Connection is NULL"); // don't use log + } + } + catch (Exception e) + { + log.severe(e.getMessage()); + } + return cons; + } // createConnections + + /** + * Get Database Driver. + * Access to database specific functionality. + * @return Adempiere Database Driver + */ + public static AdempiereDatabase getDatabase() + { + if (s_cc != null) + return s_cc.getDatabase(); + log.severe("No Database Connection"); + return null; + } // getDatabase + + /** + * Get Database Driver. + * Access to database specific functionality. + * @param URL JDBC connection url + * @return Adempiere Database Driver + */ + public static AdempiereDatabase getDatabase(String URL) + { + if (URL == null) + { + log.severe("No Database URL"); + return null; + } + if (URL.indexOf("oracle") != -1) + return new DB_Oracle(); +// if (URL.indexOf("derby") != -1) +// return new DB_Derby(); + if (URL.indexOf("db2") != -1) + return new DB_DB2(); + //begin e-evolution postgresql + if (URL.indexOf("postgresql") != -1) + return new DB_DB2(); + //end e-evolution postgresql + log.severe("No Database for " + URL); + return null; + } // getDatabase + + /** + * Do we have an Oracle DB ? + * @return true if connected to Oracle + */ + public static boolean isOracle() + { + if (s_cc != null) + return s_cc.isOracle(); + log.severe("No Database Connection"); + return false; + } // isOracle + + /** + * Do we have a Derby DB ? + * @return true if connected to Derby + */ + public static boolean isDerby() + { + if (s_cc != null) + return s_cc.isDerby(); + log.severe("No Database Connection"); + return false; + } // isDerby + + //begin vpj-cd e-evolution 02/07/2005 PostgreSQL + /** + * Do we have a Postgre DB ? + * @return true if connected to PostgreSQL + */ + public static boolean isPostgreSQL() + { + if (s_cc != null) + return s_cc.isPostgreSQL(); + log.severe("No Database"); + return false; + } // isPostgreSQL + //begin vpj-cd e-evolution 02/07/2005 PostgreSQL + /** + * Do we have a Postgre DB ? + * @return true if connected to PostgreSQL + */ +// public static boolean isEDB() +// { +// if (s_cc != null) +// return s_cc.isEDB(); +// log.severe("No Database"); +// return false; +// } // isPostgreSQL + //end vpj-cd e-evolution 02/07/2005 PostgreSQL + + /** + * Get Database Info + * @return info + */ + public static String getDatabaseInfo() + { + if (s_cc != null) + return s_cc.getDBInfo(); + return "No Database"; + } // getDatabaseInfo + + + /************************************************************************** + * Check database Version with Code version + * @param ctx context + * @return true if Database version (date) is the same + */ + public static boolean isDatabaseOK (Properties ctx) + { + // Check Version + String version = "?"; + String sql = "SELECT Version FROM AD_System"; + try + { + PreparedStatement pstmt = prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + version = rs.getString(1); + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, "Problem with AD_System Table - Run system.sql script - " + e.toString()); + return false; + } + log.info("DB_Version=" + version); + // Identical DB version + if (Adempiere.DB_VERSION.equals(version)) + return true; + + String AD_Message = "DatabaseVersionError"; + String title = org.compiere.Adempiere.getName() + " " + Msg.getMsg(ctx, AD_Message, true); + // Code assumes Database version {0}, but Database has Version {1}. + String msg = Msg.getMsg(ctx, AD_Message); // complete message + msg = MessageFormat.format(msg, new Object[] {Adempiere.DB_VERSION, version}); + Object[] options = { UIManager.get("OptionPane.noButtonText"), "Migrate" }; + int no = JOptionPane.showOptionDialog (null, msg, + title, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon"), options, options[0]); + if (no == 1) + { + JOptionPane.showMessageDialog (null, + "Start RUN_Migrate (in utils)\nSee: http://www.adempiere.com/maintain", + title, JOptionPane.INFORMATION_MESSAGE); + Env.exitEnv(1); + } + return false; + } // isDatabaseOK + + + /************************************************************************** + * Close Target + */ + public static void closeTarget() + { + boolean closed = false; + // RO connection + if (s_connections != null) + { + for (int i = 0; i < s_conCacheSize; i++) + { + try + { + if (s_connections[i] != null) + { + closed = true; + s_connections[i].close(); + } + } + catch (SQLException e) + { + log.warning("#" + i + " - " + e.getMessage()); + } + s_connections[i] = null; + } + } + s_connections = null; + // RW connection + try + { + if (s_connectionRW != null) + { + closed = true; + s_connectionRW.close(); + } + } + catch (SQLException e) + { + log.log(Level.SEVERE, "R/W", e); + } + s_connectionRW = null; + // CConnection + if (s_cc != null) + { + closed = true; + s_cc.setDataSource(null); + } + s_cc = null; + if (closed) + log.fine("closed"); + } // closeTarget + + + /************************************************************************** + * Prepare Forward Read Only Call + * @param RO_SQL sql (RO) + * @return Callable Statement + */ + public static CallableStatement prepareCall(String RO_SQL) + { + if (RO_SQL == null || RO_SQL.length() == 0) + throw new IllegalArgumentException("Required parameter missing - " + RO_SQL); + // + String sql = getDatabase().convertStatement(RO_SQL); + try + { + return getConnectionRO().prepareCall + (sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql, e); + // throw new DBException(e); + } + return null; + } // prepareCall + + + /************************************************************************** + * Prepare Read Only Statement + * @param RO_SQL sql (RO) + * @return Prepared Statement + * @deprecated + */ + public static CPreparedStatement prepareStatement (String RO_SQL) + { + return prepareStatement(RO_SQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, null); + } // prepareStatement + + /** + * Prepare Read Only Statement + * @param RO_SQL sql (RO) + * @param trxName transaction + * @return Prepared Statement + */ + public static CPreparedStatement prepareStatement (String RO_SQL, String trxName) + { + return prepareStatement(RO_SQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, trxName); + } // prepareStatement + + /** + * Prepare Statement. + * @param sql sql statement + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @return Prepared Statement r/o or r/w depending on concur + * @deprecated + */ + public static CPreparedStatement prepareStatement (String sql, + int resultSetType, int resultSetConcurrency) + { + return prepareStatement(sql, resultSetType, resultSetConcurrency, null); + } // prepareStatement + + /** + * Prepare Statement. + * @param sql sql statement + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @param trxName transaction name + * @return Prepared Statement r/o or r/w depending on concur + */ + public static CPreparedStatement prepareStatement(String sql, + int resultSetType, int resultSetConcurrency, String trxName) + { + if (sql == null || sql.length() == 0) + throw new IllegalArgumentException("No SQL"); + // + return new CPreparedStatement(resultSetType, resultSetConcurrency, sql, trxName); + } // prepareStatement + + /** + * Create Read Only Statement + * @return Statement + */ + public static Statement createStatement() + { + return createStatement (ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, null); + } // createStatement + + /** + * Create Statement. + * @param resultSetType - ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_SCROLL_SENSITIVE + * @param resultSetConcurrency - ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE + * @param trxName transaction name + * @return Statement - either r/w ir r/o depending on concur + */ + public static Statement createStatement(int resultSetType, int resultSetConcurrency, String trxName) + { + return new CStatement(resultSetType, resultSetConcurrency, trxName); + } // createStatement + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @return number of rows updated or -1 if error + * @deprecated + */ + public static int executeUpdate (String sql) + { + return executeUpdate(sql, null, false, null); + } // executeUpdate + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @param trxName optional transaction name + * @return number of rows updated or -1 if error + */ + public static int executeUpdate (String sql, String trxName) + { + return executeUpdate(sql, null, false, trxName); + } // executeUpdate + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @param ignoreError if true, no execution error is reported + * @return number of rows updated or -1 if error + * @deprecated + */ + public static int executeUpdate (String sql, boolean ignoreError) + { + return executeUpdate (sql, null, ignoreError, null); + } // executeUpdate + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @param ignoreError if true, no execution error is reported + * @param trxName transaction + * @return number of rows updated or -1 if error + */ + public static int executeUpdate (String sql, boolean ignoreError, String trxName) + { + return executeUpdate (sql, null, ignoreError, trxName); + } // executeUpdate + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @param param int param + * @param trxName transaction + * @return number of rows updated or -1 if error + */ + public static int executeUpdate (String sql, int param, String trxName) + { + return executeUpdate (sql, new Object[]{new Integer(param)}, false, trxName); + } // executeUpdate + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @param param int parameter + * @param ignoreError if true, no execution error is reported + * @param trxName transaction + * @return number of rows updated or -1 if error + */ + public static int executeUpdate (String sql, int param, boolean ignoreError, String trxName) + { + return executeUpdate (sql, new Object[]{new Integer(param)}, ignoreError, trxName); + } // executeUpdate + + /** + * Execute Update. + * saves "DBExecuteError" in Log + * @param sql sql + * @param params array of parameters + * @param ignoreError if true, no execution error is reported + * @param trxName optional transaction name + * @return number of rows updated or -1 if error + */ + public static int executeUpdate (String sql, Object[] params, boolean ignoreError, String trxName) + { + if (sql == null || sql.length() == 0) + throw new IllegalArgumentException("Required parameter missing - " + sql); + // + int no = -1; + CPreparedStatement cs = new CPreparedStatement(ResultSet.TYPE_FORWARD_ONLY, + ResultSet.CONCUR_UPDATABLE, sql, trxName); // converted in call + + try + { + // Set Parameter + if (params != null) + { + for (int i = 0; i < params.length; i++) + { + Object param = params[i]; + if (param instanceof String) + cs.setString(i+1, (String)param); + else if (param instanceof Integer) + cs.setInt(i+1, ((Integer)param).intValue()); + else if (param instanceof BigDecimal) + cs.setBigDecimal(i+1, (BigDecimal)param); + else if (param instanceof Timestamp) + cs.setTimestamp(i+1, (Timestamp)param); + } + } + // + no = cs.executeUpdate(); + // No Transaction - Commit + if (trxName == null) + { + cs.commit(); // Local commit + // Connection conn = cs.getConnection(); + // if (conn != null && !conn.getAutoCommit()) // is null for remote + // conn.commit(); + } + } + catch (SQLException e) + { + if (ignoreError) + log.log(Level.SEVERE, cs.getSql() + " [" + trxName + "] - " + e.getMessage()); + else + { + log.log(Level.SEVERE, cs.getSql() + " [" + trxName + "]", e); + log.saveError ("DBExecuteError", e); + } + // throw new DBException(e); + } + finally + { + // Always close cursor + try + { + cs.close(); + } + catch (SQLException e2) + { + log.log(Level.SEVERE, "Cannot close statement"); + } + } + return no; + } // executeUpdate + + /** + * Execute multiple Update statements. + * saves (last) "DBExecuteError" in Log + * @param sql multiple sql statements separated by "; " SQLSTATEMENT_SEPARATOR + * @param ignoreError if true, no execution error is reported + * @param trxName optional transaction name + * @return number of rows updated or -1 if error + */ + public static int executeUpdateMultiple (String sql, boolean ignoreError, String trxName) + { + if (sql == null || sql.length() == 0) + throw new IllegalArgumentException("Required parameter missing - " + sql); + int index = sql.indexOf(SQLSTATEMENT_SEPARATOR); + if (index == -1) + return executeUpdate(sql, null, ignoreError, trxName); + int no = 0; + // + String statements[] = sql.split(SQLSTATEMENT_SEPARATOR); + for (int i = 0; i < statements.length; i++) + { + log.fine(statements[i]); + no += executeUpdate(statements[i], null, ignoreError, trxName); + } + + return no; + } // executeUpdareMultiple + + /** + * Execute Update and throw exception. + * @param SQL sql + * @return number of rows updated or -1 if error + * @param trxName transaction + * @throws SQLException + */ + public static int executeUpdateEx (String SQL, String trxName) throws SQLException + { + if (SQL == null || SQL.length() == 0) + throw new IllegalArgumentException("Required parameter missing - " + SQL); + // + String sql = getDatabase().convertStatement(SQL); + int no = -1; + SQLException ex = null; + Connection conn = null; + Statement stmt = null; + try + { + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionRW (); + stmt = conn.createStatement(); + no = stmt.executeUpdate(sql); + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql + " [" + trxName + "]", e); + ex = e; + } + finally + { + // Always close cursor + try + { + stmt.close(); + } + catch (SQLException e2) + { + log.log(Level.SEVERE, "Cannot close statement"); + } + } + if (ex != null) + throw new SQLException(ex.getMessage(), ex.getSQLState(), ex.getErrorCode()); + return no; + } // execute Update + + /** + * Commit - commit on RW connection. + * Is not required as RW connection is AutoCommit (exception: with transaction) + * @param throwException if true, re-throws exception + * @param trxName transaction name + * @return true if not needed or success + * @throws SQLException + */ + public static boolean commit (boolean throwException, String trxName) throws SQLException + { + try + { + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionRW (); + // if (!conn.getAutoCommit()) + conn.commit(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, "[" + trxName + "]", e); + if (throwException) + throw e; + return false; + } + return true; + } // commit + + /** + * Rollback - rollback on RW connection. + * Is has no effect as RW connection is AutoCommit (exception: with transaction) + * @param throwException if true, re-throws exception + * @param trxName transaction name + * @return true if not needed or success + * @throws SQLException + */ + public static boolean rollback (boolean throwException, String trxName) throws SQLException + { + try + { + Connection conn = null; + Trx trx = trxName == null ? null : Trx.get(trxName, true); + if (trx != null) + conn = trx.getConnection(); + else + conn = DB.getConnectionRW (); + // if (!conn.getAutoCommit()) + conn.rollback(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, "[" + trxName + "]", e); + if (throwException) + throw e; + return false; + } + return true; + } // commit + + /** + * Get Row Set. + * When a Rowset is closed, it also closes the underlying connection. + * If the created RowSet is transfered by RMI, closing it makes no difference + * @param sql sql + * @param local local RowSet (own connection) + * @return row set or null + */ + public static RowSet getRowSet (String sql, boolean local) + { + RowSet retValue = null; + // Bugfix Gunther Hoppe, 02.09.2005 add vpj-cd e-evolution + // Begin + // CStatementVO info = new CStatementVO ( + // RowSet.TYPE_SCROLL_INSENSITIVE, RowSet.CONCUR_READ_ONLY, sql); + CStatementVO info = new CStatementVO (RowSet.TYPE_SCROLL_INSENSITIVE, RowSet.CONCUR_READ_ONLY, DB.getDatabase().convertStatement(sql)); + // End add vpj-cd e-evolution + CPreparedStatement stmt = new CPreparedStatement(info); + if (local) + { + retValue = stmt.local_getRowSet(); + } + else + { + retValue = stmt.remote_getRowSet(); + } + return retValue; + } // getRowSet + + /** + * Get Value from sql + * @param trxName trx + * @param sql sql + * @return first value or -1 + */ + public static int getSQLValue (String trxName, String sql) + { + int retValue = -1; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getInt(1); + else + log.fine("No Value " + sql); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValue + + /** + * Get Value from sql + * @param trxName trx + * @param sql sql + * @param int_param1 parameter 1 + * @return first value or -1 + */ + public static int getSQLValue (String trxName, String sql, int int_param1) + { + int retValue = -1; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + pstmt.setInt(1, int_param1); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getInt(1); + else + log.config("No Value " + sql + " - Param1=" + int_param1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql + " - Param1=" + int_param1 + " [" + trxName + "]", e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValue + + /** + * Get Value from sql + * @param trxName trx + * @param sql sql + * @param int_param1 parameter 1 + * @param int_param2 parameter 2 + * @return first value or -1 + */ + public static int getSQLValue (String trxName, String sql, int int_param1, int int_param2) + { + int retValue = -1; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + pstmt.setInt(1, int_param1); + pstmt.setInt(2, int_param2); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getInt(1); + else + log.info("No Value " + sql + + " - Param1=" + int_param1 + ",Param2=" + int_param2); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql + " - Param1=" + int_param1 + ",Param2=" + int_param2 + + " [" + trxName + "]", e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValue + + /** + * Get Value from sql + * @param trxName trx + * @param sql sql + * @param str_param1 parameter 1 + * @return first value or -1 + */ + public static int getSQLValue (String trxName, String sql, String str_param1) + { + int retValue = -1; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + pstmt.setString(1, str_param1); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getInt(1); + else + log.info("No Value " + sql + " - Param1=" + str_param1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql + " - Param1=" + str_param1, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValue + + /** + * Get Value from sql + * @param trxName trx + * @param sql sql + * @param int_param1 parameter 1 + * @param s_param2 parameter 2 + * @return first value or -1 + */ + public static int getSQLValue (String trxName, String sql, int int_param1, String s_param2) + { + int retValue = -1; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + pstmt.setInt(1, int_param1); + pstmt.setString(2, s_param2); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getInt(1); + else + log.info("No Value: " + sql + " - Param1=" + int_param1 + ",Param2=" + s_param2); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql + " - Param1=" + int_param1 + ",Param2=" + s_param2, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValue + + /** + * Get String Value from sql + * @param trxName trx + * @param sql sql + * @param int_param1 parameter 1 + * @return first value or null + */ + public static String getSQLValueString (String trxName, String sql, int int_param1) + { + String retValue = null; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + pstmt.setInt(1, int_param1); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getString(1); + else + log.info("No Value " + sql + " - Param1=" + int_param1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql + " - Param1=" + int_param1, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValueString + + /** + * Get BigDecimal Value from sql + * @param trxName trx + * @param sql sql + * @param int_param1 parameter 1 + * @return first value or null + */ + public static BigDecimal getSQLValueBD (String trxName, String sql, int int_param1) + { + BigDecimal retValue = null; + PreparedStatement pstmt = null; + try + { + pstmt = prepareStatement(sql, trxName); + pstmt.setInt(1, int_param1); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + retValue = rs.getBigDecimal(1); + else + log.info("No Value " + sql + " - Param1=" + int_param1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql + " - Param1=" + int_param1 + " [" + trxName + "]", e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return retValue; + } // getSQLValueBD + + + /** + * Get Array of Key Name Pairs + * @param sql select with id / name as first / second column + * @param optional if true (-1,"") is added + * @return array of key name pairs + */ + public static KeyNamePair[] getKeyNamePairs(String sql, boolean optional) + { + PreparedStatement pstmt = null; + ArrayList list = new ArrayList(); + if (optional) + list.add (new KeyNamePair(-1, "")); + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + list.add(new KeyNamePair(rs.getInt(1), rs.getString(2))); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + KeyNamePair[] retValue = new KeyNamePair[list.size()]; + list.toArray(retValue); + // s_log.fine("getKeyNamePairs #" + retValue.length); + return retValue; + } // getKeyNamePairs + + /** + * Is Sales Order Trx. + * Assumes Sales Order. Queries IsSOTrx of table with where clause + * @param TableName table + * @param whereClause where clause + * @return true (default) or false if tested that not SO + */ + public static boolean isSOTrx (String TableName, String whereClause) + { + if (TableName == null || TableName.length() == 0) + { + log.severe("No TableName"); + return true; + } + if (whereClause == null || whereClause.length() == 0) + { + log.severe("No Where Clause"); + return true; + } + // + boolean isSOTrx = true; + String sql = "SELECT IsSOTrx FROM " + TableName + + " WHERE " + whereClause; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + ResultSet rs = pstmt.executeQuery (); + if (rs.next ()) + isSOTrx = "Y".equals(rs.getString(1)); + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + if (TableName.endsWith("Line")) + { + String hdr = TableName.substring(0, TableName.indexOf("Line")); + sql = "SELECT IsSOTrx FROM " + hdr + + " h WHERE EXISTS (SELECT * FROM " + TableName + + " l WHERE h." + hdr + "_ID=l." + hdr + "_ID AND " + + whereClause + ")"; + PreparedStatement pstmt2 = null; + try + { + pstmt2 = DB.prepareStatement (sql, null); + ResultSet rs2 = pstmt2.executeQuery (); + if (rs2.next ()) + isSOTrx = "Y".equals(rs2.getString(1)); + rs2.close (); + pstmt2.close (); + pstmt2 = null; + } + catch (Exception ee) + { + log.finest(sql + " - " + e.getMessage()); + } + try + { + if (pstmt2 != null) + pstmt2.close (); + pstmt2 = null; + } + catch (Exception ee) + { + pstmt2 = null; + } + } + else + { + log.finest(TableName + " - No SOTrx"); + // log.finest(sql + " - " + e.getMessage()); + } + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return isSOTrx; + } // isSOTrx + + + /************************************************************************** + * Get next number for Key column = 0 is Error. + * * @param ctx client + @param TableName table name + * @param trxName optionl transaction name + * @return next no + */ + public static int getNextID (Properties ctx, String TableName, String trxName) + { + if (ctx == null) + throw new IllegalArgumentException("Context missing"); + if (TableName == null || TableName.length() == 0) + throw new IllegalArgumentException("TableName missing"); + return getNextID(Env.getAD_Client_ID(ctx), TableName, trxName); + } // getNextID + + /** + * Get next number for Key column = 0 is Error. + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return next no + */ + public static int getNextID (int AD_Client_ID, String TableName, String trxName) + { + if ((trxName == null || trxName.length() == 0) && isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + int id = server.getNextID(AD_Client_ID, TableName, null); + log.finest("server => " + id); + if (id < 0) + throw new DBException("No NextID"); + return id; + } + log.log(Level.SEVERE, "AppsServer not found - " + TableName); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + // Try locally + } + int id = MSequence.getNextID (AD_Client_ID, TableName, trxName); // tries 3 times + // if (id <= 0) + // throw new DBException("No NextID (" + id + ")"); + return id; + } // getNextID + + /** + * Get Document No based on Document Type + * @param C_DocType_ID document type + * @param trxName optional Transaction Name + * @return document no or null + */ + public static String getDocumentNo(int C_DocType_ID, String trxName) + { + if ((trxName == null || trxName.length() == 0) && isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + String dn = server.getDocumentNo (C_DocType_ID, trxName); + log.finest("Server => " + dn); + if (dn != null) + return dn; + } + log.log(Level.SEVERE, "AppsServer not found - " + C_DocType_ID); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + } + // fallback + String dn = MSequence.getDocumentNo (C_DocType_ID, trxName); + if (dn == null) // try again + dn = MSequence.getDocumentNo (C_DocType_ID, trxName); + // if (dn == null) + // throw new DBException ("No DocumentNo"); + return dn; + } // getDocumentNo + + + /** + * Get Document No from table + * @param AD_Client_ID client + * @param TableName table name + * @param trxName optional Transaction Name + * @return document no or null + */ + public static String getDocumentNo (int AD_Client_ID, String TableName, String trxName) + { + if ((trxName == null || trxName.length() == 0) && isRemoteObjects()) + { + Server server = CConnection.get().getServer(); + try + { + if (server != null) + { // See ServerBean + String dn = server.getDocumentNo (AD_Client_ID, TableName, trxName); + log.finest("Server => " + dn); + if (dn != null) + return dn; + } + log.log(Level.SEVERE, "AppsServer not found - " + TableName); + } + catch (RemoteException ex) + { + log.log(Level.SEVERE, "AppsServer error", ex); + } + } + // fallback + String dn = MSequence.getDocumentNo (AD_Client_ID, TableName, trxName); + if (dn == null) // try again + dn = MSequence.getDocumentNo (AD_Client_ID, TableName, trxName); + if (dn == null) + throw new DBException ("No DocumentNo"); + return dn; + } // getDocumentNo + + /** + * Get Document Number for current document. + *
+ * - first search for DocType based Document No + * - then Search for DocumentNo based on TableName + * @param ctx context + * @param WindowNo window + * @param TableName table + * @param onlyDocType Do not search for document no based on TableName + * @param trxName optional Transaction Name + * @return DocumentNo or null, if no doc number defined + */ + public static String getDocumentNo (Properties ctx, int WindowNo, + String TableName, boolean onlyDocType, String trxName) + { + if (ctx == null || TableName == null || TableName.length() == 0) + throw new IllegalArgumentException("Required parameter missing"); + int AD_Client_ID = Env.getContextAsInt(ctx, WindowNo, "AD_Client_ID"); + + // Get C_DocType_ID from context - NO Defaults - + int C_DocType_ID = Env.getContextAsInt(ctx, WindowNo + "|C_DocTypeTarget_ID"); + if (C_DocType_ID == 0) + C_DocType_ID = Env.getContextAsInt(ctx, WindowNo + "|C_DocType_ID"); + if (C_DocType_ID == 0) + { + log.fine("Window=" + WindowNo + + " - Target=" + Env.getContextAsInt(ctx, WindowNo + "|C_DocTypeTarget_ID") + "/" + Env.getContextAsInt(ctx, WindowNo, "C_DocTypeTarget_ID") + + " - Actual=" + Env.getContextAsInt(ctx, WindowNo + "|C_DocType_ID") + "/" + Env.getContextAsInt(ctx, WindowNo, "C_DocType_ID")); + return getDocumentNo (AD_Client_ID, TableName, trxName); + } + + String retValue = getDocumentNo (C_DocType_ID, trxName); + if (!onlyDocType && retValue == null) + return getDocumentNo (AD_Client_ID, TableName, trxName); + return retValue; + } // getDocumentNo + + /** + * Is this a remote client connection + * @return true if client and RMI or Objects on Server + */ + public static boolean isRemoteObjects() + { + return CConnection.get().isServerObjects() + && CConnection.get().isAppsServerOK(false); + } // isRemoteObjects + + /** + * Is this a remote client connection + * @return true if client and RMI or Process on Server + */ + public static boolean isRemoteProcess() + { + return CConnection.get().isServerProcess() + && CConnection.get().isAppsServerOK(false); + } // isRemoteProcess + + + /************************************************************************** + * Print SQL Warnings. + *
+ * Usage: DB.printWarning("comment", rs.getWarnings()); + * @param comment comment + * @param warning warning + */ + public static void printWarning (String comment, SQLWarning warning) + { + if (comment == null || warning == null || comment.length() == 0) + throw new IllegalArgumentException("Required parameter missing"); + log.warning(comment); + if (warning == null) + return; + // + SQLWarning warn = warning; + while (warn != null) + { + StringBuffer buffer = new StringBuffer(); + buffer.append(warn.getMessage()) + .append("; State=").append(warn.getSQLState()) + .append("; ErrorCode=").append(warn.getErrorCode()); + log.warning(buffer.toString()); + warn = warn.getNextWarning(); + } + } // printWarning + + /** + * Create SQL TO Date String from Timestamp + * + * @param time Date to be converted + * @param dayOnly true if time set to 00:00:00 + * + * @return TO_DATE('2001-01-30 18:10:20',''YYYY-MM-DD HH24:MI:SS') + * or TO_DATE('2001-01-30',''YYYY-MM-DD') + */ + public static String TO_DATE (Timestamp time, boolean dayOnly) + { + return s_cc.getDatabase().TO_DATE(time, dayOnly); + } // TO_DATE + + /** + * Create SQL TO Date String from Timestamp + * @param day day time + * @return TO_DATE String (day only) + */ + public static String TO_DATE (Timestamp day) + { + return TO_DATE(day, true); + } // TO_DATE + + /** + * Create SQL for formatted Date, Number + * + * @param columnName the column name in the SQL + * @param displayType Display Type + * @param AD_Language 6 character language setting (from Env.LANG_*) + * + * @return TRIM(TO_CHAR(columnName,'9G999G990D00','NLS_NUMERIC_CHARACTERS='',.''')) + * or TRIM(TO_CHAR(columnName,'TM9')) depending on DisplayType and Language + * @see org.compiere.util.DisplayType + * @see org.compiere.util.Env + * + * */ + public static String TO_CHAR (String columnName, int displayType, String AD_Language) + { + if (columnName == null || AD_Language == null || columnName.length() == 0) + throw new IllegalArgumentException("Required parameter missing"); + return s_cc.getDatabase().TO_CHAR(columnName, displayType, AD_Language); + } // TO_CHAR + + /** + * Return number as string for INSERT statements with correct precision + * @param number number + * @param displayType display Type + * @return number as string + */ + public String TO_NUMBER (BigDecimal number, int displayType) + { + return s_cc.getDatabase().TO_NUMBER(number, displayType); + } // TO_NUMBER + + /** + * Package Strings for SQL command in quotes + * @param txt String with text + * @return escaped string for insert statement (NULL if null) + */ + public static String TO_STRING (String txt) + { + return TO_STRING (txt, 0); + } // TO_STRING + + /** + * Package Strings for SQL command in quotes. + *
+	 *		-	include in ' (single quotes)
+	 *		-	replace ' with ''
+	 *  
+ * @param txt String with text + * @param maxLength Maximum Length of content or 0 to ignore + * @return escaped string for insert statement (NULL if null) + */ + public static String TO_STRING (String txt, int maxLength) + { + if (txt == null || txt.length() == 0) + return "NULL"; + + // Length + String text = txt; + if (maxLength != 0 && text.length() > maxLength) + text = txt.substring(0, maxLength); + + // copy characters (we need to look through anyway) + StringBuffer out = new StringBuffer(); + out.append(QUOTE); // ' + for (int i = 0; i < text.length(); i++) + { + char c = text.charAt(i); + if (c == QUOTE) + out.append("''"); + else + out.append(c); + } + out.append(QUOTE); // ' + // + return out.toString(); + } // TO_STRING + + /** Quote */ + private static final char QUOTE = '\''; + + /** + * Run Post Migration manually + * @param args ignored + */ + public static void main (String[] args) + { + Adempiere.startup(true); + MSystem system = MSystem.get(Env.getCtx()); + system.setIsJustMigrated(true); + afterMigration(Env.getCtx()); + } // main +} // DB + diff --git a/dbPort/src/org/compiere/util/DBException.java b/dbPort/src/org/compiere/util/DBException.java new file mode 100644 index 0000000000..8abe24ab53 --- /dev/null +++ b/dbPort/src/org/compiere/util/DBException.java @@ -0,0 +1,46 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +/** + * This RuntimeException is used to pass SQLException up the chain of calling + * methods to determine what to do where needed. + * + * @author Vincent Harcq + * @version $Id: DBException.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class DBException extends RuntimeException { + + /** + * Create a new DBException based on a SQLException + * @param e Specicy the Exception cause + */ + public DBException(Exception e) + { + super(e); + } // DBException + + /** + * Create a new DBException + * @param msg Message + */ + public DBException(String msg) + { + super(msg); + } // DBException + +} // DBException diff --git a/dbPort/src/org/compiere/util/DisplayType.java b/dbPort/src/org/compiere/util/DisplayType.java new file mode 100644 index 0000000000..f25bb47ebc --- /dev/null +++ b/dbPort/src/org/compiere/util/DisplayType.java @@ -0,0 +1,456 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.text.*; +import java.util.*; + +/** + * System Display Types. + *
+ *	SELECT AD_Reference_ID, Name FROM AD_Reference WHERE ValidationType = 'D'
+ *  
+ * @author Jorg Janke + * @version $Id: DisplayType.java,v 1.6 2006/08/30 20:30:44 comdivision Exp $ + */ +public final class DisplayType +{ + /** Display Type 10 String */ + public static final int String = 10; + /** Display Type 11 Integer */ + public static final int Integer = 11; + /** Display Type 12 Amount */ + public static final int Amount = 12; + /** Display Type 13 ID */ + public static final int ID = 13; + /** Display Type 14 Text */ + public static final int Text = 14; + /** Display Type 15 Date */ + public static final int Date = 15; + /** Display Type 16 DateTime */ + public static final int DateTime = 16; + /** Display Type 17 List */ + public static final int List = 17; + /** Display Type 18 Table */ + public static final int Table = 18; + /** Display Type 19 TableDir */ + public static final int TableDir = 19; + /** Display Type 20 YN */ + public static final int YesNo = 20; + /** Display Type 21 Location */ + public static final int Location = 21; + /** Display Type 22 Number */ + public static final int Number = 22; + /** Display Type 23 BLOB */ + public static final int Binary = 23; + /** Display Type 24 Time */ + public static final int Time = 24; + /** Display Type 25 Account */ + public static final int Account = 25; + /** Display Type 26 RowID */ + public static final int RowID = 26; + /** Display Type 27 Color */ + public static final int Color = 27; + /** Display Type 28 Button */ + public static final int Button = 28; + /** Display Type 29 Quantity */ + public static final int Quantity = 29; + /** Display Type 30 Search */ + public static final int Search = 30; + /** Display Type 31 Locator */ + public static final int Locator = 31; + /** Display Type 32 Image */ + public static final int Image = 32; + /** Display Type 33 Assignment */ + public static final int Assignment = 33; + /** Display Type 34 Memo */ + public static final int Memo = 34; + /** Display Type 35 PAttribute */ + public static final int PAttribute = 35; + /** Display Type 36 CLOB */ + public static final int TextLong = 36; + /** Display Type 37 CostPrice */ + public static final int CostPrice = 37; + /** Display Type 36 File Path */ + public static final int FilePath = 38; + /** Display Type 39 File Name */ + public static final int FileName = 39; + /** Display Type 40 URL */ + public static final int URL = 40; + /** Display Type 42 PrinterName */ + public static final int PrinterName = 42; + // Candidates: + + /** + * - New Display Type + INSERT INTO AD_REFERENCE + (AD_REFERENCE_ID, AD_CLIENT_ID,AD_ORG_ID,ISACTIVE,CREATED,CREATEDBY,UPDATED,UPDATEDBY, + NAME,DESCRIPTION,HELP, VALIDATIONTYPE,VFORMAT,ENTITYTYPE) + VALUES (35, 0,0,'Y',SysDate,0,SysDate,0, + 'PAttribute','Product Attribute',null,'D',null,'D'); + * + * - org.compiere.model.MModel (??) + * - org.compiere.grid.ed.VEditor/Dialog + * - org.compiere.grid.ed.VEditorFactory + * - RColumn, WWindow + * add/check 0_cleanupAD.sql + */ + + // See DBA_DisplayType.sql ---------------------------------------------- + + /** Maximum number of digits */ + private static final int MAX_DIGITS = 28; // Oracle Standard Limitation 38 digits + /** Digits of an Integer */ + private static final int INTEGER_DIGITS = 10; + /** Maximum number of fractions */ + private static final int MAX_FRACTION = 12; + /** Default Amount Precision */ + private static final int AMOUNT_FRACTION = 2; + + /** + * Returns true if (numeric) ID (Table, Search, Account, ..). + * (stored as Integer) + * @param displayType Display Type + * @return true if ID + */ + public static boolean isID (int displayType) + { + if (displayType == ID || displayType == Table || displayType == TableDir + || displayType == Search || displayType == Location || displayType == Locator + || displayType == Account || displayType == Assignment || displayType == PAttribute + || displayType == Image) + return true; + return false; + } // isID + + /** + * Returns true, if DisplayType is numeric (Amount, Number, Quantity, Integer). + * (stored as BigDecimal) + * @param displayType Display Type + * @return true if numeric + */ + public static boolean isNumeric(int displayType) + { + if (displayType == Amount || displayType == Number || displayType == CostPrice + || displayType == Integer || displayType == Quantity) + return true; + return false; + } // isNumeric + + /** + * Get Default Precision. + * Used for databases who cannot handle dynamic number precision. + * @param displayType display type + * @return scale (decimal precision) + */ + public static int getDefaultPrecision(int displayType) + { + if (displayType == Amount) + return 2; + if (displayType == Number) + return 6; + if (displayType == CostPrice + || displayType == Quantity) + return 4; + return 0; + } // getDefaultPrecision + + + /** + * Returns true, if DisplayType is text (String, Text, TextLong, Memo). + * @param displayType Display Type + * @return true if text + */ + public static boolean isText(int displayType) + { + if (displayType == String || displayType == Text + || displayType == TextLong || displayType == Memo + || displayType == FilePath || displayType == FileName + || displayType == URL || displayType == PrinterName) + return true; + return false; + } // isText + + /** + * Returns truem if DisplayType is a Date. + * (stored as Timestamp) + * @param displayType Display Type + * @return true if date + */ + public static boolean isDate (int displayType) + { + if (displayType == Date || displayType == DateTime || displayType == Time) + return true; + return false; + } // isDate + + /** + * Returns true if DisplayType is a VLookup (List, Table, TableDir, Search). + * (stored as Integer) + * @param displayType Display Type + * @return true if Lookup + */ + public static boolean isLookup(int displayType) + { + if (displayType == List || displayType == Table + || displayType == TableDir || displayType == Search) + return true; + return false; + } // isLookup + + /** + * Returns true if DisplayType is a Large Object + * @param displayType Display Type + * @return true if LOB + */ + public static boolean isLOB (int displayType) + { + if (displayType == Binary + /* + * Removed by comdivisionys as Image is not a real + * LOB Type. Tested the behavior with Image window + * and Web Project Media. Both worked fine after + * the remove. + */ + //|| displayType == Image + || displayType == TextLong) + return true; + return false; + } + + /************************************************************************** + * Return Format for numeric DisplayType + * @param displayType Display Type (default Number) + * @param language Language + * @return number format + */ + public static DecimalFormat getNumberFormat(int displayType, Language language) + { + Language myLanguage = language; + if (myLanguage == null) + myLanguage = Language.getLoginLanguage(); + Locale locale = myLanguage.getLocale(); + DecimalFormat format = null; + if (locale != null) + format = (DecimalFormat)NumberFormat.getNumberInstance(locale); + else + format = (DecimalFormat)NumberFormat.getNumberInstance(Locale.US); + // + if (displayType == Integer) + { + format.setParseIntegerOnly(true); + format.setMaximumIntegerDigits(INTEGER_DIGITS); + format.setMaximumFractionDigits(0); + } + else if (displayType == Quantity) + { + format.setMaximumIntegerDigits(MAX_DIGITS); + format.setMaximumFractionDigits(MAX_FRACTION); + } + else if (displayType == Amount) + { + format.setMaximumIntegerDigits(MAX_DIGITS); + format.setMaximumFractionDigits(AMOUNT_FRACTION); + format.setMinimumFractionDigits(AMOUNT_FRACTION); + } + else if (displayType == CostPrice) + { + format.setMaximumIntegerDigits(MAX_DIGITS); + format.setMaximumFractionDigits(MAX_FRACTION); + format.setMinimumFractionDigits(AMOUNT_FRACTION); + } + else // if (displayType == Number) + { + format.setMaximumIntegerDigits(MAX_DIGITS); + format.setMaximumFractionDigits(MAX_FRACTION); + format.setMinimumFractionDigits(1); + } + return format; + } // getDecimalFormat + + /** + * Return Format for numeric DisplayType + * @param displayType Display Type + * @return number format + */ + public static DecimalFormat getNumberFormat(int displayType) + { + return getNumberFormat (displayType, null); + } // getNumberFormat + + + /************************************************************************* + * Return Date Format + * @return date format + */ + public static SimpleDateFormat getDateFormat() + { + return getDateFormat (DisplayType.Date, null); + } // getDateFormat + + /** + * Return Date Format + * @param language Language + * @return date format + */ + public static SimpleDateFormat getDateFormat (Language language) + { + return getDateFormat (DisplayType.Date, language); + } // getDateFormat + + /** + * Return format for date displayType + * @param displayType Display Type + * @return date format + */ + public static SimpleDateFormat getDateFormat (int displayType) + { + return getDateFormat (displayType, null); + } // getDateFormat + + /** + * Return format for date displayType + * @param displayType Display Type (default Date) + * @param language Language + * @return date format + */ + public static SimpleDateFormat getDateFormat (int displayType, Language language) + { + Language myLanguage = language; + if (myLanguage == null) + myLanguage = Language.getLoginLanguage(); + // + if (displayType == DateTime) + return myLanguage.getDateTimeFormat(); + else if (displayType == Time) + return myLanguage.getTimeFormat(); + // else if (displayType == Date) + return myLanguage.getDateFormat(); // default + } // getDateFormat + + /** + * JDBC Date Format YYYY-MM-DD + * @return date format + */ + static public SimpleDateFormat getDateFormat_JDBC() + { + return new SimpleDateFormat ("yyyy-MM-dd"); + } // getDateFormat_JDBC + + /** + * Return Storage Class. + * (used for MiniTable) + * @param displayType Display Type + * @param yesNoAsBoolean - yes or no as boolean + * @return class Integer - BigDecimal - Timestamp - String - Boolean + */ + public static Class getClass (int displayType, boolean yesNoAsBoolean) + { + if (isText(displayType) || displayType == List) + return String.class; + else if (isID(displayType) || displayType == Integer) // note that Integer is stored as BD + return Integer.class; + else if (isNumeric(displayType)) + return java.math.BigDecimal.class; + else if (isDate(displayType)) + return java.sql.Timestamp.class; + else if (displayType == YesNo) + return yesNoAsBoolean ? Boolean.class : String.class; + else if (displayType == Button) + return String.class; + else if (isLOB(displayType)) // CLOB is String + return byte[].class; + // + return Object.class; + } // getClass + + /** + * Get Description + * @param displayType display Type + * @return display type description + */ + public static String getDescription (int displayType) + { + if (displayType == String) + return "String"; + if (displayType == Integer) + return "Integer"; + if (displayType == Amount) + return "Amount"; + if (displayType == ID) + return "ID"; + if (displayType == Text) + return "Text"; + if (displayType == Date) + return "Date"; + if (displayType == DateTime) + return "DateTime"; + if (displayType == List) + return "List"; + if (displayType == Table) + return "Table"; + if (displayType == TableDir) + return "TableDir"; + if (displayType == YesNo) + return "YesNo"; + if (displayType == Location) + return "Location"; + if (displayType == Number) + return "Number"; + if (displayType == Binary) + return "Binary"; + if (displayType == Time) + return "Time"; + if (displayType == Account) + return "Account"; + if (displayType == RowID) + return "RowID"; + if (displayType == Color) + return "Color"; + if (displayType == Button) + return "Button"; + if (displayType == Quantity) + return "Quantity"; + if (displayType == Search) + return "Search"; + if (displayType == Locator) + return "Locator"; + if (displayType == Image) + return "Image"; + if (displayType == Assignment) + return "Assignment"; + if (displayType == Memo) + return "Memo"; + if (displayType == PAttribute) + return "PAttribute"; + if (displayType == TextLong) + return "TextLong"; + if (displayType == CostPrice) + return "CostPrice"; + if (displayType == FilePath) + return "FilePath"; + if (displayType == FileName) + return "FileName"; + if (displayType == URL) + return "URL"; + if (displayType == PrinterName) + return "PrinterName"; + // + return "UNKNOWN DisplayType=" + displayType; + } // getDescription + +} // DisplayType diff --git a/dbPort/src/org/compiere/util/EMail.java b/dbPort/src/org/compiere/util/EMail.java new file mode 100644 index 0000000000..8d03f812b9 --- /dev/null +++ b/dbPort/src/org/compiere/util/EMail.java @@ -0,0 +1,962 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.net.*; +import java.util.*; +import java.util.logging.*; +import javax.activation.*; +import javax.mail.*; +import javax.mail.internet.*; +import com.sun.mail.smtp.*; + +import org.compiere.model.*; + +/** + * EMail Object. + * Resources: + * http://java.sun.com/products/javamail/index.html + * http://java.sun.com/products/javamail/FAQ.html + * + *

+ * When I try to send a message, I get javax.mail.SendFailedException: + * 550 Unable to relay for my-address + *
+ * This is an error reply from your SMTP mail server. It indicates that + * your mail server is not configured to allow you to send mail through it. + * + * @author Jorg Janke + * @version $Id: EMail.java,v 1.4 2006/07/30 00:54:35 jjanke Exp $ + */ +public final class EMail implements Serializable +{ + /** + * Full Constructor + * @param client the client + * @param from Sender's EMail address + * @param to Recipient EMail address + * @param subject Subject of message + * @param message The message + */ + public EMail (MClient client, String from, String to, + String subject, String message) + { + this (client.getCtx(), client.getSMTPHost(), from, to, subject, message); + } // EMail + + /** + * Full Constructor + * @param ctx context + * @param smtpHost The mail server + * @param from Sender's EMail address + * @param to Recipient EMail address + * @param subject Subject of message + * @param message The message + */ + public EMail (Properties ctx, String smtpHost, String from, String to, + String subject, String message) + { + setSmtpHost(smtpHost); + setFrom(from); + addTo(to); + m_ctx = ctx; + if (subject == null || subject.length() == 0) + setSubject("."); // pass validation + else + setSubject (subject); + if (message != null && message.length() > 0) + setMessageText (message); + m_valid = isValid (true); + } // EMail + + /** From Address */ + private InternetAddress m_from; + /** To Address */ + private ArrayList m_to; + /** CC Addresses */ + private ArrayList m_cc; + /** BCC Addresses */ + private ArrayList m_bcc; + /** Reply To Address */ + private InternetAddress m_replyTo; + /** Mail Subject */ + private String m_subject; + /** Mail Plain Message */ + private String m_messageText; + /** Mail HTML Message */ + private String m_messageHTML; + /** Mail SMTP Server */ + private String m_smtpHost; + /** Attachments */ + private ArrayList m_attachments; + /** UserName and Password */ + private EMailAuthenticator m_auth = null; + /** Message */ + private SMTPMessage m_msg = null; + /** Context - may be null */ + private Properties m_ctx; + + /** Info Valid */ + private boolean m_valid = false; + /** Send result Message */ + private String m_sentMsg = null; + + /** Mail Sent OK Status */ + public static final String SENT_OK = "OK"; + + /** Logger */ + protected static CLogger log = CLogger.getCLogger (EMail.class); + + /** + * Send Mail direct + * @return OK or error message + */ + public String send () + { + log.info("(" + m_smtpHost + ") " + m_from + " -> " + m_to); + m_sentMsg = null; + // + if (!isValid(true)) + { + m_sentMsg = "Invalid Data"; + return m_sentMsg; + } + // + Properties props = System.getProperties(); + props.put("mail.store.protocol", "smtp"); + props.put("mail.transport.protocol", "smtp"); + props.put("mail.host", m_smtpHost); + if (CLogMgt.isLevelFinest()) + props.put("mail.debug", "true"); + // + Session session = null; + try + { + if (m_auth != null) // createAuthenticator was called + props.put("mail.smtp.auth", "true"); + session = Session.getInstance(props, m_auth); + session.setDebug(CLogMgt.isLevelFinest()); + } + catch (SecurityException se) + { + log.log(Level.WARNING, "Auth=" + m_auth + " - " + se.toString()); + m_sentMsg = se.toString(); + return se.toString(); + } + catch (Exception e) + { + log.log(Level.SEVERE, "Auth=" + m_auth, e); + m_sentMsg = e.toString(); + return e.toString(); + } + + try + { + // m_msg = new MimeMessage(session); + m_msg = new SMTPMessage(session); + // Addresses + m_msg.setFrom(m_from); + InternetAddress[] rec = getTos(); + if (rec.length == 1) + m_msg.setRecipient (Message.RecipientType.TO, rec[0]); + else + m_msg.setRecipients (Message.RecipientType.TO, rec); + rec = getCcs(); + if (rec != null && rec.length > 0) + m_msg.setRecipients (Message.RecipientType.CC, rec); + rec = getBccs(); + if (rec != null && rec.length > 0) + m_msg.setRecipients (Message.RecipientType.BCC, rec); + if (m_replyTo != null) + m_msg.setReplyTo(new Address[] {m_replyTo}); + // + m_msg.setSentDate(new java.util.Date()); + m_msg.setHeader("Comments", "AdempiereMail"); + // m_msg.setDescription("Description"); + // SMTP specifics + m_msg.setAllow8bitMIME(true); + // Send notification on Failure & Success - no way to set envid in Java yet + // m_msg.setNotifyOptions (SMTPMessage.NOTIFY_FAILURE | SMTPMessage.NOTIFY_SUCCESS); + // Bounce only header + m_msg.setReturnOption (SMTPMessage.RETURN_HDRS); + // m_msg.setHeader("X-Mailer", "msgsend"); + // + setContent(); + m_msg.saveChanges(); + // log.fine("message =" + m_msg); + // + // Transport.send(msg); + Transport t = session.getTransport("smtp"); + // log.fine("transport=" + t); + t.connect(); + // t.connect(m_smtpHost, user, password); + // log.fine("transport connected"); + Transport.send(m_msg); + // t.sendMessage(msg, msg.getAllRecipients()); + log.fine("Success - MessageID=" + m_msg.getMessageID()); + } + catch (MessagingException me) + { + Exception ex = me; + StringBuffer sb = new StringBuffer("(ME)"); + boolean printed = false; + do + { + if (ex instanceof SendFailedException) + { + SendFailedException sfex = (SendFailedException)ex; + Address[] invalid = sfex.getInvalidAddresses(); + if (!printed) + { + if (invalid != null && invalid.length > 0) + { + sb.append (" - Invalid:"); + for (int i = 0; i < invalid.length; i++) + sb.append (" ").append (invalid[i]); + + } + Address[] validUnsent = sfex.getValidUnsentAddresses (); + if (validUnsent != null && validUnsent.length > 0) + { + sb.append (" - ValidUnsent:"); + for (int i = 0; i < validUnsent.length; i++) + sb.append (" ").append (validUnsent[i]); + } + Address[] validSent = sfex.getValidSentAddresses (); + if (validSent != null && validSent.length > 0) + { + sb.append (" - ValidSent:"); + for (int i = 0; i < validSent.length; i++) + sb.append (" ").append (validSent[i]); + } + printed = true; + } + if (sfex.getNextException() == null) + sb.append(" ").append(sfex.getLocalizedMessage()); + } + else if (ex instanceof AuthenticationFailedException) + { + sb.append(" - Invalid Username/Password - " + m_auth); + } + else // other MessagingException + { + String msg = ex.getLocalizedMessage(); + if (msg == null) + sb.append(": ").append(ex.toString()); + else + { + if (msg.indexOf("Could not connect to SMTP host:") != -1) + { + int index = msg.indexOf('\n'); + if (index != -1) + msg = msg.substring(0, index); + String cc = "??"; + if (m_ctx != null) + cc = m_ctx.getProperty("#AD_Client_ID"); + msg += " - AD_Client_ID=" + cc; + } + String className = ex.getClass().getName(); + if (className.indexOf("MessagingException") != -1) + sb.append(": ").append(msg); + else + sb.append(" ").append(className).append(": ").append(msg); + } + } + // Next Exception + if (ex instanceof MessagingException) + ex = ((MessagingException)ex).getNextException(); + else + ex = null; + } + while (ex != null); // error loop + // + if (CLogMgt.isLevelFinest()) + log.log(Level.WARNING, sb.toString(), me); + else + log.log(Level.WARNING, sb.toString()); + m_sentMsg = sb.toString(); + return sb.toString(); + } + catch (Exception e) + { + log.log(Level.SEVERE, "", e); + m_sentMsg = e.getLocalizedMessage(); + return e.getLocalizedMessage(); + } + // + if (CLogMgt.isLevelFinest()) + dumpMessage(); + m_sentMsg = SENT_OK; + return m_sentMsg; + } // send + + /** + * Get Send Result Msg + * @return msg + */ + public String getSentMsg() + { + return m_sentMsg; + } // getSentMsg + + /** + * Was sending the Msg OK + * @return msg == OK + */ + public boolean isSentOK() + { + return m_sentMsg != null && SENT_OK.equals(m_sentMsg); + } // isSentOK + + /** + * Dump Message Info + */ + private void dumpMessage() + { + if (m_msg == null) + return; + try + { + Enumeration e = m_msg.getAllHeaderLines (); + while (e.hasMoreElements ()) + log.fine("- " + e.nextElement ()); + } + catch (MessagingException ex) + { + log.log(Level.WARNING, m_msg.toString(), ex); + } + } // dumpMessage + + /** + * Get the message directly + * @return mail message + */ + protected MimeMessage getMimeMessage() + { + return m_msg; + } // getMessage + + /** + * Get Message ID or null + * @return Message ID e.g. <20030130004739.15377.qmail@web13506.mail.yahoo.com> + * <25699763.1043887247538.JavaMail.jjanke@main> + */ + public String getMessageID() + { + try + { + if (m_msg != null) + return m_msg.getMessageID (); + } + catch (MessagingException ex) + { + log.log(Level.SEVERE, "", ex); + } + return null; + } // getMessageID + + /** Getter/Setter ********************************************************/ + + /** + * Create Authenticator for User + * @param username user name + * @param password user password + * @return Authenticator or null + */ + public EMailAuthenticator createAuthenticator (String username, String password) + { + if (username == null || password == null) + { + log.warning("Ignored - " + username + "/" + password); + m_auth = null; + } + else + { + // log.fine("setEMailUser: " + username + "/" + password); + m_auth = new EMailAuthenticator (username, password); + } + return m_auth; + } // createAuthenticator + + /** + * Get Sender + * @return Sender's internet address + */ + public InternetAddress getFrom() + { + return m_from; + } // getFrom + + /** + * Set Sender + * @param newFrom Sender's email address + */ + public void setFrom(String newFrom) + { + if (newFrom == null) + { + m_valid = false; + return; + } + try + { + m_from = new InternetAddress (newFrom, true); + } + catch (Exception e) + { + log.log(Level.WARNING, newFrom + ": " + e.toString()); + m_valid = false; + } + } // setFrom + + /** + * Add To Recipient + * @param newTo Recipient's email address + * @return true if valid + */ + public boolean addTo (String newTo) + { + if (newTo == null || newTo.length() == 0) + { + m_valid = false; + return false; + } + InternetAddress ia = null; + try + { + ia = new InternetAddress (newTo, true); + } + catch (Exception e) + { + log.log(Level.WARNING, newTo + ": " + e.toString()); + m_valid = false; + return false; + } + if (m_to == null) + m_to = new ArrayList(); + m_to.add(ia); + return true; + } // addTo + + /** + * Get Recipient + * @return Recipient's internet address + */ + public InternetAddress getTo() + { + if (m_to == null || m_to.size() == 0) + return null; + InternetAddress ia = (InternetAddress)m_to.get(0); + return ia; + } // getTo + + /** + * Get TO Recipients + * @return Recipient's internet address + */ + public InternetAddress[] getTos() + { + if (m_to == null || m_to.size() == 0) + return null; + InternetAddress[] ias = new InternetAddress[m_to.size()]; + m_to.toArray(ias); + return ias; + } // getTos + + /** + * Add CC Recipient + * @param newCc EMail cc Recipient + * @return true if valid + */ + public boolean addCc (String newCc) + { + if (newCc == null || newCc.length() == 0) + return false; + InternetAddress ia = null; + try + { + ia = new InternetAddress (newCc, true); + } + catch (Exception e) + { + log.log(Level.WARNING, newCc + ": " + e.toString()); + return false; + } + if (m_cc == null) + m_cc = new ArrayList(); + m_cc.add (ia); + return true; + } // addCc + + /** + * Get CC Recipients + * @return Recipient's internet address + */ + public InternetAddress[] getCcs() + { + if (m_cc == null || m_cc.size() == 0) + return null; + InternetAddress[] ias = new InternetAddress[m_cc.size()]; + m_cc.toArray(ias); + return ias; + } // getCcs + + /** + * Add BCC Recipient + * @param newBcc EMail cc Recipient + * @return true if valid + */ + public boolean addBcc (String newBcc) + { + if (newBcc == null || newBcc.length() == 0) + return false; + InternetAddress ia = null; + try + { + ia = new InternetAddress (newBcc, true); + } + catch (Exception e) + { + log.log(Level.WARNING, newBcc + ": " + e.getMessage()); + return false; + } + if (m_bcc == null) + m_bcc = new ArrayList(); + m_bcc.add (ia); + return true; + } // addBcc + + /** + * Get BCC Recipients + * @return Recipient's internet address + */ + public InternetAddress[] getBccs() + { + if (m_bcc == null || m_bcc.size() == 0) + return null; + InternetAddress[] ias = new InternetAddress[m_bcc.size()]; + m_bcc.toArray(ias); + return ias; + } // getBccs + + /** + * Set Reply to Address + * @param newTo email address + * @return true if valid + */ + public boolean setReplyTo (String newTo) + { + if (newTo == null || newTo.length() == 0) + return false; + InternetAddress ia = null; + try + { + ia = new InternetAddress (newTo, true); + } + catch (Exception e) + { + log.log(Level.WARNING, newTo + ": " + e.toString()); + return false; + } + m_replyTo = ia; + return true; + } // setReplyTo + + /** + * Get Reply To + * @return Reoly To internet address + */ + public InternetAddress getReplyTo() + { + return m_replyTo; + } // getReplyTo + + + /************************************************************************** + * Set Subject + * @param newSubject Subject + */ + public void setSubject(String newSubject) + { + if (newSubject == null || newSubject.length() == 0) + m_valid = false; + else + m_subject = newSubject; + } // setSubject + + /** + * Get Subject + * @return subject + */ + public String getSubject() + { + return m_subject; + } // getSubject + + /** + * Set Message + * @param newMessage message + */ + public void setMessageText (String newMessage) + { + if (newMessage == null || newMessage.length() == 0) + m_valid = false; + else + { + m_messageText = newMessage; + if (!m_messageText.endsWith("\n")) + m_messageText += "\n"; + } + } // setMessage + + /** + * Get MIME String Message - line ending with CRLF. + * @return message + */ + public String getMessageCRLF() + { + if (m_messageText == null) + return ""; + char[] chars = m_messageText.toCharArray(); + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < chars.length; i++) + { + char c = chars[i]; + if (c == '\n') + { + int previous = i-1; + if (previous >= 0 && chars[previous] == '\r') + sb.append(c); + else + sb.append("\r\n"); + } + else + sb.append(c); + } + // log.fine("IN " + m_messageText); + // log.fine("OUT " + sb); + + return sb.toString(); + } // getMessageCRLF + + /** + * Set HTML Message + * @param html message + */ + public void setMessageHTML (String html) + { + if (html == null || html.length() == 0) + m_valid = false; + else + { + m_messageHTML = html; + if (!m_messageHTML.endsWith("\n")) + m_messageHTML += "\n"; + } + } // setMessageHTML + + /** + * Set HTML Message + * @param subject subject repeated in message as H2 + * @param message message + */ + public void setMessageHTML (String subject, String message) + { + m_subject = subject; + StringBuffer sb = new StringBuffer("\n") + .append("\n") + .append("\n") + .append(subject + "\n") + .append("\n") + .append("\n"); + sb.append("\n") + .append("

" + subject + "

" + "\n") + .append(message) + .append("\n") + .append("\n"); + sb.append("\n"); + m_messageHTML = sb.toString(); + } // setMessageHTML + + /** + * Get HTML Message + * @return message + */ + public String getMessageHTML() + { + return m_messageHTML; + } // getMessageHTML + + /** + * Add file Attachment + * @param file file to attach + */ + public void addAttachment (File file) + { + if (file == null) + return; + if (m_attachments == null) + m_attachments = new ArrayList(); + m_attachments.add(file); + } // addAttachment + + /** + * Add url based file Attachment + * @param url url content to attach + */ + public void addAttachment (URL url) + { + if (url == null) + return; + if (m_attachments == null) + m_attachments = new ArrayList(); + m_attachments.add(url); + } // addAttachment + + /** + * Add attachment. + * (converted to ByteArrayDataSource) + * @param data data + * @param type MIME type + * @param name name of attachment + */ + public void addAttachment (byte[] data, String type, String name) + { + ByteArrayDataSource byteArray = new ByteArrayDataSource (data, type).setName(name); + addAttachment (byteArray); + } // addAttachment + + /** + * Add arbitary Attachment + * @param dataSource content to attach + */ + public void addAttachment (DataSource dataSource) + { + if (dataSource == null) + return; + if (m_attachments == null) + m_attachments = new ArrayList(); + m_attachments.add(dataSource); + } // addAttachment + + /** + * Set the message content + * @throws MessagingException + * @throws IOException + */ + private void setContent () + throws MessagingException, IOException + { + // Local Character Set + String charSetName = System.getProperty("file.encoding"); // Cp1252 + if (charSetName == null || charSetName.length() == 0) + charSetName = "UTF-8"; // WebEnv.ENCODING - alternative iso-8859-1 + // + m_msg.setSubject (getSubject(), charSetName); + + // Simple Message + if (m_attachments == null || m_attachments.size() == 0) + { + if (m_messageHTML == null || m_messageHTML.length () == 0) + m_msg.setText (getMessageCRLF(), charSetName); + else + m_msg.setDataHandler (new DataHandler + (new ByteArrayDataSource (m_messageHTML, charSetName, "text/html"))); + // + log.fine("(simple) " + getSubject()); + } + else // Multi part message *************************************** + { + // First Part - Message + MimeBodyPart mbp_1 = new MimeBodyPart(); + mbp_1.setText(""); + if (m_messageHTML == null || m_messageHTML.length () == 0) + mbp_1.setText (getMessageCRLF(), charSetName); + else + mbp_1.setDataHandler (new DataHandler + (new ByteArrayDataSource (m_messageHTML, charSetName, "text/html"))); + + // Create Multipart and its parts to it + Multipart mp = new MimeMultipart(); + mp.addBodyPart(mbp_1); + log.fine("(multi) " + getSubject() + " - " + mbp_1); + + // for all attachments + for (int i = 0; i < m_attachments.size(); i++) + { + Object attachment = m_attachments.get(i); + DataSource ds = null; + if (attachment instanceof File) + { + File file = (File)attachment; + if (file.exists()) + ds = new FileDataSource (file); + else + { + log.log(Level.WARNING, "File does not exist: " + file); + continue; + } + } + else if (attachment instanceof URL) + { + URL url = (URL)attachment; + ds = new URLDataSource (url); + } + else if (attachment instanceof DataSource) + ds = (DataSource)attachment; + else + { + log.log(Level.WARNING, "Attachement type unknown: " + attachment); + continue; + } + // Attachment Part + MimeBodyPart mbp_2 = new MimeBodyPart(); + mbp_2.setDataHandler(new DataHandler(ds)); + mbp_2.setFileName(ds.getName()); + log.fine("Added Attachment " + ds.getName() + " - " + mbp_2); + mp.addBodyPart(mbp_2); + } + + // Add to Message + m_msg.setContent(mp); + } // multi=part + } // setContent + + + /************************************************************************** + * Set SMTP Host or address + * @param newSmtpHost Mail server + */ + public void setSmtpHost(String newSmtpHost) + { + if (newSmtpHost == null || newSmtpHost.length() == 0) + m_valid = false; + else + m_smtpHost = newSmtpHost; + } // setSMTPHost + + /** + * Get Mail Server name or address + * @return mail server + */ + public String getSmtpHost() + { + return m_smtpHost; + } // getSmtpHosr + + /** + * Is Info valid to send EMail + * @return true if email is valid and can be sent + */ + public boolean isValid() + { + return m_valid; + } // isValid + + /** + * Re-Check Info if valid to send EMail + * @param recheck if true check main variables + * @return true if email is valid and can be sent + */ + public boolean isValid (boolean recheck) + { + if (!recheck) + return m_valid; + + // From + if (m_from == null + || m_from.getAddress().length() == 0 + || m_from.getAddress().indexOf(' ') != -1) + { + log.warning("From is invalid=" + m_from); + return false; + } + // To + InternetAddress[] ias = getTos(); + if (ias == null) + { + log.warning("No To"); + return false; + } + for (int i = 0; i < ias.length; i++) + { + if (ias[i] == null + || ias[i].getAddress().length() == 0 + || ias[i].getAddress().indexOf(' ') != -1) + { + log.warning("To(" + i + ") is invalid=" + ias[i]); + return false; + } + } + + // Host + if (m_smtpHost == null || m_smtpHost.length() == 0) + { + log.warning("SMTP Host is invalid" + m_smtpHost); + return false; + } + + // Subject + if (m_subject == null || m_subject.length() == 0) + { + log.warning("Subject is invalid=" + m_subject); + return false; + } + return true; + } // isValid + + /** + * String Representation + * @return info + */ + public String toString () + { + StringBuffer sb = new StringBuffer ("EMail["); + sb.append("From:").append(m_from) + .append(",To:").append(getTo()) + .append(",Subject=").append(getSubject()) + .append ("]"); + return sb.toString (); + } // toString + + /************************************************************************** + * Test. + * java -cp CTools.jar;CClient.jar org.compiere.util.EMail main info@adempiere.org jjanke@adempiere.org "My Subject" "My Message" + * -- + * If you get SendFailedException: 550 5.7.1 Unable to relay for .. + * Check: + * - Does the SMTP server allow you to relay + * (Exchange: SMTP server - Access) + * - Did you authenticate (setEmailUser) + * @param args Array of arguments + */ + public static void main (String[] args) + { + org.compiere.Adempiere.startup(true); + + if (args.length != 5) + { + System.out.println("Parameters: smtpHost from to subject message"); + System.out.println("Example: java org.compiere.util.EMail mail.acme.com joe@acme.com sue@acme.com HiThere CheersJoe"); + System.exit(1); + } + EMail email = new EMail(System.getProperties(), args[0], args[1], args[2], args[3], args[4]); + email.send(); + } // main + +} // EMail diff --git a/dbPort/src/org/compiere/util/EMailAuthenticator.java b/dbPort/src/org/compiere/util/EMailAuthenticator.java new file mode 100644 index 0000000000..9b777f25e4 --- /dev/null +++ b/dbPort/src/org/compiere/util/EMailAuthenticator.java @@ -0,0 +1,79 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.util.logging.*; +import javax.mail.*; + +/** + * Email User Authentification + * + * @author Jorg Janke + * @version $Id: EMailAuthenticator.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class EMailAuthenticator extends Authenticator +{ + /** + * Constructor + * @param username user name + * @param password user password + */ + public EMailAuthenticator (String username, String password) + { + m_pass = new PasswordAuthentication (username, password); + if (username == null || username.length() == 0) + { + log.log(Level.SEVERE, "Username is NULL"); + Thread.dumpStack(); + } + if (password == null || password.length() == 0) + { + log.log(Level.SEVERE, "Password is NULL"); + Thread.dumpStack(); + } + } // EMailAuthenticator + + /** Password */ + private PasswordAuthentication m_pass = null; + /** Logger */ + private static CLogger log = CLogger.getCLogger(EMailAuthenticator.class); + + /** + * Ger PasswordAuthentication + * @return Password Autnetifucation + */ + protected PasswordAuthentication getPasswordAuthentication() + { + return m_pass; + } // getPasswordAuthentication + + /** + * Get String representation + * @return info + */ + public String toString() + { + if (m_pass == null) + return "EMailAuthenticator[]"; + if (CLogMgt.isLevelFinest()) + return "EMailAuthenticator[" + + m_pass.getUserName() + "/" + m_pass.getPassword() + "]"; + return "EMailAuthenticator[" + + m_pass.getUserName() + "/************]"; + } // toString + +} // EMailAuthenticator diff --git a/dbPort/src/org/compiere/util/EMailTest.java b/dbPort/src/org/compiere/util/EMailTest.java new file mode 100644 index 0000000000..568b948413 --- /dev/null +++ b/dbPort/src/org/compiere/util/EMailTest.java @@ -0,0 +1,149 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import junit.framework.*; + +/** + * The class EMailTest contains tests for the class + * EMail + *

+ * + * @author Jorg Janke + * @version $Id: EMailTest.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class EMailTest extends TestCase +{ + /** + * Construct new test instance + * + * @param name the test name + */ + public EMailTest(String name) + { + super(name); + } + + String host = "admin.adempiere.org"; + String usr = "jjanke"; + String pwd = ""; + // + String from = "jjanke@adempiere.org"; + // + String to = "jjanke@yahoo.com"; + String to2 = "jjanke@acm.org"; + String to3 = "jorg.janke@adempiere.org"; + + /** + * Perform pre-test initialization + * @throws Exception + * @see TestCase#setUp() + */ + protected void setUp() throws Exception + { + super.setUp(); + org.compiere.Adempiere.startup (true); + } // setup + + /** + * Test sending to internal + * + public void testInternal() + { + EMail emailTest = new EMail(host, from, from, "TestInternal", "Test Internal Message"); + assertEquals(emailTest.send(), EMail.SENT_OK); + } // testInternal + + /** + * Test sending to internal authenticated + * + public void testInternalAuthenticate() + { + EMail emailTest = new EMail(host, from, from, "TestInternalAuthenticate", "Test Internal Authenticate Message"); + emailTest.setEMailUser(usr, pwd); + assertEquals(emailTest.send(), EMail.SENT_OK); + } // testInternalAuthenticate + + /** + * Test sending to external + * + public void testExternal() + { + EMail emailTest = new EMail(host, from, to, "TestExternal", "Test External Message"); + assertNotSame(emailTest.send(), EMail.SENT_OK); + } // testExternal + + /** + * Test sending to external authenticated + * + public void testExternalAuthenticate() + { + EMail emailTest = new EMail(host, from, to, "TestExternalAuthenticate", "Test External Authenticate Message"); + emailTest.setEMailUser(usr, pwd); + assertEquals(emailTest.send(), EMail.SENT_OK); + } // testExternalAuthenticate + + /** + * Test sending HTML + * + public void testHTML() + { + EMail emailTest = new EMail(host, from, to); + emailTest.addCc(to2); + emailTest.setMessageHTML("TestHTML", "Test HTML Message"); + emailTest.setEMailUser(usr, pwd); + assertEquals(emailTest.send(), EMail.SENT_OK); + } // testHTML + + /** + * Test sending Attachment + * + public void testAttachment() + { + EMail emailTest = new EMail(host, from, to, "TestAttachment", "Test Attachment Message"); + emailTest.addTo(to2); + emailTest.addCc(to3); + emailTest.addAttachment(new File("C:\\Adempiere\\RUN_Adempiere.sh")); + emailTest.setEMailUser(usr, pwd); + assertEquals(emailTest.send(), EMail.SENT_OK); + } // testAttachmentHTML + + /** + * Test sending Attachment HTML + */ + public void testAttachmentHTML() + { + EMail emailTest = new EMail(System.getProperties(), host, from, to, null, null); + emailTest.addTo(to2); + emailTest.addCc(to3); + emailTest.setMessageHTML("TestAttachmentHTML", "Test Attachment HTML Message"); + emailTest.addAttachment(new File("C:\\Adempiere\\RUN_Adempiere.sh")); + emailTest.createAuthenticator(usr, pwd); + assertEquals(emailTest.send(), EMail.SENT_OK); + } // testAttachmentHTML + + /** + * Launch the test. + * @param args String[] + */ + public static void main(String[] args) + { + junit.textui.TestRunner.run(EMailTest.class); + } // main + +} // EMailTest diff --git a/dbPort/src/org/compiere/util/Env.java b/dbPort/src/org/compiere/util/Env.java new file mode 100644 index 0000000000..697abbf3ec --- /dev/null +++ b/dbPort/src/org/compiere/util/Env.java @@ -0,0 +1,1436 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.awt.*; +import java.math.*; +import java.net.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.swing.*; +import org.compiere.*; +import org.compiere.db.*; +import org.compiere.model.*; +import org.compiere.swing.*; + + +/** + * System Environment and static variables + * + * @author Jorg Janke + * @version $Id: Env.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public final class Env +{ + /** Logging */ + private static CLogger s_log = CLogger.getCLogger(Env.class); + + /** + * Exit System + * @param status System exit status (usually 0 for no error) + */ + public static void exitEnv (int status) + { + // End Session + MSession session = MSession.get(Env.getCtx(), false); // finish + if (session != null) + session.logout(); + // + reset(true); // final cache reset + s_log.info(""); + // + CLogMgt.shutdown(); + // + if (Ini.isClient()) + System.exit (status); + } // close + + /** + * Reset Cache + * @param finalCall everything otherwise login data remains + */ + public static void reset (boolean finalCall) + { + s_log.info("finalCall=" + finalCall); + closeWindows(); + + // Dismantle windows + /** + for (int i = 0; i < s_windows.size(); i++) + { + Container win = (Container)s_windows.get(i); + if (win.getClass().getName().endsWith("AMenu")) // Null pointer + ; + else if (win instanceof Window) + ((Window)win).dispose(); + else + win.removeAll(); + } + **/ + s_windows.clear(); + + // Clear all Context + if (finalCall) + s_ctx.clear(); + else // clear window context only + { + Object[] keys = s_ctx.keySet().toArray(); + for (int i = 0; i < keys.length; i++) + { + String tag = keys[i].toString(); + if (Character.isDigit(tag.charAt(0))) + s_ctx.remove(keys[i]); + } + } + + // Cache + CacheMgt.get().reset(); + DB.closeTarget(); + // Reset Role Access + if (!finalCall) + { + DB.setDBTarget(CConnection.get()); + MRole defaultRole = MRole.getDefault(s_ctx, false); + if (defaultRole != null) + defaultRole.loadAccess(true); // Reload + } + } // resetAll + + + /************************************************************************** + * Application Context + */ + private static Properties s_ctx = new Properties(); + /** WindowNo for Find */ + public static final int WINDOW_FIND = 1110; + /** WinowNo for MLookup */ + public static final int WINDOW_MLOOKUP = 1111; + /** WindowNo for PrintCustomize */ + public static final int WINDOW_CUSTOMIZE = 1112; + /** WindowNo for PrintCustomize */ + public static final int WINDOW_INFO = 1113; + + /** Tab for Info */ + public static final int TAB_INFO = 1113; + + /** + * Get Context + * @return Properties + */ + public static final Properties getCtx() + { + return s_ctx; + } // getCtx + + /** + * Set Context + * @param ctx context + */ + public static void setCtx (Properties ctx) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + s_ctx.clear(); + s_ctx = ctx; + } // setCtx + + /** + * Set Global Context to Value + * @param ctx context + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, String context, String value) + { + if (ctx == null || context == null) + return; + s_log.finer("Context " + context + "==" + value); + // + if (value == null || value.length() == 0) + ctx.remove(context); + else + ctx.setProperty(context, value); + } // setContext + + /** + * Set Global Context to Value + * @param ctx context + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, String context, Timestamp value) + { + if (ctx == null || context == null) + return; + if (value == null) + { + ctx.remove(context); + s_log.finer("Context " + context + "==" + value); + } + else + { // JDBC Format 2005-05-09 00:00:00.0 + String stringValue = value.toString(); + // Chop off .0 + stringValue = stringValue.substring(0, stringValue.length()-2); + ctx.setProperty(context, stringValue); + s_log.finer("Context " + context + "==" + stringValue); + } + } // setContext + + /** + * Set Global Context to (int) Value + * @param ctx context + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, String context, int value) + { + if (ctx == null || context == null) + return; + s_log.finer("Context " + context + "==" + value); + // + ctx.setProperty(context, String.valueOf(value)); + } // setContext + + /** + * Set Global Context to Y/N Value + * @param ctx context + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, String context, boolean value) + { + setContext (ctx, context, value ? "Y" : "N"); + } // setContext + + /** + * Set Context for Window to Value + * @param ctx context + * @param WindowNo window no + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, int WindowNo, String context, String value) + { + if (ctx == null || context == null) + return; + if (WindowNo != WINDOW_FIND && WindowNo != WINDOW_MLOOKUP) + s_log.finer("Context("+WindowNo+") " + context + "==" + value); + // + if (value == null || value.equals("")) + ctx.remove(WindowNo+"|"+context); + else + ctx.setProperty(WindowNo+"|"+context, value); + } // setContext + + /** + * Set Context for Window to Value + * @param ctx context + * @param WindowNo window no + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, int WindowNo, String context, Timestamp value) + { + if (ctx == null || context == null) + return; + boolean logit = WindowNo != WINDOW_FIND && WindowNo != WINDOW_MLOOKUP; + if (value == null) + { + ctx.remove(WindowNo+"|"+context); + s_log.finer("Context("+WindowNo+") " + context + "==" + value); + } + else + { // JDBC Format 2005-05-09 00:00:00.0 + String stringValue = value.toString(); + // Chop off .0 + stringValue = stringValue.substring(0, stringValue.length()-2); + ctx.setProperty(WindowNo+"|"+context, stringValue); + s_log.finer("Context("+WindowNo+") " + context + "==" + stringValue); + } + } // setContext + + /** + * Set Context for Window to int Value + * @param ctx context + * @param WindowNo window no + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, int WindowNo, String context, int value) + { + if (ctx == null || context == null) + return; + if (WindowNo != WINDOW_FIND && WindowNo != WINDOW_MLOOKUP) + s_log.finer("Context("+WindowNo+") " + context + "==" + value); + // + ctx.setProperty(WindowNo+"|"+context, String.valueOf(value)); + } // setContext + + /** + * Set Context for Window to Y/N Value + * @param ctx context + * @param WindowNo window no + * @param context context key + * @param value context value + */ + public static void setContext (Properties ctx, int WindowNo, String context, boolean value) + { + setContext (ctx, WindowNo, context, value ? "Y" : "N"); + } // setContext + + /** + * Set Context for Window & Tab to Value + * @param ctx context + * @param WindowNo window no + * @param TabNo tab no + * @param context context key + * @param value context value + * */ + public static void setContext (Properties ctx, int WindowNo, int TabNo, String context, String value) + { + if (ctx == null || context == null) + return; + if (WindowNo != WINDOW_FIND && WindowNo != WINDOW_MLOOKUP) + s_log.finest("Context("+WindowNo+","+TabNo+") " + context + "==" + value); + // + if (value == null || value.equals("")) + ctx.remove(WindowNo+"|"+TabNo+"|"+context); + else + ctx.setProperty(WindowNo+"|"+TabNo+"|"+context, value); + } // setContext + + /** + * Set Auto Commit + * @param ctx context + * @param autoCommit auto commit (save) + */ + public static void setAutoCommit (Properties ctx, boolean autoCommit) + { + if (ctx == null) + return; + ctx.setProperty("AutoCommit", autoCommit ? "Y" : "N"); + } // setAutoCommit + + /** + * Set Auto Commit for Window + * @param ctx context + * @param WindowNo window no + * @param autoCommit auto commit (save) + */ + public static void setAutoCommit (Properties ctx, int WindowNo, boolean autoCommit) + { + if (ctx == null) + return; + ctx.setProperty(WindowNo+"|AutoCommit", autoCommit ? "Y" : "N"); + } // setAutoCommit + + /** + * Set Auto New Record + * @param ctx context + * @param autoNew auto new record + */ + public static void setAutoNew (Properties ctx, boolean autoNew) + { + if (ctx == null) + return; + ctx.setProperty("AutoNew", autoNew ? "Y" : "N"); + } // setAutoNew + + /** + * Set Auto New Record for Window + * @param ctx context + * @param WindowNo window no + * @param autoNew auto new record + */ + public static void setAutoNew (Properties ctx, int WindowNo, boolean autoNew) + { + if (ctx == null) + return; + ctx.setProperty(WindowNo+"|AutoNew", autoNew ? "Y" : "N"); + } // setAutoNew + + + /** + * Set SO Trx + * @param ctx context + * @param isSOTrx SO Context + */ + public static void setSOTrx (Properties ctx, boolean isSOTrx) + { + if (ctx == null) + return; + ctx.setProperty("IsSOTrx", isSOTrx ? "Y" : "N"); + } // setSOTrx + + /** + * Get global Value of Context + * @param ctx context + * @param context context key + * @return value or "" + */ + public static String getContext (Properties ctx, String context) + { + if (ctx == null || context == null) + throw new IllegalArgumentException ("Require Context"); + return ctx.getProperty(context, ""); + } // getContext + + /** + * Get Value of Context for Window. + * if not found global context if available and enabled + * @param ctx context + * @param WindowNo window + * @param context context key + * @param onlyWindow if true, no defaults are used unless explicitly asked for + * @return value or "" + */ + public static String getContext (Properties ctx, int WindowNo, String context, boolean onlyWindow) + { + if (ctx == null) + throw new IllegalArgumentException ("No Ctx"); + if (context == null) + throw new IllegalArgumentException ("Require Context"); + String s = ctx.getProperty(WindowNo+"|"+context); + if (s == null) + { + // Explicit Base Values + if (context.startsWith("#") || context.startsWith("$")) + return getContext(ctx, context); + if (onlyWindow) // no Default values + return ""; + return getContext(ctx, "#" + context); + } + return s; + } // getContext + + /** + * Get Value of Context for Window. + * if not found global context if available + * @param ctx context + * @param WindowNo window + * @param context context key + * @return value or "" + */ + public static String getContext (Properties ctx, int WindowNo, String context) + { + return getContext(ctx, WindowNo, context, false); + } // getContext + + /** + * Get Value of Context for Window & Tab, + * if not found global context if available + * @param ctx context + * @param WindowNo window no + * @param TabNo tab no + * @param context context key + * @return value or "" + */ + public static String getContext (Properties ctx, int WindowNo, int TabNo, String context) + { + if (ctx == null || context == null) + throw new IllegalArgumentException ("Require Context"); + String s = ctx.getProperty(WindowNo+"|"+TabNo+"|"+context); + if (s == null) + return getContext(ctx, WindowNo, context, false); + return s; + } // getContext + + /** + * Get Context and convert it to an integer (0 if error) + * @param ctx context + * @param context context key + * @return value + */ + public static int getContextAsInt(Properties ctx, String context) + { + if (ctx == null || context == null) + throw new IllegalArgumentException ("Require Context"); + String s = getContext(ctx, context); + if (s.length() == 0) + s = getContext(ctx, 0, context, false); // search 0 and defaults + if (s.length() == 0) + return 0; + // + try + { + return Integer.parseInt(s); + } + catch (NumberFormatException e) + { + s_log.log(Level.SEVERE, "(" + context + ") = " + s, e); + } + return 0; + } // getContextAsInt + + /** + * Get Context and convert it to an integer (0 if error) + * @param ctx context + * @param WindowNo window no + * @param context context key + * @return value or 0 + */ + public static int getContextAsInt(Properties ctx, int WindowNo, String context) + { + String s = getContext(ctx, WindowNo, context, false); + if (s.length() == 0) + return 0; + // + try + { + return Integer.parseInt(s); + } + catch (NumberFormatException e) + { + s_log.log(Level.SEVERE, "(" + context + ") = " + s, e); + } + return 0; + } // getContextAsInt + + /** + * Get Context and convert it to an integer (0 if error) + * @param ctx context + * @param WindowNo window no + * @param TabNo tab no + * @param context context key + * @return value or 0 + */ + public static int getContextAsInt (Properties ctx, int WindowNo, int TabNo, String context) + { + String s = getContext(ctx, WindowNo, TabNo, context); + if (s.length() == 0) + return 0; + // + try + { + return Integer.parseInt(s); + } + catch (NumberFormatException e) + { + s_log.log(Level.SEVERE, "(" + context + ") = " + s, e); + } + return 0; + } // getContextAsInt + + /** + * Is AutoCommit + * @param ctx context + * @return true if auto commit + */ + public static boolean isAutoCommit (Properties ctx) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + String s = getContext(ctx, "AutoCommit"); + if (s != null && s.equals("Y")) + return true; + return false; + } // isAutoCommit + + /** + * Is Window AutoCommit (if not set use default) + * @param ctx context + * @param WindowNo window no + * @return true if auto commit + */ + public static boolean isAutoCommit (Properties ctx, int WindowNo) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + String s = getContext(ctx, WindowNo, "AutoCommit", false); + if (s != null) + { + if (s.equals("Y")) + return true; + else + return false; + } + return isAutoCommit(ctx); + } // isAutoCommit + + + /** + * Is Auto New Record + * @param ctx context + * @return true if auto new + */ + public static boolean isAutoNew (Properties ctx) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + String s = getContext(ctx, "AutoNew"); + if (s != null && s.equals("Y")) + return true; + return false; + } // isAutoNew + + /** + * Is Window Auto New Record (if not set use default) + * @param ctx context + * @param WindowNo window no + * @return true if auto new record + */ + public static boolean isAutoNew (Properties ctx, int WindowNo) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + String s = getContext(ctx, WindowNo, "AutoNew", false); + if (s != null) + { + if (s.equals("Y")) + return true; + else + return false; + } + return isAutoNew(ctx); + } // isAutoNew + + + /** + * Is Sales Order Trx + * @param ctx context + * @return true if SO (default) + */ + public static boolean isSOTrx (Properties ctx) + { + String s = getContext(ctx, "IsSOTrx"); + if (s != null && s.equals("N")) + return false; + return true; + } // isSOTrx + + /** + * Is Sales Order Trx + * @param ctx context + * @param WindowNo window no + * @return true if SO (default) + */ + public static boolean isSOTrx (Properties ctx, int WindowNo) + { + String s = getContext(ctx, WindowNo, "IsSOTrx", true); + if (s != null && s.equals("N")) + return false; + return true; + } // isSOTrx + + /** + * Get Context and convert it to a Timestamp + * if error return today's date + * @param ctx context + * @param context context key + * @return Timestamp + */ + public static Timestamp getContextAsDate(Properties ctx, String context) + { + return getContextAsDate(ctx, 0, context); + } // getContextAsDate + + /** + * Get Context and convert it to a Timestamp + * if error return today's date + * @param ctx context + * @param WindowNo window no + * @param context context key + * @return Timestamp + */ + public static Timestamp getContextAsDate(Properties ctx, int WindowNo, String context) + { + if (ctx == null || context == null) + throw new IllegalArgumentException ("Require Context"); + String s = getContext(ctx, WindowNo, context, false); + // JDBC Format YYYY-MM-DD example 2000-09-11 00:00:00.0 + if (s == null || s.equals("")) + { + s_log.log(Level.SEVERE, "No value for: " + context); + return new Timestamp(System.currentTimeMillis()); + } + + // timestamp requires time + if (s.trim().length() == 10) + s = s.trim() + " 00:00:00.0"; + else if (s.indexOf('.') == -1) + s = s.trim() + ".0"; + + return Timestamp.valueOf(s); + } // getContextAsDate + + /** + * Get Login AD_Client_ID + * @param ctx context + * @return login AD_Client_ID + */ + public static int getAD_Client_ID (Properties ctx) + { + return Env.getContextAsInt(ctx, "#AD_Client_ID"); + } // getAD_Client_ID + + /** + * Get Login AD_Org_ID + * @param ctx context + * @return login AD_Org_ID + */ + public static int getAD_Org_ID (Properties ctx) + { + return Env.getContextAsInt(ctx, "#AD_Org_ID"); + } // getAD_Client_ID + + /** + * Get Login AD_User_ID + * @param ctx context + * @return login AD_User_ID + */ + public static int getAD_User_ID (Properties ctx) + { + return Env.getContextAsInt(ctx, "#AD_User_ID"); + } // getAD_User_ID + + /** + * Get Login AD_Role_ID + * @param ctx context + * @return login AD_Role_ID + */ + public static int getAD_Role_ID (Properties ctx) + { + return Env.getContextAsInt(ctx, "#AD_Role_ID"); + } // getAD_Role_ID + + /************************************************************************** + * Get Preference. + *

+	 *		0)	Current Setting
+	 *		1) 	Window Preference
+	 *		2) 	Global Preference
+	 *		3)	Login settings
+	 *		4)	Accounting settings
+	 *  
+ * @param ctx context + * @param AD_Window_ID window no + * @param context Entity to search + * @param system System level preferences (vs. user defined) + * @return preference value + */ + public static String getPreference (Properties ctx, int AD_Window_ID, String context, boolean system) + { + if (ctx == null || context == null) + throw new IllegalArgumentException ("Require Context"); + String retValue = null; + // + if (!system) // User Preferences + { + retValue = ctx.getProperty("P"+AD_Window_ID+"|"+context);// Window Pref + if (retValue == null) + retValue = ctx.getProperty("P|"+context); // Global Pref + } + else // System Preferences + { + retValue = ctx.getProperty("#"+context); // Login setting + if (retValue == null) + retValue = ctx.getProperty("$"+context); // Accounting setting + } + // + return (retValue == null ? "" : retValue); + } // getPreference + + /************************************************************************** + * Language issues + */ + + /** Context Language identifier */ + static public final String LANGUAGE = "#AD_Language"; + + /** + * Check Base Language + * @param ctx context + * @param tableName table to be translated + * @return true if base language and table not translated + */ + public static boolean isBaseLanguage (Properties ctx, String tableName) + { + /** + if (isBaseTranslation(tableName)) + return Language.isBaseLanguage (getAD_Language(ctx)); + else // No AD Table + if (!isMultiLingualDocument(ctx)) + return true; // access base table + **/ + return Language.isBaseLanguage (getAD_Language(ctx)); + } // isBaseLanguage + + /** + * Check Base Language + * @param AD_Language language + * @param tableName table to be translated + * @return true if base language and table not translated + */ + public static boolean isBaseLanguage (String AD_Language, String tableName) + { + /** + if (isBaseTranslation(tableName)) + return Language.isBaseLanguage (AD_Language); + else // No AD Table + if (!isMultiLingualDocument(s_ctx)) // Base Context + return true; // access base table + **/ + return Language.isBaseLanguage (AD_Language); + } // isBaseLanguage + + /** + * Check Base Language + * @param language language + * @param tableName table to be translated + * @return true if base language and table not translated + */ + public static boolean isBaseLanguage (Language language, String tableName) + { + /** + if (isBaseTranslation(tableName)) + return language.isBaseLanguage(); + else // No AD Table + if (!isMultiLingualDocument(s_ctx)) // Base Context + return true; // access base table + **/ + return language.isBaseLanguage(); + } // isBaseLanguage + + /** + * Table is in Base Translation (AD) + * @param tableName table + * @return true if base trl + */ + public static boolean isBaseTranslation (String tableName) + { + if (tableName.startsWith("AD") + || tableName.equals("C_Country_Trl") ) + return true; + return false; + } // isBaseTranslation + + /** + * Do we have Multi-Lingual Documents. + * Set in DB.loadOrgs + * @param ctx context + * @return true if multi lingual documents + */ + public static boolean isMultiLingualDocument (Properties ctx) + { + return MClient.get(ctx).isMultiLingualDocument(); + } // isMultiLingualDocument + + /** + * Get System AD_Language + * @param ctx context + * @return AD_Language eg. en_US + */ + public static String getAD_Language (Properties ctx) + { + if (ctx != null) + { + String lang = getContext(ctx, LANGUAGE); + if (lang != null || lang.length() > 0) + return lang; + } + return Language.getBaseAD_Language(); + } // getAD_Language + + /** + * Get System Language + * @param ctx context + * @return Language + */ + public static Language getLanguage (Properties ctx) + { + if (ctx != null) + { + String lang = getContext(ctx, LANGUAGE); + if (lang != null || lang.length() > 0) + return Language.getLanguage(lang); + } + return Language.getBaseLanguage(); + } // getLanguage + + /** + * Get Login Language + * @param ctx context + * @return Language + */ + public static Language getLoginLanguage (Properties ctx) + { + return Language.getLoginLanguage(); + } // getLanguage + + /** + * Verify Language. + * Check that language is supported by the system + * @param ctx might be updated with new AD_Language + * @param language language + */ + public static void verifyLanguage (Properties ctx, Language language) + { + if (language.isBaseLanguage()) + return; + + boolean isSystemLanguage = false; + ArrayList AD_Languages = new ArrayList(); + String sql = "SELECT DISTINCT AD_Language FROM AD_Message_Trl"; + try + { + PreparedStatement pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String AD_Language = rs.getString(1); + if (AD_Language.equals(language.getAD_Language())) + { + isSystemLanguage = true; + break; + } + AD_Languages.add(AD_Language); + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, "", e); + } + // Found it + if (isSystemLanguage) + return; + // No Language - set to System + if (AD_Languages.size() == 0) + { + s_log.warning ("NO System Language - Set to Base " + Language.getBaseAD_Language()); + language.setAD_Language(Language.getBaseAD_Language()); + return; + } + + for (int i = 0; i < AD_Languages.size(); i++) + { + String AD_Language = (String)AD_Languages.get(i); // en_US + String lang = AD_Language.substring(0, 2); // en + // + String langCompare = language.getAD_Language().substring(0, 2); + if (lang.equals(langCompare)) + { + s_log.fine("Found similar Language " + AD_Language); + language.setAD_Language(AD_Language); + return; + } + } + + // We found same language + // if (!"0".equals(Msg.getMsg(AD_Language, "0"))) + + s_log.warning ("Not System Language=" + language + + " - Set to Base Language " + Language.getBaseAD_Language()); + language.setAD_Language(Language.getBaseAD_Language()); + } // verifyLanguage + + /************************************************************************** + * Get Context as String array with format: key == value + * @param ctx context + * @return context string + */ + public static String[] getEntireContext(Properties ctx) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + Iterator keyIterator = ctx.keySet().iterator(); + String[] sList = new String[ctx.size()]; + int i = 0; + while (keyIterator.hasNext()) + { + Object key = keyIterator.next(); + sList[i++] = key.toString() + " == " + ctx.get(key).toString(); + } + + return sList; + } // getEntireContext + + /** + * Get Header info (connection, org, user) + * @param ctx context + * @param WindowNo window + * @return Header String + */ + public static String getHeader(Properties ctx, int WindowNo) + { + StringBuffer sb = new StringBuffer(); + if (WindowNo > 0) + sb.append(getContext(ctx, WindowNo, "WindowName", false)).append(" "); + sb.append(getContext(ctx, "#AD_User_Name")).append("@") + .append(getContext(ctx, "#AD_Client_Name")).append(".") + .append(getContext(ctx, "#AD_Org_Name")) + .append(" [").append(CConnection.get().toString()).append("]"); + return sb.toString(); + } // getHeader + + /** + * Clean up context for Window (i.e. delete it) + * @param ctx context + * @param WindowNo window + */ + public static void clearWinContext(Properties ctx, int WindowNo) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + // + Object[] keys = ctx.keySet().toArray(); + for (int i = 0; i < keys.length; i++) + { + String tag = keys[i].toString(); + if (tag.startsWith(WindowNo+"|")) + ctx.remove(keys[i]); + } + // Clear Lookup Cache + MLookupCache.cacheReset(WindowNo); + // MLocator.cacheReset(WindowNo); + // + removeWindow(WindowNo); + } // clearWinContext + + /** + * Clean up all context (i.e. delete it) + * @param ctx context + */ + public static void clearContext(Properties ctx) + { + if (ctx == null) + throw new IllegalArgumentException ("Require Context"); + ctx.clear(); + } // clearContext + + + /** + * Parse Context replaces global or Window context @tag@ with actual value. + * + * @tag@ are ignored otherwise "" is returned + * @param ctx context + * @param WindowNo Number of Window + * @param value Message to be parsed + * @param onlyWindow if true, no defaults are used + * @param ignoreUnparsable if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable + * @return parsed context + */ + public static String parseContext (Properties ctx, int WindowNo, String value, + boolean onlyWindow, boolean ignoreUnparsable) + { + if (value == null || value.length() == 0) + return ""; + + String token; + String inStr = new String(value); + StringBuffer outStr = new StringBuffer(); + + int i = inStr.indexOf('@'); + while (i != -1) + { + outStr.append(inStr.substring(0, i)); // up to @ + inStr = inStr.substring(i+1, inStr.length()); // from first @ + + int j = inStr.indexOf('@'); // next @ + if (j < 0) + { + s_log.log(Level.SEVERE, "No second tag: " + inStr); + return ""; // no second tag + } + + token = inStr.substring(0, j); + + String ctxInfo = getContext(ctx, WindowNo, token, onlyWindow); // get context + if (ctxInfo.length() == 0 && (token.startsWith("#") || token.startsWith("$")) ) + ctxInfo = getContext(ctx, token); // get global context + if (ctxInfo.length() == 0) + { + s_log.config("No Context Win=" + WindowNo + " for: " + token); + if (!ignoreUnparsable) + return ""; // token not found + } + else + outStr.append(ctxInfo); // replace context with Context + + inStr = inStr.substring(j+1, inStr.length()); // from second @ + i = inStr.indexOf('@'); + } + outStr.append(inStr); // add the rest of the string + + return outStr.toString(); + } // parseContext + + /** + * Parse Context replaces global or Window context @tag@ with actual value. + * + * @param ctx context + * @param WindowNo Number of Window + * @param value Message to be parsed + * @param onlyWindow if true, no defaults are used + * @return parsed String or "" if not successful + */ + public static String parseContext (Properties ctx, int WindowNo, String value, + boolean onlyWindow) + { + return parseContext(ctx, WindowNo, value, onlyWindow, false); + } // parseContext + + /*************************************************************************/ + + // Array of active Windows + private static ArrayList s_windows = new ArrayList(20); + + /** + * Add Container and return WindowNo. + * The container is a APanel, AWindow or JFrame/JDialog + * @param win window + * @return WindowNo used for context + */ + public static int createWindowNo(Container win) + { + int retValue = s_windows.size(); + s_windows.add(win); + return retValue; + } // createWindowNo + + /** + * Search Window by comparing the Frames + * @param container container + * @return WindowNo of container or 0 + */ + public static int getWindowNo (Container container) + { + if (container == null) + return 0; + JFrame winFrame = getFrame(container); + if (winFrame == null) + return 0; + + // loop through windows + for (int i = 0; i < s_windows.size(); i++) + { + Container cmp = (Container)s_windows.get(i); + if (cmp != null) + { + JFrame cmpFrame = getFrame(cmp); + if (winFrame.equals(cmpFrame)) + return i; + } + } + return 0; + } // getWindowNo + + /** + * Return the JFrame pointer of WindowNo - or null + * @param WindowNo window + * @return JFrame of WindowNo + */ + public static JFrame getWindow (int WindowNo) + { + JFrame retValue = null; + try + { + retValue = getFrame ((Container)s_windows.get(WindowNo)); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, e.toString()); + } + return retValue; + } // getWindow + + /** + * Remove window from active list + * @param WindowNo window + */ + private static void removeWindow (int WindowNo) + { + if (WindowNo < s_windows.size()) + s_windows.set(WindowNo, null); + } // removeWindow + + /** + * Clean up context for Window (i.e. delete it) + * @param WindowNo window + */ + public static void clearWinContext(int WindowNo) + { + clearWinContext (s_ctx, WindowNo); + } // clearWinContext + + /** + * Clean up all context (i.e. delete it) + */ + public static void clearContext() + { + s_ctx.clear(); + } // clearContext + + + /************************************************************************** + * Get Frame of Window + * @param container Container + * @return JFrame of container or null + */ + public static JFrame getFrame (Container container) + { + Container element = container; + while (element != null) + { + if (element instanceof JFrame) + return (JFrame)element; + element = element.getParent(); + } + return null; + } // getFrame + + /** + * Get Graphics of container or its parent. + * The element may not have a Graphic if not displayed yet, + * but the parent might have. + * @param container Container + * @return Graphics of container or null + */ + public static Graphics getGraphics (Container container) + { + Container element = container; + while (element != null) + { + Graphics g = element.getGraphics(); + if (g != null) + return g; + element = element.getParent(); + } + return null; + } // getFrame + + /** + * Return JDialog or JFrame Parent + * @param container Container + * @return JDialog or JFrame of container + */ + public static Window getParent (Container container) + { + Container element = container; + while (element != null) + { + if (element instanceof JDialog || element instanceof JFrame) + return (Window)element; + if (element instanceof Window) + return (Window)element; + element = element.getParent(); + } + return null; + } // getParent + + /************************************************************************** + * Get Image with File name + * + * @param fileNameInImageDir full file name in imgaes folder (e.g. Bean16.gif) + * @return image + */ + public static Image getImage (String fileNameInImageDir) + { + URL url = Adempiere.class.getResource("images/" + fileNameInImageDir); + if (url == null) + { + s_log.log(Level.SEVERE, "Not found: " + fileNameInImageDir); + return null; + } + Toolkit tk = Toolkit.getDefaultToolkit(); + return tk.getImage(url); + } // getImage + + /** + * Get ImageIcon. + * + * @param fileNameInImageDir full file name in imgaes folder (e.g. Bean16.gif) + * @return image + */ + public static ImageIcon getImageIcon (String fileNameInImageDir) + { + URL url = Adempiere.class.getResource("images/" + fileNameInImageDir); + if (url == null) + { + s_log.log(Level.SEVERE, "Not found: " + fileNameInImageDir); + return null; + } + return new ImageIcon(url); + } // getImageIcon + + + /*************************************************************************** + * Start Browser + * @param url url + */ + public static void startBrowser (String url) + { + s_log.info(url); + // OS command + String cmd = "explorer "; + if (!isWindows()) + cmd = "netscape "; + // + String execute = cmd + url; + try + { + Runtime.getRuntime().exec(execute); + } + catch (Exception e) + { + s_log.severe(execute + " - " + e); + } + } // startBrowser + + /** + * Do we run on Apple + * @return true if Mac + */ + public static boolean isMac() + { + String osName = System.getProperty ("os.name"); + osName = osName.toLowerCase(); + return osName.indexOf ("mac") != -1; + } // isMac + + /** + * Do we run on Windows + * @return true if windows + */ + public static boolean isWindows() + { + String osName = System.getProperty ("os.name"); + osName = osName.toLowerCase(); + return osName.indexOf ("windows") != -1; + } // isWindows + + + /** Array of hidden Windows */ + private static ArrayList s_hiddenWindows = new ArrayList(); + /** Closing Window Indicator */ + private static boolean s_closingWindows = false; + + /** + * Hide Window + * @param window window + * @return true if window is hidden, otherwise close it + */ + static public boolean hideWindow(CFrame window) + { + if (!Ini.isCacheWindow() || s_closingWindows) + return false; + for (int i = 0; i < s_hiddenWindows.size(); i++) + { + CFrame hidden = s_hiddenWindows.get(i); + s_log.info(i + ": " + hidden); + if (hidden.getAD_Window_ID() == window.getAD_Window_ID()) + return false; // already there + } + if (window.getAD_Window_ID() != 0) // workbench + { + if (s_hiddenWindows.add(window)) + { + window.setVisible(false); + s_log.info(window.toString()); + // window.dispatchEvent(new WindowEvent(window, WindowEvent.WINDOW_ICONIFIED)); + if (s_hiddenWindows.size() > 10) + s_hiddenWindows.remove(0); // sort of lru + return true; + } + } + return false; + } // hideWindow + + /** + * Show Window + * @param AD_Window_ID window + * @return true if window re-displayed + */ + static public boolean showWindow (int AD_Window_ID) + { + for (int i = 0; i < s_hiddenWindows.size(); i++) + { + CFrame hidden = s_hiddenWindows.get(i); + if (hidden.getAD_Window_ID() == AD_Window_ID) + { + s_hiddenWindows.remove(i); + s_log.info(hidden.toString()); + hidden.setVisible(true); + hidden.toFront(); + return true; + } + } + return false; + } // showWindow + + /** + * Clode Windows + */ + static void closeWindows () + { + s_closingWindows = true; + for (int i = 0; i < s_hiddenWindows.size(); i++) + { + CFrame hidden = s_hiddenWindows.get(i); + hidden.dispose(); + } + s_hiddenWindows.clear(); + s_closingWindows = false; + } // closeWindows + + /** + * Sleep + * @param sec seconds + */ + public static void sleep (int sec) + { + s_log.info("Start - Seconds=" + sec); + try + { + Thread.sleep(sec*1000); + } + catch (Exception e) + { + s_log.log(Level.WARNING, "", e); + } + s_log.info("End"); + } // sleep + + + /************************************************************************** + * Static Variables + */ + + /** Big Decimal 0 */ + static final public BigDecimal ZERO = new BigDecimal(0.0); + /** Big Decimal 1 */ + static final public BigDecimal ONE = new BigDecimal(1.0); + /** Big Decimal 100 */ + static final public BigDecimal ONEHUNDRED = new BigDecimal(100.0); + + /** New Line */ + public static final String NL = System.getProperty("line.separator"); + + + /** + * Static initializer + */ + static + { + // Set English as default Language + s_ctx.put(LANGUAGE, Language.getBaseAD_Language()); + } // static + +} // Env diff --git a/dbPort/src/org/compiere/util/Evaluatee.java b/dbPort/src/org/compiere/util/Evaluatee.java new file mode 100644 index 0000000000..81fb4825ab --- /dev/null +++ b/dbPort/src/org/compiere/util/Evaluatee.java @@ -0,0 +1,35 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + + +/** + * Evaluator source + * + * @author Jorg Janke + * @version $Id: Evaluatee.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public interface Evaluatee +{ + /** + * Get Variable Value + * @param variableName name + * @return value + */ + public String get_ValueAsString (String variableName); + +} // Evaluatee diff --git a/dbPort/src/org/compiere/util/Evaluator.java b/dbPort/src/org/compiere/util/Evaluator.java new file mode 100644 index 0000000000..b78089c941 --- /dev/null +++ b/dbPort/src/org/compiere/util/Evaluator.java @@ -0,0 +1,255 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.math.*; +import java.util.*; +import java.util.logging.*; + + +/** + * Expression Evaluator + * + * @author Jorg Janke + * @version $Id: Evaluator.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class Evaluator +{ + /** Static Logger */ + private static CLogger s_log = CLogger.getCLogger (Evaluator.class); + + /** + * Check if All Variables are Defined + * @param source source + * @param logic logic info + * @return true if fully defined + */ + public static boolean isAllVariablesDefined (Evaluatee source, String logic) + { + if (logic == null || logic.length() == 0) + return true; + // + int pos = 0; + while (pos < logic.length()) + { + int first = logic.indexOf('@', pos); + if (first == -1) + return true; + int second = logic.indexOf('@', first+1); + if (second == -1) + { + s_log.severe("No second @ in Logic: " + logic); + return false; + } + String variable = logic.substring(first+1, second-1); + String eval = source.get_ValueAsString (variable); + s_log.finest(variable + "=" + eval); + if (eval == null || eval.length() == 0) + return false; + // + pos = second + 1; + } + return true; + } // isAllVariablesDefined + + /** + * Evaluate Logic. + * + * format := [ ] + * expression := @@ + * logic := <|> | <&> + * exLogic := <=> | | <^> | <<> | <>> + * + * context := any global or window context + * value := strings can be with ' or " + * logic operators := AND or OR with the prevoius result from left to right + * + * Example '@AD_Table@=Test | @Language@=GERGER + * + * @param source class implementing get_ValueAsString(variable) + * @param logic logic string + * @return locic result + */ + public static boolean evaluateLogic (Evaluatee source, String logic) + { + // Conditional + StringTokenizer st = new StringTokenizer(logic.trim(), "&|", true); + int it = st.countTokens(); + if (((it/2) - ((it+1)/2)) == 0) // only uneven arguments + { + s_log.severe ("Logic does not comply with format " + + "' [ ]' => " + logic); + return false; + } + + boolean retValue = evaluateLogicTuple(source, st.nextToken()); + while (st.hasMoreTokens()) + { + String logOp = st.nextToken().trim(); + boolean temp = evaluateLogicTuple(source, st.nextToken()); + if (logOp.equals("&")) + retValue = retValue & temp; + else if (logOp.equals("|")) + retValue = retValue | temp; + else + { + s_log.log(Level.SEVERE, "Logic operant '|' or '&' expected => " + logic); + return false; + } + } // hasMoreTokens + return retValue; + } // evaluateLogic + + /** + * Evaluate @context@=value or @context@!value or @context@^value. + *
+	 *	value: strips ' and " always (no escape or mid stream)
+	 *  value: can also be a context variable
+	 *  
+ * @param source class implementing get_ValueAsString(variable) + * @param logic logic tuple + * @return true or false + */ + private static boolean evaluateLogicTuple (Evaluatee source, String logic) + { + StringTokenizer st = new StringTokenizer (logic.trim(), "!=^><", true); + if (st.countTokens() != 3) + { + s_log.log(Level.SEVERE, "Logic tuple does not comply with format " + + "'@context@=value' where operand could be one of '=!^><' => " + logic); + return false; + } + // First Part + String first = st.nextToken().trim(); // get '@tag@' + String firstEval = first.trim(); + if (first.indexOf('@') != -1) // variable + { + first = first.replace ('@', ' ').trim (); // strip 'tag' + firstEval = source.get_ValueAsString (first); // replace with it's value + } + firstEval = firstEval.replace('\'', ' ').replace('"', ' ').trim(); // strip ' and " + + // Comperator + String operand = st.nextToken(); + + // Second Part + String second = st.nextToken(); // get value + String secondEval = second.trim(); + if (second.indexOf('@') != -1) // variable + { + second = second.replace('@', ' ').trim(); // strip tag + secondEval = source.get_ValueAsString (second); // replace with it's value + } + secondEval = secondEval.replace('\'', ' ').replace('"', ' ').trim(); // strip ' and " + + // Handling of ID compare (null => 0) + if (first.indexOf("_ID") != -1 && firstEval.length() == 0) + firstEval = "0"; + if (second.indexOf("_ID") != -1 && secondEval.length() == 0) + secondEval = "0"; + + // Logical Comparison + boolean result = evaluateLogicTuple (firstEval, operand, secondEval); + // + if (CLogMgt.isLevelFinest()) + s_log.finest(logic + + " => \"" + firstEval + "\" " + operand + " \"" + secondEval + "\" => " + result); + // + return result; + } // evaluateLogicTuple + + /** + * Evaluate Logic Tuple + * @param value1 value + * @param operand operand = ~ ^ ! > < + * @param value2 + * @return evaluation + */ + private static boolean evaluateLogicTuple (String value1, String operand, String value2) + { + if (value1 == null || operand == null || value2 == null) + return false; + + BigDecimal value1bd = null; + BigDecimal value2bd = null; + try + { + if (!value1.startsWith("'")) + value1bd = new BigDecimal (value1); + if (!value2.startsWith("'")) + value2bd = new BigDecimal (value2); + } + catch (Exception e) + { + value1bd = null; + value2bd = null; + } + // + if (operand.equals("=")) + { + if (value1bd != null && value2bd != null) + return value1bd.compareTo(value2bd) == 0; + return value1.compareTo(value2) == 0; + } + else if (operand.equals("<")) + { + if (value1bd != null && value2bd != null) + return value1bd.compareTo(value2bd) < 0; + return value1.compareTo(value2) < 0; + } + else if (operand.equals(">")) + { + if (value1bd != null && value2bd != null) + return value1bd.compareTo(value2bd) > 0; + return value1.compareTo(value2) > 0; + } + else // interpreted as not + { + if (value1bd != null && value2bd != null) + return value1bd.compareTo(value2bd) != 0; + return value1.compareTo(value2) != 0; + } + } // evaluateLogicTuple + + + /** + * Parse String and add variables with @ to the list. + * @param list list to be added to + * @param parseString string to parse for variables + */ + public static void parseDepends (ArrayList list, String parseString) + { + if (parseString == null || parseString.length() == 0) + return; + // log.fine( "MField.parseDepends", parseString); + String s = parseString; + // while we have variables + while (s.indexOf("@") != -1) + { + int pos = s.indexOf("@"); + s = s.substring(pos+1); + pos = s.indexOf("@"); + if (pos == -1) + continue; // error number of @@ not correct + String variable = s.substring(0, pos); + s = s.substring(pos+1); + // log.fine( variable); + list.add(variable); + } + } // parseDepends + +} // Evaluator diff --git a/dbPort/src/org/compiere/util/GenerateModel.java b/dbPort/src/org/compiere/util/GenerateModel.java new file mode 100644 index 0000000000..3c7140bce1 --- /dev/null +++ b/dbPort/src/org/compiere/util/GenerateModel.java @@ -0,0 +1,826 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.math.*; +import java.sql.*; +import java.util.logging.*; +import org.compiere.*; + +/** + * Generate Model Classes extending PO. + * Base class for CMP interface - will be extended to create byte code directly + * + * @author Jorg Janke + * @version $Id: GenerateModel.java,v 1.5 2006/07/30 00:54:36 jjanke Exp $ + */ +public class GenerateModel +{ + /** + * Generate PO Class + * @param AD_Table_ID table id + * @param directory directory with \ or / at the end. + * @param packageName package name + */ + public GenerateModel (int AD_Table_ID, String directory, String packageName) + { + // create column access methods + StringBuffer mandatory = new StringBuffer(); + StringBuffer sb = createColumns(AD_Table_ID, mandatory); + // add header stuff + String tableName = createHeader(AD_Table_ID, sb, mandatory, packageName); + // Save it + writeToFile (sb, directory + tableName + ".java"); + } // GenerateModel + + /** File Header */ + public static final String COPY = + "/******************************************************************************\n" + +" * Product: Adempiere ERP & CRM Smart Business Solution *\n" + +" * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *\n" + +" * This program is free software; you can redistribute it and/or modify it *\n" + +" * under the terms version 2 of the GNU General Public License as published *\n" + +" * by the Free Software Foundation. This program is distributed in the hope *\n" + +" * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *\n" + +" * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *\n" + +" * See the GNU General Public License for more details. *\n" + +" * You should have received a copy of the GNU General Public License along *\n" + +" * with this program; if not, write to the Free Software Foundation, Inc., *\n" + +" * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *\n" + +" * For the text or an alternative of this public license, you may reach us *\n" + +" * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *\n" + +" * or via info@compiere.org or http://www.compiere.org/license.html *\n" + +" *****************************************************************************/\n"; + + /** Generated on */ + private Timestamp s_run = new Timestamp(System.currentTimeMillis()); + + /** Logger */ + private static CLogger log = CLogger.getCLogger (GenerateModel.class); + + /** + * Add Header info to buffer + * @param AD_Table_ID table + * @param sb buffer + * @param mandatory init call for mandatory columns + * @param packageName package name + * @return class name + */ + private String createHeader (int AD_Table_ID, StringBuffer sb, StringBuffer mandatory, String packageName) + { + String tableName = ""; + int accessLevel = 0; + String sql = "SELECT TableName, AccessLevel FROM AD_Table WHERE AD_Table_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Table_ID); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + tableName = rs.getString(1); + accessLevel = rs.getInt(2); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + if (tableName == null) + throw new RuntimeException ("TableName not found for ID=" + AD_Table_ID); + // + String accessLevelInfo = accessLevel + " "; + if (accessLevel >= 4 ) + accessLevelInfo += "- System "; + if (accessLevel == 2 || accessLevel == 3 || accessLevel == 6 || accessLevel == 7) + accessLevelInfo += "- Client "; + if (accessLevel == 1 || accessLevel == 3 || accessLevel == 5 || accessLevel == 7) + accessLevelInfo += "- Org "; + + String keyColumn = tableName + "_ID"; + String className = "X_" + tableName; + // + StringBuffer start = new StringBuffer () + .append (COPY) + .append ("package " + packageName + ";\n" + + "/** Generated Model - DO NOT CHANGE */\n"); + if (!packageName.equals("org.compiere.model")) + start.append("import org.compiere.model.*;"); + start.append("import java.util.*;" + + "import java.sql.*;" + + "import java.math.*;" + + "import org.compiere.util.*;" + // Class + + "/** Generated Model for ").append(tableName).append("\n" + + " * @author Jorg Janke (generated) \n" + + " * @version ").append(Adempiere.MAIN_VERSION).append(" - ").append(s_run).append(" */\n" + + "public class ").append(className).append(" extends PO" + + "{" + // Standard Constructor + + "/** Standard Constructor\n@param ctx context\n@param " + + keyColumn + " id\n@param trxName transaction\n*/\n" + + "public ").append(className).append(" (Properties ctx, int ").append(keyColumn) + .append(", String trxName)" + + "{" + + "super (ctx, ").append(keyColumn).append(", trxName);" + + "/** if (").append(keyColumn).append(" == 0)" + + "{").append(mandatory).append("} */\n" + + "}" // Constructor End + // Short Constructor +// + "/** Short Constructor */\n" +// + "public ").append(className).append(" (Properties ctx, int ").append(keyColumn).append(")" +// + "{" +// + "this (ctx, ").append(keyColumn).append(", null);" +// + "}" // Constructor End + + // Load Constructor + + "/** Load Constructor \n@param ctx context\n@param rs result set \n@param trxName transaction\n*/\n" + + "public ").append(className).append(" (Properties ctx, ResultSet rs, String trxName)" + + "{" + + "super (ctx, rs, trxName);" + + "}" // Load Constructor End + // + + "/** AD_Table_ID=").append(AD_Table_ID).append(" */\n" + + "public static final int Table_ID=").append(AD_Table_ID).append(";\n" + // + + "/** TableName=").append(tableName).append(" */\n" + + "public static final String Table_Name=\"").append(tableName).append("\";\n" + + "protected static KeyNamePair Model = new KeyNamePair(").append(AD_Table_ID).append(",\"").append(tableName).append("\");\n" + // + + "protected BigDecimal accessLevel = new BigDecimal(").append(accessLevel).append(");" + + "/** AccessLevel\n@return ").append(accessLevelInfo).append("\n*/\n" + + "protected int get_AccessLevel()" + + "{" + + "return accessLevel.intValue();" + + "}" + // + + "/** Load Meta Data\n@param ctx context\n@return PO Info\n*/\n" + + "protected POInfo initPO (Properties ctx)" + + "{" + + "POInfo poi = POInfo.getPOInfo (ctx, Table_ID);" + + "return poi;" + + "}" // initPO + // + + "/** Info\n@return info\n*/\n" + + "public String toString()" + + "{" + + "StringBuffer sb = new StringBuffer (\"").append(className).append("[\")" + + ".append(get_ID()).append(\"]\");" + + "return sb.toString();" + + "}"); + + StringBuffer end = new StringBuffer ("}"); + // + sb.insert(0, start); + sb.append(end); + + return className; + } // createHeader + + + /** + * Create Column access methods + * @param AD_Table_ID table + * @param mandatory init call for mandatory columns + * @return set/get method + */ + private StringBuffer createColumns (int AD_Table_ID, StringBuffer mandatory) + { + StringBuffer sb = new StringBuffer(); + String sql = "SELECT c.ColumnName, c.IsUpdateable, c.IsMandatory," // 1..3 + + " c.AD_Reference_ID, c.AD_Reference_Value_ID, DefaultValue, SeqNo, " // 4..7 + + " c.FieldLength, c.ValueMin, c.ValueMax, c.VFormat, c.Callout, " // 8..12 + + " c.Name, c.Description, c.ColumnSQL, c.IsEncrypted " + + "FROM AD_Column c " + + "WHERE c.AD_Table_ID=?" + + " AND c.IsActive='Y'" + + " AND c.ColumnName <> 'AD_Client_ID'" + + " AND c.ColumnName <> 'AD_Org_ID'" + + " AND c.ColumnName <> 'IsActive'" + + " AND c.ColumnName NOT LIKE 'Created%'" + + " AND c.ColumnName NOT LIKE 'Updated%' " + + "ORDER BY c.ColumnName"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Table_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String columnName = rs.getString(1); + boolean isUpdateable = "Y".equals(rs.getString(2)); + boolean isMandatory = "Y".equals(rs.getString(3)); + int displayType = rs.getInt(4); + int AD_Reference_Value_ID = rs.getInt(5); + String defaultValue = rs.getString(6); + int seqNo = rs.getInt(7); + int fieldLength = rs.getInt(8); + String ValueMin = rs.getString(9); + String ValueMax = rs.getString(10); + String VFormat = rs.getString(11); + String Callout = rs.getString(12); + String Name = rs.getString(13); + String Description = rs.getString(14); + String ColumnSQL = rs.getString(15); + boolean virtualColumn = ColumnSQL != null && ColumnSQL.length() > 0; + boolean IsEncrypted = "Y".equals(rs.getString(16)); + // + sb.append(createColumnMethods (mandatory, + columnName, isUpdateable, isMandatory, + displayType, AD_Reference_Value_ID, fieldLength, + defaultValue, ValueMin, ValueMax, VFormat, + Callout, Name, Description, virtualColumn, IsEncrypted)); + // + if (seqNo == 1) + sb.append(createKeyNamePair(columnName, displayType)); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + return sb; + } // createColumns + + /** + * Create set/get methods for column + * @param mandatory init call for mandatory columns + * @param columnName column name + * @param isUpdateable updateable + * @param isMandatory mandatory + * @param displayType display type + * @param AD_Reference_ID validation reference + * @param fieldLength int + * @param defaultValue default value + * @param ValueMin String + * @param ValueMax String + * @param VFormat String + * @param Callout String + * @param Name String + * @param Description String + * @param virtualColumn virtual column + * @param IsEncrypted stored encrypted + @return set/get method + */ + private String createColumnMethods (StringBuffer mandatory, + String columnName, boolean isUpdateable, boolean isMandatory, + int displayType, int AD_Reference_ID, int fieldLength, + String defaultValue, String ValueMin, String ValueMax, String VFormat, + String Callout, String Name, String Description, + boolean virtualColumn, boolean IsEncrypted) + { + // Clazz + Class clazz = DisplayType.getClass(displayType, true); + if (defaultValue == null) + defaultValue = ""; + if (DisplayType.isLOB(displayType)) // No length check for LOBs + fieldLength = 0; + + // Handle Posted + if (columnName.equalsIgnoreCase("Posted") + || columnName.equalsIgnoreCase("Processed") + || columnName.equalsIgnoreCase("Processing")) + { + clazz = Boolean.class; + AD_Reference_ID = 0; + } + // Record_ID + else if (columnName.equalsIgnoreCase("Record_ID")) + { + clazz = Integer.class; + AD_Reference_ID = 0; + } + // String Key + else if (columnName.equalsIgnoreCase("AD_Language") + || columnName.equalsIgnoreCase("EntityType")) + { + clazz = String.class; + } + // Data Type + String dataType = clazz.getName(); + dataType = dataType.substring(dataType.lastIndexOf('.')+1); + if (dataType.equals("Boolean")) + dataType = "boolean"; + else if (dataType.equals("Integer")) + dataType = "int"; + else if (displayType == DisplayType.Binary) + dataType = "byte[]"; + + + StringBuffer sb = new StringBuffer(); + // ****** Set Comment ****** + sb.append("/** Set ").append(Name); + sb.append(".\n@param ").append(columnName).append(" "); + if (Description != null && Description.length() > 0) + sb.append(Description); + else + sb.append(Name); + sb.append(" */\n"); + + // Set ******** + String setValue = "set_Value"; + if (IsEncrypted) + setValue = "set_ValueE"; + // public void setColumn (xxx variable) + sb.append("public "); + if (!isUpdateable) + { + setValue = "set_ValueNoCheck"; + if (IsEncrypted) + setValue = "set_ValueNoCheckE"; + } + sb.append("void set").append(columnName).append(" (").append(dataType).append(" ").append(columnName).append(")" + + "{"); + // List Validation + if (AD_Reference_ID != 0) + { + String staticVar = addListValidation (sb, AD_Reference_ID, columnName, !isMandatory); + sb.insert(0, staticVar); // first check + } + // setValue ("ColumnName", xx); + if (virtualColumn) + { + sb.append ("throw new IllegalArgumentException (\"").append(columnName).append(" is virtual column\");"); + } + else if (clazz.equals(Integer.class)) + { + if (columnName.endsWith("_ID")) + { + if (isMandatory) // check mandatory ID + { + int firstOK = 1; // Valid ID 0 + if (columnName.equals("AD_Client_ID") || columnName.equals("AD_Org_ID") + || columnName.equals("Record_ID") || columnName.equals("C_DocType_ID") + || columnName.equals("Node_ID") || columnName.equals("AD_Role_ID") + || columnName.equals("M_AttributeSet_ID") || columnName.equals("M_AttributeSetInstance_ID")) + firstOK = 0; + sb.append("if (").append (columnName) + .append (" < ").append(firstOK).append(") throw new IllegalArgumentException (\"") + .append(columnName).append(" is mandatory.\");"); + } + else // set optional _ID to null if 0 + sb.append("if (").append (columnName).append (" <= 0) ") + .append(setValue).append(" (\"").append(columnName).append("\", null); else \n"); + } + sb.append(setValue).append(" (\"").append(columnName).append("\", new Integer(").append(columnName).append("));"); + } + else if (clazz.equals(Boolean.class)) + sb.append(setValue).append(" (\"").append(columnName).append("\", new Boolean(").append(columnName).append("));"); + else + { + if (isMandatory && AD_Reference_ID == 0) // does not apply to int/boolean + { + sb.append("if (") + .append (columnName).append (" == null)" + + " throw new IllegalArgumentException (\"") + .append(columnName).append(" is mandatory.\");"); + } + // String length check + if (clazz.equals(String.class) && fieldLength > 0) + { + sb.append ("if ("); + if (!isMandatory) + sb.append(columnName).append(" != null && "); + sb.append(columnName).append(".length() > ").append(fieldLength) + .append("){log.warning(\"Length > ") + .append(fieldLength).append(" - truncated\");") + .append(columnName).append(" = ") + .append(columnName).append(".substring(0,").append(fieldLength-1).append(");}"); + } + + // + sb.append (setValue).append(" (\"").append (columnName).append ("\", ") + .append (columnName).append (");"); + } + sb.append("}"); + + // Mandatory call in constructor + if (isMandatory) + { + mandatory.append("set").append(columnName).append(" ("); + if (clazz.equals(Integer.class)) + mandatory.append("0"); + else if (clazz.equals(Boolean.class)) + { + if (defaultValue.indexOf('Y') != -1) + mandatory.append(true); + else + mandatory.append("false"); + } + else if (clazz.equals(BigDecimal.class)) + mandatory.append("Env.ZERO"); + else if (clazz.equals(Timestamp.class)) + mandatory.append("new Timestamp(System.currentTimeMillis())"); + else + mandatory.append("null"); + mandatory.append(");"); + if (defaultValue.length() > 0) + mandatory.append("// ").append(defaultValue).append(Env.NL); + } + + + // ****** Get Comment ****** + sb.append("/** Get ").append(Name); + if (Description != null && Description.length() > 0) + sb.append(".\n@return ").append(Description); + else + sb.append(".\n@return ").append(Name); + sb.append(" */\n"); + + // Get ******** + String getValue = "get_Value"; + if (IsEncrypted) + getValue = "get_ValueE"; + sb.append("public ").append(dataType); + if (clazz.equals(Boolean.class)) + { + sb.append(" is"); + if (columnName.toLowerCase().startsWith("is")) + sb.append(columnName.substring(2)); + else + sb.append(columnName); + } + else + sb.append(" get").append(columnName); + sb.append("() {"); + if (clazz.equals(Integer.class)) + sb.append("Integer ii = (Integer)") + .append(getValue).append("(\"").append(columnName).append("\");" + + "if (ii == null)" + + " return 0;" + + "return ii.intValue();"); + else if (clazz.equals(BigDecimal.class)) + sb.append("BigDecimal bd = (BigDecimal)").append(getValue) + .append("(\"").append(columnName).append("\");" + + "if (bd == null)" + + " return Env.ZERO;" + + "return bd;"); + else if (clazz.equals(Boolean.class)) + sb.append("Object oo = ").append(getValue) + .append("(\"").append(columnName).append("\");" + + "if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return \"Y\".equals(oo);}" + + "return false;"); + else if (dataType.equals("Object")) + sb.append("return ").append(getValue) + .append("(\"").append(columnName).append("\");"); + else + sb.append("return (").append(dataType).append(")").append(getValue) + .append("(\"").append(columnName).append("\");"); + sb.append("}"); + // + return sb.toString(); + } // createColumnMethods + + + /** + * Add List Validation + * @param sb buffer - example: + if (NextAction.equals("N") || NextAction.equals("F")); + else throw new IllegalArgumentException ("NextAction Invalid value - Reference_ID=219 - N - F"); + * @param AD_Reference_ID reference + * @param columnName column + * @param nullable the validation must allow null values + * @return static parameter - Example: + public static final int NEXTACTION_AD_Reference_ID=219; + public static final String NEXTACTION_None = "N"; + public static final String NEXTACTION_FollowUp = "F"; + */ + private String addListValidation (StringBuffer sb, int AD_Reference_ID, + String columnName, boolean nullable) + { + StringBuffer retValue = new StringBuffer(); + retValue.append("\n/** ").append(columnName).append(" AD_Reference_ID=").append(AD_Reference_ID) .append(" */\n") + .append("public static final int ").append(columnName.toUpperCase()) + .append("_AD_Reference_ID=").append(AD_Reference_ID).append(";"); + // + boolean found = false; + StringBuffer values = new StringBuffer("Reference_ID=") + .append(AD_Reference_ID); + StringBuffer statement = new StringBuffer(); + if (nullable) + statement.append("if (").append(columnName).append(" == null"); + // + String sql = "SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=?"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Reference_ID); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + String value = rs.getString(1); + values.append(" - ").append(value); + if (statement.length() == 0) + statement.append("if (").append(columnName) + .append(".equals(\"").append(value).append("\")"); + else + statement.append(" || ").append(columnName) + .append(".equals(\"").append(value).append("\")"); + if (!found) + { + found = true; + sb.append("if (") + .append (columnName).append (" == null)" + + " throw new IllegalArgumentException (\"") + .append(columnName).append(" is mandatory\");"); + } + // Name (SmallTalkNotation) + String name = rs.getString(2); + char[] nameArray = name.toCharArray(); + StringBuffer nameClean = new StringBuffer(); + boolean initCap = true; + for (int i = 0; i < nameArray.length; i++) + { + char c = nameArray[i]; + if (Character.isJavaIdentifierPart(c)) + { + if (initCap) + nameClean.append(Character.toUpperCase(c)); + else + nameClean.append(c); + initCap = false; + } + else + { + if (c == '+') + nameClean.append("Plus"); + else if (c == '-') + nameClean.append("_"); + else if (c == '>') + { + if (name.indexOf('<') == -1) // ignore + nameClean.append("Gt"); + } + else if (c == '<') + { + if (name.indexOf('>') == -1) // ignore + nameClean.append("Le"); + } + else if (c == '!') + nameClean.append("Not"); + else if (c == '=') + nameClean.append("Eq"); + else if (c == '~') + nameClean.append("Like"); + initCap = true; + } + } + retValue.append("/** ").append(name).append(" = ").append(value).append(" */\n"); + retValue.append("public static final String ").append(columnName.toUpperCase()) + .append("_").append(nameClean) + .append(" = \"").append(value).append("\";"); + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.log(Level.SEVERE, sql, e); + found = false; + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + statement.append(")" + + "; " + + "else " + + "throw new IllegalArgumentException (\"").append(columnName) + .append(" Invalid value - \" + ").append(columnName) + .append(" + \" - ").append(values).append("\");"); + // + if (found && !columnName.equals("EntityType")) + sb.append (statement); + return retValue.toString(); + } // addListValidation + + /** + * Create getKeyNamePair() method with first identifier + * @param columnName name + * * @param displayType int + @return method code + */ + private StringBuffer createKeyNamePair (String columnName, int displayType) + { + String method = "get" + columnName + "()"; + if (displayType != DisplayType.String) + method = "String.valueOf(" + method + ")"; + StringBuffer sb = new StringBuffer("/** Get Record ID/ColumnName\n@return ID/ColumnName pair\n*/" + + "public KeyNamePair getKeyNamePair() " + + "{return new KeyNamePair(get_ID(), ").append(method).append(");}"); + return sb; + } // createKeyNamePair + + + /************************************************************************** + * Write to file + * @param sb string buffer + * @param fileName file name + */ + private void writeToFile (StringBuffer sb, String fileName) + { + try + { + File out = new File (fileName); + FileWriter fw = new FileWriter (out); + for (int i = 0; i < sb.length(); i++) + { + char c = sb.charAt(i); + // after + if (c == ';' || c == '}') + { + fw.write (c); + if (sb.substring(i+1).startsWith("//")) + fw.write('\t'); + else + fw.write(Env.NL); + } + // before & after + else if (c == '{') + { + fw.write(Env.NL); + fw.write (c); + fw.write(Env.NL); + } + else + fw.write (c); + } + fw.flush (); + fw.close (); + float size = out.length(); + size /= 1024; + log.info(out.getAbsolutePath() + " - " + size + " kB"); + } + catch (Exception ex) + { + log.log(Level.SEVERE, fileName, ex); + } + } // writeToFile + + /** + * String representation + * @return string representation + */ + public String toString() + { + StringBuffer sb = new StringBuffer ("GenerateModel[") + .append("]"); + return sb.toString(); + } // toString + + + + /************************************************************************** + * Generate PO Model Class. + *
+	 * 	Example: java GenerateModel.class mydirectory myPackage 'U','A'
+	 * 	would generate entity type User and Application classes into mydirectory.
+	 * 	Without parameters, the default is used:
+	 * 	C:\Adempiere\adempiere-all\extend\src\adempiere\model\ adempiere.model 'U','A'
+	 * 	
+ * @param args directory package entityType + * - directory where to save the generated file + * - package of the classes to be generated + * - entityType to be generated + */ + public static void main (String[] args) + { + org.compiere.Adempiere.startupEnvironment(true); + CLogMgt.setLevel(Level.FINE); + // CLogMgt.setLevel(Level.ALL); + log.info("Generate Model $Revision: 1.5 $"); + log.info("----------------------------------"); + // first parameter + String directory = "C:\\Adempiere\\adempiere-all\\extend\\src\\adempiere\\model\\"; + if (args.length > 0) + directory = args[0]; + if (directory == null || directory.length() == 0) + { + System.err.println("No Directory"); + System.exit(1); + } + log.info("Directory: " + directory); + + // second parameter + String packageName = "adempiere.model"; + if (args.length > 1) + packageName = args[1]; + if (packageName == null || packageName.length() == 0) + { + System.err.println("No package"); + System.exit(1); + } + log.info("Package: " + packageName); + + // third parameter + String entityType = "'U','A'"; // User, Application + if (args.length > 2) + entityType = args[2]; + if (entityType == null || entityType.length() == 0) + { + System.err.println("No EntityType"); + System.exit(1); + } + StringBuffer sql = new StringBuffer("EntityType IN (") + .append(entityType).append(")"); + log.info(sql.toString()); + log.info("----------------------------------"); + + // complete sql + sql.insert(0, "SELECT AD_Table_ID " + + "FROM AD_Table " + + "WHERE (TableName IN ('RV_WarehousePrice','RV_BPartner')" // special views + + " OR IsView='N')" + + " AND TableName NOT LIKE '%_Trl' AND "); + sql.append(" ORDER BY TableName"); + + // + int count = 0; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql.toString(), null); + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + new GenerateModel(rs.getInt(1), directory, packageName); + count++; + } + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + log.severe("main - " + e); + } + finally + { + try + { + if (pstmt != null) + pstmt.close (); + } + catch (Exception e) + {} + pstmt = null; + } + log.info("Generated = " + count); + + } // main + +} // GenerateModel diff --git a/dbPort/src/org/compiere/util/Login.java b/dbPort/src/org/compiere/util/Login.java new file mode 100644 index 0000000000..eb6df324cd --- /dev/null +++ b/dbPort/src/org/compiere/util/Login.java @@ -0,0 +1,1119 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.security.*; +import java.sql.*; +import java.util.*; +import java.util.logging.*; +import javax.swing.*; +// +import org.compiere.*; +import org.compiere.db.*; +import org.compiere.model.*; + + +/** + * Login Manager + * + * @author Jorg Janke + * @version $Id: Login.java,v 1.6 2006/10/02 05:19:06 jjanke Exp $ + */ +public class Login +{ + /** + * Test Init - Set Environment for tests + * @param isClient client session + * @return Context + */ + public static Properties initTest (boolean isClient) + { + // logger.entering("Env", "initTest"); + Adempiere.startupEnvironment(true); + // Test Context + Properties ctx = Env.getCtx(); + Login login = new Login(ctx); + KeyNamePair[] roles = login.getRoles(CConnection.get(), + "System", "System", true); + // load role + if (roles != null && roles.length > 0) + { + KeyNamePair[] clients = login.getClients (roles[0]); + // load client + if (clients != null && clients.length > 0) + { + KeyNamePair[] orgs = login.getOrgs(clients[0]); + // load org + if (orgs != null && orgs.length > 0) + { + KeyNamePair[] whs = login.getWarehouses(orgs[0]); + // + login.loadPreferences(orgs[0], null, null, null); + } + } + } + // + Env.setContext(ctx, "#Date", "2000-01-01"); + // logger.exiting("Env", "initTest"); + return ctx; + } // testInit + + /** + * Java Version Test + * @param isClient client connection + * @return true if Java Version is OK + */ + public static boolean isJavaOK (boolean isClient) + { + // Java System version check + String jVersion = System.getProperty("java.version"); + if (jVersion.startsWith("1.5.0")) + return true; + //vpj-cd e-evolution support to java 6 + if (jVersion.startsWith("1.6.0")) + return true; + //end + // Warning + boolean ok = false; + // if (jVersion.startsWith("1.4") + // || jVersion.startsWith("1.5.1")) // later/earlier release + // ok = true; + + // Error Message + StringBuffer msg = new StringBuffer(); + msg.append(System.getProperty("java.vm.name")).append(" - ").append(jVersion); + if (ok) + msg.append("(untested)"); + msg.append(" <> 1.5.0"); + // + if (isClient) + JOptionPane.showMessageDialog(null, msg.toString(), + org.compiere.Adempiere.getName() + " - Java Version Check", + ok ? JOptionPane.WARNING_MESSAGE : JOptionPane.ERROR_MESSAGE); + else + log.severe(msg.toString()); + return ok; + } // isJavaOK + + + /************************************************************************** + * Login + * @param ctx context + */ + public Login (Properties ctx) + { + if (ctx == null) + throw new IllegalArgumentException("Context missing"); + m_ctx = ctx; + } // Login + + /** Logger */ + private static CLogger log = CLogger.getCLogger(Login.class); + /** Context */ + private Properties m_ctx = null; + /** Connection Profile */ + private String m_connectionProfile = null; + + + /** + * (Test) Client Login. + *

+ * - Get Connection + * - Compare User info + *

+ * Sets Conext with login info + * @param cc connection + * @param app_user user + * @param app_pwd pwd + * @param force ignore pwd + * @return Array of Role KeyNamePair or null if error + * The error (NoDatabase, UserPwdError, DBLogin) is saved in the log + */ + protected KeyNamePair[] getRoles (CConnection cc, + String app_user, String app_pwd, boolean force) + { + // Establish connection + DB.setDBTarget(cc); + Env.setContext(m_ctx, "#Host", cc.getAppsHost()); + Env.setContext(m_ctx, "#Database", cc.getDbName()); + + if (DB.getConnectionRO() == null) + { + log.saveError("NoDatabase", ""); + return null; + } + if (app_pwd == null) + return null; + // + return getRoles (app_user, app_pwd, force); + } // getRoles + + /** + * (Web) Client Login. + *

+ * Compare User Info + *

+ * Sets Conext with login info + * @param app_user Principal + * @return role array or null if in error. + * The error (NoDatabase, UserPwdError, DBLogin) is saved in the log + */ + public KeyNamePair[] getRoles (Principal app_user) + { + if (app_user == null) + return null; + // login w/o password as previously authorized + return getRoles (app_user.getName(), null, false); + } // getRoles + + /** + * Client Login. + *

+ * Compare User Info + *

+ * Sets Conext with login info + * @param app_user user id + * @param app_pwd password + * @return role array or null if in error. + * The error (NoDatabase, UserPwdError, DBLogin) is saved in the log + */ + public KeyNamePair[] getRoles (String app_user, String app_pwd) + { + return getRoles (app_user, app_pwd, false); + } // login + + /** + * Actual DB login procedure. + * @param app_user user + * @param app_pwd pwd + * @param force ignore pwd + * @return role array or null if in error. + * The error (NoDatabase, UserPwdError, DBLogin) is saved in the log + */ + private KeyNamePair[] getRoles (String app_user, String app_pwd, boolean force) + { + log.info("User=" + app_user); + long start = System.currentTimeMillis(); + if (app_user == null) + { + log.warning("No Apps User"); + return null; + } + + // Authentification + boolean authenticated = false; + MSystem system = MSystem.get(m_ctx); + if (system.isLDAP()) + { + authenticated = system.isLDAP(app_user, app_pwd); + if (authenticated) + app_pwd = null; + // if not authenticated, use AD_User as backup + } + else if (app_pwd == null || app_pwd.length() == 0) + { + log.warning("No Apps Password"); + return null; + } + + KeyNamePair[] retValue = null; + ArrayList list = new ArrayList(); + // + StringBuffer sql = new StringBuffer("SELECT u.AD_User_ID, r.AD_Role_ID,r.Name,") + .append(" u.ConnectionProfile ") + .append("FROM AD_User u") + .append(" INNER JOIN AD_User_Roles ur ON (u.AD_User_ID=ur.AD_User_ID AND ur.IsActive='Y')") + .append(" INNER JOIN AD_Role r ON (ur.AD_Role_ID=r.AD_Role_ID AND r.IsActive='Y') ") + .append("WHERE COALESCE(u.LDAPUser,u.Name)=?") // #1 + .append(" AND u.IsActive='Y'") + .append(" AND EXISTS (SELECT * FROM AD_Client c WHERE u.AD_Client_ID=c.AD_Client_ID AND c.IsActive='Y')"); + if (app_pwd != null) + sql.append(" AND (u.Password=? OR u.Password=?)"); // #2/3 + sql.append(" ORDER BY r.Name"); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql.toString(), null); + pstmt.setString(1, app_user); + if (app_pwd != null) + { + pstmt.setString(2, app_pwd); + pstmt.setString(3, SecureEngine.encrypt(app_pwd)); + } + // execute a query + ResultSet rs = pstmt.executeQuery(); + + if (!rs.next()) // no record found + if (force) + { + Env.setContext(m_ctx, "#AD_User_Name", "System"); + Env.setContext(m_ctx, "#AD_User_ID", "0"); + Env.setContext(m_ctx, "#AD_User_Description", "System Forced Login"); + Env.setContext(m_ctx, "#User_Level", "S "); // Format 'SCO' + Env.setContext(m_ctx, "#User_Client", "0"); // Format c1, c2, ... + Env.setContext(m_ctx, "#User_Org", "0"); // Format o1, o2, ... + rs.close(); + pstmt.close(); + retValue = new KeyNamePair[] {new KeyNamePair(0, "System Administrator")}; + return retValue; + } + else + { + rs.close(); + pstmt.close(); + log.saveError("UserPwdError", app_user, false); + return null; + } + + Env.setContext(m_ctx, "#AD_User_Name", app_user); + Env.setContext(m_ctx, "#AD_User_ID", rs.getInt(1)); + Env.setContext(m_ctx, "#SalesRep_ID", rs.getInt(1)); + // + Ini.setProperty(Ini.P_UID, app_user); + if (Ini.isPropertyBool(Ini.P_STORE_PWD)) + Ini.setProperty(Ini.P_PWD, app_pwd); + + m_connectionProfile = rs.getString(4); // User Based + if (m_connectionProfile != null) + { + CConnection cc = CConnection.get(); + if (!cc.getConnectionProfile().equals(m_connectionProfile)) + { + cc.setConnectionProfile(m_connectionProfile); + Ini.setProperty(Ini.P_CONNECTION, cc.toStringLong()); + Ini.saveProperties(false); + } + } + + do // read all roles + { + int AD_Role_ID = rs.getInt(2); + if (AD_Role_ID == 0) + Env.setContext(m_ctx, "#SysAdmin", "Y"); + String Name = rs.getString(3); + KeyNamePair p = new KeyNamePair(AD_Role_ID, Name); + list.add(p); + } + while (rs.next()); + + rs.close(); + pstmt.close(); + pstmt = null; + // + retValue = new KeyNamePair[list.size()]; + list.toArray(retValue); + log.fine("User=" + app_user + " - roles #" + retValue.length); + } + catch (SQLException ex) + { + log.log(Level.SEVERE, sql.toString(), ex); + log.saveError("DBLogin", ex); + retValue = null; + } + // + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // getRoles + + + /************************************************************************** + * Load Clients. + *

+ * Sets Role info in context and loads its clients + * @param role role information + * @return list of valid client KeyNodePairs or null if in error + */ + public KeyNamePair[] getClients (KeyNamePair role) + { + if (role == null) + throw new IllegalArgumentException("Role missing"); + + // s_log.fine("loadClients - Role: " + role.toStringX()); + + ArrayList list = new ArrayList(); + KeyNamePair[] retValue = null; + String sql = "SELECT DISTINCT r.UserLevel, r.ConnectionProfile, " // 1/2 + + " c.AD_Client_ID,c.Name " // 3/4 + + "FROM AD_Role r" + + " INNER JOIN AD_Client c ON (r.AD_Client_ID=c.AD_Client_ID) " + + "WHERE r.AD_Role_ID=?" // #1 + + " AND r.IsActive='Y' AND c.IsActive='Y'"; + + PreparedStatement pstmt = null; + // get Role details + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, role.getKey()); + ResultSet rs = pstmt.executeQuery(); + + if (!rs.next()) + { + rs.close(); + pstmt.close(); + log.log(Level.SEVERE, "No Clients for Role: " + role.toStringX()); + return null; + } + + // Role Info + Env.setContext(m_ctx, "#AD_Role_ID", role.getKey()); + Env.setContext(m_ctx, "#AD_Role_Name", role.getName()); + Ini.setProperty(Ini.P_ROLE, role.getName()); + // User Level + Env.setContext(m_ctx, "#User_Level", rs.getString(1)); // Format 'SCO' + + // ConnectionProfile + CConnection cc = CConnection.get(); + if (m_connectionProfile == null) // No User Based + { + m_connectionProfile = rs.getString(2); // Role Based + if (m_connectionProfile != null + && !cc.getConnectionProfile().equals(m_connectionProfile)) + { + cc.setConnectionProfile(m_connectionProfile); + Ini.setProperty(Ini.P_CONNECTION, cc.toStringLong()); + Ini.saveProperties(false); + } + } + + // load Clients + do + { + int AD_Client_ID = rs.getInt(3); + String Name = rs.getString(4); + KeyNamePair p = new KeyNamePair(AD_Client_ID, Name); + list.add(p); + } + while (rs.next()); + rs.close(); + pstmt.close(); + pstmt = null; + // + retValue = new KeyNamePair[list.size()]; + list.toArray(retValue); + log.fine("Role: " + role.toStringX() + " - clients #" + retValue.length); + } + catch (SQLException ex) + { + log.log(Level.SEVERE, sql, ex); + retValue = null; + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // getClients + + /** + * Load Organizations. + *

+ * Sets Client info in context and loads its organization, the role has access to + * @param client client information + * @return list of valid Org KeyNodePairs or null if in error + */ + public KeyNamePair[] getOrgs (KeyNamePair client) + { + if (client == null) + throw new IllegalArgumentException("Client missing"); + if (Env.getContext(m_ctx,"#AD_Role_ID").length() == 0) // could be number 0 + throw new UnsupportedOperationException("Missing Context #AD_Role_ID"); + + int AD_Role_ID = Env.getContextAsInt(m_ctx,"#AD_Role_ID"); + int AD_User_ID = Env.getContextAsInt(m_ctx, "#AD_User_ID"); + // s_log.fine("Client: " + client.toStringX() + ", AD_Role_ID=" + AD_Role_ID); + + // get Client details for role + ArrayList list = new ArrayList(); + KeyNamePair[] retValue = null; + // + String sql = "SELECT o.AD_Org_ID,o.Name,o.IsSummary " // 1..3 + + "FROM AD_Role r, AD_Client c" + + " INNER JOIN AD_Org o ON (c.AD_Client_ID=o.AD_Client_ID OR o.AD_Org_ID=0) " + + "WHERE r.AD_Role_ID=?" // #1 + + " AND c.AD_Client_ID=?" // #2 + + " AND o.IsActive='Y' AND o.IsSummary='N'" + + " AND (r.IsAccessAllOrgs='Y' " + + "OR (r.IsUseUserOrgAccess='N' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_Role_OrgAccess ra " + + "WHERE ra.AD_Role_ID=r.AD_Role_ID AND ra.IsActive='Y')) " + + "OR (r.IsUseUserOrgAccess='Y' AND o.AD_Org_ID IN (SELECT AD_Org_ID FROM AD_User_OrgAccess ua " + + "WHERE ua.AD_User_ID=? AND ua.IsActive='Y'))" // #3 + + ") " + + "ORDER BY o.Name"; + // + PreparedStatement pstmt = null; + MRole role = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Role_ID); + pstmt.setInt(2, client.getKey()); + pstmt.setInt(3, AD_User_ID); + ResultSet rs = pstmt.executeQuery(); + // load Orgs + while (rs.next()) + { + int AD_Org_ID = rs.getInt(1); + String Name = rs.getString(2); + boolean summary = "Y".equals(rs.getString(3)); + if (summary) + { + if (role == null) + role = MRole.get(m_ctx, AD_Role_ID); + getOrgsAddSummary (list, AD_Org_ID, Name, role); + } + else + { + KeyNamePair p = new KeyNamePair(AD_Org_ID, Name); + if (!list.contains(p)) + list.add(p); + } + } + rs.close(); + pstmt.close(); + pstmt = null; + // + retValue = new KeyNamePair[list.size()]; + list.toArray(retValue); + log.fine("Client: " + client.toStringX() + + ", AD_Role_ID=" + AD_Role_ID + + ", AD_User_ID=" + AD_User_ID + + " - orgs #" + retValue.length); + } + catch (SQLException ex) + { + log.log(Level.SEVERE, sql, ex); + retValue = null; + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // No Orgs + if (retValue == null || retValue.length == 0) + { + log.log(Level.WARNING, "No Org for Client: " + client.toStringX() + + ", AD_Role_ID=" + AD_Role_ID + + ", AD_User_ID=" + AD_User_ID); + return null; + } + + // Client Info + Env.setContext(m_ctx, "#AD_Client_ID", client.getKey()); + Env.setContext(m_ctx, "#AD_Client_Name", client.getName()); + Ini.setProperty(Ini.P_CLIENT, client.getName()); + return retValue; + } // getOrgs + + /** + * Get Orgs - Add Summary Org + * @param list list + * @param Summary_Org_ID summary org + * @param Summary_Name name + * @param role role + * @see org.compiere.model.MRole#loadOrgAccessAdd + */ + private void getOrgsAddSummary (ArrayList list, int Summary_Org_ID, + String Summary_Name, MRole role) + { + if (role == null) + { + log.warning("Summary Org=" + Summary_Name + "(" + Summary_Org_ID + ") - No Role"); + return; + } + // Do we look for trees? + if (role.getAD_Tree_Org_ID() == 0) + { + log.config("Summary Org=" + Summary_Name + "(" + Summary_Org_ID + ") - No Org Tree: " + role); + return; + } + // Summary Org - Get Dependents + MTree_Base tree = MTree_Base.get(m_ctx, role.getAD_Tree_Org_ID(), null); + String sql = "SELECT AD_Client_ID, AD_Org_ID, Name, IsSummary FROM AD_Org " + + "WHERE IsActive='Y' AND AD_Org_ID IN (SELECT Node_ID FROM " + + tree.getNodeTableName() + + " WHERE AD_Tree_ID=? AND Parent_ID=? AND IsActive='Y') " + + "ORDER BY Name"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement (sql, null); + pstmt.setInt (1, tree.getAD_Tree_ID()); + pstmt.setInt (2, Summary_Org_ID); + ResultSet rs = pstmt.executeQuery (); + while (rs.next ()) + { + int AD_Client_ID = rs.getInt(1); + int AD_Org_ID = rs.getInt(2); + String Name = rs.getString(3); + boolean summary = "Y".equals(rs.getString(4)); + // + if (summary) + getOrgsAddSummary (list, AD_Org_ID, Name, role); + else + { + KeyNamePair p = new KeyNamePair(AD_Org_ID, Name); + if (!list.contains(p)) + list.add(p); + } + } + rs.close (); + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + log.log (Level.SEVERE, sql, e); + } + try + { + if (pstmt != null) + pstmt.close (); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + } // getOrgAddSummary + + + /** + * Load Warehouses + * @param org organization + * @return Array of Warehouse Info + */ + public KeyNamePair[] getWarehouses (KeyNamePair org) + { + if (org == null) + throw new IllegalArgumentException("Org missing"); + + // s_log.info("loadWarehouses - Org: " + org.toStringX()); + + ArrayList list = new ArrayList(); + KeyNamePair[] retValue = null; + String sql = "SELECT M_Warehouse_ID, Name FROM M_Warehouse " + + "WHERE AD_Org_ID=? AND IsActive='Y' " + + "ORDER BY Name"; + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, org.getKey()); + ResultSet rs = pstmt.executeQuery(); + + if (!rs.next()) + { + rs.close(); + pstmt.close(); + log.info("No Warehouses for Org: " + org.toStringX()); + return null; + } + + // load Warehousess + do + { + int AD_Warehouse_ID = rs.getInt(1); + String Name = rs.getString(2); + KeyNamePair p = new KeyNamePair(AD_Warehouse_ID, Name); + list.add(p); + } + while (rs.next()); + + rs.close(); + pstmt.close(); + pstmt = null; + // + retValue = new KeyNamePair[list.size()]; + list.toArray(retValue); + log.fine("Org: " + org.toStringX() + + " - warehouses #" + retValue.length); + } + catch (SQLException ex) + { + log.log(Level.SEVERE, "getWarehouses", ex); + retValue = null; + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + return retValue; + } // getWarehouses + + /** + * Validate Login + * @param org log-in org + * @return error message + */ + public String validateLogin (KeyNamePair org) + { + int AD_Client_ID = Env.getAD_Client_ID(m_ctx); + int AD_Org_ID = org.getKey(); + int AD_Role_ID = Env.getAD_Role_ID(m_ctx); + int AD_User_ID = Env.getAD_User_ID(m_ctx); + String error = ModelValidationEngine.get().loginComplete(AD_Client_ID, AD_Org_ID, AD_Role_ID, AD_User_ID); + if (error != null && error.length() > 0) + { + log.severe("Refused: " + error); + return error; + } + return null; + } // validateLogin + + /** + * Load Preferences into Context for selected client. + *

+ * Sets Org info in context and loads relevant field from + * - AD_Client/Info, + * - C_AcctSchema, + * - C_AcctSchema_Elements + * - AD_Preference + *

+ * Assumes that the context is set for #AD_Client_ID, #AD_User_ID, #AD_Role_ID + * + * @param org org information + * @param warehouse optional warehouse information + * @param timestamp optional date + * @param printerName optional printer info + * @return AD_Message of error (NoValidAcctInfo) or "" + */ + public String loadPreferences (KeyNamePair org, + KeyNamePair warehouse, java.sql.Timestamp timestamp, String printerName) + { + log.info("Org: " + org.toStringX()); + + if (m_ctx == null || org == null) + throw new IllegalArgumentException("Required parameter missing"); + if (Env.getContext(m_ctx,"#AD_Client_ID").length() == 0) + throw new UnsupportedOperationException("Missing Context #AD_Client_ID"); + if (Env.getContext(m_ctx,"#AD_User_ID").length() == 0) + throw new UnsupportedOperationException("Missing Context #AD_User_ID"); + if (Env.getContext(m_ctx,"#AD_Role_ID").length() == 0) + throw new UnsupportedOperationException("Missing Context #AD_Role_ID"); + + // Org Info - assumes that it is valid + Env.setContext(m_ctx, "#AD_Org_ID", org.getKey()); + Env.setContext(m_ctx, "#AD_Org_Name", org.getName()); + Ini.setProperty(Ini.P_ORG, org.getName()); + + // Warehouse Info + if (warehouse != null) + { + Env.setContext(m_ctx, "#M_Warehouse_ID", warehouse.getKey()); + Ini.setProperty(Ini.P_WAREHOUSE, warehouse.getName()); + } + + // Date (default today) + long today = System.currentTimeMillis(); + if (timestamp != null) + today = timestamp.getTime(); + Env.setContext(m_ctx, "#Date", new java.sql.Timestamp(today)); + + // Optional Printer + if (printerName == null) + printerName = ""; + Env.setContext(m_ctx, "#Printer", printerName); + Ini.setProperty(Ini.P_PRINTER, printerName); + + // Load Role Info + MRole.getDefault(m_ctx, true); + + // Other + Env.setAutoCommit(m_ctx, Ini.isPropertyBool(Ini.P_A_COMMIT)); + Env.setAutoNew(m_ctx, Ini.isPropertyBool(Ini.P_A_NEW)); + if (MRole.getDefault(m_ctx, false).isShowAcct()) + Env.setContext(m_ctx, "#ShowAcct", Ini.getProperty(Ini.P_SHOW_ACCT)); + else + Env.setContext(m_ctx, "#ShowAcct", "N"); + Env.setContext(m_ctx, "#ShowTrl", Ini.getProperty(Ini.P_SHOW_TRL)); + Env.setContext(m_ctx, "#ShowAdvanced", Ini.getProperty(Ini.P_SHOW_ADVANCED)); + + String retValue = ""; + int AD_Client_ID = Env.getContextAsInt(m_ctx, "#AD_Client_ID"); + int AD_Org_ID = org.getKey(); + int AD_User_ID = Env.getContextAsInt(m_ctx, "#AD_User_ID"); + int AD_Role_ID = Env.getContextAsInt(m_ctx, "#AD_Role_ID"); + + // Other Settings + Env.setContext(m_ctx, "#YYYY", "Y"); + Env.setContext(m_ctx, "#StdPrecision", 2); + + // AccountSchema Info (first) + String sql = "SELECT * " + + "FROM C_AcctSchema a, AD_ClientInfo c " + + "WHERE a.C_AcctSchema_ID=c.C_AcctSchema1_ID " + + "AND c.AD_Client_ID=?"; + PreparedStatement pstmt = null; + try + { + int C_AcctSchema_ID = 0; + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, AD_Client_ID); + ResultSet rs = pstmt.executeQuery(); + + if (!rs.next()) + { + // No Warning for System + if (AD_Role_ID != 0) + retValue = "NoValidAcctInfo"; + } + else + { + // Accounting Info + C_AcctSchema_ID = rs.getInt("C_AcctSchema_ID"); + Env.setContext(m_ctx, "$C_AcctSchema_ID", C_AcctSchema_ID); + Env.setContext(m_ctx, "$C_Currency_ID", rs.getInt("C_Currency_ID")); + Env.setContext(m_ctx, "$HasAlias", rs.getString("HasAlias")); + } + rs.close(); + pstmt.close(); + + // Accounting Elements + sql = "SELECT ElementType " + + "FROM C_AcctSchema_Element " + + "WHERE C_AcctSchema_ID=?" + + " AND IsActive='Y'"; + pstmt = DB.prepareStatement(sql, null); + pstmt.setInt(1, C_AcctSchema_ID); + rs = pstmt.executeQuery(); + while (rs.next()) + Env.setContext(m_ctx, "$Element_" + rs.getString("ElementType"), "Y"); + rs.close(); + pstmt.close(); + + // This reads all relevant window neutral defaults + // overwriting superseeded ones. Window specific is read in Mainain + sql = "SELECT Attribute, Value, AD_Window_ID " + + "FROM AD_Preference " + + "WHERE AD_Client_ID IN (0, @#AD_Client_ID@)" + + " AND AD_Org_ID IN (0, @#AD_Org_ID@)" + + " AND (AD_User_ID IS NULL OR AD_User_ID=0 OR AD_User_ID=@#AD_User_ID@)" + + " AND IsActive='Y' " + + "ORDER BY Attribute, AD_Client_ID, AD_User_ID DESC, AD_Org_ID"; + // the last one overwrites - System - Client - User - Org - Window + sql = Env.parseContext(m_ctx, 0, sql, false); + if (sql.length() == 0) + log.log(Level.SEVERE, "loadPreferences - Missing Environment"); + else + { + pstmt = DB.prepareStatement(sql, null); + rs = pstmt.executeQuery(); + while (rs.next()) + { + int AD_Window_ID = rs.getInt(3); + String at = ""; + if (rs.wasNull()) + at = "P|" + rs.getString(1); + else + at = "P" + AD_Window_ID + "|" + rs.getString(1); + String va = rs.getString(2); + Env.setContext(m_ctx, at, va); + } + rs.close(); + pstmt.close(); + } + + // Default Values + log.info("Default Values ..."); + sql = "SELECT t.TableName, c.ColumnName " + + "FROM AD_Column c " + + " INNER JOIN AD_Table t ON (c.AD_Table_ID=t.AD_Table_ID) " + + "WHERE c.IsKey='Y' AND t.IsActive='Y'" + + " AND EXISTS (SELECT * FROM AD_Column cc " + + " WHERE ColumnName = 'IsDefault' AND t.AD_Table_ID=cc.AD_Table_ID AND cc.IsActive='Y')"; + pstmt = DB.prepareStatement(sql, null); + rs = pstmt.executeQuery(); + while (rs.next()) + loadDefault (rs.getString(1), rs.getString(2)); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (SQLException e) + { + log.log(Level.SEVERE, "loadPreferences", e); + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // + Ini.saveProperties(Ini.isClient()); + // Country + Env.setContext(m_ctx, "#C_Country_ID", MCountry.getDefault(m_ctx).getC_Country_ID()); + return retValue; + } // loadPreferences + + /** + * Load Default Value for Table into Context. + * @param TableName table name + * @param ColumnName column name + */ + private void loadDefault (String TableName, String ColumnName) + { + if (TableName.startsWith("AD_Window") + || TableName.startsWith("AD_PrintFormat") + || TableName.startsWith("AD_Workflow") ) + return; + String value = null; + // + String sql = "SELECT " + ColumnName + " FROM " + TableName // most specific first + + " WHERE IsDefault='Y' AND IsActive='Y' ORDER BY AD_Client_ID DESC, AD_Org_ID DESC"; + sql = MRole.getDefault(m_ctx, false).addAccessSQL(sql, + TableName, MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); + PreparedStatement pstmt = null; + try + { + pstmt = DB.prepareStatement(sql, null); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + value = rs.getString(1); + rs.close(); + pstmt.close(); + pstmt = null; + } + catch (SQLException e) + { + log.log(Level.SEVERE, TableName + " (" + sql + ")", e); + return; + } + try + { + if (pstmt != null) + pstmt.close(); + pstmt = null; + } + catch (Exception e) + { + pstmt = null; + } + // Set Context Value + if (value != null && value.length() != 0) + { + if (TableName.equals("C_DocType")) + Env.setContext(m_ctx, "#C_DocTypeTarget_ID", value); + else + Env.setContext(m_ctx, "#" + ColumnName, value); + } + } // loadDefault + + /** + * Batch Login using Ini values + * + Adempiere.startup(true); + Ini.setProperty(Ini.P_UID,"SuperUser"); + Ini.setProperty(Ini.P_PWD,"System"); + Ini.setProperty(Ini.P_ROLE,"GardenAdmin"); + Ini.setProperty(Ini.P_CLIENT, "Garden World"); + Ini.setProperty(Ini.P_ORG,"HQ"); + Ini.setProperty(Ini.P_WAREHOUSE,"HQ"); + Ini.setProperty(Ini.P_LANGUAGE,"English"); + Ini.setProperty(Ini.P_PRINTER,"MyPrinter"); + Login login = new Login(Env.getCtx()); + login.batchLogin(); + * + * @param loginDate optional login date + * @return true if logged in using Ini values + */ + public boolean batchLogin(java.sql.Timestamp loginDate) + { + // User Login + String uid = Ini.getProperty(Ini.P_UID); + String pwd = Ini.getProperty(Ini.P_PWD); + KeyNamePair[] roles = getRoles (uid, pwd); + if (roles == null || roles.length == 0) + { + log.severe("User/Password invalid: " + uid); + return false; + } + log.info("User: " + uid); + + // Role + String role = Ini.getProperty(Ini.P_ROLE); + KeyNamePair rolePP = null; + for (int i = 0; i < roles.length; i++) + { + KeyNamePair pair = roles[i]; + if (pair.getName().equalsIgnoreCase(role)) + { + rolePP = pair; + break; + } + } + if (rolePP == null) + { + log.severe("Role invalid: " + role); + for (int i = 0; i < roles.length; i++) + log.info("Option: " + roles[i]); + return false; + } + log.info("Role: " + role); + + // Clients + String client = Ini.getProperty(Ini.P_CLIENT); + KeyNamePair[] clients = getClients(rolePP); + if (clients == null || clients.length == 0) + { + log.severe("No Clients for Role: " + role); + return false; + } + KeyNamePair clientPP = null; + for (int i = 0; i < clients.length; i++) + { + KeyNamePair pair = clients[i]; + if (pair.getName().equalsIgnoreCase(client)) + { + clientPP = pair; + break; + } + } + if (clientPP == null) + { + log.severe("Client invalid: " + client); + for (int i = 0; i < clients.length; i++) + log.info("Option: " + clients[i]); + return false; + } + + // Organization + String org = Ini.getProperty(Ini.P_ORG); + KeyNamePair[] orgs = getOrgs(clientPP); + if (orgs == null || orgs.length == 0) + { + log.severe("No Orgs for Client: " + client); + return false; + } + KeyNamePair orgPP = null; + for (int i = 0; i < orgs.length; i++) + { + KeyNamePair pair = orgs[i]; + if (pair.getName().equalsIgnoreCase(org)) + { + orgPP = pair; + break; + } + } + if (orgPP == null) + { + log.severe("Org invalid: " + org); + for (int i = 0; i < orgs.length; i++) + log.info("Option: " + orgs[i]); + return false; + } + String error = validateLogin(orgPP); + if (error != null && error.length() > 0) + return false; + + // Warehouse + String wh = Ini.getProperty(Ini.P_WAREHOUSE); + KeyNamePair[] whs = getWarehouses(orgPP); + if (whs == null || whs.length == 0) + { + log.severe("No Warehouses for Org: " + org); + return false; + } + KeyNamePair whPP = null; + for (int i = 0; i < whs.length; i++) + { + KeyNamePair pair = whs[i]; + if (pair.getName().equalsIgnoreCase(wh)) + { + whPP = pair; + break; + } + } + if (whPP == null) + { + log.severe("Warehouse invalid: " + wh); + for (int i = 0; i < whs.length; i++) + log.info("Option: " + whs[i]); + return false; + } + + // Language + String langName = Ini.getProperty(Ini.P_LANGUAGE); + Language language = Language.getLanguage(langName); + Language.setLoginLanguage(language); + Env.verifyLanguage (m_ctx, language); + Env.setContext(m_ctx, Env.LANGUAGE, language.getAD_Language()); + Locale loc = language.getLocale(); + Locale.setDefault(loc); + Msg.getMsg(m_ctx, "0"); + + // Preferences + String printerName = Ini.getProperty(Ini.P_PRINTER); + if (loginDate == null) + loginDate = new java.sql.Timestamp(System.currentTimeMillis()); + loadPreferences(orgPP, whPP, loginDate, printerName); + // + log.info("complete"); + return true; + } // batchLogin + + /** + * Batch Login with system date + * @return true if logged in + */ + public boolean batchLogin() + { + return batchLogin(new java.sql.Timestamp (System.currentTimeMillis())); + } // batchLogin + + /** + * Get SSO Principal + * @return principal + */ + public Principal getPrincipal() + { + return null; + } // getPrincipal + +} // Login diff --git a/dbPort/src/org/compiere/util/MimeType.java b/dbPort/src/org/compiere/util/MimeType.java new file mode 100644 index 0000000000..3aa314f3bc --- /dev/null +++ b/dbPort/src/org/compiere/util/MimeType.java @@ -0,0 +1,801 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + + +/** + * Mime - Content type map. + * http://www.iana.org/assignments/media-types/ + * + * @author Jorg Janke + * @version $Id: MimeType.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $ + */ +public class MimeType +{ + /** + * Get Mime Type of file name + * @param fileName file name + * @return mime type + */ + public static String getMimeType (String fileName) + { + if (fileName == null || fileName.indexOf('.') < 0) + return BINARY; + // + String extension = fileName.substring(fileName.lastIndexOf('.')); + for (int i = 0; i < TYPES.length; i++) + { + String[] type = TYPES[i]; + if (type[0].equals(extension)) + return type[1]; + } + return "application/octet-stream"; + } // getMimeType + + /** + * Get Mime Type of file name + * @param fileName file name + * @return mime type + */ + public static MimeType get (String fileName) + { + if (fileName == null || fileName.indexOf('.') < 0) + return new MimeType (fileName, BINARY); + // + String extension = fileName.substring(fileName.lastIndexOf('.')); + for (int i = 0; i < TYPES.length; i++) + { + String[] type = TYPES[i]; + if (type[0].equals(extension)) + return new MimeType (fileName, type[1]); + } + return new MimeType (extension, BINARY); + } // get + + /** application/octet-stream */ + public static String BINARY = "application/octet-stream"; + + + /************************************************************************** + * MimeType + * @param extension extension (with dot) + * @param mimeType mime type + */ + public MimeType (String extension, String mimeType) + { + setExtension(extension); + setMimeType(mimeType); + } // MimeType + + /** Extension */ + private String m_extension = null; + /** MIME Type */ + private String m_mimeType = null; + + + /** + * @return Returns the extension. + */ + public String getExtension () + { + return m_extension; + } // getExtension + + /** + * @param extension The extension to set. + */ + public void setExtension (String extension) + { + m_extension = extension; + } // setExtension + + /** + * @return Returns the Mime Type (Content Type). + */ + public String getMimeType () + { + return m_mimeType; + } // getMimeType + + /** + * @param mimeType The mimeType to set. + */ + public void setMimeType (String mimeType) + { + m_mimeType = mimeType; + } // setMimeType + + + /** + * String representation + * @return info + */ + public String toString () + { + return m_mimeType + "(" + m_extension + ")"; + } // toString + + /************************************************************************** + * Mime / Content Type Map + */ + public static final String[][] TYPES = new String[][] { + { ".3dm", "x-world/x-3dmf"}, + { ".3dmf", "x-world/x-3dmf"}, + { ".a", "application/octet-stream"}, + { ".aab", "application/x-authorware-bin"}, + { ".aam", "application/x-authorware-map"}, + { ".aas", "application/x-authorware-seg"}, + { ".abc", "text/vnd.abc"}, + { ".acgi", "text/html"}, + { ".afl", "video/animaflex"}, + { ".ai", "application/postscript"}, + { ".aif", "audio/aiff"}, + // { ".aif", "audio/x-aiff"}, + { ".aifc", "audio/aiff"}, + // { ".aifc", "audio/x-aiff"}, + { ".aiff", "audio/aiff"}, + // { ".aiff", "audio/x-aiff"}, + { ".aim", "application/x-aim"}, + { ".aip", "text/x-audiosoft-intra"}, + { ".ani", "application/x-navi-animation"}, + { ".aos", "application/x-nokia-9000-communicator-add-on-software"}, + { ".aps", "application/mime"}, + { ".arc", "application/octet-stream"}, + { ".arj", "application/arj"}, + // { ".arj", "application/octet-stream"}, + { ".art", "image/x-jg"}, + { ".asf", "video/x-ms-asf"}, + { ".asm", "text/x-asm"}, + { ".asp", "text/asp"}, + { ".asx", "application/x-mplayer2"}, + { ".asx", "video/x-ms-asf"}, + // { ".asx", "video/x-ms-asf-plugin"}, + { ".au", "audio/basic"}, + // { ".au", "audio/x-au"}, + // { ".avi", "application/x-troff-msvideo"}, + { ".avi", "video/avi"}, + // { ".avi", "video/msvideo"}, + // { ".avi", "video/x-msvideo"}, + // { ".avs", "video/avs-video"}, + // b + { ".bcpio", "application/x-bcpio"}, + // { ".bin", "application/mac-binary"}, + // { ".bin", "application/macbinary"}, + // { ".bin", "application/octet-stream"}, + { ".bin", "application/x-binary"}, + // { ".bin", "application/x-macbinary"}, + { ".bm", "image/bmp"}, + { ".bmp", "image/bmp"}, + // { ".bmp", "image/x-windows-bmp"}, + { ".boo", "application/book"}, + { ".book", "application/book"}, + { ".boz", "application/x-bzip2"}, + { ".bsh", "application/x-bsh"}, + { ".bz", "application/x-bzip"}, + { ".bz2", "application/x-bzip2"}, + + { ".c", "text/plain"}, + { ".c", "text/x-c"}, + { ".c++", "text/plain"}, + { ".cat", "application/vnd.ms-pki.seccat"}, + { ".cc", "text/plain"}, + // { ".cc", "text/x-c"}, + { ".ccad", "application/clariscad"}, + { ".cco", "application/x-cocoa"}, + { ".cdf", "application/cdf"}, + // { ".cdf", "application/x-cdf"}, + // { ".cdf", "application/x-netcdf"}, + { ".cer", "application/pkix-cert"}, + // { ".cer", "application/x-x509-ca-cert"}, + { ".cha", "application/x-chat"}, + { ".chat", "application/x-chat"}, + // { ".class", "application/java"}, + // { ".class", "application/x-java-applet"}, + { ".class", "application/x-java-vm "}, + { ".com", "application/octet-stream"}, + // { ".com", "text/plain"}, + { ".conf", "text/plain"}, + { ".cpio", "application/x-cpio"}, + { ".cpp", "text/x-c"}, + // { ".cpt", "application/mac-compactpro"}, + // { ".cpt", "application/x-compactpro"}, + { ".cpt", "application/x-cpt"}, + { ".crl", "application/pkcs-crl"}, + // { ".crl", "application/pkix-crl"}, + { ".crt", "application/pkix-cert"}, + // { ".crt", "application/x-x509-ca-cert"}, + // { ".crt", "application/x-x509-user-cert"}, + // { ".csh", "application/x-csh"}, + { ".csh", "text/x-script.csh"}, + // { ".css", "application/x-pointplus"}, + { ".css", "text/css"}, + { ".cvs", "application/vnd.ms-excel"}, + { ".cxx", "text/plain"}, + + { ".dcr", "application/x-director"}, + { ".deepv", "application/x-deepv"}, + { ".def", "text/plain"}, + { ".der", "application/x-x509-ca-cert"}, + { ".dif", "video/x-dv"}, + { ".dir", "application/x-director"}, + { ".dl", "video/dl"}, + // { ".dl", "video/x-dl"}, + { ".doc", "application/msword"}, + { ".dot", "application/msword"}, + { ".dp", "application/commonground"}, + { ".drw", "application/drafting"}, + { ".dump", "application/octet-stream"}, + { ".dv", "video/x-dv"}, + { ".dvi", "application/x-dvi"}, + // { ".dwf", "drawing/x-dwf (old)"}, + { ".dwf", "model/vnd.dwf"}, + // { ".dwg", "application/acad"}, + { ".dwg", "image/vnd.dwg"}, + // { ".dwg", "image/x-dwg"}, + // { ".dxf", "application/dxf"}, + { ".dxf", "image/vnd.dwg"}, + // { ".dxf", "image/x-dwg"}, + { ".dxr", "application/x-director"}, + { ".el", "text/x-script.elisp"}, + // { ".elc", "application/x-bytecode.elisp (Compiled ELisp)"}, + { ".elc", "application/x-elc"}, + { ".env", "application/x-envoy"}, + { ".eps", "application/postscript"}, + { ".es", "application/x-esrehber"}, + { ".etx", "text/x-setext"}, + { ".evy", "application/envoy"}, + // { ".evy", "application/x-envoy"}, + { ".exe", "application/octet-stream"}, + + // { ".f", "text/plain"}, + { ".f", "text/x-fortran"}, + { ".f77", "text/x-fortran"}, + // { ".f90", "text/plain"}, + { ".f90", "text/x-fortran"}, + { ".fdf", "application/vnd.fdf"}, + // { ".fif", "application/fractals"}, + { ".fif", "image/fif"}, + // { ".fli", "video/fli"}, + { ".fli", "video/x-fli"}, + { ".flo", "image/florian"}, + { ".flx", "text/vnd.fmi.flexstor"}, + { ".fmf", "video/x-atomic3d-feature"}, + // { ".for", "text/plain"}, + { ".for", "text/x-fortran"}, + { ".fpx", "image/vnd.fpx"}, + // { ".fpx", "image/vnd.net-fpx"}, + { ".frl", "application/freeloader"}, + { ".funk", "audio/make"}, + + { ".g", "text/plain"}, + { ".g3", "image/g3fax"}, + { ".gif", "image/gif"}, + { ".gl", "video/gl"}, + { ".gl", "video/x-gl"}, + { ".gsd", "audio/x-gsm"}, + { ".gsm", "audio/x-gsm"}, + { ".gsp", "application/x-gsp"}, + { ".gss", "application/x-gss"}, + { ".gtar", "application/x-gtar"}, + // { ".gz", "application/x-compressed"}, + { ".gz", "application/x-gzip"}, + { ".gzip", "application/x-gzip"}, + // { ".gzip", "multipart/x-gzip"}, + + // { ".h", "text/plain"}, + { ".h", "text/x-h"}, + { ".hdf", "application/x-hdf"}, + { ".help", "application/x-helpfile"}, + { ".hgl", "application/vnd.hp-HPGL"}, + // { ".hh", "text/plain"}, + { ".hh", "text/x-h"}, + { ".hlb", "text/x-script"}, + { ".hlp", "application/hlp"}, + // { ".hlp", "application/x-helpfile"}, + // { ".hlp", "application/x-winhelp"}, + { ".hpg", "application/vnd.hp-HPGL"}, + { ".hpgl", "application/vnd.hp-HPGL"}, + { ".hqx", "application/binhex"}, + // { ".hqx", "application/binhex4"}, + // { ".hqx", "application/mac-binhex"}, + // { ".hqx", "application/mac-binhex40"}, + // { ".hqx", "application/x-binhex40"}, + // { ".hqx", "application/x-mac-binhex40"}, + { ".hta", "application/hta"}, + { ".htc", "text/x-component"}, + { ".htm", "text/html"}, + { ".html", "text/html"}, + { ".htmls", "text/html"}, + { ".htt", "text/webviewhtml"}, + { ".htx", "text/html"}, + + { ".ice", "x-conference/x-cooltalk"}, + { ".ico", "image/x-icon"}, + { ".idc", "text/plain"}, + { ".ief", "image/ief"}, + { ".iefs", "image/ief"}, + { ".iges", "application/iges"}, + // { ".iges", "model/iges"}, + { ".igs", "application/iges"}, + // { ".igs", "model/iges"}, + { ".ima", "application/x-ima"}, + { ".imap", "application/x-httpd-imap"}, + { ".inf", "application/inf"}, + { ".ins", "application/x-internett-signup"}, + { ".ip", "application/x-ip2"}, + { ".isu", "video/x-isvideo"}, + { ".it", "audio/it"}, + { ".iv", "application/x-inventor"}, + { ".ivr", "i-world/i-vrml"}, + { ".ivy", "application/x-livescreen"}, + + { ".jam", "audio/x-jam"}, + // { ".jav", "text/plain"}, + { ".jav", "text/x-java-source"}, + // { ".java", "text/plain"}, + { ".java", "text/x-java-source"}, + { ".jar", "application/java-archive"}, + { ".jcm", "application/x-java-commerce"}, + { ".jfif", "image/jpeg"}, + // { ".jfif", "image/pjpeg"}, + { ".jfif-tbnl", "image/jpeg"}, + { ".jpe", "image/jpeg"}, + // { ".jpe", "image/pjpeg"}, + { ".jpeg", "image/jpeg"}, + // { ".jpeg", "image/pjpeg"}, + { ".jpg", "image/jpeg"}, + // { ".jpg", "image/pjpeg"}, + { ".jps", "image/x-jps"}, + { ".js", "application/x-javascript"}, + { ".jut", "image/jutvision"}, + + { ".kar", "audio/midi"}, + { ".kar", "music/x-karaoke"}, + // { ".ksh", "application/x-ksh"}, + { ".ksh", "text/x-script.ksh"}, + + { ".la", "audio/nspaudio"}, + { ".la", "audio/x-nspaudio"}, + { ".lam", "audio/x-liveaudio"}, + { ".latex", "application/x-latex"}, + { ".lha", "application/lha"}, + // { ".lha", "application/x-lha"}, + { ".lhx", "application/octet-stream"}, + { ".list", "text/plain"}, + { ".lma", "audio/nspaudio"}, + { ".lma", "audio/x-nspaudio"}, + { ".log", "text/plain"}, + { ".lsp", "application/x-lisp"}, + { ".lsp", "text/x-script.lisp"}, + { ".lst", "text/plain"}, + { ".lsx", "text/x-la-asf"}, + { ".ltx", "application/x-latex"}, + { ".lzh", "application/octet-stream"}, + { ".lzh", "application/x-lzh"}, + { ".lzx", "application/lzx"}, + { ".lzx", "application/octet-stream"}, + { ".lzx", "application/x-lzx"}, + + { ".m", "text/plain"}, + { ".m", "text/x-m"}, + { ".m1v", "video/mpeg"}, + { ".m2a", "audio/mpeg"}, + { ".m2v", "video/mpeg"}, + { ".m3u", "audio/x-mpequrl"}, + { ".man", "application/x-troff-man"}, + { ".map", "application/x-navimap"}, + { ".mar", "text/plain"}, + { ".mbd", "application/mbedlet"}, + { ".mc$", "application/x-magic-cap-package-1.0"}, + { ".mcd", "application/mcad"}, + { ".mcd", "application/x-mathcad"}, + { ".mcf", "image/vasa"}, + { ".mcf", "text/mcf"}, + { ".mcp", "application/netmc"}, + { ".me", "application/x-troff-me"}, + { ".mht", "message/rfc822"}, + { ".mhtml", "message/rfc822"}, + { ".mid", "application/x-midi"}, + { ".mid", "audio/midi"}, + { ".mid", "audio/x-mid"}, + { ".mid", "audio/x-midi"}, + { ".mid", "music/crescendo"}, + { ".mid", "x-music/x-midi"}, + // { ".midi", "application/x-midi"}, + { ".midi", "audio/midi"}, + // { ".midi", "audio/x-mid"}, + // { ".midi", "audio/x-midi"}, + { ".midi", "music/crescendo"}, + { ".midi", "x-music/x-midi"}, + { ".mif", "application/x-frame"}, + { ".mif", "application/x-mif"}, + { ".mime", "message/rfc822"}, + // { ".mime", "www/mime"}, + { ".mjf", "audio/x-vnd.AudioExplosion.MjuiceMediaFile"}, + { ".mjpg", "video/x-motion-jpeg"}, + { ".mm", "application/base64"}, + { ".mm", "application/x-meme"}, + { ".mme", "application/base64"}, + { ".mod", "audio/mod"}, + { ".mod", "audio/x-mod"}, + { ".moov", "video/quicktime"}, + { ".mov", "video/quicktime"}, + { ".movie", "video/x-sgi-movie"}, + { ".mp2", "audio/mpeg"}, + // { ".mp2", "audio/x-mpeg"}, + // { ".mp2", "video/mpeg"}, + // { ".mp2", "video/x-mpeg"}, + // { ".mp2", "video/x-mpeq2a"}, + { ".mp3", "audio/mpeg3"}, + // { ".mp3", "audio/x-mpeg-3"}, + // { ".mp3", "video/mpeg"}, + // { ".mp3", "video/x-mpeg"}, + { ".mpa", "audio/mpeg"}, + // { ".mpa", "video/mpeg"}, + { ".mpc", "application/x-project"}, + { ".mpe", "video/mpeg"}, + { ".mpeg", "video/mpeg"}, + { ".mpg", "audio/mpeg"}, + { ".mpg", "video/mpeg"}, + { ".mpga", "audio/mpeg"}, + { ".mpp", "application/vnd.ms-project"}, + { ".mpt", "application/x-project"}, + { ".mpv", "application/x-project"}, + { ".mpx", "application/x-project"}, + { ".mrc", "application/marc"}, + { ".ms", "application/x-troff-ms"}, + { ".mv", "video/x-sgi-movie"}, + { ".my", "audio/make"}, + { ".mzz", "application/x-vnd.AudioExplosion.mzz"}, + + { ".nap", "image/naplps"}, + { ".naplps", "image/naplps"}, + { ".nc", "application/x-netcdf"}, + { ".ncm", "application/vnd.nokia.configuration-message"}, + { ".nif", "image/x-niff"}, + { ".niff", "image/x-niff"}, + { ".nix", "application/x-mix-transfer"}, + { ".nsc", "application/x-conference"}, + { ".nvd", "application/x-navidoc"}, + + { ".o", "application/octet-stream"}, + { ".oda", "application/oda"}, + { ".omc", "application/x-omc"}, + { ".omcd", "application/x-omcdatamaker"}, + { ".omcr", "application/x-omcregerator"}, + + { ".p", "text/x-pascal"}, + { ".p10", "application/pkcs10"}, + { ".p10", "application/x-pkcs10"}, + { ".p12", "application/pkcs-12"}, + { ".p12", "application/x-pkcs12"}, + { ".p7a", "application/x-pkcs7-signature"}, + { ".p7c", "application/pkcs7-mime"}, + { ".p7c", "application/x-pkcs7-mime"}, + { ".p7m", "application/pkcs7-mime"}, + { ".p7m", "application/x-pkcs7-mime"}, + { ".p7r", "application/x-pkcs7-certreqresp"}, + { ".p7s", "application/pkcs7-signature"}, + { ".part", "application/pro_eng"}, + { ".pas", "text/pascal"}, + { ".pbm", "image/x-portable-bitmap"}, + { ".pcl", "application/vnd.hp-PCL"}, + { ".pcl", "application/x-pcl"}, + { ".pct", "image/x-pict"}, + { ".pcx", "image/x-pcx"}, + { ".pdb", "chemical/x-pdb"}, + { ".pdf", "application/pdf"}, + { ".pfunk", "audio/make"}, + { ".pfunk", "audio/make.my.funk"}, + { ".pgm", "image/x-portable-graymap"}, + { ".pgm", "image/x-portable-greymap"}, + { ".pic", "image/pict"}, + { ".pict", "image/pict"}, + { ".pkg", "application/x-newton-compatible-pkg"}, + { ".pko", "application/vnd.ms-pki.pko"}, + { ".pl", "text/plain"}, + { ".pl", "text/x-script.perl"}, + { ".plx", "application/x-PiXCLscript"}, + { ".pm", "image/x-xpixmap"}, + { ".pm", "text/x-script.perl-module"}, + { ".pm4", "application/x-pagemaker"}, + { ".pm5", "application/x-pagemaker"}, + { ".png", "image/png"}, + { ".pnm", "application/x-portable-anymap"}, + { ".pnm", "image/x-portable-anymap"}, + { ".pot", "application/mspowerpoint"}, + { ".pot", "application/vnd.ms-powerpoint"}, + { ".pov", "model/x-pov"}, + { ".ppa", "application/vnd.ms-powerpoint"}, + { ".ppm", "image/x-portable-pixmap"}, + { ".pps", "application/mspowerpoint"}, + { ".pps", "application/vnd.ms-powerpoint"}, + { ".ppt", "application/mspowerpoint"}, + { ".ppt", "application/powerpoint"}, + { ".ppt", "application/vnd.ms-powerpoint"}, + { ".ppt", "application/x-mspowerpoint"}, + { ".ppz", "application/mspowerpoint"}, + { ".pre", "application/x-freelance"}, + { ".prt", "application/pro_eng"}, + { ".ps", "application/postscript"}, + { ".psd", "application/octet-stream"}, + { ".pvu", "paleovu/x-pv"}, + { ".pwz", "application/vnd.ms-powerpoint"}, + { ".py", "text/x-script.phyton"}, + { ".pyc", "applicaiton/x-bytecode.python"}, + + { ".qcp", "audio/vnd.qcelp"}, + { ".qd3", "x-world/x-3dmf"}, + { ".qd3d", "x-world/x-3dmf"}, + { ".qif", "image/x-quicktime"}, + { ".qt", "video/quicktime"}, + { ".qtc", "video/x-qtc"}, + { ".qti", "image/x-quicktime"}, + { ".qtif", "image/x-quicktime"}, + + { ".ra", "audio/x-pn-realaudio"}, + // { ".ra", "audio/x-pn-realaudio-plugin"}, + { ".ra", "audio/x-realaudio"}, + { ".ram", "audio/x-pn-realaudio"}, + // { ".ras", "application/x-cmu-raster"}, + { ".ras", "image/cmu-raster"}, + // { ".ras", "image/x-cmu-raster"}, + { ".rast", "image/cmu-raster"}, + { ".rexx", "text/x-script.rexx"}, + { ".rf", "image/vnd.rn-realflash"}, + { ".rgb", "image/x-rgb"}, + // { ".rm", "application/vnd.rn-realmedia"}, + { ".rm", "audio/x-pn-realaudio"}, + { ".rmi", "audio/mid"}, + { ".rmm", "audio/x-pn-realaudio"}, + { ".rmp", "audio/x-pn-realaudio"}, + // { ".rmp", "audio/x-pn-realaudio-plugin"}, + { ".rng", "application/ringing-tones"}, + // { ".rng", "application/vnd.nokia.ringing-tone"}, + { ".rnx", "application/vnd.rn-realplayer"}, + { ".roff", "application/x-troff"}, + { ".rp", "image/vnd.rn-realpix"}, + { ".rpm", "audio/x-pn-realaudio-plugin"}, + { ".rt", "text/richtext"}, + // { ".rt", "text/vnd.rn-realtext"}, + { ".rtf", "application/rtf"}, + // { ".rtf", "application/x-rtf"}, + // { ".rtf", "text/richtext"}, + { ".rtx", "application/rtf"}, + // { ".rtx", "text/richtext"}, + { ".rv", "video/vnd.rn-realvideo"}, + + { ".s", "text/x-asm"}, + { ".s3m", "audio/s3m"}, + { ".saveme", "application/octet-stream"}, + { ".sbk", "application/x-tbook"}, + // { ".scm", "application/x-lotusscreencam"}, + // { ".scm", "text/x-script.guile"}, + // { ".scm", "text/x-script.scheme"}, + { ".scm", "video/x-scm"}, + { ".sdml", "text/plain"}, + { ".sdp", "application/sdp"}, + // { ".sdp", "application/x-sdp"}, + { ".sdr", "application/sounder"}, + { ".sea", "application/sea"}, + // { ".sea", "application/x-sea"}, + { ".set", "application/set"}, + { ".sgm", "text/sgml"}, + // { ".sgm", "text/x-sgml"}, + { ".sgml", "text/sgml"}, + // { ".sgml", "text/x-sgml"}, + // { ".sh", "application/x-bsh"}, + // { ".sh", "application/x-sh"}, + // { ".sh", "application/x-shar"}, + { ".sh", "text/x-script.sh"}, + // { ".shar", "application/x-bsh"}, + { ".shar", "application/x-shar"}, + { ".shtml", "text/html"}, + { ".shtml", "text/x-server-parsed-html"}, + { ".sid", "audio/x-psid"}, + { ".sit", "application/x-sit"}, + // { ".sit", "application/x-stuffit"}, + { ".skd", "application/x-koan"}, + { ".skm", "application/x-koan"}, + { ".skp", "application/x-koan"}, + { ".skt", "application/x-koan"}, + { ".sl", "application/x-seelogo"}, + { ".smi", "application/smil"}, + { ".smil", "application/smil"}, + // { ".snd", "audio/basic"}, + { ".snd", "audio/x-adpcm"}, + { ".sol", "application/solids"}, + { ".spc", "application/x-pkcs7-certificates"}, + // { ".spc", "text/x-speech"}, + { ".spl", "application/futuresplash"}, + { ".spr", "application/x-sprite"}, + { ".sprite", "application/x-sprite"}, + { ".src", "application/x-wais-source"}, + { ".ssi", "text/x-server-parsed-html"}, + { ".ssm", "application/streamingmedia"}, + { ".sst", "application/vnd.ms-pki.certstore"}, + { ".step", "application/step"}, + // { ".stl", "application/sla"}, + { ".stl", "application/vnd.ms-pki.stl"}, + // { ".stl", "application/x-navistyle"}, + { ".stp", "application/step"}, + { ".sv4cpio", "application/x-sv4cpio"}, + { ".sv4crc", "application/x-sv4crc"}, + { ".svf", "image/vnd.dwg"}, + // { ".svf", "image/x-dwg"}, + // { ".svr", "application/x-world"}, + { ".svr", "x-world/x-svr"}, + { ".swf", "application/x-shockwave-flash"}, + + { ".t", "application/x-troff"}, + { ".talk", "text/x-speech"}, + { ".tar", "application/x-tar"}, + { ".tbk", "application/toolbook"}, + // { ".tbk", "application/x-tbook"}, + // { ".tcl", "application/x-tcl"}, + { ".tcl", "text/x-script.tcl"}, + { ".tcsh", "text/x-script.tcsh"}, + { ".tex", "application/x-tex"}, + { ".texi", "application/x-texinfo"}, + { ".texinfo", "application/x-texinfo"}, + // { ".text", "application/plain"}, + { ".text", "text/plain"}, + // { ".tgz", "application/gnutar"}, + { ".tgz", "application/x-compressed"}, + { ".tif", "image/tiff"}, + // { ".tif", "image/x-tiff"}, + { ".tiff", "image/tiff"}, + // { ".tiff", "image/x-tiff"}, + { ".tr", "application/x-troff"}, + { ".tsi", "audio/tsp-audio"}, + { ".tsp", "application/dsptype"}, + { ".tsp", "audio/tsplayer"}, + { ".tsv", "text/tab-separated-values"}, + { ".turbot", "image/florian"}, + + { ".txt", "text/plain"}, + { ".uil", "text/x-uil"}, + { ".uni", "text/uri-list"}, + { ".unis", "text/uri-list"}, + { ".unv", "application/i-deas"}, + { ".uri", "text/uri-list"}, + { ".uris", "text/uri-list"}, + { ".ustar", "application/x-ustar"}, + // { ".ustar", "multipart/x-ustar"}, + // { ".uu", "application/octet-stream"}, + { ".uu", "text/x-uuencode"}, + { ".uue", "text/x-uuencode"}, + { ".vcd", "application/x-cdlink"}, + { ".vcs", "text/x-vCalendar"}, + { ".vda", "application/vda"}, + { ".vdo", "video/vdo"}, + { ".vew", "application/groupwise"}, + // { ".viv", "video/vivo"}, + { ".viv", "video/vnd.vivo"}, + // { ".vivo", "video/vivo"}, + { ".vivo", "video/vnd.vivo"}, + { ".vmd", "application/vocaltec-media-desc"}, + { ".vmf", "application/vocaltec-media-file"}, + { ".voc", "audio/voc"}, + // { ".voc", "audio/x-voc"}, + { ".vos", "video/vosaic"}, + { ".vox", "audio/voxware"}, + { ".vqe", "audio/x-twinvq-plugin"}, + { ".vqf", "audio/x-twinvq"}, + { ".vql", "audio/x-twinvq-plugin"}, + { ".vrml", "application/x-vrml"}, + { ".vrml", "model/vrml"}, + // { ".vrml", "x-world/x-vrml"}, + { ".vrt", "x-world/x-vrt"}, + { ".vsd", "application/x-visio"}, + { ".vst", "application/x-visio"}, + { ".vsw", "application/x-visio"}, + { ".w60", "application/wordperfect6.0"}, + { ".w61", "application/wordperfect6.1"}, + { ".w6w", "application/msword"}, + { ".wav", "audio/wav"}, + // { ".wav", "audio/x-wav"}, + { ".wb1", "application/x-qpro"}, + { ".wbmp", "image/vnd.wap.wbmp"}, + { ".web", "application/vnd.xara"}, + { ".wiz", "application/msword"}, + { ".wk1", "application/x-123"}, + { ".wmf", "windows/metafile"}, + { ".wml", "text/vnd.wap.wml"}, + { ".wmlc", "application/vnd.wap.wmlc"}, + { ".wmls", "text/vnd.wap.wmlscript"}, + { ".wmlsc", "application/vnd.wap.wmlscriptc"}, + { ".word", "application/msword"}, + { ".wp", "application/wordperfect"}, + { ".wp5", "application/wordperfect"}, + { ".wp5", "application/wordperfect6.0"}, + { ".wp6", "application/wordperfect"}, + { ".wpd", "application/wordperfect"}, + // { ".wpd", "application/x-wpwin"}, + { ".wq1", "application/x-lotus"}, + { ".wri", "application/mswrite"}, + // { ".wri", "application/x-wri"}, + // { ".wrl", "application/x-world"}, + { ".wrl", "model/vrml"}, + // { ".wrl", "x-world/x-vrml"}, + { ".wrz", "model/vrml"}, + // { ".wrz", "x-world/x-vrml"}, + { ".wsc", "text/scriplet"}, + { ".wsrc", "application/x-wais-source"}, + { ".wtk", "application/x-wintalk"}, + + // { ".xbm", "image/x-xbitmap"}, + // { ".xbm", "image/x-xbm"}, + { ".xbm", "image/xbm"}, + { ".xdr", "video/x-amt-demorun"}, + { ".xgz", "xgl/drawing"}, + { ".xif", "image/vnd.xiff"}, + { ".xl", "application/excel"}, + // { ".xla", "application/excel"}, + { ".xla", "application/x-excel"}, + // { ".xla", "application/x-msexcel"}, + // { ".xlb", "application/excel"}, + { ".xlb", "application/vnd.ms-excel"}, + // { ".xlb", "application/x-excel"}, + // { ".xlc", "application/excel"}, + { ".xlc", "application/vnd.ms-excel"}, + // { ".xlc", "application/x-excel"}, + // { ".xld", "application/excel"}, + { ".xld", "application/x-excel"}, + // { ".xlk", "application/excel"}, + // { ".xlk", "application/x-excel"}, + // { ".xll", "application/excel"}, + { ".xll", "application/vnd.ms-excel"}, + // { ".xll", "application/x-excel"}, + // { ".xlm", "application/excel"}, + { ".xlm", "application/vnd.ms-excel"}, + // { ".xlm", "application/x-excel"}, + // { ".xls", "application/excel"}, + { ".xls", "application/vnd.ms-excel"}, + // { ".xls", "application/x-excel"}, + // { ".xls", "application/x-msexcel"}, + // { ".xlt", "application/excel"}, + { ".xlt", "application/x-excel"}, + // { ".xlv", "application/excel"}, + { ".xlv", "application/x-excel"}, + // { ".xlw", "application/excel"}, + { ".xlw", "application/vnd.ms-excel"}, + // { ".xlw", "application/x-excel"}, + // { ".xlw", "application/x-msexcel"}, + { ".xm", "audio/xm"}, + // { ".xml", "application/xml"}, + { ".xml", "text/xml"}, + { ".xmz", "xgl/movie"}, + { ".xpix", "application/x-vnd.ls-xpix"}, + // { ".xpm", "image/x-xpixmap"}, + { ".xpm", "image/xpm"}, + { ".x-png", "image/png"}, + { ".xsr", "video/x-amt-showrun"}, + { ".xwd", "image/x-xwd"}, + // { ".xwd", "image/x-xwindowdump"}, + { ".xyz", "chemical/x-pdb"}, + + // { ".z", "application/x-compress"}, + { ".z", "application/x-compressed"}, + // { ".zip", "application/x-compressed"}, + // { ".zip", "application/x-zip-compressed"}, + { ".zip", "application/zip"}, + // { ".zip", "multipart/x-zip"}, + { ".zoo", "application/octet-stream"}, + { ".zsh", "text/x-script.zsh"} + }; +} // MimeType diff --git a/dbPort/src/org/compiere/util/Msg.java b/dbPort/src/org/compiere/util/Msg.java new file mode 100644 index 0000000000..4a9c5f4400 --- /dev/null +++ b/dbPort/src/org/compiere/util/Msg.java @@ -0,0 +1,657 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; +import java.sql.*; +import java.text.*; +import java.util.*; +import java.util.logging.*; +import org.compiere.*; + +/** + * Reads all Messages and stores them in a HashMap + * + * @author Jorg Janke + * @version $Id: Msg.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public final class Msg +{ + /** Initial size of HashMap */ + private static final int MAP_SIZE = 750; + /** Separator between Msg and optional Tip */ + private static final String SEPARATOR = Env.NL + Env.NL; + + /** Singleton */ + private static Msg s_msg = null; + + /** Logger */ + private static CLogger s_log = CLogger.getCLogger (Msg.class); + + /** + * Get Message Object + * @return Mag + */ + private static Msg get() + { + if (s_msg == null) + s_msg = new Msg(); + return s_msg; + } // get + + + /************************************************************************** + * Constructor + */ + private Msg() + { + } // Mag + + /** The Map */ + private CCache> m_languages + = new CCache>("msg_lang", 2, 0); + + /** + * Get Language specific Message Map + * @param ad_language Language Key + * @return HashMap of Language + */ + private CCache getMsgMap (String ad_language) + { + String AD_Language = ad_language; + if (AD_Language == null || AD_Language.length() == 0) + AD_Language = Language.getBaseAD_Language(); + // Do we have the language ? + CCache retValue = (CCache)m_languages.get(AD_Language); + if (retValue != null && retValue.size() > 0) + return retValue; + + // Load Language + retValue = initMsg(AD_Language); + if (retValue != null) + { + m_languages.put(AD_Language, retValue); + return retValue; + } + return retValue; + } // getMsgMap + + + /** + * Init message HashMap. + * The initial call is from ALogin (ConfirmPanel init). + * The second from Env.verifyLanguage. + * @param AD_Language Language + * @return Cache HashMap + */ + private CCache initMsg (String AD_Language) + { + // Trace.printStack(); + CCache msg = new CCache("AD_Message", MAP_SIZE, 0); + // + if (!DB.isConnected()) + { + s_log.log(Level.SEVERE, "No DB Connection"); + return null; + } + try + { + PreparedStatement pstmt = null; + if (AD_Language == null || AD_Language.length() == 0 || Env.isBaseLanguage(AD_Language, "AD_Language")) + pstmt = DB.prepareStatement("SELECT Value, MsgText, MsgTip FROM AD_Message", null); + else + { + pstmt = DB.prepareStatement("SELECT m.Value, t.MsgText, t.MsgTip " + + "FROM AD_Message_Trl t, AD_Message m " + + "WHERE m.AD_Message_ID=t.AD_Message_ID" + + " AND t.AD_Language=?", null); + pstmt.setString(1, AD_Language); + } + ResultSet rs = pstmt.executeQuery(); + + // get values + while (rs.next()) + { + String AD_Message = rs.getString(1); + StringBuffer MsgText = new StringBuffer(); + MsgText.append(rs.getString(2)); + String MsgTip = rs.getString(3); + // + if (MsgTip != null) // messageTip on next line, if exists + MsgText.append(" ").append(SEPARATOR).append(MsgTip); + msg.put(AD_Message, MsgText.toString()); + } + + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, "initMsg", e); + return null; + } + // + if (msg.size() < 100) + { + s_log.log(Level.SEVERE, "Too few (" + msg.size() + ") Records found for " + AD_Language); + return null; + } + s_log.info("Records=" + msg.size() + " - " + AD_Language); + return msg; + } // initMsg + + /** + * Reset Message cache + */ + public void reset() + { + if (m_languages == null) + return; + + // clear all languages + Iterator iterator = m_languages.values().iterator(); + while (iterator.hasNext()) + { + HashMap hm = (HashMap)iterator.next(); + hm.clear(); + } + m_languages.clear(); + } // reset + + /** + * Return an array of the installed Languages + * @return Array of loaded Languages or null + */ + public String[] getLanguages() + { + if (m_languages == null) + return null; + String[] retValue = new String[m_languages.size()]; + m_languages.keySet().toArray(retValue); + return retValue; + } // getLanguages + + /** + * Check if Language is loaded + * @param language Language code + * @return true, if language is loaded + */ + public boolean isLoaded (String language) + { + if (m_languages == null) + return false; + return m_languages.containsKey(language); + } // isLoaded + + /** + * Lookup term + * @param AD_Language language + * @param text text + * @return translated term or null + */ + private String lookup (String AD_Language, String text) + { + if (text == null) + return null; + if (AD_Language == null || AD_Language.length() == 0) + return text; + // hardcoded trl + if (text.equals("/") || text.equals("\\")) + return File.separator; + if (text.equals(";") || text.equals(":")) + return File.pathSeparator; + if (text.equals("ADEMPIERE_HOME")) + return Adempiere.getAdempiereHome(); + if (text.equals("bat") || text.equals("sh")) + { + if (System.getProperty("os.name").startsWith("Win")) + return "bat"; + return "sh"; + } + if (text.equals("CopyRight")) + return Adempiere.COPYRIGHT; + // + HashMap langMap = getMsgMap(AD_Language); + if (langMap == null) + return null; + return (String)langMap.get(text); + } // lookup + + + /************************************************************************** + * Get translated text for AD_Message + * @param ad_language - Language + * @param AD_Message - Message Key + * @return translated text + */ + public static String getMsg (String ad_language, String AD_Message) + { + if (AD_Message == null || AD_Message.length() == 0) + return ""; + // + String AD_Language = ad_language; + if (AD_Language == null || AD_Language.length() == 0) + AD_Language = Language.getBaseAD_Language(); + // + String retStr = get().lookup (AD_Language, AD_Message); + // + if (retStr == null || retStr.length() == 0) + { + s_log.warning("NOT found: " + AD_Message); + return AD_Message; + } + + return retStr; + } // getMsg + + /** + * Get translated text message for AD_Message + * @param ctx Context to retrieve language + * @param AD_Message - Message Key + * @return translated text + */ + public static String getMsg (Properties ctx, String AD_Message) + { + return getMsg (Env.getAD_Language(ctx), AD_Message); + } // getMeg + + /** + * Get translated text message for AD_Message + * @param language Language + * @param AD_Message - Message Key + * @return translated text + */ + public static String getMsg (Language language, String AD_Message) + { + return getMsg (language.getAD_Language(), AD_Message); + } // getMeg + + /** + * Get translated text message for AD_Message + * @param ad_language - Language + * @param AD_Message - Message Key + * @param getText if true only return Text, if false only return Tip + * @return translated text + */ + public static String getMsg (String ad_language, String AD_Message, boolean getText) + { + String retStr = getMsg (ad_language, AD_Message); + int pos = retStr.indexOf(SEPARATOR); + // No Tip + if (pos == -1) + { + if (getText) + return retStr; + else + return ""; + } + else // with Tip + { + if (getText) + retStr = retStr.substring (0, pos); + else + { + int start = pos + SEPARATOR.length(); + int end = retStr.length(); + retStr = retStr.substring (start); + } + } + return retStr; + } // getMsg + + /** + * Get translated text message for AD_Message + * @param ctx Context to retrieve language + * @param AD_Message Message Key + * @param getText if true only return Text, if false only return Tip + * @return translated text + */ + public static String getMsg (Properties ctx, String AD_Message, boolean getText) + { + return getMsg (Env.getAD_Language(ctx), AD_Message, getText); + } // getMsg + + /** + * Get translated text message for AD_Message + * @param language Language + * @param AD_Message Message Key + * @param getText if true only return Text, if false only return Tip + * @return translated text + */ + public static String getMsg (Language language, String AD_Message, boolean getText) + { + return getMsg (language.getAD_Language(), AD_Message, getText); + } // getMsg + + /** + * Get clear text for AD_Message with parameters + * @param ctx Context to retrieve language + * @param AD_Message Message yey + * @param args MessageFormat arguments + * @return translated text + * @see java.text.MessageFormat for formatting options + */ + public static String getMsg(Properties ctx, String AD_Message, Object[] args) + { + return getMsg (Env.getAD_Language(ctx), AD_Message, args); + } // getMsg + + /** + * Get clear text for AD_Message with parameters + * @param language Language + * @param AD_Message Message yey + * @param args MessageFormat arguments + * @return translated text + * @see java.text.MessageFormat for formatting options + */ + public static String getMsg(Language language, String AD_Message, Object[] args) + { + return getMsg (language.getAD_Language(), AD_Message, args); + } // getMsg + + /** + * Get clear text for AD_Message with parameters + * @param ad_language Language + * @param AD_Message Message yey + * @param args MessageFormat arguments + * @return translated text + * @see java.text.MessageFormat for formatting options + */ + public static String getMsg (String ad_language, String AD_Message, Object[] args) + { + String msg = getMsg(ad_language, AD_Message); + String retStr = msg; + try + { + retStr = MessageFormat.format(msg, args); // format string + } + catch (Exception e) + { + s_log.log(Level.SEVERE, msg, e); + } + return retStr; + } // getMsg + + + /************************************************************************** + * Get Amount in Words + * @param language language + * @param amount numeric amount (352.80) + * @return amount in words (three*five*two 80/100) + */ + public static String getAmtInWords (Language language, String amount) + { + if (amount == null || language == null) + return amount; + // Try to find Class + String className = "org.compiere.util.AmtInWords_"; + try + { + className += language.getLanguageCode().toUpperCase(); + Class clazz = Class.forName(className); + AmtInWords aiw = (AmtInWords)clazz.newInstance(); + return aiw.getAmtInWords(amount); + } + catch (ClassNotFoundException e) + { + s_log.log(Level.FINER, "Class not found: " + className); + } + catch (Exception e) + { + s_log.log(Level.SEVERE, className, e); + } + + // Fallback + StringBuffer sb = new StringBuffer(); + int pos = amount.lastIndexOf('.'); + int pos2 = amount.lastIndexOf(','); + if (pos2 > pos) + pos = pos2; + for (int i = 0; i < amount.length(); i++) + { + if (pos == i) // we are done + { + String cents = amount.substring(i+1); + sb.append(' ').append(cents).append("/100"); + break; + } + else + { + char c = amount.charAt(i); + if (c == ',' || c == '.') // skip thousand separator + continue; + if (sb.length() > 0) + sb.append("*"); + sb.append(getMsg(language, String.valueOf(c))); + } + } + return sb.toString(); + } // getAmtInWords + + + /************************************************************************** + * Get Translation for Element + * @param ad_language language + * @param ColumnName column name + * @param isSOTrx if false PO terminology is used (if exists) + * @return Name of the Column or "" if not found + */ + public static String getElement (String ad_language, String ColumnName, boolean isSOTrx) + { + if (ColumnName == null || ColumnName.equals("")) + return ""; + String AD_Language = ad_language; + if (AD_Language == null || AD_Language.length() == 0) + AD_Language = Language.getBaseAD_Language(); + + // Check AD_Element + String retStr = ""; + try + { + PreparedStatement pstmt = null; + try + { + if (AD_Language == null || AD_Language.length() == 0 || Env.isBaseLanguage(AD_Language, "AD_Element")) + pstmt = DB.prepareStatement("SELECT Name, PO_Name FROM AD_Element WHERE UPPER(ColumnName)=?", null); + else + { + pstmt = DB.prepareStatement("SELECT t.Name, t.PO_Name FROM AD_Element_Trl t, AD_Element e " + + "WHERE t.AD_Element_ID=e.AD_Element_ID AND UPPER(e.ColumnName)=? " + + "AND t.AD_Language=?", null); + pstmt.setString(2, AD_Language); + } + } + catch (Exception e) + { + return ColumnName; + } + pstmt.setString(1, ColumnName.toUpperCase()); + ResultSet rs = pstmt.executeQuery(); + if (rs.next()) + { + retStr = rs.getString(1); + if (!isSOTrx) + { + String temp = rs.getString(2); + if (temp != null && temp.length() > 0) + retStr = temp; + } + } + rs.close(); + pstmt.close(); + } + catch (SQLException e) + { + s_log.log(Level.SEVERE, "getElement", e); + return ""; + } + if (retStr != null) + return retStr.trim(); + return retStr; + } // getElement + + /** + * Get Translation for Element using Sales terminology + * @param ctx context + * @param ColumnName column name + * @return Name of the Column or "" if not found + */ + public static String getElement (Properties ctx, String ColumnName) + { + return getElement (Env.getAD_Language(ctx), ColumnName, true); + } // getElement + + /** + * Get Translation for Element + * @param ctx context + * @param ColumnName column name + * @param isSOTrx sales transaction + * @return Name of the Column or "" if not found + */ + public static String getElement (Properties ctx, String ColumnName, boolean isSOTrx) + { + return getElement (Env.getAD_Language(ctx), ColumnName, isSOTrx); + } // getElement + + + /************************************************************************** + * "Translate" text. + *

+	 *		- Check AD_Message.AD_Message 	->	MsgText
+	 *		- Check AD_Element.ColumnName	->	Name
+	 *  
+ * If checking AD_Element, the SO terminology is used. + * @param ad_language Language + * @param isSOTrx sales order context + * @param text Text - MsgText or Element Name + * @return translated text or original text if not found + */ + public static String translate(String ad_language, boolean isSOTrx, String text) + { + if (text == null || text.equals("")) + return ""; + String AD_Language = ad_language; + if (AD_Language == null || AD_Language.length() == 0) + AD_Language = Language.getBaseAD_Language(); + + // Check AD_Message + String retStr = get().lookup (AD_Language, text); + if (retStr != null) + return retStr; + + // Check AD_Element + retStr = getElement(AD_Language, text, isSOTrx); + if (!retStr.equals("")) + return retStr.trim(); + + // Nothing found + if (!text.startsWith("*")) + s_log.warning("NOT found: " + text); + return text; + } // translate + + /*** + * "Translate" text (SO Context). + *
+	 *		- Check AD_Message.AD_Message 	->	MsgText
+	 *		- Check AD_Element.ColumnName	->	Name
+	 *  
+ * If checking AD_Element, the SO terminology is used. + * @param ad_language Language + * @param text Text - MsgText or Element Name + * @return translated text or original text if not found + */ + public static String translate(String ad_language, String text) + { + return translate (ad_language, true, text); + } // translate + + /** + * "Translate" text. + *
+	 *		- Check AD_Message.AD_Message 	->	MsgText
+	 *		- Check AD_Element.ColumnName	->	Name
+	 *  
+ * @param ctx Context + * @param text Text - MsgText or Element Name + * @return translated text or original text if not found + */ + public static String translate(Properties ctx, String text) + { + if (text == null || text.length() == 0) + return text; + String s = (String)ctx.get(text); + if (s != null && s.length() > 0) + return s; + return translate (Env.getAD_Language(ctx), Env.isSOTrx(ctx), text); + } // translate + + /** + * "Translate" text. + *
+	 *		- Check AD_Message.AD_Message 	->	MsgText
+	 *		- Check AD_Element.ColumnName	->	Name
+	 *  
+ * @param language Language + * @param text Text + * @return translated text or original text if not found + */ + public static String translate(Language language, String text) + { + return translate (language.getAD_Language(), false, text); + } // translate + + /** + * Translate elements enclosed in "@" (at sign) + * @param ctx Context + * @param text Text + * @return translated text or original text if not found + */ + public static String parseTranslation(Properties ctx, String text) + { + if (text == null || text.length() == 0) + return text; + + String inStr = text; + String token; + StringBuffer outStr = new StringBuffer(); + + int i = inStr.indexOf("@"); + while (i != -1) + { + outStr.append(inStr.substring(0, i)); // up to @ + inStr = inStr.substring(i+1, inStr.length()); // from first @ + + int j = inStr.indexOf("@"); // next @ + if (j < 0) // no second tag + { + inStr = "@" + inStr; + break; + } + + token = inStr.substring(0, j); + outStr.append(translate(ctx, token)); // replace context + + inStr = inStr.substring(j+1, inStr.length()); // from second @ + i = inStr.indexOf("@"); + } + + outStr.append(inStr); // add remainder + return outStr.toString(); + } // parseTranslation + +} // Msg diff --git a/dbPort/src/org/compiere/util/NullParameter.java b/dbPort/src/org/compiere/util/NullParameter.java new file mode 100644 index 0000000000..86e2e722fc --- /dev/null +++ b/dbPort/src/org/compiere/util/NullParameter.java @@ -0,0 +1,58 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.io.*; + +/** + * Null Parameter for CPreparedStatement + * + * @author Jorg Janke + * @version $Id: NullParameter.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class NullParameter implements Serializable +{ + /** + * Cosntructor + * @param type SQL Type java.sql.Types.* + */ + public NullParameter(int type) + { + m_type = type; + } // NullParameter + + private int m_type = -1; + + /** + * Get Type + * @return type + */ + public int getType() + { + return m_type; + } // getType + + /** + * String representation + * @return info + */ + public String toString() + { + return "NullParameter Type=" + m_type; + } // toString + +} // NullParameter diff --git a/dbPort/src/org/compiere/util/Splash.java b/dbPort/src/org/compiere/util/Splash.java new file mode 100644 index 0000000000..919b5cfd0e --- /dev/null +++ b/dbPort/src/org/compiere/util/Splash.java @@ -0,0 +1,297 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.awt.*; +import java.net.*; +import java.util.Locale; + +import org.compiere.Adempiere; + +/** + * Splash Screen. + * - don't use environment as not set up yet - + * + * Splash splash = new Splash("Processing"); + * .. do something here + * splash.dispose(); + * splash = null; + * + * @author Jorg Janke + * @version $Id: Splash.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ +public class Splash extends Frame +{ + /** + * Get Splash Screen + * @return Splash Screen + */ + public static Splash getSplash () + { + String msg; + if (Locale.getDefault().getLanguage().equals("es")) // espaņol - globalqss + msg = new String("Cargando..."); + else + // Default english + msg = new String("Loading..."); + return getSplash (msg); + } // getSplash + + /** + * Get Splash Screen + * @param text splash text + * @return Splash Screen + */ + public static Splash getSplash (String text) + { + if (s_splash == null) + s_splash = new Splash (text); + else + s_splash.setText(text); + return s_splash; + } // getSplash + + private static Splash s_splash = null; + + /************************************************************************** + * Standard constructor + * @param text clear text + */ + public Splash (String text) + { + super("Adempiere"); + message.setText(text); + try + { + jbInit(); + } + catch(Exception e) + { + System.out.println("Splash"); + e.printStackTrace(); + } + display(); + } // Splash + + /** Tracker */ + private MediaTracker tracker = new MediaTracker(this); + // + private CImage cImage = new CImage(); + private AImage aImage = new AImage(); + // + private Label productLabel = new Label(); + private Panel contentPanel = new Panel(); + private GridBagLayout contentLayout = new GridBagLayout(); + private Label message = new Label(); + + /** + * Static Init + * @throws Exception + */ + private void jbInit() throws Exception + { + this.setBackground(Color.white); + this.setName("splash"); + this.setUndecorated(true); + // + productLabel.setAlignment(Label.CENTER); + message.setFont(new java.awt.Font("Serif", 3, 20)); // italic bold 20 pt + message.setForeground(SystemColor.activeCaption); + message.setAlignment(Label.CENTER); + contentPanel.setLayout(contentLayout); + contentPanel.setName("splashContent"); + contentPanel.setBackground(Color.white); + // + productLabel.setFont(new java.awt.Font("Serif", 2, 10)); + productLabel.setForeground(Color.blue); + productLabel.setText(Adempiere.getSubtitle()); + // productLabel.setToolTipText(Adempiere.getURL()); + // + contentPanel.add(cImage, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 + ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 5, 0, 10), 0, 0)); + contentPanel.add(productLabel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 + ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 5, 0, 10), 0, 0)); + contentPanel.add(message, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 + ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 10, 10), 0, 0)); + // + this.add(aImage, BorderLayout.WEST); + this.add(contentPanel, BorderLayout.EAST); + } // jbInit + + /** + * Set Text (20 pt) + * @param text translated text to display + */ + public void setText (String text) + { + message.setText(text); + display(); + } // setText + + /** + * Show Window + * @param visible true if visible + */ + public void setVisible (boolean visible) + { + super.setVisible(visible); + if (visible) + toFront(); + } // setVisible + + /** + * Calculate size and display + */ + private void display() + { + pack(); + Dimension ss = Toolkit.getDefaultToolkit().getScreenSize(); + Rectangle bounds = getBounds(); + setBounds((ss.width - bounds.width) / 2, (ss.height - bounds.height) / 2, + bounds.width, bounds.height); + setVisible(true); + } // display + + /** + * Dispose Splash + */ + public void dispose() + { + super.dispose(); + s_splash = null; + } // dispose + + + /************************************************************************** + * Adempiere Image + */ + private class CImage extends Component + { + /** + * Adempiere Image + */ + public CImage () + { + /** Removing/modifying the Adempiere logo is a violation of the license */ + m_image = Adempiere.getImageLogo(); + tracker.addImage(m_image, 0); + } + /** The Image */ + private Image m_image = null; + /* The Dimansion */ + private Dimension m_dim = null; + + /** + * Calculate Size + * @return size + */ + public Dimension getPreferredSize() + { + try + { + tracker.waitForID(0); + } + catch (Exception e) + { + System.err.println("Splash.CImage"); + e.printStackTrace(); + } + m_dim = new Dimension (m_image.getWidth(this), m_image.getHeight(this)); + return m_dim; + } // getPreferredSize + + /** + * Paint + * @param g Graphics + */ + public void paint(Graphics g) + { + if (tracker.checkID(0)) + g.drawImage(m_image, 0, 0, this); + } // paint + + } // CImage + + /** + * Animation Image + * @author jjanke + * @version $Id: Splash.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $ + */ + private class AImage extends Component + { + /** + * Animation Image + */ + public AImage() + { + super(); + URL url = org.compiere.Adempiere.class.getResource("images/Java_anim.gif"); + if (url == null) + url = org.compiere.Adempiere.class.getResource("images/Java_logo.gif"); + if (url != null) + { + m_image = Toolkit.getDefaultToolkit().getImage(url); + tracker.addImage(m_image, 1); + } + } // AImage + + /** The image */ + private Image m_image = null; + /** The dimansion */ + private Dimension m_dim = null; + + /** + * Calculate Size + * @return size + */ + public Dimension getPreferredSize() + { + try + { + tracker.waitForID(1); + } + catch (Exception e) + { + System.err.println("Splash.AImage"); + e.printStackTrace(); + } + m_dim = new Dimension (m_image.getWidth(this)+15, m_image.getHeight(this)+15); + return m_dim; + } // getPreferredSize + + /** + * Paint + * @param g Graphics + */ + public void paint (Graphics g) + { + if (tracker.checkID(1)) + g.drawImage(m_image, 10, 10, this); + } // paint + + /** + * Update + * @param g Graphics + */ + public void update (Graphics g) + { + paint(g); + } // update + + } // AImage + +} // Splash diff --git a/dbPort/src/org/compiere/util/TimeUtil.java b/dbPort/src/org/compiere/util/TimeUtil.java new file mode 100644 index 0000000000..2901961eeb --- /dev/null +++ b/dbPort/src/org/compiere/util/TimeUtil.java @@ -0,0 +1,672 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.sql.*; +import java.util.*; + + +/** + * Time Utilities + * + * @author Jorg Janke + * @version $Id: TimeUtil.java,v 1.3 2006/07/30 00:54:35 jjanke Exp $ + */ +public class TimeUtil +{ + /** + * Get earliest time of a day (truncate) + * @param time day and time + * @return day with 00:00 + */ + static public Timestamp getDay (long time) + { + if (time == 0) + time = System.currentTimeMillis(); + GregorianCalendar cal = new GregorianCalendar(Language.getLoginLanguage().getLocale()); + cal.setTimeInMillis(time); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + return new Timestamp (cal.getTimeInMillis()); + } // getDay + + /** + * Get earliest time of a day (truncate) + * @param dayTime day and time + * @return day with 00:00 + */ + static public Timestamp getDay (Timestamp dayTime) + { + if (dayTime == null) + return getDay(System.currentTimeMillis()); + return getDay(dayTime.getTime()); + } // getDay + + /** + * Get earliest time of a day (truncate) + * @param day day 1..31 + * @param month month 1..12 + * @param year year (if two diguts: < 50 is 2000; > 50 is 1900) + * @return timestamp ** not too reliable + */ + static public Timestamp getDay (int year, int month, int day) + { + if (year < 50) + year += 2000; + else if (year < 100) + year += 1900; + if (month < 1 || month > 12) + throw new IllegalArgumentException("Invalid Month: " + month); + if (day < 1 || day > 31) + throw new IllegalArgumentException("Invalid Day: " + month); + GregorianCalendar cal = new GregorianCalendar (year, month-1, day); + return new Timestamp (cal.getTimeInMillis()); + } // getDay + + /** + * Get today (truncate) + * @return day with 00:00 + */ + static public Calendar getToday () + { + GregorianCalendar cal = new GregorianCalendar(Language.getLoginLanguage().getLocale()); + // cal.setTimeInMillis(System.currentTimeMillis()); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + return cal; + } // getToday + + /** + * Get earliest time of next day + * @param day day + * @return next day with 00:00 + */ + static public Timestamp getNextDay (Timestamp day) + { + if (day == null) + day = new Timestamp(System.currentTimeMillis()); + GregorianCalendar cal = new GregorianCalendar(Language.getLoginLanguage().getLocale()); + cal.setTimeInMillis(day.getTime()); + cal.add(Calendar.DAY_OF_YEAR, +1); // next + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + return new Timestamp (cal.getTimeInMillis()); + } // getNextDay + + /** + * Get last date in month + * @param day day + * @return last day with 00:00 + */ + static public Timestamp getMonthLastDay (Timestamp day) + { + if (day == null) + day = new Timestamp(System.currentTimeMillis()); + GregorianCalendar cal = new GregorianCalendar(Language.getLoginLanguage().getLocale()); + cal.setTimeInMillis(day.getTime()); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + // + cal.add(Calendar.MONTH, 1); // next + cal.set(Calendar.DAY_OF_MONTH, 1); // first + cal.add(Calendar.DAY_OF_YEAR, -1); // previous + return new Timestamp (cal.getTimeInMillis()); + } // getNextDay + + /** + * Return the day and time + * @param day day part + * @param time time part + * @return day + time + */ + static public Timestamp getDayTime (Timestamp day, Timestamp time) + { + GregorianCalendar cal_1 = new GregorianCalendar(); + cal_1.setTimeInMillis(day.getTime()); + GregorianCalendar cal_2 = new GregorianCalendar(); + cal_2.setTimeInMillis(time.getTime()); + // + GregorianCalendar cal = new GregorianCalendar(Language.getLoginLanguage().getLocale()); + cal.set(cal_1.get(Calendar.YEAR), + cal_1.get(Calendar.MONTH), + cal_1.get(Calendar.DAY_OF_MONTH), + cal_2.get(Calendar.HOUR_OF_DAY), + cal_2.get(Calendar.MINUTE), + cal_2.get(Calendar.SECOND)); + cal.set(Calendar.MILLISECOND, 0); + Timestamp retValue = new Timestamp(cal.getTimeInMillis()); + // log.fine( "TimeUtil.getDayTime", "Day=" + day + ", Time=" + time + " => " + retValue); + return retValue; + } // getDayTime + + /** + * Is the _1 in the Range of _2 + *
+	 * 		Time_1         +--x--+
+	 * 		Time_2   +a+      +---b---+   +c+
+	 * 	
+ * The function returns true for b and false for a/b. + * @param start_1 start (1) + * @param end_1 not included end (1) + * @param start_2 start (2) + * @param end_2 not included (2) + * @return true if in range + */ + static public boolean inRange (Timestamp start_1, Timestamp end_1, Timestamp start_2, Timestamp end_2) + { + // validity check + if (end_1.before(start_1)) + throw new UnsupportedOperationException ("TimeUtil.inRange End_1=" + end_1 + " before Start_1=" + start_1); + if (end_2.before(start_2)) + throw new UnsupportedOperationException ("TimeUtil.inRange End_2=" + end_2 + " before Start_2=" + start_2); + // case a + if (!end_2.after(start_1)) // end not including + { + // log.fine( "TimeUtil.InRange - No", start_1 + "->" + end_1 + " " + start_2 + "->" + end_2); + return false; + } + // case c + if (!start_2.before(end_1)) // end not including + { + // log.fine( "TimeUtil.InRange - No", start_1 + "->" + end_1 + " " + start_2 + "->" + end_2); + return false; + } + // log.fine( "TimeUtil.InRange - Yes", start_1 + "->" + end_1 + " " + start_2 + "->" + end_2); + return true; + } // inRange + + /** + * Is start..end on one of the days ? + * @param start start day + * @param end end day (not including) + * @param OnMonday true if OK + * @param OnTuesday true if OK + * @param OnWednesday true if OK + * @param OnThursday true if OK + * @param OnFriday true if OK + * @param OnSaturday true if OK + * @param OnSunday true if OK + * @return true if on one of the days + */ + static public boolean inRange (Timestamp start, Timestamp end, + boolean OnMonday, boolean OnTuesday, boolean OnWednesday, + boolean OnThursday, boolean OnFriday, boolean OnSaturday, boolean OnSunday) + { + // are there restrictions? + if (OnSaturday && OnSunday && OnMonday && OnTuesday && OnWednesday && OnThursday && OnFriday) + return false; + + GregorianCalendar calStart = new GregorianCalendar(); + calStart.setTimeInMillis(start.getTime()); + int dayStart = calStart.get(Calendar.DAY_OF_WEEK); + // + GregorianCalendar calEnd = new GregorianCalendar(); + calEnd.setTimeInMillis(end.getTime()); + calEnd.add(Calendar.DAY_OF_YEAR, -1); // not including + int dayEnd = calEnd.get(Calendar.DAY_OF_WEEK); + + // On same day + if (calStart.get(Calendar.YEAR) == calEnd.get(Calendar.YEAR) + && calStart.get(Calendar.MONTH) == calEnd.get(Calendar.MONTH) + && calStart.get(Calendar.DAY_OF_MONTH) == calEnd.get(Calendar.DAY_OF_YEAR)) + { + if ((!OnSaturday && dayStart == Calendar.SATURDAY) + || (!OnSunday && dayStart == Calendar.SUNDAY) + || (!OnMonday && dayStart == Calendar.MONDAY) + || (!OnTuesday && dayStart == Calendar.TUESDAY) + || (!OnWednesday && dayStart == Calendar.WEDNESDAY) + || (!OnThursday && dayStart == Calendar.THURSDAY) + || (!OnFriday && dayStart == Calendar.FRIDAY)) + { + // log.fine( "TimeUtil.InRange - SameDay - Yes", start + "->" + end + " - " + // + OnMonday+"-"+OnTuesday+"-"+OnWednesday+"-"+OnThursday+"-"+OnFriday+"="+OnSaturday+"-"+OnSunday); + return true; + } + // log.fine( "TimeUtil.InRange - SameDay - No", start + "->" + end + " - " + // + OnMonday+"-"+OnTuesday+"-"+OnWednesday+"-"+OnThursday+"-"+OnFriday+"="+OnSaturday+"-"+OnSunday); + return false; + } + // + // log.fine( "TimeUtil.inRange - WeekDay Start=" + dayStart + ", Incl.End=" + dayEnd); + + // Calendar.SUNDAY=1 ... SATURDAY=7 + BitSet days = new BitSet (8); + // Set covered days in BitArray + if (dayEnd <= dayStart) + dayEnd += 7; + for (int i = dayStart; i < dayEnd; i++) + { + int index = i; + if (index > 7) + index -= 7; + days.set(index); + // System.out.println("Set index=" + index + " i=" + i); + } + + // for (int i = Calendar.SUNDAY; i <= Calendar.SATURDAY; i++) + // System.out.println("Result i=" + i + " - " + days.get(i)); + + // Compare days to availability + if ((!OnSaturday && days.get(Calendar.SATURDAY)) + || (!OnSunday && days.get(Calendar.SUNDAY)) + || (!OnMonday && days.get(Calendar.MONDAY)) + || (!OnTuesday && days.get(Calendar.TUESDAY)) + || (!OnWednesday && days.get(Calendar.WEDNESDAY)) + || (!OnThursday && days.get(Calendar.THURSDAY)) + || (!OnFriday && days.get(Calendar.FRIDAY))) + { + // log.fine( "MAssignment.InRange - Yes", start + "->" + end + " - " + // + OnMonday+"-"+OnTuesday+"-"+OnWednesday+"-"+OnThursday+"-"+OnFriday+"="+OnSaturday+"-"+OnSunday); + return true; + } + + // log.fine( "MAssignment.InRange - No", start + "->" + end + " - " + // + OnMonday+"-"+OnTuesday+"-"+OnWednesday+"-"+OnThursday+"-"+OnFriday+"="+OnSaturday+"-"+OnSunday); + return false; + } // isRange + + + /** + * Is it the same day + * @param one day + * @param two compared day + * @return true if the same day + */ + static public boolean isSameDay (Timestamp one, Timestamp two) + { + GregorianCalendar calOne = new GregorianCalendar(); + if (one != null) + calOne.setTimeInMillis(one.getTime()); + GregorianCalendar calTwo = new GregorianCalendar(); + if (two != null) + calTwo.setTimeInMillis(two.getTime()); + if (calOne.get(Calendar.YEAR) == calTwo.get(Calendar.YEAR) + && calOne.get(Calendar.MONTH) == calTwo.get(Calendar.MONTH) + && calOne.get(Calendar.DAY_OF_MONTH) == calTwo.get(Calendar.DAY_OF_YEAR)) + return true; + return false; + } // isSameDay + + /** + * Is it the same hour + * @param one day/time + * @param two compared day/time + * @return true if the same day + */ + static public boolean isSameHour (Timestamp one, Timestamp two) + { + GregorianCalendar calOne = new GregorianCalendar(); + if (one != null) + calOne.setTimeInMillis(one.getTime()); + GregorianCalendar calTwo = new GregorianCalendar(); + if (two != null) + calTwo.setTimeInMillis(two.getTime()); + if (calOne.get(Calendar.YEAR) == calTwo.get(Calendar.YEAR) + && calOne.get(Calendar.MONTH) == calTwo.get(Calendar.MONTH) + && calOne.get(Calendar.DAY_OF_MONTH) == calTwo.get(Calendar.DAY_OF_YEAR) + && calOne.get(Calendar.HOUR_OF_DAY) == calTwo.get(Calendar.HOUR_OF_DAY)) + return true; + return false; + } // isSameHour + + /** + * Is all day + * @param start start date + * @param end end date + * @return true if all day (00:00-00:00 next day) + */ + static public boolean isAllDay (Timestamp start, Timestamp end) + { + GregorianCalendar calStart = new GregorianCalendar(); + calStart.setTimeInMillis(start.getTime()); + GregorianCalendar calEnd = new GregorianCalendar(); + calEnd.setTimeInMillis(end.getTime()); + if (calStart.get(Calendar.HOUR_OF_DAY) == calEnd.get(Calendar.HOUR_OF_DAY) + && calStart.get(Calendar.MINUTE) == calEnd.get(Calendar.MINUTE) + && calStart.get(Calendar.SECOND) == calEnd.get(Calendar.SECOND) + && calStart.get(Calendar.MILLISECOND) == calEnd.get(Calendar.MILLISECOND) + && calStart.get(Calendar.HOUR_OF_DAY) == 0 + && calStart.get(Calendar.MINUTE) == 0 + && calStart.get(Calendar.SECOND) == 0 + && calStart.get(Calendar.MILLISECOND) == 0 + && start.before(end)) + return true; + // + return false; + } // isAllDay + + /** + * Calculate the number of days between start and end. + * @param start start date + * @param end end date + * @return number of days (0 = same) + */ + static public int getDaysBetween (Timestamp start, Timestamp end) + { + boolean negative = false; + if (end.before(start)) + { + negative = true; + Timestamp temp = start; + start = end; + end = temp; + } + // + GregorianCalendar cal = new GregorianCalendar(); + cal.setTime(start); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + GregorianCalendar calEnd = new GregorianCalendar(); + calEnd.setTime(end); + calEnd.set(Calendar.HOUR_OF_DAY, 0); + calEnd.set(Calendar.MINUTE, 0); + calEnd.set(Calendar.SECOND, 0); + calEnd.set(Calendar.MILLISECOND, 0); + + // System.out.println("Start=" + start + ", End=" + end + ", dayStart=" + cal.get(Calendar.DAY_OF_YEAR) + ", dayEnd=" + calEnd.get(Calendar.DAY_OF_YEAR)); + + // in same year + if (cal.get(Calendar.YEAR) == calEnd.get(Calendar.YEAR)) + { + if (negative) + return (calEnd.get(Calendar.DAY_OF_YEAR) - cal.get(Calendar.DAY_OF_YEAR)) * -1; + return calEnd.get(Calendar.DAY_OF_YEAR) - cal.get(Calendar.DAY_OF_YEAR); + } + + // not very efficient, but correct + int counter = 0; + while (calEnd.after(cal)) + { + cal.add (Calendar.DAY_OF_YEAR, 1); + counter++; + } + if (negative) + return counter * -1; + return counter; + } // getDatesBetrween + + /** + * Return Day + offset (truncates) + * @param day Day + * @param offset day offset + * @return Day + offset at 00:00 + */ + static public Timestamp addDays (Timestamp day, int offset) + { + if (day == null) + day = new Timestamp(System.currentTimeMillis()); + // + GregorianCalendar cal = new GregorianCalendar(); + cal.setTime(day); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MILLISECOND, 0); + if (offset == 0) + return new Timestamp (cal.getTimeInMillis()); + cal.add(Calendar.DAY_OF_YEAR, offset); // may have a problem with negative (before 1/1) + return new Timestamp (cal.getTimeInMillis()); + } // addDays + + /** + * Return DateTime + offset in minutes + * @param dateTime Date and Time + * @param offset minute offset + * @return dateTime + offset in minutes + */ + static public Timestamp addMinutess (Timestamp dateTime, int offset) + { + if (dateTime == null) + dateTime = new Timestamp(System.currentTimeMillis()); + if (offset == 0) + return dateTime; + // + GregorianCalendar cal = new GregorianCalendar(); + cal.setTime(dateTime); + cal.add(Calendar.MINUTE, offset); // may have a problem with negative + return new Timestamp (cal.getTimeInMillis()); + } // addMinutes + + + /************************************************************************** + * Format Elapsed Time + * @param start start time or null for now + * @param end end time or null for now + * @return formatted time string 1'23:59:59.999 + */ + public static String formatElapsed (Timestamp start, Timestamp end) + { + long startTime = 0; + if (start == null) + startTime = System.currentTimeMillis(); + else + startTime = start.getTime(); + // + long endTime = 0; + if (end == null) + endTime = System.currentTimeMillis(); + else + endTime = end.getTime(); + return formatElapsed(endTime-startTime); + } // formatElapsed + + /** + * Format Elapsed Time until now + * @param start start time + * @return formatted time string 1'23:59:59.999 + */ + public static String formatElapsed (Timestamp start) + { + if (start == null) + return "NoStartTime"; + long startTime = start.getTime(); + long endTime = System.currentTimeMillis(); + return formatElapsed(endTime-startTime); + } // formatElapsed + + /** + * Format Elapsed Time + * @param elapsedMS time in ms + * @return formatted time string 1'23:59:59.999 - d'hh:mm:ss.xxx + */ + public static String formatElapsed (long elapsedMS) + { + if (elapsedMS == 0) + return "0"; + StringBuffer sb = new StringBuffer(); + if (elapsedMS < 0) + { + elapsedMS = - elapsedMS; + sb.append("-"); + } + // + long miliSeconds = elapsedMS%1000; + elapsedMS = elapsedMS / 1000; + long seconds = elapsedMS%60; + elapsedMS = elapsedMS / 60; + long minutes = elapsedMS%60; + elapsedMS = elapsedMS / 60; + long hours = elapsedMS%24; + long days = elapsedMS / 24; + // + if (days != 0) + sb.append(days).append("'"); + // hh + if (hours != 0) + sb.append(get2digits(hours)).append(":"); + else if (days != 0) + sb.append("00:"); + // mm + if (minutes != 0) + sb.append(get2digits(minutes)).append(":"); + else if (hours != 0 || days != 0) + sb.append("00:"); + // ss + sb.append(get2digits(seconds)) + .append(".").append(miliSeconds); + return sb.toString(); + } // formatElapsed + + /** + * Get Minimum of 2 digits + * @param no number + * @return String + */ + private static String get2digits (long no) + { + String s = String.valueOf(no); + if (s.length() > 1) + return s; + return "0" + s; + } // get2digits + + + /** + * Is it valid today? + * @param validFrom valid from + * @param validTo valid to + * @return true if walid + */ + public static boolean isValid (Timestamp validFrom, Timestamp validTo) + { + return isValid (validFrom, validTo, new Timestamp (System.currentTimeMillis())); + } // isValid + + /** + * Is it valid on test date + * @param validFrom valid from + * @param validTo valid to + * @param testDate Date + @return true if walid + */ + public static boolean isValid (Timestamp validFrom, Timestamp validTo, Timestamp testDate) + { + if (testDate == null) + return true; + if (validFrom == null && validTo == null) + return true; + // (validFrom) ok + if (validFrom != null && validFrom.after(testDate)) + return false; + // ok (validTo) + if (validTo != null && validTo.before(testDate)) + return false; + return true; + } // isValid + + /** + * Max date + * @param ts1 p1 + * @param ts2 p2 + * @return max time + */ + public static Timestamp max (Timestamp ts1, Timestamp ts2) + { + if (ts1 == null) + return ts2; + if (ts2 == null) + return ts1; + + if (ts2.after(ts1)) + return ts2; + return ts1; + } // max + + /** Truncate Day - D */ + public static final String TRUNC_DAY = "D"; + /** Truncate Week - W */ + public static final String TRUNC_WEEK = "W"; + /** Truncate Month - MM */ + public static final String TRUNC_MONTH = "MM"; + /** Truncate Quarter - Q */ + public static final String TRUNC_QUARTER = "Q"; + /** Truncate Year - Y */ + public static final String TRUNC_YEAR = "Y"; + + /** + * Get truncated day/time + * @param dayTime day + * @param trunc how to truncate TRUNC_* + * @return next day with 00:00 + */ + static public Timestamp trunc (Timestamp dayTime, String trunc) + { + if (dayTime == null) + dayTime = new Timestamp(System.currentTimeMillis()); + GregorianCalendar cal = new GregorianCalendar(Language.getLoginLanguage().getLocale()); + cal.setTimeInMillis(dayTime.getTime()); + cal.set(Calendar.MILLISECOND, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MINUTE, 0); + // D + cal.set(Calendar.HOUR_OF_DAY, 0); + if (trunc == null || trunc.equals(TRUNC_DAY)) + return new Timestamp (cal.getTimeInMillis()); + // W + if (trunc.equals(TRUNC_WEEK)) + { + cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek()); + return new Timestamp (cal.getTimeInMillis()); + } + // MM + cal.set(Calendar.DAY_OF_MONTH, 1); + if (trunc.equals(TRUNC_MONTH)) + return new Timestamp (cal.getTimeInMillis()); + // Q + if (trunc.equals(TRUNC_QUARTER)) + { + int mm = cal.get(Calendar.MONTH); + if (mm < 4) + mm = 1; + else if (mm < 7) + mm = 4; + else if (mm < 10) + mm = 7; + else + mm = 10; + cal.set(Calendar.MONTH, mm); + return new Timestamp (cal.getTimeInMillis()); + } + cal.set(Calendar.DAY_OF_YEAR, 1); + return new Timestamp (cal.getTimeInMillis()); + } // trunc + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + Timestamp t1 = getDay(01, 01, 01); + Timestamp t2 = getDay(02, 02, 02); + Timestamp t3 = getDay(03, 03, 03); + + System.out.println(t1 + " - " + t3); + System.out.println(t2 + " - " + isValid (t1,t3, t2)); + } // main + +} // TimeUtil diff --git a/dbPort/src/org/compiere/util/Trx.java b/dbPort/src/org/compiere/util/Trx.java new file mode 100644 index 0000000000..711af44893 --- /dev/null +++ b/dbPort/src/org/compiere/util/Trx.java @@ -0,0 +1,358 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.beans.*; +import java.sql.*; +import java.util.logging.*; + +/** + * Transaction Management. + * - Create new Transaction by Trx.get(name); + * - ..transactions.. + * - commit(); + * ---- start(); + * ---- commit(); + * - close(); + * + * @author Jorg Janke + * @version $Id$ + */ +public class Trx implements VetoableChangeListener +{ + /** + * Get Transaction + * @param trxName trx name + * @param createNew if false, null is returned if not found + * @return Transaction or null + */ + public static synchronized Trx get (String trxName, boolean createNew) + { + if (trxName == null || trxName.length() == 0) + throw new IllegalArgumentException ("No Transaction Name"); + + if (s_cache == null) + { + s_cache = new CCache("Trx", 10, -1); // no expiration + s_cache.addVetoableChangeListener(new Trx("controller")); + } + + Trx retValue = (Trx)s_cache.get(trxName); + if (retValue == null && createNew) + { + retValue = new Trx (trxName); + s_cache.put(trxName, retValue); + } + return retValue; + } // get + + /** Transaction Cache */ + private static CCache s_cache = null; // create change listener + + /** + * Create unique Transaction Name + * @param prefix optional prefix + * @return unique name + */ + public static String createTrxName (String prefix) + { + if (prefix == null || prefix.length() == 0) + prefix = "Trx"; + prefix += "_" + System.currentTimeMillis(); + return prefix; + } // createTrxName + + /** + * Create unique Transaction Name + * @return unique name + */ + public static String createTrxName () + { + return createTrxName(null); + } // createTrxName + + + /************************************************************************** + * Transaction Constructor + * @param trxName unique name + */ + private Trx (String trxName) + { + this (trxName, null); + } // Trx + + /** + * Transaction Constructor + * @param trxName unique name + @param con optional connection + * */ + private Trx (String trxName, Connection con) + { + // log.info (trxName); + setTrxName (trxName); + setConnection (con); + } // Trx + + /** Logger */ + private CLogger log = CLogger.getCLogger(getClass()); + + private Connection m_connection = null; + private String m_trxName = null; + private Savepoint m_savepoint = null; + private boolean m_active = false; + + /** + * Get Connection + * @return connection + */ + public Connection getConnection() + { + log.log(Level.ALL, "Active=" + isActive() + ", Connection=" + m_connection); + if (m_connection == null) // get new Connection + setConnection(DB.createConnection(false, Connection.TRANSACTION_READ_COMMITTED)); + if (!isActive()) + start(); + // System.err.println ("Trx.getConnection - " + m_name + ": "+ m_connection); + // Trace.printStack(); + return m_connection; + } // getConnection + + /** + * Set Connection + * @param conn connection + */ + private void setConnection (Connection conn) + { + if (conn == null) + return; + m_connection = conn; + log.finest("Connection=" + conn); + try + { + m_connection.setAutoCommit(false); + } + catch (SQLException e) + { + log.log(Level.SEVERE, "connection", e); + } + } // setConnection + + /** + * Set Trx Name + * @param trxName transaction name + */ + private void setTrxName (String trxName) + { + if (trxName == null || trxName.length() == 0) + throw new IllegalArgumentException ("No Transaction Name"); + m_trxName = trxName; + } // setName + + /** + * Get Name + * @return name + */ + public String getTrxName() + { + return m_trxName; + } // getName + + /** + * Start Trx + * @return true if trx started + */ + public boolean start() + { + if (m_savepoint != null || m_active) + { + log.warning("Trx in progress " + m_trxName + " - " + m_savepoint); + return false; + } + m_active = true; + try + { + if (m_connection != null) + { + m_savepoint = m_connection.setSavepoint(m_trxName); + log.info("**** " + getTrxName()); + } + } + catch (SQLException e) + { + log.log(Level.SEVERE, m_trxName, e); + m_savepoint = null; + return false; + } + return true; + } // startTrx + + /** + * Get Savepoint + * @return savepoint or null + */ + public Savepoint getSavepoint() + { + return m_savepoint; + } // getSavepoint + + /** + * Transaction is Active + * @return true if transaction active + */ + public boolean isActive() + { + return m_active; + } // isActive + + /** + * Rollback + * @return true if success + */ + public boolean rollback() + { + try + { + if (m_connection != null) + { + if (m_savepoint == null) + m_connection.rollback(); + else + m_connection.rollback(m_savepoint); + log.info ("**** " + m_trxName); + m_savepoint = null; + m_active = false; + return true; + } + } + catch (SQLException e) + { + log.log(Level.SEVERE, m_trxName, e); + } + m_savepoint = null; + m_active = false; + return false; + } // rollback + + /** + * Release savepoint + * @return true if released + * + public boolean release() + { + if (m_connection == null) + return false; + m_active = false; + if (m_savepoint == null) + return true; + try + { + getConnection().releaseSavepoint(m_savepoint); + log.fine("release **** " + getName()); + m_savepoint = null; + } + catch (SQLException e) + { + log.log(Level.SEVERE, "release ****", e); + m_savepoint = null; + return false; + } + return true; + } // release + + /** + * Commit + **/ + public boolean commit() + { + try + { + if (m_connection != null) + { + m_connection.commit(); + log.info ("**** " + m_trxName); + m_savepoint = null; + m_active = false; + return true; + } + } + catch (SQLException e) + { + log.log(Level.SEVERE, m_trxName, e); + } + m_savepoint = null; + m_active = false; + return false; + } // commit + + /** + * End Transaction and Close Connection + * @return true if success + */ + public synchronized boolean close() + { + if (s_cache != null) + s_cache.remove(getTrxName()); + // + if (m_connection == null) + return true; + + if (m_savepoint != null || isActive()) + commit(); + + // Close Connection + try + { + m_connection.close(); + } + catch (SQLException e) + { + log.log(Level.SEVERE, m_trxName, e); + } + m_savepoint = null; + m_connection = null; + m_active = false; + log.config(m_trxName); + return true; + } // close + + /** + * String Representation + * @return info + */ + public String toString() + { + StringBuffer sb = new StringBuffer("Trx["); + sb.append(getTrxName()) + .append(",Active=").append(isActive()) + .append("]"); + return sb.toString(); + } // toString + + /** + * Vetoable Change. + * Called from CCache to close connections + * @param evt event + * @throws PropertyVetoException + */ + public void vetoableChange (PropertyChangeEvent evt) + throws PropertyVetoException + { + log.info(evt.toString()); + } // vetoableChange + + +} // Trx diff --git a/dbPort/src/org/compiere/util/ZipUtil.java b/dbPort/src/org/compiere/util/ZipUtil.java new file mode 100644 index 0000000000..3e5158399a --- /dev/null +++ b/dbPort/src/org/compiere/util/ZipUtil.java @@ -0,0 +1,439 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ +package org.compiere.util; + +import java.util.*; +import java.util.zip.*; +import java.util.jar.*; +import java.io.*; +import java.sql.*; + +/** + * Zip/Jar File Utilities + * + * @author Jorg Janke + * @version $Id: ZipUtil.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $ + */ +public class ZipUtil +{ + /** + * Empty Constructor, need to open explicitly. + */ + public ZipUtil() + { + } // ZipUtil + + /** + * Open zip file. + * @param fileName zip file name + */ + public ZipUtil(String fileName) + { + open (fileName); + } // ZipUtil + + /** + * Open zip file. + * @param file zip file + */ + public ZipUtil(File file) + { + open(file); + } // ZipUtil + + private File m_file; + private ZipFile m_zipFile; + + /** + * Open the Zip File for reading + * @param fileName zip file + * @return true if opened + */ + public boolean open (String fileName) + { + if (fileName == null) + return false; + try + { + return open (new File(fileName)); + } + catch (Exception ex) + { + System.err.println("ZipUtil.open - " + ex); + } + return false; + } // open + + /** + * Open the Zip File for reading + * @param file zip file + * @return true if opened + */ + public boolean open (File file) + { + if (file == null) + return false; + m_file = file; + try + { + if (file.getName().endsWith("jar")) + m_zipFile = new JarFile (file, false, JarFile.OPEN_READ); + else + m_zipFile = new ZipFile (file, ZipFile.OPEN_READ); + } + catch (IOException ex) + { + System.err.println("ZipUtil.open - " + ex); + m_zipFile = null; + return false; + } + return true; + } // open + + /** + * Close Zip File + */ + public void close() + { + try + { + if (m_zipFile != null) + m_zipFile.close(); + } + catch (IOException ex) + { + System.err.println("ZipUtil.close - " + ex); + } + m_zipFile = null; + } // close + + /** + * Is the Zip File Open + * @return true if yes + */ + public boolean isOpen() + { + return m_zipFile != null; + } // isOpen + + /** + * Is it a Jar + * @return true if yes + */ + public boolean isJar() + { + return (m_zipFile != null && m_zipFile instanceof JarFile); + } // isJar + + /** + * Get it as Jar if it is a Jar + * @return jar or null if not a jar + */ + public JarFile getJar() + { + if (m_zipFile != null && m_zipFile instanceof JarFile) + return (JarFile)m_zipFile; + return null; + } // getJar + + /** + * String Representation + * @return info + */ + public String toString() + { + if (m_zipFile != null) + return m_zipFile.toString(); + return "ZipUtil"; + } // toString + + + /************************************************************************** + * Get Content as sorted String Array + * @return content + */ + public String[] getContent() + { + if (!isOpen()) + return null; + Enumeration e = m_zipFile.entries(); + ArrayList list = new ArrayList(); + while (e.hasMoreElements()) + list.add(e.nextElement()); + // return sorted array + String[] retValue = new String[list.size()]; + for (int i = 0; i < retValue.length; i++) + retValue[i] = ((ZipEntry)list.get(i)).getName(); + Arrays.sort(retValue); + return retValue; + } // getContent + + /** + * Get ZipEntries as Enumeration + * @return entries + */ + public Enumeration entries() + { + if (!isOpen()) + return null; + return m_zipFile.entries(); + } // entries + + /** + * Get Zip Entry + * @param name entry name + * @return ZipEntry or null if not found + */ + public ZipEntry getEntry (String name) + { + if (!isOpen()) + return null; + return m_zipFile.getEntry(name); + } // getEntry + + /** + * Get File Info + * @param name name + * @return time and size + */ + public String getEntryInfo (String name) + { + StringBuffer sb = new StringBuffer(name); + ZipEntry e = getEntry(name); + if (e == null) + sb.append(": -"); + else + { + Timestamp ts = new Timestamp(e.getTime()); + sb.append(": ").append(ts).append(" - ").append(e.getSize()); + } + return sb.toString(); + } // getEntryInfo + + /** + * Get Manifest if a Jar + * @return Manifest if exists or null + */ + public Manifest getManifest() + { + try + { + JarFile jar = getJar(); + if (jar != null) + return jar.getManifest(); + } + catch (IOException ex) + { + System.err.println("ZipUtil.getManifest - " + ex); + } + return null; + } // getManifest + + + /************************************************************************** + * Get Zip Entry + * @param fileName zip/jar file + * @param entryName entry + * @return ZipEntry + */ + static public ZipEntry getEntry (String fileName, String entryName) + { + if (fileName == null || entryName == null) + return null; + // File + File file = new File(fileName); + if (!file.exists()) + { + String fn = findInPath(fileName); + if (fn == null) + return null; // file not found + file = new File(fn); + } + ZipUtil zu = new ZipUtil (file); + if (!zu.isOpen()) + return null; + // Entry + ZipEntry retValue = zu.getEntry(entryName); + if (retValue == null) + { + Enumeration e = zu.entries(); + while (e.hasMoreElements()) + { + ZipEntry entry = (ZipEntry)e.nextElement(); + if (entry.getName().indexOf(entryName) != -1) + { + retValue = entry; + break; + } + } + } + zu.close(); + return retValue; + } // getEntry + + /** + * Get Jar File + * @param fileName zip/jar file + * @return Jar + */ + static public JarFile getJar (String fileName) + { + if (fileName == null) + return null; + // File + File file = new File(fileName); + if (!file.exists()) + { + String fn = findInPath(fileName); + if (fn == null) + return null; // file not found + file = new File(fn); + } + ZipUtil zu = new ZipUtil (file); + return zu.getJar(); + } // getJar + + /** + * Get Manifest + * @param fileName zip/jar file + * @return Manifest or null + */ + static public Manifest getManifest (String fileName) + { + if (fileName == null) + return null; + JarFile jar = getJar (fileName); + if (jar == null) + return null; + try + { + return jar.getManifest(); + } + catch (IOException ex) + { + System.err.println("ZipUtil.getManifest - " + ex); + } + return null; + } // getManifest + + /** + * Get Manifest + * @param fileName jar file + * @param jarEntry jar entry + * @return Manifest + */ + static public JarEntry getJarEntry (String fileName, String jarEntry) + { + if (fileName == null) + return null; + JarFile jar = getJar (fileName); + if (jar == null) + return null; + return jar.getJarEntry(jarEntry); + } // getManifest + + /** + * Dump Manifest to + * @param fileName zip/jar file + * */ + static public void dumpManifest (String fileName) + { + Manifest mf = getManifest (fileName); + if (mf == null) + { + System.out.println("No Jar file: " + fileName); + return; + } + // + System.out.println(mf.getEntries()); + } // dumpManifest + + /** + * Get Zip Entry time + * @param fileName zip file + * @param entryName entry + * @return Time as String or null + */ + static public String getEntryTime (String fileName, String entryName) + { + ZipEntry entry = getEntry(fileName, entryName); + if (entry == null) + return null; + Timestamp ts = new Timestamp (entry.getTime()); + return ts.toString(); + } // getEntryTime + + /** + * Get Fill name of jarfile in path + * @param jarFile name + * @return full name or null if not found + */ + static public String findInPath (String jarFile) + { + String path = System.getProperty("java.class.path"); + String[] pathEntries = path.split(System.getProperty("path.separator")); + for (int i = 0; i < pathEntries.length; i++) + { + // System.out.println(pathEntries[i]); + if (pathEntries[i].indexOf(jarFile) != -1) + return pathEntries[i]; + } + path = System.getProperty("sun.boot.class.path"); + pathEntries = path.split(System.getProperty("path.separator")); + for (int i = 0; i < pathEntries.length; i++) + { + // System.out.println(pathEntries[i]); + if (pathEntries[i].indexOf(jarFile) != -1) + return pathEntries[i]; + } + return null; + } // findInPath + + /** + * Test + * @param args ignored + */ + public static void main (String[] args) + { + try + { + // Get Jar File + JarFile jar = ZipUtil.getJar("CClient.jar"); + if (jar == null) + jar = ZipUtil.getJar("CTools.jar"); + if (jar == null) + return; + + // JarEntry je = jar.getJarEntry(JarFile.MANIFEST_NAME); + // if (je != null) + // System.out.println("Time " + new Date(je.getTime())); + Manifest mf = jar.getManifest(); + if (mf != null) + { + Attributes atts = mf.getMainAttributes(); + atts.getValue("Implementation-Vendor"); + atts.getValue("Implementation-Version"); + // + } + } + catch (IOException ex) + { + System.err.println(ex); + } + } + +} // ZipUtil diff --git a/dbPort/src/org/compiere/util/logClient.properties b/dbPort/src/org/compiere/util/logClient.properties new file mode 100644 index 0000000000..f760e3354f --- /dev/null +++ b/dbPort/src/org/compiere/util/logClient.properties @@ -0,0 +1,34 @@ +############################################################ +# Adempiere Client Logging Configuration File +# $Id: logClient.properties,v 1.1 2006/04/21 17:53:31 jjanke Exp $ +############################################################ + +############################################################ +# Global properties +############################################################ + +# "handlers" specifies a comma separated list of log Handler classes. +# handlers= org.compiere.util.CLogConsole, org.compiere.util.CLogErrorBuffer +handlers= + +# Default global logging level. +.level= INFO + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +# temporary directory. +java.util.logging.FileHandler.formatter = org.compiere.util.CLogFormatter + +# Limit the message that are printed on the console to INFO and above. +java.util.logging.ConsoleHandler.level = INFO +java.util.logging.ConsoleHandler.formatter = org.compiere.util.CLogFormatter + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ +com.adempiere.level = SEVERE +sun.rmi.level = WARNING diff --git a/dbPort/src/org/compiere/util/logServer.properties b/dbPort/src/org/compiere/util/logServer.properties new file mode 100644 index 0000000000..cc7e59ee7a --- /dev/null +++ b/dbPort/src/org/compiere/util/logServer.properties @@ -0,0 +1,34 @@ +############################################################ +# Adempiere Server Logging Configuration File +# $Id: logServer.properties,v 1.1 2006/04/21 17:53:31 jjanke Exp $ +############################################################ + +############################################################ +# Global properties +############################################################ + +# "handlers" specifies a comma separated list of log Handler classes. +# handlers= org.compiere.util.CLogErrorBuffer +handlers= + +# Default global logging level. +.level= INFO + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +# temporary directory. +java.util.logging.FileHandler.formatter = org.compiere.util.CLogFormatter + +# Limit the message that are printed on the console to INFO and above. +java.util.logging.ConsoleHandler.level = INFO +java.util.logging.ConsoleHandler.formatter = org.compiere.util.CLogFormatter + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ +com.adempiere.level = SEVERE +sun.rmi.level = WARNING diff --git a/dbPort/test.bat b/dbPort/test.bat new file mode 100644 index 0000000000..70e0c5900f --- /dev/null +++ b/dbPort/test.bat @@ -0,0 +1,4 @@ +java -classpath D:\Adempiere\dbPort\dbPort.jar;D:\Adempiere\looks\CLooks.jar;D:\Adempiere\lib\ojdbc14_g.jar org.compiere.db.DB_Oracle + + +pause