1 2 package org.compiere.model; 3 import java.util.*; 4 import java.sql.*; 5 import java.math.*; 6 import java.io.Serializable ; 7 import org.compiere.util.*; 8 10 public class X_M_DiscountSchema extends PO 11 { 12 13 public X_M_DiscountSchema (Properties ctx, int M_DiscountSchema_ID) 14 { 15 super (ctx, M_DiscountSchema_ID); 16 25 } 26 27 public X_M_DiscountSchema (Properties ctx, ResultSet rs) 28 { 29 super (ctx, rs); 30 } 31 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 toString() 39 { 40 StringBuffer sb = new StringBuffer ("X_M_DiscountSchema[").append(getID()).append("]"); 41 return sb.toString(); 42 } 43 public static final String CUMULATIVELEVEL_Line = "L"; 44 public void setCumulativeLevel (String CumulativeLevel) 45 { 46 if (CumulativeLevel.equals("L")); 47 else throw new IllegalArgumentException ("CumulativeLevel Invalid value - Reference_ID=246 - L"); 48 setValue ("CumulativeLevel", CumulativeLevel); 49 } 50 public String getCumulativeLevel() 51 { 52 return (String )getValue("CumulativeLevel"); 53 } 54 public void setDescription (String Description) 55 { 56 setValue ("Description", Description); 57 } 58 public String getDescription() 59 { 60 return (String )getValue("Description"); 61 } 62 public static final String DISCOUNTTYPE_FlatPercent = "F"; 63 public static final String DISCOUNTTYPE_Formula = "S"; 64 public static final String DISCOUNTTYPE_Breaks = "B"; 65 public static final String DISCOUNTTYPE_Pricelist = "P"; 66 public void setDiscountType (String DiscountType) 67 { 68 if (DiscountType.equals("F") || DiscountType.equals("S") || DiscountType.equals("B") || DiscountType.equals("P")); 69 else throw new IllegalArgumentException ("DiscountType Invalid value - Reference_ID=247 - F - S - B - P"); 70 if (DiscountType == null) throw new IllegalArgumentException ("DiscountType is mandatory"); 71 setValue ("DiscountType", DiscountType); 72 } 73 public String getDiscountType() 74 { 75 return (String )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 (IsQuantityBased)); 90 } 91 public boolean isQuantityBased() 92 { 93 Boolean bb = (Boolean )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 (M_DiscountSchema_ID)); 100 } 101 public int getM_DiscountSchema_ID() 102 { 103 Integer ii = (Integer )getValue("M_DiscountSchema_ID"); 104 if (ii == null) return 0; 105 return ii.intValue(); 106 } 107 public void setName (String Name) 108 { 109 if (Name == null) throw new IllegalArgumentException ("Name is mandatory"); 110 setValue ("Name", Name); 111 } 112 public String getName() 113 { 114 return (String )getValue("Name"); 115 } 116 public void setProcessing (String Processing) 117 { 118 setValue ("Processing", Processing); 119 } 120 public String getProcessing() 121 { 122 return (String )getValue("Processing"); 123 } 124 public void setScript (String Script) 125 { 126 setValue ("Script", Script); 127 } 128 public String getScript() 129 { 130 return (String )getValue("Script"); 131 } 132 public void setValidFrom (Timestamp ValidFrom) 133 { 134 if (ValidFrom == null) throw new IllegalArgumentException ("ValidFrom is mandatory"); 135 setValue ("ValidFrom", ValidFrom); 136 } 137 public Timestamp getValidFrom() 138 { 139 return (Timestamp)getValue("ValidFrom"); 140 } 141 } 142
| Popular Tags
|