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    package org.kuali.kfs.gl.businessobject;
017    
018    import java.sql.Date;
019    import java.util.HashMap;
020    import java.util.LinkedHashMap;
021    import java.util.Map;
022    
023    import org.kuali.kfs.coa.businessobject.Chart;
024    import org.kuali.kfs.coa.businessobject.Organization;
025    import org.kuali.kfs.sys.KFSPropertyConstants;
026    import org.kuali.kfs.sys.context.SpringContext;
027    import org.kuali.rice.kns.bo.Campus;
028    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
029    import org.kuali.rice.kns.service.KualiModuleService;
030    import org.kuali.rice.kns.util.KNSPropertyConstants;
031    import org.kuali.rice.kns.util.KualiDecimal;
032    
033    /**
034     * This class represents a unique header for use with a CollectorBatch class
035     */
036    public class CollectorHeader extends PersistableBusinessObjectBase {
037    
038        private String chartOfAccountsCode;
039        private String organizationCode;
040        private Date processTransmissionDate;
041        private Integer processBatchSequenceNumber;
042        private Integer processTotalRecordCount;
043        private KualiDecimal processTotalAmount;
044        private String campusCode;
045        private String contactPersonPhoneNumber;
046        private String contactMailingAddress;
047        private String contactDepartmentName;
048    
049        private Organization organization;
050        private Chart chartOfAccounts;
051        private Campus campus;
052    
053        /**
054         * Default constructor.
055         */
056        public CollectorHeader() {
057    
058        }
059    
060        /**
061         * Gets the chartOfAccountsCode attribute.
062         * 
063         * @return Returns the chartOfAccountsCode
064         */
065        public String getChartOfAccountsCode() {
066            return chartOfAccountsCode;
067        }
068    
069        /**
070         * Sets the chartOfAccountsCode attribute.
071         * 
072         * @param chartOfAccountsCode The chartOfAccountsCode to set.
073         */
074        public void setChartOfAccountsCode(String chartOfAccountsCode) {
075            this.chartOfAccountsCode = chartOfAccountsCode;
076        }
077    
078    
079        /**
080         * Gets the organizationCode attribute.
081         * 
082         * @return Returns the organizationCode
083         */
084        public String getOrganizationCode() {
085            return organizationCode;
086        }
087    
088        /**
089         * Sets the organizationCode attribute.
090         * 
091         * @param organizationCode The organizationCode to set.
092         */
093        public void setOrganizationCode(String organizationCode) {
094            this.organizationCode = organizationCode;
095        }
096    
097    
098        /**
099         * Gets the processTransmissionDate attribute.
100         * 
101         * @return Returns the processTransmissionDate
102         */
103        public Date getProcessTransmissionDate() {
104            return processTransmissionDate;
105        }
106    
107        /**
108         * Sets the processTransmissionDate attribute.
109         * 
110         * @param processTransmissionDate The processTransmissionDate to set.
111         */
112        public void setProcessTransmissionDate(Date processTransmissionDate) {
113            this.processTransmissionDate = processTransmissionDate;
114        }
115    
116    
117        /**
118         * Gets the processBatchSequenceNumber attribute.
119         * 
120         * @return Returns the processBatchSequenceNumber
121         */
122        public Integer getProcessBatchSequenceNumber() {
123            return processBatchSequenceNumber;
124        }
125    
126        /**
127         * Sets the processBatchSequenceNumber attribute.
128         * 
129         * @param processBatchSequenceNumber The processBatchSequenceNumber to set.
130         */
131        public void setProcessBatchSequenceNumber(Integer processBatchSequenceNumber) {
132            this.processBatchSequenceNumber = processBatchSequenceNumber;
133        }
134    
135    
136        /**
137         * Gets the processTotalRecordCount attribute.
138         * 
139         * @return Returns the processTotalRecordCount
140         */
141        public Integer getProcessTotalRecordCount() {
142            return processTotalRecordCount;
143        }
144    
145        /**
146         * Sets the processTotalRecordCount attribute.
147         * 
148         * @param processTotalRecordCount The processTotalRecordCount to set.
149         */
150        public void setProcessTotalRecordCount(Integer processTotalRecordCount) {
151            this.processTotalRecordCount = processTotalRecordCount;
152        }
153    
154    
155        /**
156         * Gets the processTotalAmount attribute.
157         * 
158         * @return Returns the processTotalAmount
159         */
160        public KualiDecimal getProcessTotalAmount() {
161            return processTotalAmount;
162        }
163    
164        /**
165         * Sets the processTotalAmount attribute.
166         * 
167         * @param processTotalAmount The processTotalAmount to set.
168         */
169        public void setProcessTotalAmount(KualiDecimal processTotalAmount) {
170            this.processTotalAmount = processTotalAmount;
171        }
172    
173    
174        /**
175         * Gets the organization attribute.
176         * 
177         * @return Returns the organization
178         */
179        public Organization getOrganization() {
180            return organization;
181        }
182    
183        /**
184         * Sets the organization attribute.
185         * 
186         * @param organization The organization to set.
187         * @deprecated
188         */
189        public void setOrganization(Organization organization) {
190            this.organization = organization;
191        }
192    
193        /**
194         * Gets the chartOfAccounts attribute.
195         * 
196         * @return Returns the chartOfAccounts
197         */
198        public Chart getChartOfAccounts() {
199            return chartOfAccounts;
200        }
201    
202        /**
203         * Sets the chartOfAccounts attribute.
204         * 
205         * @param chartOfAccounts The chartOfAccounts to set.
206         * @deprecated
207         */
208        public void setChartOfAccounts(Chart chartOfAccounts) {
209            this.chartOfAccounts = chartOfAccounts;
210        }
211    
212        /**
213         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
214         */
215        protected LinkedHashMap toStringMapper() {
216            LinkedHashMap<String, String> m = new LinkedHashMap();
217            m.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.chartOfAccountsCode);
218            m.put(KFSPropertyConstants.ORGANIZATION_CODE, this.organizationCode);
219            if (this.processTransmissionDate != null) {
220                m.put(KFSPropertyConstants.PROCESS_TRANSMISSION_DATE, this.processTransmissionDate.toString());
221            }
222            if (this.processBatchSequenceNumber != null) {
223                m.put(KFSPropertyConstants.PROCESS_BATCH_SEQUENCE_NUMBER, this.processBatchSequenceNumber.toString());
224            }
225            if (this.processTotalRecordCount != null) {
226                m.put(KFSPropertyConstants.PROCESS_TOTAL_RECORD_COUNT, this.processTotalRecordCount.toString());
227            }
228            if (this.processTotalAmount != null) {
229                m.put(KFSPropertyConstants.PROCESS_TOTAL_AMOUNT, this.processTotalAmount.toString());
230            }
231            return m;
232        }
233    
234        /**
235         * Gets the campusCode attribute.
236         * 
237         * @return Returns the campusCode.
238         */
239        public String getCampusCode() {
240            return campusCode;
241        }
242    
243        /**
244         * Sets the campusCode attribute value.
245         * 
246         * @param campusCode The campusCode to set.
247         */
248        public void setContactCampusCode(String campusCode) {
249            this.campusCode = campusCode;
250        }
251    
252        /**
253         * Gets the departmentName attribute.
254         * 
255         * @return Returns the departmentName.
256         */
257        public String getContactDepartmentName() {
258            return contactDepartmentName;
259        }
260    
261        /**
262         * Sets the departmentName attribute value.
263         * 
264         * @param departmentName The departmentName to set.
265         */
266        public void setContactDepartmentName(String contactDepartmentName) {
267            this.contactDepartmentName = contactDepartmentName;
268        }
269    
270        /**
271         * Gets the mailingAddress attribute.
272         * 
273         * @return Returns the mailingAddress.
274         */
275        public String getContactMailingAddress() {
276            return contactMailingAddress;
277        }
278    
279        /**
280         * Sets the mailingAddress attribute value.
281         * 
282         * @param mailingAddress The mailingAddress to set.
283         */
284        public void setContactMailingAddress(String contactMailingAddress) {
285            this.contactMailingAddress = contactMailingAddress;
286        }
287    
288        /**
289         * Gets the phoneNumber attribute.
290         * 
291         * @return Returns the phoneNumber.
292         */
293        public String getContactPersonPhoneNumber() {
294            return contactPersonPhoneNumber;
295        }
296    
297        /**
298         * Sets the phoneNumber attribute value.
299         * 
300         * @param phoneNumber The phoneNumber to set.
301         */
302        public void setContactPersonPhoneNumber(String contactPersonPhoneNumber) {
303            this.contactPersonPhoneNumber = contactPersonPhoneNumber;
304        }
305    
306        /**
307         * Gets the campus attribute.
308         * 
309         * @return Returns the campus.
310         */
311        public Campus getCampus() {
312            Map<String, Object> criteria = new HashMap<String, Object>();
313            criteria.put(KNSPropertyConstants.CAMPUS_CODE, campusCode);
314            return campus = (Campus) SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(Campus.class).getExternalizableBusinessObject(Campus.class, criteria);
315        }
316    
317        /**
318         * Sets the campus attribute value.
319         * 
320         * @param campus The campus to set.
321         */
322        public void setCampus(Campus campus) {
323            this.campus = campus;
324        }
325    }