/******************************************************************************
 * 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_LoyaltyCollect;
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_M_Product;
import org.compiere.util.Env;

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

	private static final long serialVersionUID = 20240523L;

	/**
	 * Standard Constructor
	 */
	public X_iNO_LoyaltyCollectProd (Properties ctx, int iNO_LoyaltyCollectProd_ID, String trxName) {
		super (ctx, iNO_LoyaltyCollectProd_ID, trxName);
		/** if (iNO_LoyaltyCollectProd_ID == 0)
		{
			setiNO_LoyaltyCollect_ID (0);
			setiNO_LoyaltyCollectProd_ID (0);
			setM_Product_ID (0);
		} */
    }

	/**
	 * Load Constructor
	 */
	public X_iNO_LoyaltyCollectProd (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_LoyaltyCollectProd[")
			.append(get_ID()).append("]");
		return sb.toString();
	}

	/**
	 * 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 Loyalty Point.
	 * @param iEXT_LoyaltyPoint Loyalty Point
	 */
	public void setiEXT_LoyaltyPoint (BigDecimal loyaltyPoint) {
		set_Value (COLUMNNAME_iEXT_LoyaltyPoint, loyaltyPoint);
	}

	/**
	 * Get Loyalty Point.
	 * @return Loyalty Point
	 */
	public BigDecimal getiEXT_LoyaltyPoint () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_iEXT_LoyaltyPoint);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	public X_iNO_LoyaltyCollect getiNO_LoyaltyCollect() throws RuntimeException {
		return (X_iNO_LoyaltyCollect)MTable.get(getCtx(), X_iNO_LoyaltyCollect.Table_Name)
				.getPO(getiNO_LoyaltyCollect_ID(), get_TrxName());
	}

	/**
	 * Set Loyalty Collect.
	 * @param iNO_LoyaltyCollect_ID Loyalty Collect
	 */
	public void setiNO_LoyaltyCollect_ID (int loyaltyCollectID) {
		if (loyaltyCollectID < 1) 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyCollect_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyCollect_ID, Integer.valueOf(loyaltyCollectID));
	}

	/**
	 * Get Loyalty Collect.
	 * @return Loyalty Collect
	 */
	public int getiNO_LoyaltyCollect_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_iNO_LoyaltyCollect_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set Loyalty Collect Product.
	 * @param iNO_LoyaltyCollectProd_ID Loyalty Collect Product
	 */
	public void setiNO_LoyaltyCollectProd_ID (int loyaltyCollectProdID) {
		if (loyaltyCollectProdID < 1) 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyCollectProd_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyCollectProd_ID, Integer.valueOf(loyaltyCollectProdID));
	}

	/**
	 * Get Loyalty Collect Product.
	 * @return Loyalty Collect Product
	 */
	public int getiNO_LoyaltyCollectProd_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_iNO_LoyaltyCollectProd_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set iNO_LoyaltyCollectProd_UU.
	 * @param iNO_LoyaltyCollectProd_UU iNO_LoyaltyCollectProd_UU
	 */
	public void setiNO_LoyaltyCollectProd_UU (String loyaltyCollectProdUU) {
		set_Value (COLUMNNAME_iNO_LoyaltyCollectProd_UU, loyaltyCollectProdUU);
	}

	/**
	 * Get iNO_LoyaltyCollectProd_UU.
	 * @return iNO_LoyaltyCollectProd_UU
	 */
	public String getiNO_LoyaltyCollectProd_UU () {
		return (String)get_Value(COLUMNNAME_iNO_LoyaltyCollectProd_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();
	}
}