KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > acct > DocLine_Material


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-2001 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.acct;
15
16 import java.sql.*;
17 import java.math.*;
18
19 import org.compiere.model.*;
20
21 /**
22  * Document Line for Material Movements
23  * (Shipment, Inventory, Movement, Production)
24  *
25  * @author Jorg Janke
26  * @version $Id: DocLine_Material.java,v 1.7 2003/10/10 01:03:41 jjanke Exp $
27  */

28 public class DocLine_Material extends DocLine
29 {
30     /**
31      * Constructor
32      * @param DocumentType document type
33      * @param TrxHeader_ID trx header id
34      * @param TrxLine_ID trx line id
35      */

36     public DocLine_Material (String JavaDoc DocumentType, int TrxHeader_ID, int TrxLine_ID)
37     {
38         super(DocumentType, TrxHeader_ID, TrxLine_ID);
39     } // DocLine_Material
40

41     /** Locator */
42     private int m_M_Locator_ID = 0;
43     private int m_M_LocatorTo_ID = 0;
44
45     /**
46      * Set Warehouse Loactor
47      * @param M_Locator_ID locator
48      */

49     public void setM_Locator_ID (int M_Locator_ID)
50     {
51         m_M_Locator_ID = M_Locator_ID;
52     } // setM_Locator_ID
53

54     /**
55      * Get Warehouse Locator
56      * @return M_Locator_ID
57      */

58     public int getM_Locator_ID()
59     {
60         return m_M_Locator_ID;
61     } // getM_Locator_ID
62

63     /**
64      * Set Warehouse Loactor To
65      * @param M_Locator_ID (to)
66      */

67     public void setM_LocatorTo_ID (int M_Locator_ID)
68     {
69         m_M_LocatorTo_ID = M_Locator_ID;
70     } // setM_LocatorTo_ID
71

72     /**
73      * Get Warehouse Locator To
74      * @return M_Locator_ID (to)
75      */

76     public int getM_LocatorTo_ID()
77     {
78         return m_M_LocatorTo_ID;
79     } // getM_LocatorTo_ID
80

81     /**
82      * Get Transcation (or Storage) UOM
83      * @return C_UOM_ID Trx for MatShipment/Receipt - Storage for all others
84      */

85     public int getC_UOM_ID()
86     {
87         // Trx UOM
88
if (p_DocumentType.equals(DocVO.DOCTYPE_MatShipment)
89             || p_DocumentType.equals(DocVO.DOCTYPE_MatReceipt))
90             return super.getC_UOM_ID();
91         // Storage UOM
92
return p_productInfo.getC_UOM_ID();
93     } // getC_UOM_ID
94

95     /**
96      * Set Trasaction Quantity and Storage Qty
97      * @param qty qty
98      */

99     public void setQty (BigDecimal qty)
100     {
101         super.setQty(qty); // save TrxQty
102
p_productInfo.setQty (qty, p_productInfo.getC_UOM_ID());
103     } // setQty
104

105     /**
106      * Get Total Product Costs
107      * @param as accounting schema
108      * @return costs
109      */

110     public BigDecimal getProductCosts (AcctSchema as)
111     {
112         return p_productInfo.getProductCosts(as);
113     } // getProductCosts
114

115     /**
116      * Line Account from Product
117      *
118      * @param AcctType see ProoductInfo.ACCTTYPE_* (0..3)
119      * @param as accounting schema
120      * @return Requested Product Account
121      */

122     public Account getAccount(int AcctType, AcctSchema as)
123     {
124         return p_productInfo.getAccount (AcctType, as);
125     } // getAccount
126

127 } // DocLine_Material
128
Popular Tags