View Javadoc
1   /*
2    * Copyright 2005-2006 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  
17  package org.kuali.ole.fp.businessobject;
18  
19  import java.sql.Timestamp;
20  import java.text.ParseException;
21  import java.util.ArrayList;
22  import java.util.Iterator;
23  import java.util.LinkedHashMap;
24  import java.util.List;
25  
26  import org.kuali.ole.sys.OLEPropertyConstants;
27  import org.kuali.ole.sys.context.SpringContext;
28  import org.kuali.rice.core.api.datetime.DateTimeService;
29  import org.kuali.rice.core.api.util.type.KualiDecimal;
30  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
31  import org.kuali.rice.krad.util.ObjectUtils;
32  
33  /**
34   * This class is used to represent a non-employee trip for a disbursement voucher .
35   */
36  public class DisbursementVoucherNonEmployeeTravel extends PersistableBusinessObjectBase {
37  
38      private String documentNumber;
39      private String disbVchrTravelFromCityName;
40      private String disbVchrTravelFromStateCode;
41      private String dvTravelFromCountryCode;
42      private String disbVchrTravelToCityName;
43      private String disbVchrTravelToStateCode;
44      private String disbVchrTravelToCountryCode;
45      private Timestamp dvPerdiemStartDttmStamp;
46      private Timestamp dvPerdiemEndDttmStamp;
47      private KualiDecimal disbVchrPerdiemCalculatedAmt;
48      private KualiDecimal disbVchrPerdiemActualAmount;
49      private String dvPerdiemChangeReasonText;
50      private String disbVchrServicePerformedDesc;
51      private String dvServicePerformedLocName;
52      private String dvServiceRegularEmprName;
53      private String disbVchrAutoFromCityName;
54      private String disbVchrAutoFromStateCode;
55      private String disbVchrAutoToCityName;
56      private String disbVchrAutoToStateCode;
57      private boolean disbVchrAutoRoundTripCode;
58      private Integer dvPersonalCarMileageAmount;
59      private KualiDecimal disbVchrPersonalCarRate;
60      private KualiDecimal disbVchrPersonalCarAmount;
61      private boolean disbVchrExceptionCode;
62      private Integer financialDocumentNextLineNbr;
63      private String disbVchrNonEmpTravelerName;
64      private KualiDecimal disbVchrPerdiemRate;
65      private String disbVchrPerdiemCategoryName;
66      private KualiDecimal disbVchrMileageCalculatedAmt;
67  
68      private KualiDecimal totalTravelAmount;
69  
70      private List dvNonEmployeeExpenses;
71      private List dvPrePaidEmployeeExpenses;
72  
73      /**
74       * Default no-arg constructor.
75       */
76      public DisbursementVoucherNonEmployeeTravel() {
77          dvNonEmployeeExpenses = new ArrayList<DisbursementVoucherNonEmployeeExpense>();
78          dvPrePaidEmployeeExpenses = new ArrayList<DisbursementVoucherNonEmployeeExpense>();
79          financialDocumentNextLineNbr = new Integer(1);
80      }
81  
82      /**
83       * Gets the documentNumber attribute.
84       * 
85       * @return Returns the documentNumber
86       */
87      public String getDocumentNumber() {
88          return documentNumber;
89      }
90  
91  
92      /**
93       * Sets the documentNumber attribute.
94       * 
95       * @param documentNumber The documentNumber to set.
96       */
97      public void setDocumentNumber(String documentNumber) {
98          this.documentNumber = documentNumber;
99      }
100 
101     /**
102      * Gets the disbVchrTravelFromCityName attribute.
103      * 
104      * @return Returns the disbVchrTravelFromCityName
105      */
106     public String getDisbVchrTravelFromCityName() {
107         return disbVchrTravelFromCityName;
108     }
109 
110 
111     /**
112      * Sets the disbVchrTravelFromCityName attribute.
113      * 
114      * @param disbVchrTravelFromCityName The disbVchrTravelFromCityName to set.
115      */
116     public void setDisbVchrTravelFromCityName(String disbVchrTravelFromCityName) {
117         this.disbVchrTravelFromCityName = disbVchrTravelFromCityName;
118     }
119 
120     /**
121      * Gets the disbVchrTravelFromStateCode attribute.
122      * 
123      * @return Returns the disbVchrTravelFromStateCode
124      */
125     public String getDisbVchrTravelFromStateCode() {
126         return disbVchrTravelFromStateCode;
127     }
128 
129 
130     /**
131      * Sets the disbVchrTravelFromStateCode attribute.
132      * 
133      * @param disbVchrTravelFromStateCode The disbVchrTravelFromStateCode to set.
134      */
135     public void setDisbVchrTravelFromStateCode(String disbVchrTravelFromStateCode) {
136         this.disbVchrTravelFromStateCode = disbVchrTravelFromStateCode;
137     }
138 
139     /**
140      * Gets the dvTravelFromCountryCode attribute.
141      * 
142      * @return Returns the dvTravelFromCountryCode
143      */
144     public String getDvTravelFromCountryCode() {
145         return dvTravelFromCountryCode;
146     }
147 
148 
149     /**
150      * Sets the dvTravelFromCountryCode attribute.
151      * 
152      * @param dvTravelFromCountryCode The dvTravelFromCountryCode to set.
153      */
154     public void setDvTravelFromCountryCode(String dvTravelFromCountryCode) {
155         this.dvTravelFromCountryCode = dvTravelFromCountryCode;
156     }
157 
158     /**
159      * Gets the disbVchrTravelToCityName attribute.
160      * 
161      * @return Returns the disbVchrTravelToCityName
162      */
163     public String getDisbVchrTravelToCityName() {
164         return disbVchrTravelToCityName;
165     }
166 
167 
168     /**
169      * Sets the disbVchrTravelToCityName attribute.
170      * 
171      * @param disbVchrTravelToCityName The disbVchrTravelToCityName to set.
172      */
173     public void setDisbVchrTravelToCityName(String disbVchrTravelToCityName) {
174         this.disbVchrTravelToCityName = disbVchrTravelToCityName;
175     }
176 
177     /**
178      * Gets the disbVchrTravelToStateCode attribute.
179      * 
180      * @return Returns the disbVchrTravelToStateCode
181      */
182     public String getDisbVchrTravelToStateCode() {
183         return disbVchrTravelToStateCode;
184     }
185 
186 
187     /**
188      * Sets the disbVchrTravelToStateCode attribute.
189      * 
190      * @param disbVchrTravelToStateCode The disbVchrTravelToStateCode to set.
191      */
192     public void setDisbVchrTravelToStateCode(String disbVchrTravelToStateCode) {
193         this.disbVchrTravelToStateCode = disbVchrTravelToStateCode;
194     }
195 
196     /**
197      * Gets the disbVchrTravelToCountryCode attribute.
198      * 
199      * @return Returns the disbVchrTravelToCountryCode
200      */
201     public String getDisbVchrTravelToCountryCode() {
202         return disbVchrTravelToCountryCode;
203     }
204 
205 
206     /**
207      * Sets the disbVchrTravelToCountryCode attribute.
208      * 
209      * @param disbVchrTravelToCountryCode The disbVchrTravelToCountryCode to set.
210      */
211     public void setDisbVchrTravelToCountryCode(String disbVchrTravelToCountryCode) {
212         this.disbVchrTravelToCountryCode = disbVchrTravelToCountryCode;
213     }
214 
215     /**
216      * Gets the dvPerdiemStartDttmStamp attribute.
217      * 
218      * @return Returns the dvPerdiemStartDttmStamp
219      */
220     public Timestamp getDvPerdiemStartDttmStamp() {
221         return dvPerdiemStartDttmStamp;
222     }
223 
224 
225     /**
226      * Sets the dvPerdiemStartDttmStamp attribute.
227      * 
228      * @param dvPerdiemStartDttmStamp The dvPerdiemStartDttmStamp to set.
229      */
230     public void setDvPerdiemStartDttmStamp(Timestamp dvPerdiemStartDttmStamp) {
231         this.dvPerdiemStartDttmStamp = dvPerdiemStartDttmStamp;
232     }
233 
234     /**
235      * Gets the dvPerdiemEndDttmStamp attribute.
236      * 
237      * @return Returns the dvPerdiemEndDttmStamp
238      */
239     public Timestamp getDvPerdiemEndDttmStamp() {
240         return dvPerdiemEndDttmStamp;
241     }
242 
243 
244     /**
245      * Sets the dvPerdiemEndDttmStamp attribute.
246      * 
247      * @param dvPerdiemEndDttmStamp The dvPerdiemEndDttmStamp to set.
248      */
249     public void setDvPerdiemEndDttmStamp(Timestamp dvPerdiemEndDttmStamp) {
250         this.dvPerdiemEndDttmStamp = dvPerdiemEndDttmStamp;
251     }
252 
253     /**
254      * Gets the disbVchrPerdiemCalculatedAmt attribute.
255      * 
256      * @return Returns the disbVchrPerdiemCalculatedAmt
257      */
258     public KualiDecimal getDisbVchrPerdiemCalculatedAmt() {
259         return disbVchrPerdiemCalculatedAmt;
260     }
261 
262 
263     /**
264      * Sets the disbVchrPerdiemCalculatedAmt attribute.
265      * 
266      * @param disbVchrPerdiemCalculatedAmt The disbVchrPerdiemCalculatedAmt to set.
267      */
268     public void setDisbVchrPerdiemCalculatedAmt(KualiDecimal disbVchrPerdiemCalculatedAmt) {
269         this.disbVchrPerdiemCalculatedAmt = disbVchrPerdiemCalculatedAmt;
270     }
271 
272     /**
273      * Gets the disbVchrPerdiemActualAmount attribute.
274      * 
275      * @return Returns the disbVchrPerdiemActualAmount
276      */
277     public KualiDecimal getDisbVchrPerdiemActualAmount() {
278         return disbVchrPerdiemActualAmount;
279     }
280 
281 
282     /**
283      * Sets the disbVchrPerdiemActualAmount attribute.
284      * 
285      * @param disbVchrPerdiemActualAmount The disbVchrPerdiemActualAmount to set.
286      */
287     public void setDisbVchrPerdiemActualAmount(KualiDecimal disbVchrPerdiemActualAmount) {
288         this.disbVchrPerdiemActualAmount = disbVchrPerdiemActualAmount;
289     }
290 
291     /**
292      * Gets the dvPerdiemChangeReasonText attribute.
293      * 
294      * @return Returns the dvPerdiemChangeReasonText
295      */
296     public String getDvPerdiemChangeReasonText() {
297         return dvPerdiemChangeReasonText;
298     }
299 
300 
301     /**
302      * Sets the dvPerdiemChangeReasonText attribute.
303      * 
304      * @param dvPerdiemChangeReasonText The dvPerdiemChangeReasonText to set.
305      */
306     public void setDvPerdiemChangeReasonText(String dvPerdiemChangeReasonText) {
307         this.dvPerdiemChangeReasonText = dvPerdiemChangeReasonText;
308     }
309 
310     /**
311      * Gets the disbVchrServicePerformedDesc attribute.
312      * 
313      * @return Returns the disbVchrServicePerformedDesc
314      */
315     public String getDisbVchrServicePerformedDesc() {
316         return disbVchrServicePerformedDesc;
317     }
318 
319 
320     /**
321      * Sets the disbVchrServicePerformedDesc attribute.
322      * 
323      * @param disbVchrServicePerformedDesc The disbVchrServicePerformedDesc to set.
324      */
325     public void setDisbVchrServicePerformedDesc(String disbVchrServicePerformedDesc) {
326         this.disbVchrServicePerformedDesc = disbVchrServicePerformedDesc;
327     }
328 
329     /**
330      * Gets the dvServicePerformedLocName attribute.
331      * 
332      * @return Returns the dvServicePerformedLocName
333      */
334     public String getDvServicePerformedLocName() {
335         return dvServicePerformedLocName;
336     }
337 
338 
339     /**
340      * Sets the dvServicePerformedLocName attribute.
341      * 
342      * @param dvServicePerformedLocName The dvServicePerformedLocName to set.
343      */
344     public void setDvServicePerformedLocName(String dvServicePerformedLocName) {
345         this.dvServicePerformedLocName = dvServicePerformedLocName;
346     }
347 
348     /**
349      * Gets the dvServiceRegularEmprName attribute.
350      * 
351      * @return Returns the dvServiceRegularEmprName
352      */
353     public String getDvServiceRegularEmprName() {
354         return dvServiceRegularEmprName;
355     }
356 
357 
358     /**
359      * Sets the dvServiceRegularEmprName attribute.
360      * 
361      * @param dvServiceRegularEmprName The dvServiceRegularEmprName to set.
362      */
363     public void setDvServiceRegularEmprName(String dvServiceRegularEmprName) {
364         this.dvServiceRegularEmprName = dvServiceRegularEmprName;
365     }
366 
367     /**
368      * Gets the disbVchrAutoFromCityName attribute.
369      * 
370      * @return Returns the disbVchrAutoFromCityName
371      */
372     public String getDisbVchrAutoFromCityName() {
373         return disbVchrAutoFromCityName;
374     }
375 
376 
377     /**
378      * Sets the disbVchrAutoFromCityName attribute.
379      * 
380      * @param disbVchrAutoFromCityName The disbVchrAutoFromCityName to set.
381      */
382     public void setDisbVchrAutoFromCityName(String disbVchrAutoFromCityName) {
383         this.disbVchrAutoFromCityName = disbVchrAutoFromCityName;
384     }
385 
386     /**
387      * Gets the disbVchrAutoFromStateCode attribute.
388      * 
389      * @return Returns the disbVchrAutoFromStateCode
390      */
391     public String getDisbVchrAutoFromStateCode() {
392         return disbVchrAutoFromStateCode;
393     }
394 
395 
396     /**
397      * Sets the disbVchrAutoFromStateCode attribute.
398      * 
399      * @param disbVchrAutoFromStateCode The disbVchrAutoFromStateCode to set.
400      */
401     public void setDisbVchrAutoFromStateCode(String disbVchrAutoFromStateCode) {
402         this.disbVchrAutoFromStateCode = disbVchrAutoFromStateCode;
403     }
404 
405     /**
406      * Gets the disbVchrAutoToCityName attribute.
407      * 
408      * @return Returns the disbVchrAutoToCityName
409      */
410     public String getDisbVchrAutoToCityName() {
411         return disbVchrAutoToCityName;
412     }
413 
414 
415     /**
416      * Sets the disbVchrAutoToCityName attribute.
417      * 
418      * @param disbVchrAutoToCityName The disbVchrAutoToCityName to set.
419      */
420     public void setDisbVchrAutoToCityName(String disbVchrAutoToCityName) {
421         this.disbVchrAutoToCityName = disbVchrAutoToCityName;
422     }
423 
424     /**
425      * Gets the disbVchrAutoToStateCode attribute.
426      * 
427      * @return Returns the disbVchrAutoToStateCode
428      */
429     public String getDisbVchrAutoToStateCode() {
430         return disbVchrAutoToStateCode;
431     }
432 
433 
434     /**
435      * Sets the disbVchrAutoToStateCode attribute.
436      * 
437      * @param disbVchrAutoToStateCode The disbVchrAutoToStateCode to set.
438      */
439     public void setDisbVchrAutoToStateCode(String disbVchrAutoToStateCode) {
440         this.disbVchrAutoToStateCode = disbVchrAutoToStateCode;
441     }
442 
443     /**
444      * Gets the disbVchrAutoRoundTripCode attribute.
445      * 
446      * @return Returns the disbVchrAutoRoundTripCode
447      */
448     public boolean getDisbVchrAutoRoundTripCode() {
449         return disbVchrAutoRoundTripCode;
450     }
451 
452 
453     /**
454      * Sets the disbVchrAutoRoundTripCode attribute.
455      * 
456      * @param disbVchrAutoRoundTripCode The disbVchrAutoRoundTripCode to set.
457      */
458     public void setDisbVchrAutoRoundTripCode(boolean disbVchrAutoRoundTripCode) {
459         this.disbVchrAutoRoundTripCode = disbVchrAutoRoundTripCode;
460     }
461 
462     /**
463      * Gets the dvPersonalCarMileageAmount attribute.
464      * 
465      * @return Returns the dvPersonalCarMileageAmount
466      */
467     public Integer getDvPersonalCarMileageAmount() {
468         return dvPersonalCarMileageAmount;
469     }
470 
471 
472     /**
473      * Sets the dvPersonalCarMileageAmount attribute.
474      * 
475      * @param dvPersonalCarMileageAmount The dvPersonalCarMileageAmount to set.
476      */
477     public void setDvPersonalCarMileageAmount(Integer dvPersonalCarMileageAmount) {
478         this.dvPersonalCarMileageAmount = dvPersonalCarMileageAmount;
479     }
480 
481     /**
482      * Gets the disbVchrPersonalCarRate attribute.
483      * 
484      * @return Returns the disbVchrPersonalCarRate
485      */
486     public KualiDecimal getDisbVchrPersonalCarRate() {
487         return disbVchrPersonalCarRate;
488     }
489 
490 
491     /**
492      * Sets the disbVchrPersonalCarRate attribute.
493      * 
494      * @param disbVchrPersonalCarRate The disbVchrPersonalCarRate to set.
495      */
496     public void setDisbVchrPersonalCarRate(KualiDecimal disbVchrPersonalCarRate) {
497         this.disbVchrPersonalCarRate = disbVchrPersonalCarRate;
498     }
499 
500     /**
501      * Gets the disbVchrPersonalCarAmount attribute.
502      * 
503      * @return Returns the disbVchrPersonalCarAmount
504      */
505     public KualiDecimal getDisbVchrPersonalCarAmount() {
506         return dvPersonalCarMileageAmount == null ? null : disbVchrPersonalCarAmount;
507     }
508 
509 
510     /**
511      * Sets the disbVchrPersonalCarAmount attribute.
512      * 
513      * @param disbVchrPersonalCarAmount The disbVchrPersonalCarAmount to set.
514      */
515     public void setDisbVchrPersonalCarAmount(KualiDecimal disbVchrPersonalCarAmount) {
516         this.disbVchrPersonalCarAmount = disbVchrPersonalCarAmount;
517     }
518 
519     /**
520      * Gets the disbVchrExceptionCode attribute.
521      * 
522      * @return Returns the disbVchrExceptionCode
523      */
524     public boolean getDisbVchrExceptionCode() {
525         return disbVchrExceptionCode;
526     }
527 
528 
529     /**
530      * Sets the disbVchrExceptionCode attribute.
531      * 
532      * @param disbVchrExceptionCode The disbVchrExceptionCode to set.
533      */
534     public void setDisbVchrExceptionCode(boolean disbVchrExceptionCode) {
535         this.disbVchrExceptionCode = disbVchrExceptionCode;
536     }
537 
538     /**
539      * Gets the financialDocumentNextLineNbr attribute.
540      * 
541      * @return Returns the financialDocumentNextLineNbr
542      */
543     public Integer getFinancialDocumentNextLineNbr() {
544         return financialDocumentNextLineNbr;
545     }
546 
547 
548     /**
549      * Sets the financialDocumentNextLineNbr attribute.
550      * 
551      * @param financialDocumentNextLineNbr The financialDocumentNextLineNbr to set.
552      */
553     public void setFinancialDocumentNextLineNbr(Integer financialDocumentNextLineNbr) {
554         this.financialDocumentNextLineNbr = financialDocumentNextLineNbr;
555     }
556 
557     /**
558      * Gets the disbVchrNonEmpTravelerName attribute.
559      * 
560      * @return Returns the disbVchrNonEmpTravelerName
561      */
562     public String getDisbVchrNonEmpTravelerName() {
563         return disbVchrNonEmpTravelerName;
564     }
565 
566 
567     /**
568      * Sets the disbVchrNonEmpTravelerName attribute.
569      * 
570      * @param disbVchrNonEmpTravelerName The disbVchrNonEmpTravelerName to set.
571      */
572     public void setDisbVchrNonEmpTravelerName(String disbVchrNonEmpTravelerName) {
573         this.disbVchrNonEmpTravelerName = disbVchrNonEmpTravelerName;
574     }
575 
576     /**
577      * Gets the disbVchrPerdiemRate attribute.
578      * 
579      * @return Returns the disbVchrPerdiemRate
580      */
581     public KualiDecimal getDisbVchrPerdiemRate() {
582         return disbVchrPerdiemRate;
583     }
584 
585 
586     /**
587      * Sets the disbVchrPerdiemRate attribute.
588      * 
589      * @param disbVchrPerdiemRate The disbVchrPerdiemRate to set.
590      */
591     public void setDisbVchrPerdiemRate(KualiDecimal disbVchrPerdiemRate) {
592         this.disbVchrPerdiemRate = disbVchrPerdiemRate;
593     }
594 
595     /**
596      * Gets the disbVchrPerdiemCategoryName attribute.
597      * 
598      * @return Returns the disbVchrPerdiemCategoryName
599      */
600     public String getDisbVchrPerdiemCategoryName() {
601         return disbVchrPerdiemCategoryName;
602     }
603 
604 
605     /**
606      * Sets the disbVchrPerdiemCategoryName attribute.
607      * 
608      * @param disbVchrPerdiemCategoryName The disbVchrPerdiemCategoryName to set.
609      */
610     public void setDisbVchrPerdiemCategoryName(String disbVchrPerdiemCategoryName) {
611         this.disbVchrPerdiemCategoryName = disbVchrPerdiemCategoryName;
612     }
613 
614     /**
615      * Gets the disbVchrMileageCalculatedAmt attribute.
616      * 
617      * @return Returns the disbVchrMileageCalculatedAmt
618      */
619     public KualiDecimal getDisbVchrMileageCalculatedAmt() {
620         return dvPersonalCarMileageAmount == null ? null : disbVchrMileageCalculatedAmt;
621     }
622 
623 
624     /**
625      * Sets the disbVchrMileageCalculatedAmt attribute.
626      * 
627      * @param disbVchrMileageCalculatedAmt The disbVchrMileageCalculatedAmt to set.
628      */
629     public void setDisbVchrMileageCalculatedAmt(KualiDecimal disbVchrMileageCalculatedAmt) {
630         this.disbVchrMileageCalculatedAmt = disbVchrMileageCalculatedAmt;
631     }
632 
633     /**
634      * Gets the dvNonEmployeeExpenses attribute.
635      * 
636      * @return Returns the dvNonEmployeeExpenses.
637      */
638     public List getDvNonEmployeeExpenses() {
639         return dvNonEmployeeExpenses;
640     }
641 
642     /**
643      * Sets the dvNonEmployeeExpenses attribute value.
644      * 
645      * @param dvNonEmployeeExpenses The dvNonEmployeeExpenses to set.
646      */
647     public void setDvNonEmployeeExpenses(List dvNonEmployeeExpenses) {
648         this.dvNonEmployeeExpenses = dvNonEmployeeExpenses;
649     }
650 
651     /**
652      * @return Returns the dvPrePaidEmployeeExpenses.
653      */
654     public List getDvPrePaidEmployeeExpenses() {
655         return dvPrePaidEmployeeExpenses;
656     }
657 
658     /**
659      * @param dvPrePaidEmployeeExpenses The dvPrePaidEmployeeExpenses to set.
660      */
661     public void setDvPrePaidEmployeeExpenses(List dvPrePaidEmployeeExpenses) {
662         this.dvPrePaidEmployeeExpenses = dvPrePaidEmployeeExpenses;
663     }
664 
665     /**
666      * Adds a dv non employee expense line
667      * 
668      * @param line
669      */
670     public void addDvNonEmployeeExpenseLine(DisbursementVoucherNonEmployeeExpense line) {
671         line.setFinancialDocumentLineNumber(getFinancialDocumentNextLineNbr());
672         this.dvNonEmployeeExpenses.add(line);
673         this.financialDocumentNextLineNbr = new Integer(getFinancialDocumentNextLineNbr().intValue() + 1);
674     }
675 
676     /**
677      * Adds a dv pre paid expense line
678      * 
679      * @param line
680      */
681     public void addDvPrePaidEmployeeExpenseLine(DisbursementVoucherNonEmployeeExpense line) {
682         line.setFinancialDocumentLineNumber(getFinancialDocumentNextLineNbr());
683         this.dvPrePaidEmployeeExpenses.add(line);
684         this.financialDocumentNextLineNbr = new Integer(getFinancialDocumentNextLineNbr().intValue() + 1);
685     }
686 
687     /**
688      * Returns the per diem start date time as a string representation.
689      * 
690      * @return
691      */
692     public String getPerDiemStartDateTime() {
693         return SpringContext.getBean(DateTimeService.class).toDateTimeString(dvPerdiemStartDttmStamp);
694     }
695 
696     /**
697      * Sets the per diem start timestamp from the string representation.
698      * 
699      * @param perDiemStartDateTime
700      */
701     public void setPerDiemStartDateTime(String perDiemStartDateTime) {
702         try {
703             this.dvPerdiemStartDttmStamp = SpringContext.getBean(DateTimeService.class).convertToSqlTimestamp(perDiemStartDateTime);
704         }
705         catch (ParseException e) {
706             this.dvPerdiemStartDttmStamp = null;
707         }
708     }
709 
710     /**
711      * Returns the per diem end date time as a string representation.
712      * 
713      * @return String
714      */
715     public String getPerDiemEndDateTime() {
716         return SpringContext.getBean(DateTimeService.class).toDateTimeString(dvPerdiemEndDttmStamp);
717     }
718 
719     /**
720      * Sets the per diem start timestamp from the string representation.
721      * 
722      * @param perDiemEndDateTime
723      */
724     public void setPerDiemEndDateTime(String perDiemEndDateTime) {
725         try {
726             this.dvPerdiemEndDttmStamp = SpringContext.getBean(DateTimeService.class).convertToSqlTimestamp(perDiemEndDateTime);
727         }
728         catch (ParseException e) {
729             this.dvPerdiemEndDttmStamp = null;
730         }
731     }
732 
733     /**
734      * Calculates the total pre paid expense amount
735      * 
736      * @return KualiDecimal
737      */
738     public KualiDecimal getTotalPrePaidAmount() {
739         KualiDecimal totalPrePaidAmount = KualiDecimal.ZERO;
740         if (dvPrePaidEmployeeExpenses != null) {
741             for (Iterator iter = dvPrePaidEmployeeExpenses.iterator(); iter.hasNext();) {
742                 DisbursementVoucherNonEmployeeExpense element = (DisbursementVoucherNonEmployeeExpense) iter.next();
743                 if (ObjectUtils.isNotNull(element.getDisbVchrExpenseAmount())) {
744                     totalPrePaidAmount = totalPrePaidAmount.add(element.getDisbVchrExpenseAmount());
745                 }
746             }
747         }
748 
749         return totalPrePaidAmount;
750     }
751 
752     /**
753      * Calculates the total expense amount
754      * 
755      * @return KualiDecimal
756      */
757     public KualiDecimal getTotalExpenseAmount() {
758         KualiDecimal totalExpenseAmount = KualiDecimal.ZERO;
759         if (dvNonEmployeeExpenses != null) {
760             for (Iterator iter = dvNonEmployeeExpenses.iterator(); iter.hasNext();) {
761                 DisbursementVoucherNonEmployeeExpense element = (DisbursementVoucherNonEmployeeExpense) iter.next();
762                 if (ObjectUtils.isNotNull(element.getDisbVchrExpenseAmount())) {
763                     totalExpenseAmount = totalExpenseAmount.add(element.getDisbVchrExpenseAmount());
764                 }
765             }
766         }
767         return totalExpenseAmount;
768     }
769 
770     /**
771      * Calculates the total travel amount.
772      * 
773      * @return KualiDecimal
774      */
775     public KualiDecimal getTotalTravelAmount() {
776         KualiDecimal travelAmount = KualiDecimal.ZERO;
777 
778         // get non paid expenses first
779         travelAmount = travelAmount.add(getTotalExpenseAmount());
780 
781         // add in per diem amount
782         if (disbVchrPerdiemActualAmount != null) {
783             travelAmount = travelAmount.add(disbVchrPerdiemActualAmount);
784         }
785         // add in personnal car amount
786         if (disbVchrPersonalCarAmount != null) {
787             travelAmount = travelAmount.add(disbVchrPersonalCarAmount);
788         }
789 
790         return travelAmount;
791     }
792 
793     /**
794      * @param totalTravelAmount The totalTravelAmount to set.
795      */
796     public void setTotalTravelAmount(KualiDecimal totalTravelAmount) {
797         this.totalTravelAmount = totalTravelAmount;
798     }
799 
800     /**
801      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
802      */
803     
804     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
805         LinkedHashMap m = new LinkedHashMap();
806         m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
807         return m;
808     }
809 }