www.pudn.com > code_source_compiere_erp_crm_logiciel_java.zip > MBP_BankAccount.java


/****************************************************************************** 
 * The contents of this file are subject to the   Compiere License  Version 1.1 
 * ("License"); You may not use this file except in compliance with the License 
 * You may obtain a copy of the License at http://www.compiere.org/license.html 
 * Software distributed under the License is distributed on an  "AS IS"  basis, 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for 
 * the specific language governing rights and limitations under the License. 
 * The Original Code is             Compiere  ERP & CRM Smart Business Solution 
 * The Initial Developer of the Original Code is Jorg Janke  and ComPiere, Inc. 
 * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts 
 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved. 
 * Contributor(s): ______________________________________. 
 *****************************************************************************/ 
package org.compiere.model; 
 
import java.util.*; 
import java.sql.*; 
import java.math.*; 
import java.io.Serializable; 
 
import org.compiere.util.*; 
 
/** 
 *  BP Bank Account Model 
 * 
 *  @author Jorg Janke 
 *  @version $Id: MBP_BankAccount.java,v 1.4 2003/04/28 04:18:58 jjanke Exp $ 
 */ 
public class MBP_BankAccount extends PO 
{ 
	/** 
	 * 	Constructor 
	 *	@param ctx context 
	 *	@param C_BP_BankAccount_ID BP bank account 
	 */ 
	public MBP_BankAccount (Properties ctx, int C_BP_BankAccount_ID) 
	{ 
		super (ctx, C_BP_BankAccount_ID); 
		if (C_BP_BankAccount_ID == 0) 
		{ 
		//	setC_BPartner_ID (0); 
			setIsACH (false); 
		} 
	}	//	MBP_BankAccount 
 
	/** 
	 * 	Constructor 
	 *	@param ctx context 
	 *	@param rs result set 
	 */ 
	public MBP_BankAccount (Properties ctx, ResultSet rs) 
	{ 
		super (ctx, rs); 
	}	//	MBP_BankAccount 
 
	/** 
	 * 	Constructor 
	 *	@param ctx context 
	 * 	@param bp BP 
	 *	@param bpc BP Contact 
	 * 	@param l Location 
	 */ 
	public MBP_BankAccount (Properties ctx, MBPartner bp, MBPartner_Contact bpc, MLocation l) 
	{ 
		super (ctx, 0); 
		setIsACH (false); 
		// 
		setC_BPartner_ID(bp.getC_BPartner_ID()); 
		// 
		setA_Name(bpc.getName()); 
		setA_EMail(bpc.getEmail()); 
		// 
		setA_Street(l.getAddress1()); 
		setA_City(l.getCity()); 
		setA_Zip(l.getPostal()); 
		setA_State(l.getRegionName()); 
		setA_Country(l.getCountryName()); 
	}	//	MBP_BankAccount 
 
 
	protected POInfo initPO (Properties ctx) 
	{ 
		int AD_Table_ID = 298; 
		POInfo poi = POInfo.getPOInfo (ctx, AD_Table_ID); 
		return poi; 
	} 
 
	/*************************************************************************/ 
 
	/** 
	 * 	Save 
	 * 	@return true if saved 
	 */ 
	public boolean save () 
	{ 
		log.debug ("save"); 
		return super.save (); 
	}	//	save 
 
	public String toString () 
	{ 
		StringBuffer sb = new StringBuffer ("MBP_BankAccount[") 
			.append (getID ()) 
			.append(", Name=").append(getA_Name()) 
			.append ("]"); 
		return sb.toString (); 
	}	//	toString 
 
	/*************************************************************************/ 
 
	/** 
	 * 	Set Routing No 
	 *	@param RoutingNo routing 
	 */ 
	public void setRoutingNo (String RoutingNo) 
	{ 
		if (RoutingNo != null) 
			setValue ("RoutingNo", RoutingNo); 
	} 
 
	public String getRoutingNo () 
	{ 
		return (String)getValue ("RoutingNo"); 
	} 
 
	public void setIsACH (boolean IsACH) 
	{ 
		setValue ("IsACH", new Boolean (IsACH)); 
	} 
 
	public boolean isACH () 
	{ 
		Boolean bb = (Boolean)getValue ("IsACH"); 
		if (bb != null) 
			return bb.booleanValue (); 
		return false; 
	} 
 
 
	public static final String CreditCardType_Amex = "A"; 
	public static final String CreditCardType_MasterCard = "M"; 
	public static final String CreditCardType_Visa = "V"; 
	public static final String CreditCardType_ATM = "C"; 
	public static final String CreditCardType_Diners = "D"; 
	public static final String CreditCardType_Discover = "N"; 
	public static final String CreditCardType_Purchase_Card = "P"; 
 
	public void setCreditCardType (String CreditCardType) 
	{ 
		if (CreditCardType == null) 
			return; 
		if (CreditCardType.equals ("A") || CreditCardType.equals ("M") 
		  || CreditCardType.equals ("V") || CreditCardType.equals ("C") 
		  || CreditCardType.equals ("D") || CreditCardType.equals ("N") 
		  || CreditCardType.equals ("P")) 
			; 
		else 
			throw new IllegalArgumentException ("CreditCardType Invalid value - Reference_ID=149 - A - M - V - C - D - N - P"); 
		setValue ("CreditCardType", CreditCardType); 
	} 
 
	public String getCreditCardType () 
	{ 
		return (String)getValue ("CreditCardType"); 
	} 
 
	public void setA_City (String A_City) 
	{ 
		if (A_City != null) 
			setValue ("A_City", A_City); 
	} 
 
	public String getA_City () 
	{ 
		return (String)getValue ("A_City"); 
	} 
 
	void setC_BP_BankAccount_ID (int C_BP_BankAccount_ID) 
	{ 
		setValueNoCheck ("C_BP_BankAccount_ID", new Integer (C_BP_BankAccount_ID)); 
	} 
 
	public int getC_BP_BankAccount_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_BP_BankAccount_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setA_EMail (String A_EMail) 
	{ 
		if (A_EMail != null) 
			setValue ("A_EMail", A_EMail); 
	} 
 
	public String getA_EMail () 
	{ 
		return (String)getValue ("A_EMail"); 
	} 
 
	public void setCreditCardExpYY (int CreditCardExpYY) 
	{ 
		if (CreditCardExpYY != 0) 
			setValue ("CreditCardExpYY", new Integer (CreditCardExpYY)); 
	} 
 
	public int getCreditCardExpYY () 
	{ 
		Integer ii = (Integer)getValue ("CreditCardExpYY"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setA_Street (String A_Street) 
	{ 
		if (A_Street != null) 
			setValue ("A_Street", A_Street); 
	} 
 
	public String getA_Street () 
	{ 
		return (String)getValue ("A_Street"); 
	} 
 
	public void setCreditCardVV (String CreditCardVV) 
	{ 
		if (CreditCardVV != null) 
			setValue ("CreditCardVV", CreditCardVV); 
	} 
 
	public String getCreditCardVV () 
	{ 
		return (String)getValue ("CreditCardVV"); 
	} 
 
 
	public static final String R_AvsAddr_Match = "Y"; 
	public static final String R_AvsAddr_No_Match = "N"; 
	public static final String R_AvsAddr_Unavailable = "X"; 
 
	void setR_AvsAddr (String R_AvsAddr) 
	{ 
		if (R_AvsAddr == null) 
			return; 
		if (R_AvsAddr.equals ("Y") || R_AvsAddr.equals ("N") || R_AvsAddr.equals ("X")) 
			; 
		else 
			throw new IllegalArgumentException ("R_AvsAddr Invalid value - Reference_ID=213 - Y - N - X"); 
		setValueNoCheck ("R_AvsAddr", R_AvsAddr); 
	} 
 
	public String getR_AvsAddr () 
	{ 
		return (String)getValue ("R_AvsAddr"); 
	} 
 
	public void setA_Ident_SSN (String A_Ident_SSN) 
	{ 
		if (A_Ident_SSN != null) 
			setValue ("A_Ident_SSN", A_Ident_SSN); 
	} 
 
	public String getA_Ident_SSN () 
	{ 
		return (String)getValue ("A_Ident_SSN"); 
	} 
 
	public void setAccountNo (String AccountNo) 
	{ 
		if (AccountNo != null) 
			setValue ("AccountNo", AccountNo); 
	} 
 
	public String getAccountNo () 
	{ 
		return (String)getValue ("AccountNo"); 
	} 
 
 
	public static final String R_AvsZip_Match = "Y"; 
	public static final String R_AvsZip_No_Match = "N"; 
	public static final String R_AvsZip_Unavailable = "X"; 
 
	void setR_AvsZip (String R_AvsZip) 
	{ 
		if (R_AvsZip == null) 
			return; 
		if (R_AvsZip.equals ("Y") || R_AvsZip.equals ("N") || R_AvsZip.equals ("X")) 
			; 
		else 
			throw new IllegalArgumentException ("R_AvsZip Invalid value - Reference_ID=213 - Y - N - X"); 
		setValueNoCheck ("R_AvsZip", R_AvsZip); 
	} 
 
	public String getR_AvsZip () 
	{ 
		return (String)getValue ("R_AvsZip"); 
	} 
 
 
	public static final String BankAccountType_Checking = "C"; 
	public static final String BankAccountType_Savings = "S"; 
 
	public void setBankAccountType (String BankAccountType) 
	{ 
		if (BankAccountType.equals ("C") || BankAccountType.equals ("S")) 
			; 
		else 
			throw new IllegalArgumentException ("BankAccountType Invalid value - Reference_ID=216 - C - S"); 
		setValue ("BankAccountType", BankAccountType); 
	} 
 
	public String getBankAccountType () 
	{ 
		return (String)getValue ("BankAccountType"); 
	} 
 
	public void setCreditCardNumber (String CreditCardNumber) 
	{ 
		if (CreditCardNumber != null) 
			setValue ("CreditCardNumber", CreditCardNumber); 
	} 
 
	public String getCreditCardNumber () 
	{ 
		return (String)getValue ("CreditCardNumber"); 
	} 
 
	public void setA_Zip (String A_Zip) 
	{ 
		if (A_Zip != null) 
			setValue ("A_Zip", A_Zip); 
	} 
 
	public String getA_Zip () 
	{ 
		return (String)getValue ("A_Zip"); 
	} 
 
	public void setA_State (String A_State) 
	{ 
		if (A_State != null) 
			setValue ("A_State", A_State); 
	} 
 
	public String getA_State () 
	{ 
		return (String)getValue ("A_State"); 
	} 
 
	public void setA_Name (String A_Name) 
	{ 
		if (A_Name == null) 
			throw new IllegalArgumentException ("A_Name is mandatory"); 
		setValue ("A_Name", A_Name); 
	} 
 
	/** 
	 *	Set Account Country 
	 *  @param A_Country country 
	 */ 
	public void setA_Country (String A_Country) 
	{ 
		if (A_Country != null) 
			setValue ("A_Country", A_Country); 
	} 
	public String getA_Country() 
	{ 
		return (String)getValue("A_Country"); 
	} 
 
	public String getA_Name () 
	{ 
		return (String)getValue ("A_Name"); 
	} 
 
	public void setC_BPartner_Contact_ID (int C_BPartner_Contact_ID) 
	{ 
		setValue ("C_BPartner_Contact_ID", new Integer (C_BPartner_Contact_ID)); 
	} 
 
	public int getC_BPartner_Contact_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_BPartner_Contact_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setA_Ident_DL (String A_Ident_DL) 
	{ 
		if (A_Ident_DL != null) 
			setValue ("A_Ident_DL", A_Ident_DL); 
	} 
 
	public String getA_Ident_DL () 
	{ 
		return (String)getValue ("A_Ident_DL"); 
	} 
 
	void setC_BPartner_ID (int C_BPartner_ID) 
	{ 
		setValueNoCheck ("C_BPartner_ID", new Integer (C_BPartner_ID)); 
	} 
 
	public int getC_BPartner_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_BPartner_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setC_Bank_ID (int C_Bank_ID) 
	{ 
		setValue ("C_Bank_ID", new Integer (C_Bank_ID)); 
	} 
 
	public int getC_Bank_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_Bank_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setCreditCardExpMM (int CreditCardExpMM) 
	{ 
		if (CreditCardExpMM != 0) 
			setValue ("CreditCardExpMM", new Integer (CreditCardExpMM)); 
	} 
 
	public int getCreditCardExpMM () 
	{ 
		Integer ii = (Integer)getValue ("CreditCardExpMM"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
}	//	MBP_BankAccount