www.pudn.com > code_source_compiere_erp_crm_logiciel_java.zip > MInOut.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.Env; 
 
 
/** 
 *  Shipment Model 
 * 
 *  @author Jorg Janke 
 *  @version $Id: MInOut.java,v 1.1 2003/04/16 06:08:11 jjanke Exp $ 
 */ 
public class MInOut extends PO 
{ 
	public MInOut (Properties ctx, int M_InOut_ID) 
	{ 
		super (ctx, M_InOut_ID); 
		if (M_InOut_ID == 0) 
		{ 
			setM_Warehouse_ID (0); 
			setDateAcct (new Timestamp (System.currentTimeMillis ())); 
			setMovementType (null); 
			setDocAction (null); 
			setMovementDate (new Timestamp (System.currentTimeMillis ())); 
			setDeliveryViaRule (null); 
			setProcessed (false); 
			setPriorityRule (null); 
			setC_BPartner_Location_ID (0); 
			setIsSOTrx (false); 
			setDeliveryRule (null); 
			setIsPrinted (false); 
			setFreightCostRule (null); 
			setM_InOut_ID (0); 
			setC_BPartner_ID (0); 
			setC_DocType_ID (0); 
			setSendEMail (false); 
			setDocStatus (null); 
			setDocumentNo (null); 
		} 
	}	//	MInOut 
 
	/** 
	 *  Load Constructor 
	 *  @param ctx context 
	 *  @param rs result set record 
	 */ 
	public MInOut (Properties ctx, ResultSet rs) 
	{ 
		super (ctx, rs); 
	}	//	MInOut 
 
 
	protected POInfo initPO (Properties ctx) 
	{ 
		int AD_Table_ID = 319; 
		POInfo poi = POInfo.getPOInfo (ctx, AD_Table_ID); 
		return poi; 
	} 
 
	public boolean save () 
	{ 
		log.debug ("save"); 
		return super.save (); 
	} 
 
	public String toString () 
	{ 
		StringBuffer sb = new StringBuffer ("MInOut[").append (getID ()).append ("]"); 
		return sb.toString (); 
	} 
 
	public void setM_Warehouse_ID (int M_Warehouse_ID) 
	{ 
		setValue ("M_Warehouse_ID", new Integer (M_Warehouse_ID)); 
	} 
 
	public int getM_Warehouse_ID () 
	{ 
		Integer ii = (Integer)getValue ("M_Warehouse_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setDateAcct (Timestamp DateAcct) 
	{ 
		if (DateAcct == null) 
			throw new IllegalArgumentException ("DateAcct is mandatory"); 
		setValue ("DateAcct", DateAcct); 
	} 
 
	public Timestamp getDateAcct () 
	{ 
		return (Timestamp)getValue ("DateAcct"); 
	} 
 
	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 setCreateFrom (String CreateFrom) 
	{ 
		setValue ("CreateFrom", CreateFrom); 
	} 
 
	public String getCreateFrom () 
	{ 
		return (String)getValue ("CreateFrom"); 
	} 
 
	public void setGenerateTo (String GenerateTo) 
	{ 
		setValue ("GenerateTo", GenerateTo); 
	} 
 
	public String getGenerateTo () 
	{ 
		return (String)getValue ("GenerateTo"); 
	} 
 
	public void setChargeAmt (BigDecimal ChargeAmt) 
	{ 
		setValue ("ChargeAmt", ChargeAmt); 
	} 
 
	public BigDecimal getChargeAmt () 
	{ 
		BigDecimal bd = (BigDecimal)getValue ("ChargeAmt"); 
		if (bd == null) 
			return Env.ZERO; 
		return bd; 
	} 
 
	void setDateOrdered (Timestamp DateOrdered) 
	{ 
		setValueNoCheck ("DateOrdered", DateOrdered); 
	} 
 
	public Timestamp getDateOrdered () 
	{ 
		return (Timestamp)getValue ("DateOrdered"); 
	} 
 
	public void setDescription (String Description) 
	{ 
		setValue ("Description", Description); 
	} 
 
	public String getDescription () 
	{ 
		return (String)getValue ("Description"); 
	} 
 
	public static final String MovementType_ProductionP = "P+"; 
	public static final String MovementType_ProductionM = "P-"; 
	public static final String MovementType_CustomerShipment = "C-"; 
	public static final String MovementType_CustomerReturns = "C+"; 
	public static final String MovementType_VendorReceipts = "V+"; 
	public static final String MovementType_VendorReturns = "V-"; 
	public static final String MovementType_InventoryOut = "I-"; 
	public static final String MovementType_InventoryIn = "I+"; 
	public static final String MovementType_MovementFrom = "M-"; 
	public static final String MovementType_MovementTo = "M+"; 
 
	void setMovementType (String MovementType) 
	{ 
		if (MovementType.equals ("P+") || MovementType.equals ("P-") || MovementType.equals ("C-") || MovementType.equals ("C+") || MovementType.equals ("V+") || MovementType.equals ("V-") || MovementType.equals ("I-") || MovementType.equals ("I+") || MovementType.equals ("M-") || MovementType.equals ("M+")) 
			; 
		else 
			throw new IllegalArgumentException ("MovementType Invalid value - Reference_ID=189 - P+ - P- - C- - C+ - V+ - V- - I- - I+ - M- - M+"); 
		if (MovementType == null) 
			throw new IllegalArgumentException ("MovementType is mandatory"); 
		setValueNoCheck ("MovementType", MovementType); 
	} 
 
	public String getMovementType () 
	{ 
		return (String)getValue ("MovementType"); 
	} 
 
	public static final String DocAction_Complete = "CO"; 
	public static final String DocAction_Approve = "AP"; 
	public static final String DocAction_Reject = "RJ"; 
	public static final String DocAction_Post = "PO"; 
	public static final String DocAction_Void = "VO"; 
	public static final String DocAction_Close = "CL"; 
	public static final String DocAction_ReverseCorrection = "RC"; 
	public static final String DocAction_ReverseAccrual = "RA"; 
	public static final String DocAction_Transfer = "TR"; 
	public static final String DocAction_ReActivate = "RE"; 
	public static final String DocAction_None = "--"; 
	public static final String DocAction_Process = "PR"; 
	public static final String DocAction_Unlock = "XL"; 
 
	void setDocAction (String DocAction) 
	{ 
		if (DocAction.equals ("CO") || DocAction.equals ("AP") || DocAction.equals ("RJ") || DocAction.equals ("PO") || DocAction.equals ("VO") || DocAction.equals ("CL") || DocAction.equals ("RC") || DocAction.equals ("RA") || DocAction.equals ("TR") || DocAction.equals ("RE") || DocAction.equals ("--") || DocAction.equals ("PR") 
		  || DocAction.equals ("XL")) 
			; 
		else 
			throw new IllegalArgumentException ("DocAction Invalid value - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - TR - RE - -- - PR - XL"); 
		if (DocAction == null) 
			throw new IllegalArgumentException ("DocAction is mandatory"); 
		setValueNoCheck ("DocAction", DocAction); 
	} 
 
	public String getDocAction () 
	{ 
		return (String)getValue ("DocAction"); 
	} 
 
	public void setMovementDate (Timestamp MovementDate) 
	{ 
		if (MovementDate == null) 
			throw new IllegalArgumentException ("MovementDate is mandatory"); 
		setValue ("MovementDate", MovementDate); 
	} 
 
	public Timestamp getMovementDate () 
	{ 
		return (Timestamp)getValue ("MovementDate"); 
	} 
 
	public void setFreightAmt (BigDecimal FreightAmt) 
	{ 
		setValue ("FreightAmt", FreightAmt); 
	} 
 
	public BigDecimal getFreightAmt () 
	{ 
		BigDecimal bd = (BigDecimal)getValue ("FreightAmt"); 
		if (bd == null) 
			return Env.ZERO; 
		return bd; 
	} 
 
	public void setC_Invoice_ID (int C_Invoice_ID) 
	{ 
		setValue ("C_Invoice_ID", new Integer (C_Invoice_ID)); 
	} 
 
	public int getC_Invoice_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_Invoice_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public static final String DeliveryViaRule_Pickup = "P"; 
	public static final String DeliveryViaRule_Delivery = "D"; 
	public static final String DeliveryViaRule_Shipper = "S"; 
 
	public void setDeliveryViaRule (String DeliveryViaRule) 
	{ 
		if (DeliveryViaRule.equals ("P") || DeliveryViaRule.equals ("D") || DeliveryViaRule.equals ("S")) 
			; 
		else 
			throw new IllegalArgumentException ("DeliveryViaRule Invalid value - Reference_ID=152 - P - D - S"); 
		if (DeliveryViaRule == null) 
			throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); 
		setValue ("DeliveryViaRule", DeliveryViaRule); 
	} 
 
	public String getDeliveryViaRule () 
	{ 
		return (String)getValue ("DeliveryViaRule"); 
	} 
 
	public void setProcessed (boolean Processed) 
	{ 
		setValue ("Processed", new Boolean (Processed)); 
	} 
 
	public boolean isProcessed () 
	{ 
		Boolean bb = (Boolean)getValue ("Processed"); 
		if (bb != null) 
			return bb.booleanValue (); 
		return false; 
	} 
 
	public void setProcessing (String Processing) 
	{ 
		setValue ("Processing", Processing); 
	} 
 
	public String getProcessing () 
	{ 
		return (String)getValue ("Processing"); 
	} 
 
	public static final String PriorityRule_High = "3"; 
	public static final String PriorityRule_Medium = "5"; 
	public static final String PriorityRule_Low = "7"; 
 
	public void setPriorityRule (String PriorityRule) 
	{ 
		if (PriorityRule.equals ("3") || PriorityRule.equals ("5") || PriorityRule.equals ("7")) 
			; 
		else 
			throw new IllegalArgumentException ("PriorityRule Invalid value - Reference_ID=154 - 3 - 5 - 7"); 
		if (PriorityRule == null) 
			throw new IllegalArgumentException ("PriorityRule is mandatory"); 
		setValue ("PriorityRule", PriorityRule); 
	} 
 
	public String getPriorityRule () 
	{ 
		return (String)getValue ("PriorityRule"); 
	} 
 
	public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) 
	{ 
		setValue ("C_BPartner_Location_ID", new Integer (C_BPartner_Location_ID)); 
	} 
 
	public int getC_BPartner_Location_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_BPartner_Location_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setIsSOTrx (boolean IsSOTrx) 
	{ 
		setValue ("IsSOTrx", new Boolean (IsSOTrx)); 
	} 
 
	public boolean isSOTrx () 
	{ 
		Boolean bb = (Boolean)getValue ("IsSOTrx"); 
		if (bb != null) 
			return bb.booleanValue (); 
		return false; 
	} 
 
	public static final String DeliveryRule_AfterReceipt = "R"; 
	public static final String DeliveryRule_Availability = "A"; 
	public static final String DeliveryRule_CompleteLine = "L"; 
	public static final String DeliveryRule_CompleteOrder = "O"; 
 
	public void setDeliveryRule (String DeliveryRule) 
	{ 
		if (DeliveryRule.equals ("R") || DeliveryRule.equals ("A") || DeliveryRule.equals ("L") || DeliveryRule.equals ("O")) 
			; 
		else 
			throw new IllegalArgumentException ("DeliveryRule Invalid value - Reference_ID=151 - R - A - L - O"); 
		if (DeliveryRule == null) 
			throw new IllegalArgumentException ("DeliveryRule is mandatory"); 
		setValue ("DeliveryRule", DeliveryRule); 
	} 
 
	public String getDeliveryRule () 
	{ 
		return (String)getValue ("DeliveryRule"); 
	} 
 
	public void setC_Charge_ID (int C_Charge_ID) 
	{ 
		setValue ("C_Charge_ID", new Integer (C_Charge_ID)); 
	} 
 
	public int getC_Charge_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_Charge_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setC_Order_ID (int C_Order_ID) 
	{ 
		setValue ("C_Order_ID", new Integer (C_Order_ID)); 
	} 
 
	public int getC_Order_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_Order_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setPOReference (String POReference) 
	{ 
		setValue ("POReference", POReference); 
	} 
 
	public String getPOReference () 
	{ 
		return (String)getValue ("POReference"); 
	} 
 
	public void setIsPrinted (boolean IsPrinted) 
	{ 
		setValue ("IsPrinted", new Boolean (IsPrinted)); 
	} 
 
	public boolean isPrinted () 
	{ 
		Boolean bb = (Boolean)getValue ("IsPrinted"); 
		if (bb != null) 
			return bb.booleanValue (); 
		return false; 
	} 
 
	public void setDatePrinted (Timestamp DatePrinted) 
	{ 
		setValue ("DatePrinted", DatePrinted); 
	} 
 
	public Timestamp getDatePrinted () 
	{ 
		return (Timestamp)getValue ("DatePrinted"); 
	} 
 
	public void setM_Shipper_ID (int M_Shipper_ID) 
	{ 
		setValue ("M_Shipper_ID", new Integer (M_Shipper_ID)); 
	} 
 
	public int getM_Shipper_ID () 
	{ 
		Integer ii = (Integer)getValue ("M_Shipper_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public static final String FreightCostRule_FreightIncluded = "I"; 
	public static final String FreightCostRule_FixPrice = "F"; 
	public static final String FreightCostRule_Calculated = "C"; 
	public static final String FreightCostRule_Line = "L"; 
 
	public void setFreightCostRule (String FreightCostRule) 
	{ 
		if (FreightCostRule.equals ("I") || FreightCostRule.equals ("F") || FreightCostRule.equals ("C") || FreightCostRule.equals ("L")) 
			; 
		else 
			throw new IllegalArgumentException ("FreightCostRule Invalid value - Reference_ID=153 - I - F - C - L"); 
		if (FreightCostRule == null) 
			throw new IllegalArgumentException ("FreightCostRule is mandatory"); 
		setValue ("FreightCostRule", FreightCostRule); 
	} 
 
	public String getFreightCostRule () 
	{ 
		return (String)getValue ("FreightCostRule"); 
	} 
 
	void setM_InOut_ID (int M_InOut_ID) 
	{ 
		setValueNoCheck ("M_InOut_ID", new Integer (M_InOut_ID)); 
	} 
 
	public int getM_InOut_ID () 
	{ 
		Integer ii = (Integer)getValue ("M_InOut_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setC_BPartner_ID (int C_BPartner_ID) 
	{ 
		setValue ("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 (); 
	} 
 
	void setC_DocType_ID (int C_DocType_ID) 
	{ 
		setValueNoCheck ("C_DocType_ID", new Integer (C_DocType_ID)); 
	} 
 
	public int getC_DocType_ID () 
	{ 
		Integer ii = (Integer)getValue ("C_DocType_ID"); 
		if (ii == null) 
			return 0; 
		return ii.intValue (); 
	} 
 
	public void setSendEMail (boolean SendEMail) 
	{ 
		setValue ("SendEMail", new Boolean (SendEMail)); 
	} 
 
	public boolean isSendEMail () 
	{ 
		Boolean bb = (Boolean)getValue ("SendEMail"); 
		if (bb != null) 
			return bb.booleanValue (); 
		return false; 
	} 
 
	public static final String DocStatus_Drafted = "DR"; 
	public static final String DocStatus_Completed = "CO"; 
	public static final String DocStatus_Approved = "AP"; 
	public static final String DocStatus_Changed = "CH"; 
	public static final String DocStatus_NotApproved = "NA"; 
	public static final String DocStatus_TransferError = "TE"; 
	public static final String DocStatus_Printed = "PR"; 
	public static final String DocStatus_Transferred = "TR"; 
	public static final String DocStatus_Voided = "VO"; 
	public static final String DocStatus_Inactive = "IN"; 
	public static final String DocStatus_PostingError = "PE"; 
	public static final String DocStatus_Posted = "PO"; 
	public static final String DocStatus_Reversed = "RE"; 
	public static final String DocStatus_Closed = "CL"; 
	public static final String DocStatus_Unknown = "??"; 
	public static final String DocStatus_BeingProcessed = "XX"; 
	public static final String DocStatus_InProgress = "IP"; 
	public static final String DocStatus_WaitingPayment = "WP"; 
 
	void setDocStatus (String DocStatus) 
	{ 
		if (DocStatus.equals ("DR") || DocStatus.equals ("CO") || DocStatus.equals ("AP") || DocStatus.equals ("CH") || DocStatus.equals ("NA") || DocStatus.equals ("TE") || DocStatus.equals ("PR") || DocStatus.equals ("TR") || DocStatus.equals ("VO") || DocStatus.equals ("IN") || DocStatus.equals ("PE") || DocStatus.equals ("PO") 
		  || DocStatus.equals ("RE") || DocStatus.equals ("CL") || DocStatus.equals ("??") || DocStatus.equals ("XX") || DocStatus.equals ("IP") || DocStatus.equals ("WP")) 
			; 
		else 
			throw new IllegalArgumentException ("DocStatus Invalid value - Reference_ID=131 - DR - CO - AP - CH - NA - TE - PR - TR - VO - IN - PE - PO - RE - CL - ?? - XX - IP - WP"); 
		if (DocStatus == null) 
			throw new IllegalArgumentException ("DocStatus is mandatory"); 
		setValueNoCheck ("DocStatus", DocStatus); 
	} 
 
	public String getDocStatus () 
	{ 
		return (String)getValue ("DocStatus"); 
	} 
 
	void setDocumentNo (String DocumentNo) 
	{ 
		if (DocumentNo == null) 
			throw new IllegalArgumentException ("DocumentNo is mandatory"); 
		setValueNoCheck ("DocumentNo", DocumentNo); 
	} 
 
	public String getDocumentNo () 
	{ 
		return (String)getValue ("DocumentNo"); 
	} 
 
}	//	MInOut