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 org.kuali.rice.krad.demo.travel.authorization.dataobject;
17  
18  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
19  import javax.persistence.Entity;
20  import javax.persistence.Table;
21  import java.sql.Date;
22  import java.util.LinkedHashMap;
23  import org.kuali.rice.core.api.util.type.KualiDecimal;
24  import org.kuali.rice.core.framework.persistence.jpa.type.HibernateKualiDecimalFieldType;
25  
26  @Entity
27  @Table(name="TRVL_ADV_T")
28  public class TravelAdvance extends PersistableBusinessObjectBase {
29      private Integer id;
30      private String documentNumber;
31      private KualiDecimal travelAdvanceRequested;
32      private Date dueDate;
33      private String paymentMethod;
34      private String advancePaymentReasonCode;
35      private Boolean travelAdvancePolicy = Boolean.FALSE;
36      private String additionalJustification;
37  
38  
39      /**
40       * Returns the travel document identifier.
41       *
42       * <p>
43       * Gets the travel document identifier.
44       * </p>
45       *
46       * @return Integer - generated id of this Travel Advance
47       */
48      public Integer getId() {
49          return id;
50      }
51  
52      /**
53       * Initializes the document identifier.
54       *
55       * <p>
56       * Sets the document identifier.
57       * </p>
58       *
59       * @param id - generated id of this Travel Advance
60       */
61      public void setId(Integer id) {
62          this.id = id;
63      }
64  
65      /**
66       * Returns the documentNumber attribute.
67       *
68       * <p>
69       * Gets the documentNumber attribute.
70       * </p>
71       *
72       * @return Integer - generated id of this Travel Advance
73       */
74      public String getDocumentNumber() {
75          return documentNumber;
76      }
77  
78      /**
79       * Initializes the documentNumber attribute.
80       *
81       * <p>
82       * Sets the the documentNumber attribute.
83       * </p>
84       *
85       * @param documentNumber - document number attribute
86       */
87      public void setDocumentNumber(String documentNumber) {
88          this.documentNumber = documentNumber;
89      }
90  
91      /**
92       * Returns travel advance requested amount.
93       *
94       * <p>
95       * Gets the travel advance requested amount.
96       * </p>
97       *
98       * @return KualiDecimal - travel advance requested amount
99       */
100     public KualiDecimal getTravelAdvanceRequested() {
101         return travelAdvanceRequested;
102     }
103 
104     /**
105      * Initializes the amount requested attribute.
106      *
107      * <p>
108      * Sets the the amount requested attribute.
109      * </p>
110      *
111      * @param travelAdvanceRequested - amount requested
112      */
113     public void setTravelAdvanceRequested(KualiDecimal travelAdvanceRequested) {
114         this.travelAdvanceRequested = travelAdvanceRequested;
115     }
116 
117     /**
118      * Returns travel advance due date.
119      *
120      * <p>
121      * Gets the travel advance due date.
122      * </p>
123      *
124      * @return Date - travel advance due date
125      */
126     public Date getDueDate() {
127         return dueDate;
128     }
129 
130     /**
131      * Initializes the due date.
132      *
133      * <p>
134      * Sets the the payment advance due date.
135      * </p>
136      *
137      * @param dueDate - due date
138      */
139     public void setDueDate(Date dueDate) {
140         this.dueDate = dueDate;
141     }
142 
143     /**
144      * Returns travel advance payment method.
145      *
146      * <p>
147      * Gets the travel advance payment method.
148      * </p>
149      *
150      * @return String - travel advance payment method
151      */
152     public String getPaymentMethod() {
153         return paymentMethod;
154     }
155 
156     /**
157      * Initializes the payment method.
158      *
159      * <p>
160      * Sets the the payment advance payment method.
161      * </p>
162      *
163      * @param paymentMethod - payment method
164      */
165     public void setPaymentMethod(String paymentMethod) {
166         this.paymentMethod = paymentMethod;
167     }
168 
169     /**
170      * Returns travel advance payment reason code.
171      *
172      * <p>
173      * Gets the travel advance payment reason code.
174      * </p>
175      *
176      * @return String - travel advance payment reason code
177      */
178     public String getAdvancePaymentReasonCode() {
179         return advancePaymentReasonCode;
180     }
181 
182     /**
183      * Initializes the payment reason code.
184      *
185      * <p>
186      * Sets the payment reason code.
187      * </p>
188      *
189      * @param advancePaymentReasonCode - payment reason code
190      */
191     public void setAdvancePaymentReasonCode(String advancePaymentReasonCode) {
192         this.advancePaymentReasonCode = advancePaymentReasonCode;
193     }
194 
195     /**
196      * Returns travel policy acceptance flag.
197      *
198      * <p>
199      * Gets the travel policy acceptance flag.
200      * </p>
201      *
202      * @return Boolean - travel policy acceptance flag
203      */
204     public boolean getTravelAdvancePolicy() {
205         return travelAdvancePolicy;
206     }
207 
208     /**
209      * Initializes the travel policy acceptance flag.
210      *
211      * <p>
212      * Sets the travel policy acceptance flag.
213      * </p>
214      *
215      * @param travelAdvancePolicy - travel policy acceptance flag
216      */
217     public void setTravelAdvancePolicy(boolean travelAdvancePolicy) {
218         this.travelAdvancePolicy = travelAdvancePolicy;
219     }
220 
221     /**
222      * Returns the additional justification text.
223      *
224      * <p>
225      * Gets the additional justification text.
226      * </p>
227      *
228      * @return String - additional justification
229      */
230     public String getAdditionalJustification() {
231         return additionalJustification;
232     }
233 
234     /**
235      * Initializes the additional justification text.
236      *
237      * <p>
238      * Sets the additional justification text.
239      * </p>
240      *
241      * @param additionalJustification - the additional justification
242      */
243     public void setAdditionalJustification(String additionalJustification) {
244         this.additionalJustification = additionalJustification;
245     }
246 
247     protected LinkedHashMap toStringMapper() {
248         LinkedHashMap map = new LinkedHashMap();
249         map.put("id", this.id);
250         map.put("documentNumber", this.documentNumber);
251         map.put("travelAdvanceRequested", this.travelAdvanceRequested);
252         map.put("dueDate", this.dueDate);
253         map.put("paymentMethod", this.paymentMethod);
254         map.put("advancePaymentReasonCode", this.advancePaymentReasonCode);
255         map.put("travelAdvancePolicy", this.travelAdvancePolicy);
256         map.put("additionalJustification", this.additionalJustification);
257         return map;
258     }
259 
260 }