001 /**
002 * Copyright 2005-2014 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package edu.sampleu.travel.dataobject;
017
018 import org.kuali.rice.krad.bo.DataObjectBase;
019 import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
020 import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
021 import org.kuali.rice.krad.data.provider.annotation.Description;
022 import org.kuali.rice.krad.data.provider.annotation.Label;
023 import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
024 import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
025 import org.kuali.rice.krad.data.provider.annotation.UifValidCharactersConstraintBeanName;
026
027 import javax.persistence.Column;
028 import javax.persistence.Convert;
029 import javax.persistence.Entity;
030 import javax.persistence.GeneratedValue;
031 import javax.persistence.Id;
032 import javax.persistence.Table;
033 import javax.persistence.Temporal;
034 import javax.persistence.TemporalType;
035 import java.io.Serializable;
036 import java.math.BigDecimal;
037 import java.util.Date;
038
039 /**
040 * This class provides the expense items.
041 *
042 * @author Kuali Rice Team (rice.collab@kuali.org)
043 */
044 @Entity
045 @Table(name = "TRVL_EXP_ITM_T")
046 @UifAutoCreateViews({UifAutoCreateViewType.INQUIRY, UifAutoCreateViewType.LOOKUP})
047 public class TravelExpenseItem extends DataObjectBase implements Serializable {
048
049 private static final long serialVersionUID = -4092206384418712220L;
050
051 @Id @Column(name = "EXP_ITM_ID", length = 10)
052 @GeneratedValue(generator = "TRVL_EXP_ITM_ID_S")
053 @PortableSequenceGenerator(name = "TRVL_EXP_ITM_ID_S")
054 @Label("Id")
055 @Description("Unique identifier for item")
056 @UifValidCharactersConstraintBeanName("AlphaNumericPatternConstraint")
057 private String travelExpenseItemId;
058
059 @Column(name = "TRVL_AUTH_DOC_ID")
060 private String travelAuthorizationDocumentId;
061
062 @Column(name = "TRVL_CO_NM")
063 private String travelCompanyName;
064
065 @Column(name = "EXP_TYP_CD", length = 10)
066 @Label("Expense Type")
067 @Description("Type of expense")
068 private String travelExpenseTypeCd;
069
070 @Column(name = "EXP_DESC", length = 10)
071 @Label("Expense Description")
072 @Description("Description of expense")
073 private String expenseDesc;
074
075 @Temporal(TemporalType.TIMESTAMP)
076 @Column(name = "EXP_DT")
077 @Label("Expense Date")
078 @Description("Date of expense")
079 private Date expenseDate;
080
081 @Column(name = "EXP_AMT", length = 10)
082 @Label("Expense Amount")
083 @Description("Amount of expense")
084 private BigDecimal expenseAmount;
085
086 @Column(name = "EXP_REIMB", nullable = false, length = 1)
087 @Convert(converter = BooleanYNConverter.class)
088 @Label("Reimbursable")
089 @Description("Whether expense is reimbursed to traveler")
090 private boolean reimbursable;
091
092 @Column(name = "EXP_TXBL", nullable = false, length = 1)
093 @Convert(converter = BooleanYNConverter.class)
094 @Label("Taxable")
095 @Description("Whether expense is taxed")
096 private boolean taxable;
097
098 public String getTravelExpenseItemId() {
099 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 }