KickJava   Java API By Example, From Geeks To Geeks.

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


1 /** Generated Model - DO NOT CHANGE - Copyright (C) 1999-2003 Jorg Janke **/
2 package org.compiere.model;
3 import java.util.*;
4 import java.sql.*;
5 import java.math.*;
6 import java.io.Serializable JavaDoc;
7 import org.compiere.util.*;
8 /** Generated Model for M_DiscountSchema
9  ** @version $Id: X_M_DiscountSchema.java,v 1.26 2003/10/31 05:30:53 jjanke Exp $ **/

10 public class X_M_DiscountSchema extends PO
11 {
12 /** Standard Constructor **/
13 public X_M_DiscountSchema (Properties ctx, int M_DiscountSchema_ID)
14 {
15 super (ctx, M_DiscountSchema_ID);
16 /** if (M_DiscountSchema_ID == 0)
17 {
18 setDiscountType (null);
19 setIsQuantityBased (false);
20 setM_DiscountSchema_ID (0);
21 setName (null);
22 setValidFrom (new Timestamp(System.currentTimeMillis()));
23 }
24  **/

25 }
26 /** Load Constructor **/
27 public X_M_DiscountSchema (Properties ctx, ResultSet rs)
28 {
29 super (ctx, rs);
30 }
31 /** Load Meta Data **/
32 protected POInfo initPO (Properties ctx)
33 {
34 int AD_Table_ID = 475;
35 POInfo poi = POInfo.getPOInfo (ctx, AD_Table_ID);
36 return poi;
37 }
38 public String JavaDoc toString()
39 {
40 StringBuffer JavaDoc sb = new StringBuffer JavaDoc ("X_M_DiscountSchema[").append(getID()).append("]");
41 return sb.toString();
42 }
43 public static final String JavaDoc CUMULATIVELEVEL_Line = "L";
44 public void setCumulativeLevel (String JavaDoc CumulativeLevel)
45 {
46 if (CumulativeLevel.equals("L"));
47  else throw new IllegalArgumentException JavaDoc ("CumulativeLevel Invalid value - Reference_ID=246 - L");
48 setValue ("CumulativeLevel", CumulativeLevel);
49 }
50 public String JavaDoc getCumulativeLevel()
51 {
52 return (String JavaDoc)getValue("CumulativeLevel");
53 }
54 public void setDescription (String JavaDoc Description)
55 {
56 setValue ("Description", Description);
57 }
58 public String JavaDoc getDescription()
59 {
60 return (String JavaDoc)getValue("Description");
61 }
62 public static final String JavaDoc DISCOUNTTYPE_FlatPercent = "F";
63 public static final String JavaDoc DISCOUNTTYPE_Formula = "S";
64 public static final String JavaDoc DISCOUNTTYPE_Breaks = "B";
65 public static final String JavaDoc DISCOUNTTYPE_Pricelist = "P";
66 public void setDiscountType (String JavaDoc DiscountType)
67 {
68 if (DiscountType.equals("F") || DiscountType.equals("S") || DiscountType.equals("B") || DiscountType.equals("P"));
69  else throw new IllegalArgumentException JavaDoc ("DiscountType Invalid value - Reference_ID=247 - F - S - B - P");
70 if (DiscountType == null) throw new IllegalArgumentException JavaDoc ("DiscountType is mandatory");
71 setValue ("DiscountType", DiscountType);
72 }
73 public String JavaDoc getDiscountType()
74 {
75 return (String JavaDoc)getValue("DiscountType");
76 }
77 public void setFlatDiscount (BigDecimal FlatDiscount)
78 {
79 setValue ("FlatDiscount", FlatDiscount);
80 }
81 public BigDecimal getFlatDiscount()
82 {
83 BigDecimal bd = (BigDecimal)getValue("FlatDiscount");
84 if (bd == null) return Env.ZERO;
85 return bd;
86 }
87 public void setIsQuantityBased (boolean IsQuantityBased)
88 {
89 setValue ("IsQuantityBased", new Boolean JavaDoc(IsQuantityBased));
90 }
91 public boolean isQuantityBased()
92 {
93 Boolean JavaDoc bb = (Boolean JavaDoc)getValue("IsQuantityBased");
94 if (bb != null) return bb.booleanValue();
95 return false;
96 }
97 void setM_DiscountSchema_ID (int M_DiscountSchema_ID)
98 {
99 setValueNoCheck ("M_DiscountSchema_ID", new Integer JavaDoc(M_DiscountSchema_ID));
100 }
101 public int getM_DiscountSchema_ID()
102 {
103 Integer JavaDoc ii = (Integer JavaDoc)getValue("M_DiscountSchema_ID");
104 if (ii == null) return 0;
105 return ii.intValue();
106 }
107 public void setName (String JavaDoc Name)
108 {
109 if (Name == null) throw new IllegalArgumentException JavaDoc ("Name is mandatory");
110 setValue ("Name", Name);
111 }
112 public String JavaDoc getName()
113 {
114 return (String JavaDoc)getValue("Name");
115 }
116 public void setProcessing (String JavaDoc Processing)
117 {
118 setValue ("Processing", Processing);
119 }
120 public String JavaDoc getProcessing()
121 {
122 return (String JavaDoc)getValue("Processing");
123 }
124 public void setScript (String JavaDoc Script)
125 {
126 setValue ("Script", Script);
127 }
128 public String JavaDoc getScript()
129 {
130 return (String JavaDoc)getValue("Script");
131 }
132 public void setValidFrom (Timestamp ValidFrom)
133 {
134 if (ValidFrom == null) throw new IllegalArgumentException JavaDoc ("ValidFrom is mandatory");
135 setValue ("ValidFrom", ValidFrom);
136 }
137 public Timestamp getValidFrom()
138 {
139 return (Timestamp)getValue("ValidFrom");
140 }
141 }
142
Free Books   Free Magazines  
Popular Tags