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.Date;
020: import java.util.Iterator;
021: import java.util.LinkedHashMap;
022: import java.util.List;
023:
024: import org.kuali.core.bo.PersistableBusinessObjectBase;
025: import org.kuali.core.util.KualiDecimal;
026: import org.kuali.core.util.TypedArrayList;
027: import org.kuali.kfs.KFSPropertyConstants;
028:
029: /**
030: * This class is used to represent a disbursement voucher pre-conference detail.
031: */
032: public class DisbursementVoucherPreConferenceDetail extends
033: PersistableBusinessObjectBase {
034:
035: private String documentNumber;
036: private String dvConferenceDestinationName;
037: private Date disbVchrConferenceStartDate;
038: private Date disbVchrConferenceEndDate;
039: private KualiDecimal disbVchrConferenceTotalAmt;
040: private String disbVchrExpenseCode;
041:
042: private List dvPreConferenceRegistrants;
043:
044: /**
045: * Default no-arg constructor.
046: */
047: public DisbursementVoucherPreConferenceDetail() {
048: dvPreConferenceRegistrants = new TypedArrayList(
049: DisbursementVoucherPreConferenceRegistrant.class);
050: }
051:
052: /**
053: * Gets the documentNumber attribute.
054: *
055: * @return Returns the documentNumber
056: */
057: public String getDocumentNumber() {
058: return documentNumber;
059: }
060:
061: /**
062: * Gets the dvPreConferenceRegistrants attribute.
063: *
064: * @return Returns the dvPreConferenceRegistrants.
065: */
066: public List getDvPreConferenceRegistrants() {
067: return dvPreConferenceRegistrants;
068: }
069:
070: /**
071: * Sets the dvPreConferenceRegistrants attribute value.
072: *
073: * @param dvPreConferenceRegistrants The dvPreConferenceRegistrants to set.
074: */
075: public void setDvPreConferenceRegistrants(
076: List dvPreConferenceRegistrants) {
077: this .dvPreConferenceRegistrants = dvPreConferenceRegistrants;
078: }
079:
080: /**
081: * Sets the documentNumber attribute.
082: *
083: * @param documentNumber The documentNumber to set.
084: */
085: public void setDocumentNumber(String documentNumber) {
086: this .documentNumber = documentNumber;
087: }
088:
089: /**
090: * Gets the dvConferenceDestinationName attribute.
091: *
092: * @return Returns the dvConferenceDestinationName
093: */
094: public String getDvConferenceDestinationName() {
095: return dvConferenceDestinationName;
096: }
097:
098: /**
099: * Sets the dvConferenceDestinationName attribute.
100: *
101: * @param dvConferenceDestinationName The dvConferenceDestinationName to set.
102: */
103: public void setDvConferenceDestinationName(
104: String dvConferenceDestinationName) {
105: this .dvConferenceDestinationName = dvConferenceDestinationName;
106: }
107:
108: /**
109: * Gets the disbVchrConferenceStartDate attribute.
110: *
111: * @return Returns the disbVchrConferenceStartDate
112: */
113: public Date getDisbVchrConferenceStartDate() {
114: return disbVchrConferenceStartDate;
115: }
116:
117: /**
118: * Sets the disbVchrConferenceStartDate attribute.
119: *
120: * @param disbVchrConferenceStartDate The disbVchrConferenceStartDate to set.
121: */
122: public void setDisbVchrConferenceStartDate(
123: Date disbVchrConferenceStartDate) {
124: this .disbVchrConferenceStartDate = disbVchrConferenceStartDate;
125: }
126:
127: /**
128: * Gets the disbVchrConferenceEndDate attribute.
129: *
130: * @return Returns the disbVchrConferenceEndDate
131: */
132: public Date getDisbVchrConferenceEndDate() {
133: return disbVchrConferenceEndDate;
134: }
135:
136: /**
137: * Sets the disbVchrConferenceEndDate attribute.
138: *
139: * @param disbVchrConferenceEndDate The disbVchrConferenceEndDate to set.
140: */
141: public void setDisbVchrConferenceEndDate(
142: Date disbVchrConferenceEndDate) {
143: this .disbVchrConferenceEndDate = disbVchrConferenceEndDate;
144: }
145:
146: /**
147: * Gets the disbVchrConferenceTotalAmt attribute.
148: *
149: * @return Returns the disbVchrConferenceTotalAmt
150: */
151: public KualiDecimal getDisbVchrConferenceTotalAmt() {
152: KualiDecimal totalConferenceAmount = new KualiDecimal(0);
153:
154: if (dvPreConferenceRegistrants != null) {
155: for (Iterator iter = dvPreConferenceRegistrants.iterator(); iter
156: .hasNext();) {
157: DisbursementVoucherPreConferenceRegistrant registrantLine = (DisbursementVoucherPreConferenceRegistrant) iter
158: .next();
159: totalConferenceAmount = totalConferenceAmount
160: .add(registrantLine.getDisbVchrExpenseAmount());
161: }
162: }
163:
164: return totalConferenceAmount;
165: }
166:
167: /**
168: * Sets the disbVchrConferenceTotalAmt attribute.
169: *
170: * @param disbVchrConferenceTotalAmt The disbVchrConferenceTotalAmt to set.
171: */
172: public void setDisbVchrConferenceTotalAmt(
173: KualiDecimal disbVchrConferenceTotalAmt) {
174: this .disbVchrConferenceTotalAmt = disbVchrConferenceTotalAmt;
175: }
176:
177: /**
178: * Gets the disbVchrExpenseCode attribute.
179: *
180: * @return Returns the disbVchrExpenseCode
181: */
182: public String getDisbVchrExpenseCode() {
183: return disbVchrExpenseCode;
184: }
185:
186: /**
187: * Sets the disbVchrExpenseCode attribute.
188: *
189: * @param disbVchrExpenseCode The disbVchrExpenseCode to set.
190: */
191: public void setDisbVchrExpenseCode(String disbVchrExpenseCode) {
192: this .disbVchrExpenseCode = disbVchrExpenseCode;
193: }
194:
195: /**
196: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
197: */
198: protected LinkedHashMap toStringMapper() {
199: LinkedHashMap m = new LinkedHashMap();
200: m
201: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
202: this.documentNumber);
203: return m;
204: }
205: }
|