001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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:
017: package org.kuali.module.financial.bo;
018:
019: import java.sql.Timestamp;
020: import java.text.ParseException;
021: import java.util.Iterator;
022: import java.util.LinkedHashMap;
023: import java.util.List;
024:
025: import org.kuali.core.bo.PersistableBusinessObjectBase;
026: import org.kuali.core.service.DateTimeService;
027: import org.kuali.core.util.KualiDecimal;
028: import org.kuali.core.util.ObjectUtils;
029: import org.kuali.core.util.TypedArrayList;
030: import org.kuali.kfs.KFSPropertyConstants;
031: import org.kuali.kfs.context.SpringContext;
032:
033: /**
034: * This class is used to represent a non-employee trip for a disbursement voucher .
035: */
036: public class DisbursementVoucherNonEmployeeTravel extends
037: PersistableBusinessObjectBase {
038:
039: private String documentNumber;
040: private String disbVchrTravelFromCityName;
041: private String disbVchrTravelFromStateCode;
042: private String dvTravelFromCountryCode;
043: private String disbVchrTravelToCityName;
044: private String disbVchrTravelToStateCode;
045: private String disbVchrTravelToCountryCode;
046: private Timestamp dvPerdiemStartDttmStamp;
047: private Timestamp dvPerdiemEndDttmStamp;
048: private KualiDecimal disbVchrPerdiemCalculatedAmt;
049: private KualiDecimal disbVchrPerdiemActualAmount;
050: private String dvPerdiemChangeReasonText;
051: private String disbVchrServicePerformedDesc;
052: private String dvServicePerformedLocName;
053: private String dvServiceRegularEmprName;
054: private String disbVchrAutoFromCityName;
055: private String disbVchrAutoFromStateCode;
056: private String disbVchrAutoToCityName;
057: private String disbVchrAutoToStateCode;
058: private boolean disbVchrAutoRoundTripCode;
059: private Integer dvPersonalCarMileageAmount;
060: private KualiDecimal disbVchrPersonalCarRate;
061: private KualiDecimal disbVchrPersonalCarAmount;
062: private boolean disbVchrExceptionCode;
063: private Integer financialDocumentNextLineNbr;
064: private String disbVchrNonEmpTravelerName;
065: private KualiDecimal disbVchrPerdiemRate;
066: private String disbVchrPerdiemCategoryName;
067: private KualiDecimal disbVchrMileageCalculatedAmt;
068:
069: private KualiDecimal totalTravelAmount;
070:
071: private List dvNonEmployeeExpenses;
072: private List dvPrePaidEmployeeExpenses;
073:
074: /**
075: * Default no-arg constructor.
076: */
077: public DisbursementVoucherNonEmployeeTravel() {
078: dvNonEmployeeExpenses = new TypedArrayList(
079: DisbursementVoucherNonEmployeeExpense.class);
080: dvPrePaidEmployeeExpenses = new TypedArrayList(
081: DisbursementVoucherNonEmployeeExpense.class);
082: financialDocumentNextLineNbr = new Integer(1);
083: }
084:
085: /**
086: * Gets the documentNumber attribute.
087: *
088: * @return Returns the documentNumber
089: */
090: public String getDocumentNumber() {
091: return documentNumber;
092: }
093:
094: /**
095: * Sets the documentNumber attribute.
096: *
097: * @param documentNumber The documentNumber to set.
098: */
099: public void setDocumentNumber(String documentNumber) {
100: this .documentNumber = documentNumber;
101: }
102:
103: /**
104: * Gets the disbVchrTravelFromCityName attribute.
105: *
106: * @return Returns the disbVchrTravelFromCityName
107: */
108: public String getDisbVchrTravelFromCityName() {
109: return disbVchrTravelFromCityName;
110: }
111:
112: /**
113: * Sets the disbVchrTravelFromCityName attribute.
114: *
115: * @param disbVchrTravelFromCityName The disbVchrTravelFromCityName to set.
116: */
117: public void setDisbVchrTravelFromCityName(
118: String disbVchrTravelFromCityName) {
119: this .disbVchrTravelFromCityName = disbVchrTravelFromCityName;
120: }
121:
122: /**
123: * Gets the disbVchrTravelFromStateCode attribute.
124: *
125: * @return Returns the disbVchrTravelFromStateCode
126: */
127: public String getDisbVchrTravelFromStateCode() {
128: return disbVchrTravelFromStateCode;
129: }
130:
131: /**
132: * Sets the disbVchrTravelFromStateCode attribute.
133: *
134: * @param disbVchrTravelFromStateCode The disbVchrTravelFromStateCode to set.
135: */
136: public void setDisbVchrTravelFromStateCode(
137: String disbVchrTravelFromStateCode) {
138: this .disbVchrTravelFromStateCode = disbVchrTravelFromStateCode;
139: }
140:
141: /**
142: * Gets the dvTravelFromCountryCode attribute.
143: *
144: * @return Returns the dvTravelFromCountryCode
145: */
146: public String getDvTravelFromCountryCode() {
147: return dvTravelFromCountryCode;
148: }
149:
150: /**
151: * Sets the dvTravelFromCountryCode attribute.
152: *
153: * @param dvTravelFromCountryCode The dvTravelFromCountryCode to set.
154: */
155: public void setDvTravelFromCountryCode(
156: String dvTravelFromCountryCode) {
157: this .dvTravelFromCountryCode = dvTravelFromCountryCode;
158: }
159:
160: /**
161: * Gets the disbVchrTravelToCityName attribute.
162: *
163: * @return Returns the disbVchrTravelToCityName
164: */
165: public String getDisbVchrTravelToCityName() {
166: return disbVchrTravelToCityName;
167: }
168:
169: /**
170: * Sets the disbVchrTravelToCityName attribute.
171: *
172: * @param disbVchrTravelToCityName The disbVchrTravelToCityName to set.
173: */
174: public void setDisbVchrTravelToCityName(
175: String disbVchrTravelToCityName) {
176: this .disbVchrTravelToCityName = disbVchrTravelToCityName;
177: }
178:
179: /**
180: * Gets the disbVchrTravelToStateCode attribute.
181: *
182: * @return Returns the disbVchrTravelToStateCode
183: */
184: public String getDisbVchrTravelToStateCode() {
185: return disbVchrTravelToStateCode;
186: }
187:
188: /**
189: * Sets the disbVchrTravelToStateCode attribute.
190: *
191: * @param disbVchrTravelToStateCode The disbVchrTravelToStateCode to set.
192: */
193: public void setDisbVchrTravelToStateCode(
194: String disbVchrTravelToStateCode) {
195: this .disbVchrTravelToStateCode = disbVchrTravelToStateCode;
196: }
197:
198: /**
199: * Gets the disbVchrTravelToCountryCode attribute.
200: *
201: * @return Returns the disbVchrTravelToCountryCode
202: */
203: public String getDisbVchrTravelToCountryCode() {
204: return disbVchrTravelToCountryCode;
205: }
206:
207: /**
208: * Sets the disbVchrTravelToCountryCode attribute.
209: *
210: * @param disbVchrTravelToCountryCode The disbVchrTravelToCountryCode to set.
211: */
212: public void setDisbVchrTravelToCountryCode(
213: String disbVchrTravelToCountryCode) {
214: this .disbVchrTravelToCountryCode = disbVchrTravelToCountryCode;
215: }
216:
217: /**
218: * Gets the dvPerdiemStartDttmStamp attribute.
219: *
220: * @return Returns the dvPerdiemStartDttmStamp
221: */
222: public Timestamp getDvPerdiemStartDttmStamp() {
223: return dvPerdiemStartDttmStamp;
224: }
225:
226: /**
227: * Sets the dvPerdiemStartDttmStamp attribute.
228: *
229: * @param dvPerdiemStartDttmStamp The dvPerdiemStartDttmStamp to set.
230: */
231: public void setDvPerdiemStartDttmStamp(
232: Timestamp dvPerdiemStartDttmStamp) {
233: this .dvPerdiemStartDttmStamp = dvPerdiemStartDttmStamp;
234: }
235:
236: /**
237: * Gets the dvPerdiemEndDttmStamp attribute.
238: *
239: * @return Returns the dvPerdiemEndDttmStamp
240: */
241: public Timestamp getDvPerdiemEndDttmStamp() {
242: return dvPerdiemEndDttmStamp;
243: }
244:
245: /**
246: * Sets the dvPerdiemEndDttmStamp attribute.
247: *
248: * @param dvPerdiemEndDttmStamp The dvPerdiemEndDttmStamp to set.
249: */
250: public void setDvPerdiemEndDttmStamp(Timestamp dvPerdiemEndDttmStamp) {
251: this .dvPerdiemEndDttmStamp = dvPerdiemEndDttmStamp;
252: }
253:
254: /**
255: * Gets the disbVchrPerdiemCalculatedAmt attribute.
256: *
257: * @return Returns the disbVchrPerdiemCalculatedAmt
258: */
259: public KualiDecimal getDisbVchrPerdiemCalculatedAmt() {
260: return disbVchrPerdiemCalculatedAmt;
261: }
262:
263: /**
264: * Sets the disbVchrPerdiemCalculatedAmt attribute.
265: *
266: * @param disbVchrPerdiemCalculatedAmt The disbVchrPerdiemCalculatedAmt to set.
267: */
268: public void setDisbVchrPerdiemCalculatedAmt(
269: KualiDecimal disbVchrPerdiemCalculatedAmt) {
270: this .disbVchrPerdiemCalculatedAmt = disbVchrPerdiemCalculatedAmt;
271: }
272:
273: /**
274: * Gets the disbVchrPerdiemActualAmount attribute.
275: *
276: * @return Returns the disbVchrPerdiemActualAmount
277: */
278: public KualiDecimal getDisbVchrPerdiemActualAmount() {
279: return disbVchrPerdiemActualAmount;
280: }
281:
282: /**
283: * Sets the disbVchrPerdiemActualAmount attribute.
284: *
285: * @param disbVchrPerdiemActualAmount The disbVchrPerdiemActualAmount to set.
286: */
287: public void setDisbVchrPerdiemActualAmount(
288: KualiDecimal disbVchrPerdiemActualAmount) {
289: this .disbVchrPerdiemActualAmount = disbVchrPerdiemActualAmount;
290: }
291:
292: /**
293: * Gets the dvPerdiemChangeReasonText attribute.
294: *
295: * @return Returns the dvPerdiemChangeReasonText
296: */
297: public String getDvPerdiemChangeReasonText() {
298: return dvPerdiemChangeReasonText;
299: }
300:
301: /**
302: * Sets the dvPerdiemChangeReasonText attribute.
303: *
304: * @param dvPerdiemChangeReasonText The dvPerdiemChangeReasonText to set.
305: */
306: public void setDvPerdiemChangeReasonText(
307: String dvPerdiemChangeReasonText) {
308: this .dvPerdiemChangeReasonText = dvPerdiemChangeReasonText;
309: }
310:
311: /**
312: * Gets the disbVchrServicePerformedDesc attribute.
313: *
314: * @return Returns the disbVchrServicePerformedDesc
315: */
316: public String getDisbVchrServicePerformedDesc() {
317: return disbVchrServicePerformedDesc;
318: }
319:
320: /**
321: * Sets the disbVchrServicePerformedDesc attribute.
322: *
323: * @param disbVchrServicePerformedDesc The disbVchrServicePerformedDesc to set.
324: */
325: public void setDisbVchrServicePerformedDesc(
326: String disbVchrServicePerformedDesc) {
327: this .disbVchrServicePerformedDesc = disbVchrServicePerformedDesc;
328: }
329:
330: /**
331: * Gets the dvServicePerformedLocName attribute.
332: *
333: * @return Returns the dvServicePerformedLocName
334: */
335: public String getDvServicePerformedLocName() {
336: return dvServicePerformedLocName;
337: }
338:
339: /**
340: * Sets the dvServicePerformedLocName attribute.
341: *
342: * @param dvServicePerformedLocName The dvServicePerformedLocName to set.
343: */
344: public void setDvServicePerformedLocName(
345: String dvServicePerformedLocName) {
346: this .dvServicePerformedLocName = dvServicePerformedLocName;
347: }
348:
349: /**
350: * Gets the dvServiceRegularEmprName attribute.
351: *
352: * @return Returns the dvServiceRegularEmprName
353: */
354: public String getDvServiceRegularEmprName() {
355: return dvServiceRegularEmprName;
356: }
357:
358: /**
359: * Sets the dvServiceRegularEmprName attribute.
360: *
361: * @param dvServiceRegularEmprName The dvServiceRegularEmprName to set.
362: */
363: public void setDvServiceRegularEmprName(
364: String dvServiceRegularEmprName) {
365: this .dvServiceRegularEmprName = dvServiceRegularEmprName;
366: }
367:
368: /**
369: * Gets the disbVchrAutoFromCityName attribute.
370: *
371: * @return Returns the disbVchrAutoFromCityName
372: */
373: public String getDisbVchrAutoFromCityName() {
374: return disbVchrAutoFromCityName;
375: }
376:
377: /**
378: * Sets the disbVchrAutoFromCityName attribute.
379: *
380: * @param disbVchrAutoFromCityName The disbVchrAutoFromCityName to set.
381: */
382: public void setDisbVchrAutoFromCityName(
383: String disbVchrAutoFromCityName) {
384: this .disbVchrAutoFromCityName = disbVchrAutoFromCityName;
385: }
386:
387: /**
388: * Gets the disbVchrAutoFromStateCode attribute.
389: *
390: * @return Returns the disbVchrAutoFromStateCode
391: */
392: public String getDisbVchrAutoFromStateCode() {
393: return disbVchrAutoFromStateCode;
394: }
395:
396: /**
397: * Sets the disbVchrAutoFromStateCode attribute.
398: *
399: * @param disbVchrAutoFromStateCode The disbVchrAutoFromStateCode to set.
400: */
401: public void setDisbVchrAutoFromStateCode(
402: String disbVchrAutoFromStateCode) {
403: this .disbVchrAutoFromStateCode = disbVchrAutoFromStateCode;
404: }
405:
406: /**
407: * Gets the disbVchrAutoToCityName attribute.
408: *
409: * @return Returns the disbVchrAutoToCityName
410: */
411: public String getDisbVchrAutoToCityName() {
412: return disbVchrAutoToCityName;
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: * Sets the disbVchrAutoToStateCode attribute.
435: *
436: * @param disbVchrAutoToStateCode The disbVchrAutoToStateCode to set.
437: */
438: public void setDisbVchrAutoToStateCode(
439: 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: * Sets the disbVchrAutoRoundTripCode attribute.
454: *
455: * @param disbVchrAutoRoundTripCode The disbVchrAutoRoundTripCode to set.
456: */
457: public void setDisbVchrAutoRoundTripCode(
458: 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: * Sets the dvPersonalCarMileageAmount attribute.
473: *
474: * @param dvPersonalCarMileageAmount The dvPersonalCarMileageAmount to set.
475: */
476: public void setDvPersonalCarMileageAmount(
477: 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: * Sets the disbVchrPersonalCarRate attribute.
492: *
493: * @param disbVchrPersonalCarRate The disbVchrPersonalCarRate to set.
494: */
495: public void setDisbVchrPersonalCarRate(
496: 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
507: : disbVchrPersonalCarAmount;
508: }
509:
510: /**
511: * Sets the disbVchrPersonalCarAmount attribute.
512: *
513: * @param disbVchrPersonalCarAmount The disbVchrPersonalCarAmount to set.
514: */
515: public void setDisbVchrPersonalCarAmount(
516: KualiDecimal disbVchrPersonalCarAmount) {
517: this .disbVchrPersonalCarAmount = disbVchrPersonalCarAmount;
518: }
519:
520: /**
521: * Gets the disbVchrExceptionCode attribute.
522: *
523: * @return Returns the disbVchrExceptionCode
524: */
525: public boolean getDisbVchrExceptionCode() {
526: return disbVchrExceptionCode;
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: * Sets the financialDocumentNextLineNbr attribute.
549: *
550: * @param financialDocumentNextLineNbr The financialDocumentNextLineNbr to set.
551: */
552: public void setFinancialDocumentNextLineNbr(
553: 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: * Sets the disbVchrNonEmpTravelerName attribute.
568: *
569: * @param disbVchrNonEmpTravelerName The disbVchrNonEmpTravelerName to set.
570: */
571: public void setDisbVchrNonEmpTravelerName(
572: 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: * Sets the disbVchrPerdiemRate attribute.
587: *
588: * @param disbVchrPerdiemRate The disbVchrPerdiemRate to set.
589: */
590: public void setDisbVchrPerdiemRate(KualiDecimal disbVchrPerdiemRate) {
591: this .disbVchrPerdiemRate = disbVchrPerdiemRate;
592: }
593:
594: /**
595: * Gets the disbVchrPerdiemCategoryName attribute.
596: *
597: * @return Returns the disbVchrPerdiemCategoryName
598: */
599: public String getDisbVchrPerdiemCategoryName() {
600: return disbVchrPerdiemCategoryName;
601: }
602:
603: /**
604: * Sets the disbVchrPerdiemCategoryName attribute.
605: *
606: * @param disbVchrPerdiemCategoryName The disbVchrPerdiemCategoryName to set.
607: */
608: public void setDisbVchrPerdiemCategoryName(
609: String disbVchrPerdiemCategoryName) {
610: this .disbVchrPerdiemCategoryName = disbVchrPerdiemCategoryName;
611: }
612:
613: /**
614: * Gets the disbVchrMileageCalculatedAmt attribute.
615: *
616: * @return Returns the disbVchrMileageCalculatedAmt
617: */
618: public KualiDecimal getDisbVchrMileageCalculatedAmt() {
619: return dvPersonalCarMileageAmount == null ? null
620: : disbVchrMileageCalculatedAmt;
621: }
622:
623: /**
624: * Sets the disbVchrMileageCalculatedAmt attribute.
625: *
626: * @param disbVchrMileageCalculatedAmt The disbVchrMileageCalculatedAmt to set.
627: */
628: public void setDisbVchrMileageCalculatedAmt(
629: 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(
662: List dvPrePaidEmployeeExpenses) {
663: this .dvPrePaidEmployeeExpenses = dvPrePaidEmployeeExpenses;
664: }
665:
666: /**
667: * Adds a dv non employee expense line
668: *
669: * @param line
670: */
671: public void addDvNonEmployeeExpenseLine(
672: DisbursementVoucherNonEmployeeExpense line) {
673: line
674: .setFinancialDocumentLineNumber(getFinancialDocumentNextLineNbr());
675: this .dvNonEmployeeExpenses.add(line);
676: this .financialDocumentNextLineNbr = new Integer(
677: getFinancialDocumentNextLineNbr().intValue() + 1);
678: }
679:
680: /**
681: * Adds a dv pre paid expense line
682: *
683: * @param line
684: */
685: public void addDvPrePaidEmployeeExpenseLine(
686: DisbursementVoucherNonEmployeeExpense line) {
687: line
688: .setFinancialDocumentLineNumber(getFinancialDocumentNextLineNbr());
689: this .dvPrePaidEmployeeExpenses.add(line);
690: this .financialDocumentNextLineNbr = new Integer(
691: getFinancialDocumentNextLineNbr().intValue() + 1);
692: }
693:
694: /**
695: * Returns the per diem start date time as a string representation.
696: *
697: * @return
698: */
699: public String getPerDiemStartDateTime() {
700: return SpringContext.getBean(DateTimeService.class)
701: .toDateTimeString(dvPerdiemStartDttmStamp);
702: }
703:
704: /**
705: * Sets the per diem start timestamp from the string representation.
706: *
707: * @param perDiemStartDateTime
708: */
709: public void setPerDiemStartDateTime(String perDiemStartDateTime) {
710: try {
711: this .dvPerdiemStartDttmStamp = SpringContext.getBean(
712: DateTimeService.class).convertToSqlTimestamp(
713: perDiemStartDateTime);
714: } catch (ParseException e) {
715: this .dvPerdiemStartDttmStamp = null;
716: }
717: }
718:
719: /**
720: * Returns the per diem end date time as a string representation.
721: *
722: * @return String
723: */
724: public String getPerDiemEndDateTime() {
725: return SpringContext.getBean(DateTimeService.class)
726: .toDateTimeString(dvPerdiemEndDttmStamp);
727: }
728:
729: /**
730: * Sets the per diem start timestamp from the string representation.
731: *
732: * @param perDiemEndDateTime
733: */
734: public void setPerDiemEndDateTime(String perDiemEndDateTime) {
735: try {
736: this .dvPerdiemEndDttmStamp = SpringContext.getBean(
737: DateTimeService.class).convertToSqlTimestamp(
738: perDiemEndDateTime);
739: } catch (ParseException e) {
740: this .dvPerdiemEndDttmStamp = null;
741: }
742: }
743:
744: /**
745: * Calculates the total pre paid expense amount
746: *
747: * @return KualiDecimal
748: */
749: public KualiDecimal getTotalPrePaidAmount() {
750: KualiDecimal totalPrePaidAmount = new KualiDecimal(0);
751: if (dvPrePaidEmployeeExpenses != null) {
752: for (Iterator iter = dvPrePaidEmployeeExpenses.iterator(); iter
753: .hasNext();) {
754: DisbursementVoucherNonEmployeeExpense element = (DisbursementVoucherNonEmployeeExpense) iter
755: .next();
756: if (ObjectUtils.isNotNull(element
757: .getDisbVchrExpenseAmount())) {
758: totalPrePaidAmount = totalPrePaidAmount.add(element
759: .getDisbVchrExpenseAmount());
760: }
761: }
762: }
763:
764: return totalPrePaidAmount;
765: }
766:
767: /**
768: * Calculates the total expense amount
769: *
770: * @return KualiDecimal
771: */
772: public KualiDecimal getTotalExpenseAmount() {
773: KualiDecimal totalExpenseAmount = new KualiDecimal(0);
774: if (dvNonEmployeeExpenses != null) {
775: for (Iterator iter = dvNonEmployeeExpenses.iterator(); iter
776: .hasNext();) {
777: DisbursementVoucherNonEmployeeExpense element = (DisbursementVoucherNonEmployeeExpense) iter
778: .next();
779: if (ObjectUtils.isNotNull(element
780: .getDisbVchrExpenseAmount())) {
781: totalExpenseAmount = totalExpenseAmount.add(element
782: .getDisbVchrExpenseAmount());
783: }
784: }
785: }
786: return totalExpenseAmount;
787: }
788:
789: /**
790: * Calculates the total travel amount.
791: *
792: * @return KualiDecimal
793: */
794: public KualiDecimal getTotalTravelAmount() {
795: KualiDecimal travelAmount = new KualiDecimal(0);
796:
797: // get non paid expenses first
798: travelAmount = travelAmount.add(getTotalExpenseAmount());
799:
800: // add in per diem amount
801: if (disbVchrPerdiemActualAmount != null) {
802: travelAmount = travelAmount
803: .add(disbVchrPerdiemActualAmount);
804: }
805: // add in personnal car amount
806: if (disbVchrPersonalCarAmount != null) {
807: travelAmount = travelAmount.add(disbVchrPersonalCarAmount);
808: }
809:
810: return travelAmount;
811: }
812:
813: /**
814: * @param totalTravelAmount The totalTravelAmount to set.
815: */
816: public void setTotalTravelAmount(KualiDecimal totalTravelAmount) {
817: this .totalTravelAmount = totalTravelAmount;
818: }
819:
820: /**
821: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
822: */
823: @Override
824: protected LinkedHashMap toStringMapper() {
825: LinkedHashMap m = new LinkedHashMap();
826: m
827: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
828: this.documentNumber);
829: return m;
830: }
831: }
|