KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > model > MProductPrice


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.model;
15
16 import java.sql.ResultSet JavaDoc;
17 import java.util.Properties JavaDoc;
18 import java.math.*;
19
20 import org.compiere.util.*;
21
22 /**
23  * Product Price
24  *
25  * @author Jorg Janke
26  * @version $Id: MProductPrice.java,v 1.4 2003/10/11 05:20:33 jjanke Exp $
27  */

28 public class MProductPrice extends X_M_ProductPrice
29 {
30
31     /**
32      * Standard Constructor
33      * @param ctx context
34      * @param M_ProductPrice_ID id
35      */

36     public MProductPrice (Properties JavaDoc ctx, int M_ProductPrice_ID)
37     {
38         super(ctx, M_ProductPrice_ID);
39         if (M_ProductPrice_ID == 0)
40         {
41         // setM_PriceList_Version_ID (0); FK
42
// setM_Product_ID (0); FK
43
setPriceLimit (Env.ZERO);
44             setPriceList (Env.ZERO);
45             setPriceStd (Env.ZERO);
46         }
47     } // MProductPrice
48

49     /**
50      * Load Constructor
51      * @param ctx context
52      * @param rs result set
53      */

54     public MProductPrice (Properties JavaDoc ctx, ResultSet JavaDoc rs)
55     {
56         super(ctx, rs);
57     } // MProductPrice
58

59     /**
60      * New Constructor
61      * @param ctx context
62      * @param M_PriceList_Version_ID Price List Version
63      * @param M_Product_ID product
64      */

65     public MProductPrice (Properties JavaDoc ctx, int M_PriceList_Version_ID, int M_Product_ID)
66     {
67         this (ctx, 0);
68         setM_PriceList_Version_ID (M_PriceList_Version_ID); // FK
69
setM_Product_ID (M_Product_ID); // FK
70
} // MProductPrice
71

72     /**
73      * New Constructor
74      * @param ctx context
75      * @param M_PriceList_Version_ID Price List Version
76      * @param M_Product_ID product
77      * @param PriceList list price
78      * @param PriceStd standard price
79      * @param PriceLimit limit price
80      */

81     public MProductPrice (Properties JavaDoc ctx, int M_PriceList_Version_ID, int M_Product_ID,
82         BigDecimal PriceList, BigDecimal PriceStd, BigDecimal PriceLimit)
83     {
84         this (ctx, M_PriceList_Version_ID, M_Product_ID);
85         setPrices (PriceList, PriceStd, PriceLimit);
86     } // MProductPrice
87

88     /**
89      * Set Prices
90      * @param PriceList list price
91      * @param PriceStd standard price
92      * @param PriceLimit limit price
93      */

94     public void setPrices (BigDecimal PriceList, BigDecimal PriceStd, BigDecimal PriceLimit)
95     {
96         setPriceLimit (PriceLimit);
97         setPriceList (PriceList);
98         setPriceStd (PriceStd);
99     } // setPrice
100

101     /**
102      * Get Prices
103      * @return Prices - list - std - limit
104      */

105     public MProductPriceVO getPrices()
106     {
107         MProductPriceVO retValue = new MProductPriceVO (getM_Product_ID(), getM_PriceList_Version_ID(),
108             getPriceList(), getPriceStd(), getPriceLimit());
109             
110         return retValue;
111     } // getPrices
112

113     
114
115 } // MProductPrice
116
Popular Tags