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.Date;
20  import java.util.ArrayList;
21  import java.util.Iterator;
22  import java.util.LinkedHashMap;
23  import java.util.List;
24  
25  import org.kuali.ole.sys.OLEPropertyConstants;
26  import org.kuali.rice.core.api.util.type.KualiDecimal;
27  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
28  
29  /**
30   * This class is used to represent a disbursement voucher pre-conference detail.
31   */
32  public class DisbursementVoucherPreConferenceDetail extends PersistableBusinessObjectBase {
33  
34      private String documentNumber;
35      private String dvConferenceDestinationName;
36      private Date disbVchrConferenceStartDate;
37      private Date disbVchrConferenceEndDate;
38      private KualiDecimal disbVchrConferenceTotalAmt;
39      private String disbVchrExpenseCode;
40  
41  
42      private List dvPreConferenceRegistrants;
43  
44      /**
45       * Default no-arg constructor.
46       */
47      public DisbursementVoucherPreConferenceDetail() {
48          dvPreConferenceRegistrants = new ArrayList<DisbursementVoucherPreConferenceRegistrant>();
49      }
50  
51      /**
52       * Gets the documentNumber attribute.
53       * 
54       * @return Returns the documentNumber
55       */
56      public String getDocumentNumber() {
57          return documentNumber;
58      }
59  
60  
61      /**
62       * Gets the dvPreConferenceRegistrants attribute.
63       * 
64       * @return Returns the dvPreConferenceRegistrants.
65       */
66      public List getDvPreConferenceRegistrants() {
67          return dvPreConferenceRegistrants;
68      }
69  
70      /**
71       * Sets the dvPreConferenceRegistrants attribute value.
72       * 
73       * @param dvPreConferenceRegistrants The dvPreConferenceRegistrants to set.
74       */
75      public void setDvPreConferenceRegistrants(List dvPreConferenceRegistrants) {
76          this.dvPreConferenceRegistrants = dvPreConferenceRegistrants;
77      }
78  
79      /**
80       * Sets the documentNumber attribute.
81       * 
82       * @param documentNumber The documentNumber to set.
83       */
84      public void setDocumentNumber(String documentNumber) {
85          this.documentNumber = documentNumber;
86      }
87  
88      /**
89       * Gets the dvConferenceDestinationName attribute.
90       * 
91       * @return Returns the dvConferenceDestinationName
92       */
93      public String getDvConferenceDestinationName() {
94          return dvConferenceDestinationName;
95      }
96  
97  
98      /**
99       * Sets the dvConferenceDestinationName attribute.
100      * 
101      * @param dvConferenceDestinationName The dvConferenceDestinationName to set.
102      */
103     public void setDvConferenceDestinationName(String dvConferenceDestinationName) {
104         this.dvConferenceDestinationName = dvConferenceDestinationName;
105     }
106 
107     /**
108      * Gets the disbVchrConferenceStartDate attribute.
109      * 
110      * @return Returns the disbVchrConferenceStartDate
111      */
112     public Date getDisbVchrConferenceStartDate() {
113         return disbVchrConferenceStartDate;
114     }
115 
116 
117     /**
118      * Sets the disbVchrConferenceStartDate attribute.
119      * 
120      * @param disbVchrConferenceStartDate The disbVchrConferenceStartDate to set.
121      */
122     public void setDisbVchrConferenceStartDate(Date disbVchrConferenceStartDate) {
123         this.disbVchrConferenceStartDate = disbVchrConferenceStartDate;
124     }
125 
126     /**
127      * Gets the disbVchrConferenceEndDate attribute.
128      * 
129      * @return Returns the disbVchrConferenceEndDate
130      */
131     public Date getDisbVchrConferenceEndDate() {
132         return disbVchrConferenceEndDate;
133     }
134 
135 
136     /**
137      * Sets the disbVchrConferenceEndDate attribute.
138      * 
139      * @param disbVchrConferenceEndDate The disbVchrConferenceEndDate to set.
140      */
141     public void setDisbVchrConferenceEndDate(Date disbVchrConferenceEndDate) {
142         this.disbVchrConferenceEndDate = disbVchrConferenceEndDate;
143     }
144 
145     /**
146      * Gets the disbVchrConferenceTotalAmt attribute.
147      * 
148      * @return Returns the disbVchrConferenceTotalAmt
149      */
150     public KualiDecimal getDisbVchrConferenceTotalAmt() {
151         KualiDecimal totalConferenceAmount = KualiDecimal.ZERO;
152 
153         if (dvPreConferenceRegistrants != null) {
154             for (Iterator iter = dvPreConferenceRegistrants.iterator(); iter.hasNext();) {
155                 DisbursementVoucherPreConferenceRegistrant registrantLine = (DisbursementVoucherPreConferenceRegistrant) iter.next();
156                 totalConferenceAmount = totalConferenceAmount.add(registrantLine.getDisbVchrExpenseAmount());
157             }
158         }
159 
160         return totalConferenceAmount;
161     }
162 
163 
164     /**
165      * Sets the disbVchrConferenceTotalAmt attribute.
166      * 
167      * @param disbVchrConferenceTotalAmt The disbVchrConferenceTotalAmt to set.
168      */
169     public void setDisbVchrConferenceTotalAmt(KualiDecimal disbVchrConferenceTotalAmt) {
170         this.disbVchrConferenceTotalAmt = disbVchrConferenceTotalAmt;
171     }
172 
173     /**
174      * Gets the disbVchrExpenseCode attribute.
175      * 
176      * @return Returns the disbVchrExpenseCode
177      */
178     public String getDisbVchrExpenseCode() {
179         return disbVchrExpenseCode;
180     }
181 
182 
183     /**
184      * Sets the disbVchrExpenseCode attribute.
185      * 
186      * @param disbVchrExpenseCode The disbVchrExpenseCode to set.
187      */
188     public void setDisbVchrExpenseCode(String disbVchrExpenseCode) {
189         this.disbVchrExpenseCode = disbVchrExpenseCode;
190     }
191 
192     /**
193      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
194      */
195     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
196         LinkedHashMap m = new LinkedHashMap();
197         m.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
198         return m;
199     }
200 }