KickJava   Java API By Example, From Geeks To Geeks.

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


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
19 import org.compiere.util.*;
20
21 /**
22  *
23  *
24  * @author Jorg Janke
25  * @version $Id: MDocType.java,v 1.1 2003/10/11 05:20:32 jjanke Exp $
26  */

27 public class MDocType extends X_C_DocType
28 {
29     /**
30      * Standard Constructor
31      * @param ctx context
32      * @param C_DocType_ID id
33      */

34     public MDocType(Properties JavaDoc ctx, int C_DocType_ID)
35     {
36         super(ctx, C_DocType_ID);
37         if (C_DocType_ID == 0)
38         {
39         // setDocBaseType (null);
40
setDocumentCopies (0);
41         // setGL_Category_ID (0);
42
setHasCharges (false);
43             setIsApproved (true);
44             setIsBatchControlEnforced (false);
45             setIsBatchDocNoControlled (false);
46             setIsBatched (false);
47             setIsDefault (false);
48             setIsDocNoControlled (false);
49             setIsPrinted (false);
50             setIsSOTrx (false);
51             setIsTransferred (false);
52         // setName (null);
53
// setPrintName (null);
54
}
55     } // MDocType
56

57     /**
58      * Load Constructor
59      * @param ctx context
60      * @param rs result set
61      */

62     public MDocType(Properties JavaDoc ctx, ResultSet JavaDoc rs)
63     {
64         super(ctx, rs);
65     } // MDocType
66

67     /**
68      * New Constructor
69      * @param ctx context
70      * @param DocBaseType document base type
71      * @param Name name
72      */

73     public MDocType (Properties JavaDoc ctx, String JavaDoc DocBaseType, String JavaDoc Name)
74     {
75         this (ctx, 0);
76         setAD_Org_ID(0);
77         setDocBaseType (DocBaseType);
78         setName (Name);
79         setPrintName (Name);
80         setGL_Category_ID ();
81     } // MDocType
82

83     /**
84      * Set Default GL Category
85      */

86     public void setGL_Category_ID()
87     {
88         String JavaDoc sql = "SELECT * FROM GL_Category WHERE AD_Client_ID=? AND IsDefault='Y'";
89         int GL_Category_ID = DB.getSQLValue(sql, getAD_Client_ID());
90         if (GL_Category_ID == 0)
91         {
92             sql = "SELECT * FROM GL_Category WHERE AD_Client_ID=?";
93             GL_Category_ID = DB.getSQLValue(sql, getAD_Client_ID());
94         }
95         setGL_Category_ID(GL_Category_ID);
96     } // setGL_Category_ID
97

98 } // MDocType
99
Popular Tags