/******************************************************************************
 * 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.model.X_AD_Table;
import org.compiere.model.X_C_BPartner;
import org.compiere.model.X_M_Product;
import org.compiere.util.Env;

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

	private static final long serialVersionUID = 20240523L;

	/**
	 * Standard Constructor
	 */
	public X_iNO_LoyaltyCollectTrx (Properties ctx, int iNO_LoyaltyCollectTrx_ID, String trxName) {
		super (ctx, iNO_LoyaltyCollectTrx_ID, trxName);
		/** if (iNO_LoyaltyCollectTrx_ID == 0)
		{
			setiNO_LoyaltyCollectTrx_ID (0);
		} */
    }

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

	public X_AD_Table getAD_Table() throws RuntimeException {
		return (X_AD_Table)MTable.get(getCtx(), X_AD_Table.Table_Name)
				.getPO(getAD_Table_ID(), get_TrxName());
	}

	/**
	 * Set Table.
	 * @param AD_Table_ID 
	 * Database Table information
	 */
	public void setAD_Table_ID (int tableID) {
		if (tableID < 1) 
			set_Value (COLUMNNAME_AD_Table_ID, null);
		else 
			set_Value (COLUMNNAME_AD_Table_ID, Integer.valueOf(tableID));
	}

	/**
	 * Get Table.
	 * @return Database Table information
	 */
	public int getAD_Table_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_AD_Table_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	public X_C_BPartner getC_BPartner() throws RuntimeException {
		return (X_C_BPartner)MTable.get(getCtx(), X_C_BPartner.Table_Name)
				.getPO(getC_BPartner_ID(), get_TrxName());
	}

	/**
	 * Set Business Partner .
	 * @param C_BPartner_ID 
	 * Identifies a Business Partner
	 */
	public void setC_BPartner_ID (int bPartnerID) {
		if (bPartnerID < 1) 
			set_Value (COLUMNNAME_C_BPartner_ID, null);
		else 
			set_Value (COLUMNNAME_C_BPartner_ID, Integer.valueOf(bPartnerID));
	}

	/**
	 * Get Business Partner .
	 * @return Identifies a Business Partner
	 */
	public int getC_BPartner_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set Transaction Date.
	 * @param DateTrx 
	 * Transaction Date
	 */
	public void setDateTrx (Timestamp dateTrx) {
		set_Value (COLUMNNAME_DateTrx, dateTrx);
	}

	/**
	 * Get Transaction Date.
	 * @return Transaction Date
	 */
	public Timestamp getDateTrx () {
		return (Timestamp)get_Value(COLUMNNAME_DateTrx);
	}

	/**
	 * 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 Trx.
	 * @param iNO_LoyaltyCollectTrx_ID Loyalty Collect Trx
	 */
	public void setiNO_LoyaltyCollectTrx_ID (int loyaltyCollectTrxID) {
		if (loyaltyCollectTrxID < 1) 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyCollectTrx_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyCollectTrx_ID, Integer.valueOf(loyaltyCollectTrxID));
	}

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

	/**
	 * Set iNO_LoyaltyCollectTrx_UU.
	 * @param iNO_LoyaltyCollectTrx_UU iNO_LoyaltyCollectTrx_UU
	 */
	public void setiNO_LoyaltyCollectTrx_UU (String loyaltyCollectTrxUU) {
		set_Value (COLUMNNAME_iNO_LoyaltyCollectTrx_UU, loyaltyCollectTrxUU);
	}

	/**
	 * Get iNO_LoyaltyCollectTrx_UU.
	 * @return iNO_LoyaltyCollectTrx_UU
	 */
	public String getiNO_LoyaltyCollectTrx_UU () {
		return (String)get_Value(COLUMNNAME_iNO_LoyaltyCollectTrx_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 Cancelled.
	 * @param IsCancelled 
	 * The transaction was cancelled
	 */
	public void setIsCancelled (boolean isCancelled) {
		set_ValueNoCheck (COLUMNNAME_IsCancelled, Boolean.valueOf(isCancelled));
	}

	/**
	 * Get Cancelled.
	 * @return The transaction was cancelled
	 */
	public boolean isCancelled () {
		Object oo = get_Value(COLUMNNAME_IsCancelled);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/**
	 * Set Is Synced.
	 * @param IsSynced Is Synced
	 */
	public void setIsSynced (boolean isSynced) {
		set_Value (COLUMNNAME_IsSynced, Boolean.valueOf(isSynced));
	}

	/**
	 * Get Is Synced.
	 * @return Is Synced
	 */
	public boolean isSynced () {
		Object oo = get_Value(COLUMNNAME_IsSynced);
		if (oo != null) 
		{
			 if (oo instanceof Boolean) 
				 return ((Boolean)oo).booleanValue(); 
			return "Y".equals(oo);
		}
		return false;
	}

	/**
	 * Set Line ID.
	 * @param Line_ID 
	 * Transaction line ID (internal)
	 */
	public void setLine_ID (BigDecimal iD) {
		set_ValueNoCheck (COLUMNNAME_Line_ID, iD);
	}

	/**
	 * Get Line ID.
	 * @return Transaction line ID (internal)
	 */
	public BigDecimal getLine_ID () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Line_ID);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/**
	 * Set Line Amount.
	 * @param LineNetAmt 
	 * Line Extended Amount (Quantity * Actual Price) without Freight and Charges
	 */
	public void setLineNetAmt (BigDecimal lineNetAmt) {
		set_Value (COLUMNNAME_LineNetAmt, lineNetAmt);
	}

	/**
	 * Get Line Amount.
	 * @return Line Extended Amount (Quantity * Actual Price) without Freight and Charges
	 */
	public BigDecimal getLineNetAmt () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_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 (COLUMNNAME_LineTotalAmt, lineTotalAmt);
	}

	/**
	 * Get Line Total.
	 * @return Total line amount incl. Tax
	 */
	public BigDecimal getLineTotalAmt () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_LineTotalAmt);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	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 Record ID.
	 * @param Record_ID 
	 * Direct internal record ID
	 */
	public void setRecord_ID (int iD) {
		if (iD < 0) 
			set_Value (COLUMNNAME_Record_ID, null);
		else 
			set_Value (COLUMNNAME_Record_ID, Integer.valueOf(iD));
	}

	/**
	 * Get Record ID.
	 * @return Direct internal record ID
	 */
	public int getRecord_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_Record_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set Source Table Name.
	 * @param SourceTableName Source Table Name
	 */
	public void setSourceTableName (String sourceTableName) {
		set_Value (COLUMNNAME_SourceTableName, sourceTableName);
	}

	/**
	 * Get Source Table Name.
	 * @return Source Table Name
	 */
	public String getSourceTableName () {
		return (String)get_Value(COLUMNNAME_SourceTableName);
	}
}