1 14 package org.compiere.model; 15 16 import java.sql.ResultSet ; 17 import java.util.Properties ; 18 19 import org.compiere.util.*; 20 21 27 public class MDocType extends X_C_DocType 28 { 29 34 public MDocType(Properties ctx, int C_DocType_ID) 35 { 36 super(ctx, C_DocType_ID); 37 if (C_DocType_ID == 0) 38 { 39 setDocumentCopies (0); 41 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 } 55 } 57 62 public MDocType(Properties ctx, ResultSet rs) 63 { 64 super(ctx, rs); 65 } 67 73 public MDocType (Properties ctx, String DocBaseType, String 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 } 83 86 public void setGL_Category_ID() 87 { 88 String 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 } 98 } | Popular Tags |