⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webbasketline.java

📁 Java写的ERP系统
💻 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.wstore;

import java.util.*;
import java.sql.*;
import java.math.*;

import org.apache.log4j.Logger;

import org.compiere.model.*;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.www.*;

/**
 *  Web Basket Line
 *
 *  @author Jorg Janke
 *  @version $Id: WebBasketLine.java,v 1.1 2003/04/09 05:06:43 jjanke Exp $
 */
public class WebBasketLine
{
	/**
	 * 	Web Basket Line
	 * 	@param M_Product_ID product
	 * 	@param Name Name
	 *	@param Qty Qty
	 * 	@param Price Price
	 */
	public WebBasketLine (int M_Product_ID, String Name, BigDecimal Qty, BigDecimal Price)
	{
		setM_Product_ID(M_Product_ID);
		setName(Name);
		setQuantity(Qty);
		setPrice(Price);
	}	//	WebBasketLine

	private int			m_line;
	private int 		m_M_Product_ID;
	private String 		m_Name;
	private BigDecimal 	m_Price;
	private BigDecimal 	m_Quantity;
	private BigDecimal 	m_Total;

	public static BigDecimal		ONE = new BigDecimal(1);

	/**
	 * 	String Representation
	 * 	@return info
	 */
	public String toString()
	{
		StringBuffer sb = new StringBuffer("WebBasketLine[");
		sb.append(m_line).append("-M_Product_ID=") .append(m_M_Product_ID)
			.append(",Qty=").append(m_Quantity).append(",Price=").append(m_Price)
			.append(",Total=").append(m_Total)
			.append("]");
		return sb.toString();
	}	//	toString


	public int getLine()
	{
		return m_line;
	}
	public void setLine (int line)
	{
		m_line = line;
	}

	public int getM_Product_ID()
	{
		return m_M_Product_ID;
	}
	public void setM_Product_ID (int M_Product_ID)
	{
		m_M_Product_ID = M_Product_ID;
	}

	public String getName()
	{
		if (m_Name == null)
			return "-";
		return m_Name;
	}
	public void setName(String name)
	{
		m_Name = name;
	}

	public BigDecimal getPrice()
	{
		if (m_Price == null)
			return ONE;
		return m_Price;
	}
	public void setPrice(BigDecimal price)
	{
		m_Price = price;
		m_Total = null;
	}

	public BigDecimal getQuantity()
	{
		if (m_Quantity == null)
			return ONE;
		return m_Quantity;
	}
	public void setQuantity(BigDecimal quantity)
	{
		m_Quantity = quantity;
		m_Total = null;
	}

	public BigDecimal getTotal()
	{
		if (m_Total == null)
			m_Total = getQuantity().multiply(getPrice());
		return m_Total;
	}

}	//	WebBasketLine

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -