/******************************************************************************
 * Product: iDempiere ERP & CRM Smart Business Solution                       *
 * Copyright (C) 1999-2012 ComPiere, Inc. All Rights Reserved.                *
 * This program is free software, you can redistribute it and/or modify it    *
 * under the terms version 2 of the GNU General Public License as published   *
 * by the Free Software Foundation. This program is distributed in the hope   *
 * that it will be useful, but WITHOUT ANY WARRANTY, without even the implied *
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
 * See the GNU General Public License for more details.                       *
 * You should have received a copy of the GNU General Public License along    *
 * with this program, if not, write to the Free Software Foundation, Inc.,    *
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
 * For the text or an alternative of this public license, you may reach us    *
 * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
 * or via info@compiere.org or http://www.compiere.org/license.html           *
 *****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.isnov.plugin.model;

import X_iNO_PrepareOrder;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.model.I_Persistent;
import org.compiere.model.MTable;
import org.compiere.model.PO;
import org.compiere.model.POInfo;
import org.compiere.model.X_C_OrderLine;
import org.compiere.model.X_C_UOM;
import org.compiere.model.X_M_Product;
import org.compiere.util.Env;

/**
 * Generated Model for table iNO_PrepareOrderLine
 * @author iDempiere (generated)
 * @version Release 7.1 - $Id$
 */
public class X_iNO_PrepareOrderLine extends PO implements I_iNO_PrepareOrderLine, I_Persistent {

	private static final long serialVersionUID = 20240108L;

	/**
	 * Standard Constructor
	 */
	public X_iNO_PrepareOrderLine (Properties ctx, int iNO_PrepareOrderLine_ID, String trxName) {
		super (ctx, iNO_PrepareOrderLine_ID, trxName);
		/** if (iNO_PrepareOrderLine_ID == 0)
		{
			setC_UOM_ID (0);
			setIEXT_PriceMax (Env.ZERO);
// 0
			setiNO_PrepareOrder_ID (0);
			setiNO_PrepareOrderLine_ID (0);
			setM_Product_ID (0);
			setPriceLimit (Env.ZERO);
		} */
    }

	/**
	 * Load Constructor
	 */
	public X_iNO_PrepareOrderLine (Properties ctx, ResultSet rs, String trxName) {
		super (ctx, rs, trxName);
	}

	/**
	 * AccessLevel
	 * @return 3 - Client - Org 
	 */
	protected int get_AccessLevel() {
		return accessLevel.intValue();
	}

	/**
	 * Load Meta Data
	 */
	protected POInfo initPO (Properties ctx) {
		POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
		return poi;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder ("X_iNO_PrepareOrderLine[")
			.append(get_ID()).append("]");
		return sb.toString();
	}

	public X_C_OrderLine getC_OrderLine() throws RuntimeException {
		return (X_C_OrderLine)MTable.get(getCtx(), X_C_OrderLine.Table_Name)
				.getPO(getC_OrderLine_ID(), get_TrxName());
	}

	/**
	 * Set Sales Order Line.
	 * @param C_OrderLine_ID 
	 * Sales Order Line
	 */
	public void setC_OrderLine_ID (int orderLineID) {
		if (orderLineID < 1) 
			set_Value (COLUMNNAME_C_OrderLine_ID, null);
		else 
			set_Value (COLUMNNAME_C_OrderLine_ID, Integer.valueOf(orderLineID));
	}

	/**
	 * Get Sales Order Line.
	 * @return Sales Order Line
	 */
	public int getC_OrderLine_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_C_OrderLine_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public X_C_UOM getC_UOM() throws RuntimeException {
		return (X_C_UOM)MTable.get(getCtx(), X_C_UOM.Table_Name)
				.getPO(getC_UOM_ID(), get_TrxName());
	}

	/**
	 * Set UOM.
	 * @param C_UOM_ID 
	 * Unit of Measure
	 */
	public void setC_UOM_ID (int uOMID) {
		if (uOMID < 1) 
			set_Value (COLUMNNAME_C_UOM_ID, null);
		else 
			set_Value (COLUMNNAME_C_UOM_ID, Integer.valueOf(uOMID));
	}

	/**
	 * Get UOM.
	 * @return Unit of Measure
	 */
	public int getC_UOM_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_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) {
		set_Value (COLUMNNAME_Description, description);
	}

	/**
	 * Get Description.
	 * @return Optional short description of the record
	 */
	public String getDescription () {
		return (String)get_Value(COLUMNNAME_Description);
	}

	/**
	 * Set Divide Rate.
	 * @param DivideRate 
	 * To convert Source number to Target number, the Source is divided
	 */
	public void setDivideRate (BigDecimal divideRate) {
		set_Value (COLUMNNAME_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(COLUMNNAME_DivideRate);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/**
	 * Set Price committed.
	 * @param IEXT_PriceEntered Price committed
	 */
	public void setIEXT_PriceEntered (BigDecimal priceEntered) {
		set_Value (COLUMNNAME_IEXT_PriceEntered, priceEntered);
	}

	/**
	 * Get Price committed.
	 * @return Price committed
	 */
	public BigDecimal getIEXT_PriceEntered () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_IEXT_PriceEntered);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/**
	 * Set Price Max.
	 * @param IEXT_PriceMax 
	 * Contains the Max Price of a product
	 */
	public void setIEXT_PriceMax (BigDecimal priceMax) {
		set_Value (COLUMNNAME_IEXT_PriceMax, priceMax);
	}

	/**
	 * Get Price Max.
	 * @return Contains the Max Price of a product
	 */
	public BigDecimal getIEXT_PriceMax () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_IEXT_PriceMax);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	public X_iNO_PrepareOrder getiNO_PrepareOrder() throws RuntimeException {
		return (X_iNO_PrepareOrder)MTable.get(getCtx(), X_iNO_PrepareOrder.Table_Name)
				.getPO(getiNO_PrepareOrder_ID(), get_TrxName());
	}

	/**
	 * Set Prepare Order.
	 * @param iNO_PrepareOrder_ID Prepare Order
	 */
	public void setiNO_PrepareOrder_ID (int prepareOrderID) {
		if (prepareOrderID < 1) 
			set_ValueNoCheck (COLUMNNAME_iNO_PrepareOrder_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_iNO_PrepareOrder_ID, Integer.valueOf(prepareOrderID));
	}

	/**
	 * Get Prepare Order.
	 * @return Prepare Order
	 */
	public int getiNO_PrepareOrder_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_iNO_PrepareOrder_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set Prepare Order Line.
	 * @param iNO_PrepareOrderLine_ID Prepare Order Line
	 */
	public void setiNO_PrepareOrderLine_ID (int prepareOrderLineID) {
		if (prepareOrderLineID < 1) 
			set_ValueNoCheck (COLUMNNAME_iNO_PrepareOrderLine_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_iNO_PrepareOrderLine_ID, Integer.valueOf(prepareOrderLineID));
	}

	/**
	 * Get Prepare Order Line.
	 * @return Prepare Order Line
	 */
	public int getiNO_PrepareOrderLine_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_iNO_PrepareOrderLine_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set iNO_PrepareOrderLine_UU.
	 * @param iNO_PrepareOrderLine_UU iNO_PrepareOrderLine_UU
	 */
	public void setiNO_PrepareOrderLine_UU (String prepareOrderLineUU) {
		set_Value (COLUMNNAME_iNO_PrepareOrderLine_UU, prepareOrderLineUU);
	}

	/**
	 * Get iNO_PrepareOrderLine_UU.
	 * @return iNO_PrepareOrderLine_UU
	 */
	public String getiNO_PrepareOrderLine_UU () {
		return (String)get_Value(COLUMNNAME_iNO_PrepareOrderLine_UU);
	}

	public X_M_Product getM_Product() throws RuntimeException {
		return (X_M_Product)MTable.get(getCtx(), X_M_Product.Table_Name)
				.getPO(getM_Product_ID(), get_TrxName());
	}

	/**
	 * Set Product.
	 * @param M_Product_ID 
	 * Product, Service, Item
	 */
	public void setM_Product_ID (int productID) {
		if (productID < 1) 
			set_Value (COLUMNNAME_M_Product_ID, null);
		else 
			set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(productID));
	}

	/**
	 * Get Product.
	 * @return Product, Service, Item
	 */
	public int getM_Product_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_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) {
		set_Value (COLUMNNAME_PriceLimit, priceLimit);
	}

	/**
	 * Get Limit Price.
	 * @return Lowest price for a product
	 */
	public BigDecimal getPriceLimit () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PriceLimit);
		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) {
		set_Value (COLUMNNAME_QtyEntered, qtyEntered);
	}

	/**
	 * Get Quantity.
	 * @return The Quantity Entered is based on the selected UoM
	 */
	public BigDecimal getQtyEntered () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyEntered);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}
}