001 /** 002 * Copyright 2005-2013 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.approval.dataobject; 017 018 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 019 import javax.persistence.Entity; 020 import javax.persistence.Table; 021 import java.sql.Date; 022 import java.util.LinkedHashMap; 023 import org.kuali.rice.core.api.util.type.KualiDecimal; 024 import org.kuali.rice.core.framework.persistence.jpa.type.HibernateKualiDecimalFieldType; 025 026 @Entity 027 @Table(name="TRVL_ADV_T") 028 public class TravelAdvance extends PersistableBusinessObjectBase { 029 private Integer id; 030 private String documentNumber; 031 private KualiDecimal travelAdvanceRequested; 032 private Date dueDate; 033 private String paymentMethod; 034 private String advancePaymentReasonCode; 035 private Boolean travelAdvancePolicy = Boolean.FALSE; 036 private String additionalJustification; 037 038 039 /** 040 * Returns the travel document identifier. 041 * 042 * <p> 043 * Gets the travel document identifier. 044 * </p> 045 * 046 * @return Integer - generated id of this Travel Advance 047 */ 048 public Integer getId() { 049 return id; 050 } 051 052 /** 053 * Initializes the document identifier. 054 * 055 * <p> 056 * Sets the document identifier. 057 * </p> 058 * 059 * @param id - generated id of this Travel Advance 060 */ 061 public void setId(Integer id) { 062 this.id = id; 063 } 064 065 /** 066 * Returns the documentNumber attribute. 067 * 068 * <p> 069 * Gets the documentNumber attribute. 070 * </p> 071 * 072 * @return Integer - generated id of this Travel Advance 073 */ 074 public String getDocumentNumber() { 075 return documentNumber; 076 } 077 078 /** 079 * Initializes the documentNumber attribute. 080 * 081 * <p> 082 * Sets the the documentNumber attribute. 083 * </p> 084 * 085 * @param documentNumber - document number attribute 086 */ 087 public void setDocumentNumber(String documentNumber) { 088 this.documentNumber = documentNumber; 089 } 090 091 /** 092 * Returns travel advance requested amount. 093 * 094 * <p> 095 * Gets the travel advance requested amount. 096 * </p> 097 * 098 * @return KualiDecimal - travel advance requested amount 099 */ 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 }