View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package edu.sampleu.travel.dataobject;
17  
18  import org.kuali.rice.krad.bo.DataObjectBase;
19  import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
20  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
21  import org.kuali.rice.krad.data.provider.annotation.Description;
22  import org.kuali.rice.krad.data.provider.annotation.Label;
23  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
24  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
25  import org.kuali.rice.krad.data.provider.annotation.UifValidCharactersConstraintBeanName;
26  
27  import javax.persistence.Column;
28  import javax.persistence.Convert;
29  import javax.persistence.Entity;
30  import javax.persistence.GeneratedValue;
31  import javax.persistence.Id;
32  import javax.persistence.Table;
33  import javax.persistence.Temporal;
34  import javax.persistence.TemporalType;
35  import java.io.Serializable;
36  import java.math.BigDecimal;
37  import java.util.Date;
38  
39  /**
40   * This class provides the expense items.
41   *
42   * @author Kuali Rice Team (rice.collab@kuali.org)
43   */
44  @Entity
45  @Table(name = "TRVL_EXP_ITM_T")
46  @UifAutoCreateViews({UifAutoCreateViewType.INQUIRY, UifAutoCreateViewType.LOOKUP})
47  public class TravelExpenseItem extends DataObjectBase implements Serializable {
48  
49      private static final long serialVersionUID = -4092206384418712220L;
50  
51      @Id @Column(name = "EXP_ITM_ID", length = 10)
52      @GeneratedValue(generator = "TRVL_EXP_ITM_ID_S")
53      @PortableSequenceGenerator(name = "TRVL_EXP_ITM_ID_S")
54      @Label("Id")
55      @Description("Unique identifier for item")
56      @UifValidCharactersConstraintBeanName("AlphaNumericPatternConstraint")
57      private String travelExpenseItemId;
58  
59      @Column(name = "TRVL_AUTH_DOC_ID")
60      private String travelAuthorizationDocumentId;
61  
62      @Column(name = "TRVL_CO_NM")
63      private String travelCompanyName;
64  
65      @Column(name = "EXP_TYP_CD", length = 10)
66      @Label("Expense Type")
67      @Description("Type of expense")
68      private String travelExpenseTypeCd;
69  
70      @Column(name = "EXP_DESC", length = 10)
71      @Label("Expense Description")
72      @Description("Description of expense")
73      private String expenseDesc;
74  
75      @Temporal(TemporalType.TIMESTAMP)
76      @Column(name = "EXP_DT")
77      @Label("Expense Date")
78      @Description("Date of expense")
79      private Date expenseDate;
80  
81      @Column(name = "EXP_AMT", length = 10)
82      @Label("Expense Amount")
83      @Description("Amount of expense")
84      private BigDecimal expenseAmount;
85  
86      @Column(name = "EXP_REIMB", nullable = false, length = 1)
87      @Convert(converter = BooleanYNConverter.class)
88      @Label("Reimbursable")
89      @Description("Whether expense is reimbursed to traveler")
90      private boolean reimbursable;
91  
92      @Column(name = "EXP_TXBL", nullable = false, length = 1)
93      @Convert(converter = BooleanYNConverter.class)
94      @Label("Taxable")
95      @Description("Whether expense is taxed")
96      private boolean taxable;
97  
98      public String getTravelExpenseItemId() {
99          return travelExpenseItemId;
100     }
101 
102     public void setTravelExpenseItemId(String travelExpenseItemId) {
103         this.travelExpenseItemId = travelExpenseItemId;
104     }
105 
106     public String getTravelAuthorizationDocumentId() {
107         return travelAuthorizationDocumentId;
108     }
109 
110     public void setTravelAuthorizationDocumentId(String travelAuthorizationDocumentId) {
111         this.travelAuthorizationDocumentId = travelAuthorizationDocumentId;
112     }
113 
114     public String getTravelCompanyName() {
115         return travelCompanyName;
116     }
117 
118     public void setTravelCompanyName(String travelCompanyName) {
119         this.travelCompanyName = travelCompanyName;
120     }
121 
122     public String getTravelExpenseTypeCd() {
123         return travelExpenseTypeCd;
124     }
125 
126     public void setTravelExpenseTypeCd(String travelExpenseTypeCd) {
127         this.travelExpenseTypeCd = travelExpenseTypeCd;
128     }
129 
130     public String getExpenseDesc() {
131         return expenseDesc;
132     }
133 
134     public void setExpenseDesc(String expenseDesc) {
135         this.expenseDesc = expenseDesc;
136     }
137 
138     public Date getExpenseDate() {
139         return expenseDate;
140     }
141 
142     public void setExpenseDate(Date expenseDate) {
143         this.expenseDate = expenseDate;
144     }
145 
146     public BigDecimal getExpenseAmount() {
147         return expenseAmount;
148     }
149 
150     public void setExpenseAmount(BigDecimal expenseAmount) {
151         this.expenseAmount = expenseAmount;
152     }
153 
154     public boolean isReimbursable() {
155         return reimbursable;
156     }
157 
158     public void setReimbursable(boolean reimbursable) {
159         this.reimbursable = reimbursable;
160     }
161 
162     public boolean isTaxable() {
163         return taxable;
164     }
165 
166     public void setTaxable(boolean taxable) {
167         this.taxable = taxable;
168     }
169 }