001    /*
002     * Copyright 2011 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    
017    package org.kuali.kfs.fp.businessobject;
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.kfs.sys.KFSPropertyConstants;
025    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
026    import org.kuali.rice.kns.util.KualiDecimal;
027    import org.kuali.rice.kns.util.TypedArrayList;
028    
029    /**
030     * This class is used to represent a disbursement voucher pre-conference detail.
031     */
032    public class DisbursementVoucherPreConferenceDetail extends PersistableBusinessObjectBase {
033    
034        private String documentNumber;
035        private String dvConferenceDestinationName;
036        private Date disbVchrConferenceStartDate;
037        private Date disbVchrConferenceEndDate;
038        private KualiDecimal disbVchrConferenceTotalAmt;
039        private String disbVchrExpenseCode;
040    
041    
042        private List dvPreConferenceRegistrants;
043    
044        /**
045         * Default no-arg constructor.
046         */
047        public DisbursementVoucherPreConferenceDetail() {
048            dvPreConferenceRegistrants = new TypedArrayList(DisbursementVoucherPreConferenceRegistrant.class);
049        }
050    
051        /**
052         * Gets the documentNumber attribute.
053         * 
054         * @return Returns the documentNumber
055         */
056        public String getDocumentNumber() {
057            return documentNumber;
058        }
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(List dvPreConferenceRegistrants) {
076            this.dvPreConferenceRegistrants = dvPreConferenceRegistrants;
077        }
078    
079        /**
080         * Sets the documentNumber attribute.
081         * 
082         * @param documentNumber The documentNumber to set.
083         */
084        public void setDocumentNumber(String documentNumber) {
085            this.documentNumber = documentNumber;
086        }
087    
088        /**
089         * Gets the dvConferenceDestinationName attribute.
090         * 
091         * @return Returns the dvConferenceDestinationName
092         */
093        public String getDvConferenceDestinationName() {
094            return dvConferenceDestinationName;
095        }
096    
097    
098        /**
099         * 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.kns.bo.BusinessObjectBase#toStringMapper()
194         */
195        protected LinkedHashMap toStringMapper() {
196            LinkedHashMap m = new LinkedHashMap();
197            m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber);
198            return m;
199        }
200    }