X_M_MMRule.java
| Index Score | ||
|---|---|---|
![]() |
![]() |
org.compiere.model |
![]() |
![]() |
Compiere |
View: Reasons, Metrics, Source Code
These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.
/******************************************************************************
* Product: Compiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. *
* This program is free software, you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program, if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 3600 Bridge Parkway #102, Redwood City, CA 94065, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
/** Generated Model - DO NOT CHANGE */
import java.sql.*;
import java.math.*;
import org.compiere.framework.*;
import org.compiere.util.*;
/** Generated Model for M_MMRule
* @author Jorg Janke (generated)
* @version Release 3.1.0 - $Id$ */
public class X_M_MMRule extends PO
{
/** Standard Constructor
@param ctx context
@param M_MMRule_ID id
@param trxName transaction
*/
public X_M_MMRule (Ctx ctx, int M_MMRule_ID, String trxName)
{
super (ctx, M_MMRule_ID, trxName);
/** if (M_MMRule_ID == 0)
{
setIsMaintainUOMIntegrity (false);
setMMType (null);
setM_MMRule_ID (0);
setM_Warehouse_ID (0);
setName (null);
setRule (null);
}
*/
}
/** Load Constructor
@param ctx context
@param rs result set
@param trxName transaction
*/
public X_M_MMRule (Ctx ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** Serial Version No */
static final long serialVersionUID = 27498287027789L;
/** Last Updated Timestamp 2008-07-15 15:41:51.0 */
public static final long updatedMS = 1216161711000L;
/** AD_Table_ID=1039 */
public static final int Table_ID=1039;
/** TableName=M_MMRule */
public static final String Table_Name="M_MMRule";
protected static KeyNamePair Model = new KeyNamePair(Table_ID,"M_MMRule");
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 (Ctx ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("X_M_MMRule[").append(get_ID()).append("]");
return sb.toString();
}
/** Set Description.
@param Description Optional short description of the record */
public void setDescription (String Description)
{
int length = p_info.getFieldLength("Description");
if (Description != null && Description.length() > length)
{
log.warning("Length > " + length + " - truncated");
Description = Description.substring(0,length);
}
set_Value ("Description", Description);
}
/** Get Description.
@return Optional short description of the record */
public String getDescription()
{
return (String)get_Value("Description");
}
/** Set Maintain UOM Integrity.
@param IsMaintainUOMIntegrity Maintain UOM Integrity */
public void setIsMaintainUOMIntegrity (boolean IsMaintainUOMIntegrity)
{
set_Value ("IsMaintainUOMIntegrity", new Boolean(IsMaintainUOMIntegrity));
}
/** Get Maintain UOM Integrity.
@return Maintain UOM Integrity */
public boolean isMaintainUOMIntegrity()
{
Object oo = get_Value("IsMaintainUOMIntegrity");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** MMType AD_Reference_ID=455 */
public static final int MMTYPE_AD_Reference_ID=455;
/** Material Picking = PCK */
public static final String MMTYPE_MaterialPicking = "PCK";
/** Material Putaway = PUT */
public static final String MMTYPE_MaterialPutaway = "PUT";
/** Is test a valid value.
@param test testvalue
@return true if valid **/
public boolean isMMTypeValid (String test)
{
return test.equals("PCK") || test.equals("PUT");
}
/** Set Type.
@param MMType Material Management Rule Type */
public void setMMType (String MMType)
{
if (MMType == null) throw new IllegalArgumentException ("MMType is mandatory");
if (!isMMTypeValid(MMType))
throw new IllegalArgumentException ("MMType Invalid value - " + MMType + " - Reference_ID=455 - PCK - PUT");
int length = p_info.getFieldLength("MMType");
if (MMType.length() > length)
{
log.warning("Length > " + length + " - truncated");
MMType = MMType.substring(0,length);
}
set_Value ("MMType", MMType);
}
/** Get Type.
@return Material Management Rule Type */
public String getMMType()
{
return (String)get_Value("MMType");
}
/** Set Material Management Rule.
@param M_MMRule_ID Material Management Rule */
public void setM_MMRule_ID (int M_MMRule_ID)
{
if (M_MMRule_ID < 1) throw new IllegalArgumentException ("M_MMRule_ID is mandatory.");
set_ValueNoCheck ("M_MMRule_ID", new Integer(M_MMRule_ID));
}
/** Get Material Management Rule.
@return Material Management Rule */
public int getM_MMRule_ID()
{
Integer ii = (Integer)get_Value("M_MMRule_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 Zone.
@param M_Zone_ID Warehouse zone */
public void setM_Zone_ID (int M_Zone_ID)
{
if (M_Zone_ID <= 0) set_Value ("M_Zone_ID", null);
else
set_Value ("M_Zone_ID", new Integer(M_Zone_ID));
}
/** Get Zone.
@return Warehouse zone */
public int getM_Zone_ID()
{
Integer ii = (Integer)get_Value("M_Zone_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.");
int length = p_info.getFieldLength("Name");
if (Name.length() > length)
{
log.warning("Length > " + length + " - truncated");
Name = Name.substring(0,length);
}
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());
}
/** Rule AD_Reference_ID=456 */
public static final int RULE_AD_Reference_ID=456;
/** Find a fixed locator = MMA */
public static final String RULE_FindAFixedLocator = "MMA";
/** Find a floating locator with the same product = MMB */
public static final String RULE_FindAFloatingLocatorWithTheSameProduct = "MMB";
/** Find any empty floating locator = MMC */
public static final String RULE_FindAnyEmptyFloatingLocator = "MMC";
/** Find item in the warehouse = MMD */
public static final String RULE_FindItemInTheWarehouse = "MMD";
/** Find item in the warehouse (Pick to clean) = MME */
public static final String RULE_FindItemInTheWarehousePickToClean = "MME";
/** Use custom class = MMF */
public static final String RULE_UseCustomClass = "MMF";
/** Is test a valid value.
@param test testvalue
@return true if valid **/
public boolean isRuleValid (String test)
{
return test.equals("MMA") || test.equals("MMB") || test.equals("MMC") || test.equals("MMD") || test.equals("MME") || test.equals("MMF");
}
/** Set Rule.
@param Rule Rule */
public void setRule (String Rule)
{
if (Rule == null) throw new IllegalArgumentException ("Rule is mandatory");
if (!isRuleValid(Rule))
throw new IllegalArgumentException ("Rule Invalid value - " + Rule + " - Reference_ID=456 - MMA - MMB - MMC - MMD - MME - MMF");
int length = p_info.getFieldLength("Rule");
if (Rule.length() > length)
{
log.warning("Length > " + length + " - truncated");
Rule = Rule.substring(0,length);
}
set_Value ("Rule", Rule);
}
/** Get Rule.
@return Rule */
public String getRule()
{
return (String)get_Value("Rule");
}
/** Set Custom Class.
@param RuleClass Custom class for Material Management Rule */
public void setRuleClass (String RuleClass)
{
int length = p_info.getFieldLength("RuleClass");
if (RuleClass != null && RuleClass.length() > length)
{
log.warning("Length > " + length + " - truncated");
RuleClass = RuleClass.substring(0,length);
}
set_Value ("RuleClass", RuleClass);
}
/** Get Custom Class.
@return Custom class for Material Management Rule */
public String getRuleClass()
{
return (String)get_Value("RuleClass");
}
}
The table below shows all metrics for X_M_MMRule.java.




