/******************************************************************************
 * 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_C_BPartner;
import org.compiere.model.X_C_DocType;
import org.compiere.util.Env;

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

	private static final long serialVersionUID = 20240524L;

	/**
	 * Standard Constructor
	 */
	public X_iNO_LoyaltyConvertTrx (Properties ctx, int iNO_LoyaltyConvertTrx_ID, String trxName) {
		super (ctx, iNO_LoyaltyConvertTrx_ID, trxName);
		/** if (iNO_LoyaltyConvertTrx_ID == 0)
		{
			setiNO_LoyaltyConvertTrx_ID (0);
		} */
    }

	/**
	 * Load Constructor
	 */
	public X_iNO_LoyaltyConvertTrx (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_LoyaltyConvertTrx[")
			.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;
	}

	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();
	}

	public X_C_DocType getC_DocType() throws RuntimeException {
		return (X_C_DocType)MTable.get(getCtx(), X_C_DocType.Table_Name)
				.getPO(getC_DocType_ID(), get_TrxName());
	}

	/**
	 * Set Document Type.
	 * @param C_DocType_ID 
	 * Document type or rules
	 */
	public void setC_DocType_ID (int docTypeID) {
		if (docTypeID < 0) 
			set_Value (COLUMNNAME_C_DocType_ID, null);
		else 
			set_Value (COLUMNNAME_C_DocType_ID, Integer.valueOf(docTypeID));
	}

	/**
	 * Get Document Type.
	 * @return Document type or rules
	 */
	public int getC_DocType_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_C_DocType_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 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 Document No.
	 * @param DocumentNo 
	 * Document sequence number of the document
	 */
	public void setDocumentNo (String documentNo) {
		set_Value (COLUMNNAME_DocumentNo, documentNo);
	}

	/**
	 * Get Document No.
	 * @return Document sequence number of the document
	 */
	public String getDocumentNo () {
		return (String)get_Value(COLUMNNAME_DocumentNo);
	}

	/**
	 * Set Loyalty Points Avalaible.
	 * @param Iext_LoyaltyPointsAvalaible Loyalty Points Avalaible
	 */
	public void setIext_LoyaltyPointsAvalaible (BigDecimal loyaltyPointsAvalaible) {
		set_Value (COLUMNNAME_Iext_LoyaltyPointsAvalaible, loyaltyPointsAvalaible);
	}

	/**
	 * Get Loyalty Points Avalaible.
	 * @return Loyalty Points Avalaible
	 */
	public BigDecimal getIext_LoyaltyPointsAvalaible () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Iext_LoyaltyPointsAvalaible);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/**
	 * Set Loyalty Points To Convert.
	 * @param iEXT_LoyaltyPointsToConvert Loyalty Points To Convert
	 */
	public void setiEXT_LoyaltyPointsToConvert (BigDecimal loyaltyPointsToConvert) {
		set_Value (COLUMNNAME_iEXT_LoyaltyPointsToConvert, loyaltyPointsToConvert);
	}

	/**
	 * Get Loyalty Points To Convert.
	 * @return Loyalty Points To Convert
	 */
	public BigDecimal getiEXT_LoyaltyPointsToConvert () {
		BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_iEXT_LoyaltyPointsToConvert);
		if (bd == null)
			 return Env.ZERO;
		return bd;
	}

	/**
	 * Set Loyalty Convert Trx.
	 * @param iNO_LoyaltyConvertTrx_ID Loyalty Convert Trx
	 */
	public void setiNO_LoyaltyConvertTrx_ID (int loyaltyConvertTrxID) {
		if (loyaltyConvertTrxID < 1) 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyConvertTrx_ID, null);
		else 
			set_ValueNoCheck (COLUMNNAME_iNO_LoyaltyConvertTrx_ID, Integer.valueOf(loyaltyConvertTrxID));
	}

	/**
	 * Get Loyalty Convert Trx.
	 * @return Loyalty Convert Trx
	 */
	public int getiNO_LoyaltyConvertTrx_ID () {
		Integer ii = (Integer)get_Value(COLUMNNAME_iNO_LoyaltyConvertTrx_ID);
		if (ii == null)
			 return 0;
		return ii.intValue();
	}

	/**
	 * Set iNO_LoyaltyConvertTrx_UU.
	 * @param iNO_LoyaltyConvertTrx_UU iNO_LoyaltyConvertTrx_UU
	 */
	public void setiNO_LoyaltyConvertTrx_UU (String loyaltyConvertTrxUU) {
		set_Value (COLUMNNAME_iNO_LoyaltyConvertTrx_UU, loyaltyConvertTrxUU);
	}

	/**
	 * Get iNO_LoyaltyConvertTrx_UU.
	 * @return iNO_LoyaltyConvertTrx_UU
	 */
	public String getiNO_LoyaltyConvertTrx_UU () {
		return (String)get_Value(COLUMNNAME_iNO_LoyaltyConvertTrx_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();
	}
}