/******************************************************************************
 * 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_LoyaltyPlan;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.sql.Timestamp;
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.util.Env;

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

	private static final long serialVersionUID = 20240523L;

	/**
	 * Standard Constructor
	 */
	public X_iNO_LoyaltyCollect (Properties ctx, int iNO_LoyaltyCollect_ID, String trxName) {
		super (ctx, iNO_LoyaltyCollect_ID, trxName);
		/** if (iNO_LoyaltyCollect_ID == 0)
		{
			setEndDate (new Timestamp( System.currentTimeMillis() ));
			setiEXT_LoyaltyCollectBase (null);
			setiEXT_LoyaltyCollectLevel (null);
// GL
			setiNO_LoyaltyCollect_ID (0);
			setiNO_LoyaltyPlan_ID (0);
			setStartDate (new Timestamp( System.currentTimeMillis() ));
		} */
    }

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

	/**
	 * Set Amount.
	 * @param Amount 
	 * Amount in a defined currency
	 */
	public void setAmount (BigDecimal amount) {
		set_Value (COLUMNNAME_Amount, amount);
	}

	/**
	 * Get Amount.
	 * @return Amount in a defined currency
	 */
	public BigDecimal getAmount () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Amount);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/**
	 * 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 End Date.
	 * @param EndDate 
	 * Last effective date (inclusive)
	 */
	public void setEndDate (Timestamp endDate) {
		set_Value (COLUMNNAME_EndDate, endDate);
	}

	/**
	 * Get End Date.
	 * @return Last effective date (inclusive)
	 */
	public Timestamp getEndDate () {
		return (Timestamp)get_Value(COLUMNNAME_EndDate);
	}

	/**
	 * Set Price includes Tax.
	 * @param IEXT_IsTaxIncluded 
	 * Tax is included in the price 
	 */
	public void setIEXT_IsTaxIncluded (boolean isTaxIncluded) {
		set_Value (COLUMNNAME_IEXT_IsTaxIncluded, Boolean.valueOf(isTaxIncluded));
	}

	/**
	 * Get Price includes Tax.
	 * @return Tax is included in the price 
	 */
	public boolean isIEXT_IsTaxIncluded () {
		Object oo = get_Value(COLUMNNAME_IEXT_IsTaxIncluded);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/** Invoice = I */
	public static final String IEXT_LOYALTYCOLLECTBASE_Invoice = "I";
	/** Oder = O */
	public static final String IEXT_LOYALTYCOLLECTBASE_Oder = "O";
	/**
	 * Set Loyalty collect base.
	 * @param iEXT_LoyaltyCollectBase Loyalty collect base
	 */
	public void setiEXT_LoyaltyCollectBase (String loyaltyCollectBase) {

		set_Value (COLUMNNAME_iEXT_LoyaltyCollectBase, loyaltyCollectBase);
	}

	/**
	 * Get Loyalty collect base.
	 * @return Loyalty collect base
	 */
	public String getiEXT_LoyaltyCollectBase () {
		return (String)get_Value(COLUMNNAME_iEXT_LoyaltyCollectBase);
	}

	/** Global = GL */
	public static final String IEXT_LOYALTYCOLLECTLEVEL_Global = "GL";
	/** Product Category = PC */
	public static final String IEXT_LOYALTYCOLLECTLEVEL_ProductCategory = "PC";
	/** Product = PR */
	public static final String IEXT_LOYALTYCOLLECTLEVEL_Product = "PR";
	/**
	 * Set Loyalty collect Level.
	 * @param iEXT_LoyaltyCollectLevel Loyalty collect Level
	 */
	public void setiEXT_LoyaltyCollectLevel (String loyaltyCollectLevel) {

		set_Value (COLUMNNAME_iEXT_LoyaltyCollectLevel, loyaltyCollectLevel);
	}

	/**
	 * Get Loyalty collect Level.
	 * @return Loyalty collect Level
	 */
	public String getiEXT_LoyaltyCollectLevel () {
		return (String)get_Value(COLUMNNAME_iEXT_LoyaltyCollectLevel);
	}

	/**
	 * 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;
	}

	/**
	 * 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 iNO_LoyaltyCollect_UU.
	 * @param iNO_LoyaltyCollect_UU iNO_LoyaltyCollect_UU
	 */
	public void setiNO_LoyaltyCollect_UU (String loyaltyCollectUU) {
		set_Value (COLUMNNAME_iNO_LoyaltyCollect_UU, loyaltyCollectUU);
	}

	/**
	 * Get iNO_LoyaltyCollect_UU.
	 * @return iNO_LoyaltyCollect_UU
	 */
	public String getiNO_LoyaltyCollect_UU () {
		return (String)get_Value(COLUMNNAME_iNO_LoyaltyCollect_UU);
	}

	public X_iNO_LoyaltyPlan getiNO_LoyaltyPlan() throws RuntimeException {
		return (X_iNO_LoyaltyPlan)MTable.get(getCtx(), X_iNO_LoyaltyPlan.Table_Name)
				.getPO(getiNO_LoyaltyPlan_ID(), get_TrxName());
	}

	/**
	 * Set Loyalty Plan.
	 * @param iNO_LoyaltyPlan_ID Loyalty Plan
	 */
	public void setiNO_LoyaltyPlan_ID (int loyaltyPlanID) {
		if (loyaltyPlanID < 1) 
			set_Value (COLUMNNAME_iNO_LoyaltyPlan_ID, null);
		else 
			set_Value (COLUMNNAME_iNO_LoyaltyPlan_ID, Integer.valueOf(loyaltyPlanID));
	}

	/**
	 * Get Loyalty Plan.
	 * @return Loyalty Plan
	 */
	public int getiNO_LoyaltyPlan_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_iNO_LoyaltyPlan_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 (COLUMNNAME_StartDate, startDate);
	}

	/**
	 * Get Start Date.
	 * @return First effective day (inclusive)
	 */
	public Timestamp getStartDate () {
		return (Timestamp)get_Value(COLUMNNAME_StartDate);
	}
}