View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    *
4    * Copyright 2005-2014 The Kuali Foundation
5    *
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   *
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.kfs.module.ar.businessobject;
20  
21  import java.sql.Date;
22  import java.util.ArrayList;
23  import java.util.Collection;
24  import java.util.LinkedHashMap;
25  import java.util.List;
26  
27  import org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAgency;
28  import org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward;
29  import org.kuali.kfs.integration.cg.ContractsAndGrantsBillingFrequency;
30  import org.kuali.kfs.module.ar.ArPropertyConstants;
31  import org.kuali.kfs.sys.KFSPropertyConstants;
32  import org.kuali.kfs.sys.context.SpringContext;
33  import org.kuali.rice.core.api.util.type.KualiDecimal;
34  import org.kuali.rice.krad.bo.TransientBusinessObjectBase;
35  import org.kuali.rice.krad.service.KualiModuleService;
36  
37  /**
38   * Defines an entry in the Contracts & Grants Invoice Lookup Result.
39   */
40  public class ContractsGrantsInvoiceLookupResult extends TransientBusinessObjectBase {
41  
42      private Long proposalNumber;
43      private String agencyNumber;
44      private String customerNumber;
45      private String accountNumber;
46      private String agencyReportingName;
47      private String agencyFullName;
48      private Date awardBeginningDate;
49      private Date awardEndingDate;
50      private String awardBillingFrequency;
51      private KualiDecimal awardTotal = KualiDecimal.ZERO;
52      private Collection<ContractsAndGrantsBillingAward> awards;
53      private ContractsAndGrantsBillingAgency agency;
54      private ContractsAndGrantsBillingFrequency billingFrequency;
55      private Customer customer;
56  
57      /**
58       * Gets the proposalNumber attribute.
59       *
60       * @return Returns the proposalNumber.
61       */
62      public Long getProposalNumber() {
63          return proposalNumber;
64      }
65  
66  
67      /**
68       * Sets the proposalNumber attribute value.
69       *
70       * @param proposalNumber The proposalNumber to set.
71       */
72      public void setProposalNumber(Long proposalNumber) {
73          this.proposalNumber = proposalNumber;
74      }
75  
76  
77      /**
78       * Gets the awardBeginningDate attribute.
79       *
80       * @return Returns the awardBeginningDate.
81       */
82      public Date getAwardBeginningDate() {
83          return awardBeginningDate;
84      }
85  
86  
87      /**
88       * Sets the awardBeginningDate attribute value.
89       *
90       * @param awardBeginningDate The awardBeginningDate to set.
91       */
92      public void setAwardBeginningDate(Date awardBeginningDate) {
93          this.awardBeginningDate = awardBeginningDate;
94      }
95  
96  
97      /**
98       * Gets the awardEndingDate attribute.
99       *
100      * @return Returns the awardEndingDate.
101      */
102     public Date getAwardEndingDate() {
103         return awardEndingDate;
104     }
105 
106 
107     /**
108      * Sets the awardEndingDate attribute value.
109      *
110      * @param awardEndingDate The awardEndingDate to set.
111      */
112     public void setAwardEndingDate(Date awardEndingDate) {
113         this.awardEndingDate = awardEndingDate;
114     }
115 
116     /**
117      * Gets the accountNumber attribute.
118      *
119      * @return Returns the accountNumber.
120      */
121     public String getAccountNumber() {
122         return accountNumber;
123     }
124 
125 
126     /**
127      * Sets the accountNumber attribute value.
128      *
129      * @param accountNumber The accountNumber to set.
130      */
131     public void setAccountNumber(String accountNumber) {
132         this.accountNumber = accountNumber;
133     }
134 
135 
136     /**
137      * Gets the awardBillingFrequency attribute.
138      *
139      * @return Returns the awardBillingFrequency.
140      */
141     public String getAwardBillingFrequency() {
142         return awardBillingFrequency;
143     }
144 
145 
146     /**
147      * Sets the awardBillingFrequency attribute value.
148      *
149      * @param awardBillingFrequency The awardBillingFrequency to set.
150      */
151     public void setAwardBillingFrequency(String awardBillingFrequency) {
152         this.awardBillingFrequency = awardBillingFrequency;
153     }
154 
155 
156     /**
157      * Gets the awardTotal attribute.
158      *
159      * @return Returns the awardTotal.
160      */
161     public KualiDecimal getAwardTotal() {
162         return awardTotal;
163     }
164 
165 
166     /**
167      * Sets the awardTotal attribute value.
168      *
169      * @param awardTotal The awardTotal to set.
170      */
171     public void setAwardTotal(KualiDecimal awardTotal) {
172         this.awardTotal = awardTotal;
173     }
174 
175 
176     /**
177      * Gets the awards attribute.
178      *
179      * @return Returns the awards.
180      */
181     public Collection<ContractsAndGrantsBillingAward> getAwards() {
182 
183         return awards;
184     }
185 
186     /**
187      * Sets the awards attribute value.
188      *
189      * @param awards The awards to set.
190      */
191     public void setAwards(Collection awards) {
192         this.awards = awards;
193     }
194 
195 
196     /**
197      * Gets the billingFrequency attribute.
198      *
199      * @return Returns the billingFrequency.
200      */
201     public ContractsAndGrantsBillingFrequency getBillingFrequency() {
202         return billingFrequency = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(ContractsAndGrantsBillingFrequency.class).retrieveExternalizableBusinessObjectIfNecessary(this, billingFrequency, ArPropertyConstants.BILLING_FREQUENCY);
203     }
204 
205 
206     /**
207      * Sets the billingFrequency attribute value.
208      *
209      * @param billingFrequency The billingFrequency to set.
210      */
211     public void setBillingFrequency(ContractsAndGrantsBillingFrequency billingFrequency) {
212         this.billingFrequency = billingFrequency;
213     }
214 
215 
216     /**
217      * Gets the agencyNumber attribute.
218      *
219      * @return Returns the agencyNumber.
220      */
221     public String getAgencyNumber() {
222         return agencyNumber;
223     }
224 
225 
226     /**
227      * Sets the agencyNumber attribute value.
228      *
229      * @param agencyNumber The agencyNumber to set.
230      */
231     public void setAgencyNumber(String agencyNumber) {
232         this.agencyNumber = agencyNumber;
233     }
234 
235 
236     /**
237      * Gets the customerNumber attribute.
238      *
239      * @return Returns the customerNumber.
240      */
241     public String getCustomerNumber() {
242         return customerNumber;
243     }
244 
245 
246     /**
247      * Sets the customerNumber attribute value.
248      *
249      * @param customerNumber The customerNumber to set.
250      */
251     public void setCustomerNumber(String customerNumber) {
252         this.customerNumber = customerNumber;
253     }
254 
255 
256     /**
257      * Gets the agencyReportingName attribute.
258      *
259      * @return Returns the agencyReportingName.
260      */
261     public String getAgencyReportingName() {
262         return agencyReportingName;
263     }
264 
265 
266     /**
267      * Sets the agencyReportingName attribute value.
268      *
269      * @param agencyReportingName The agencyReportingName to set.
270      */
271     public void setAgencyReportingName(String agencyReportingName) {
272         this.agencyReportingName = agencyReportingName;
273     }
274 
275 
276     /**
277      * Gets the agencyFullName attribute.
278      *
279      * @return Returns the agencyFullName.
280      */
281     public String getAgencyFullName() {
282         return agencyFullName;
283     }
284 
285 
286     /**
287      * Sets the agencyFullName attribute value.
288      *
289      * @param agencyFullName The agencyFullName to set.
290      */
291     public void setAgencyFullName(String agencyFullName) {
292         this.agencyFullName = agencyFullName;
293     }
294 
295 
296 
297     public ContractsAndGrantsBillingAgency getAgency() {
298         return agency;
299     }
300 
301 
302     public void setAgency(ContractsAndGrantsBillingAgency agency) {
303         this.agency = agency;
304     }
305 
306 
307     public Customer getCustomer() {
308         return customer;
309     }
310 
311 
312     public void setCustomer(Customer customer) {
313         this.customer = customer;
314     }
315 
316 
317     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
318         LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
319         if (this.proposalNumber != null) {
320             m.put(KFSPropertyConstants.PROPOSAL_NUMBER, this.proposalNumber.toString());
321         }
322         if (this.awardBeginningDate != null) {
323             m.put("awardBeginningDate", this.awardBeginningDate.toString());
324         }
325         if (this.awardEndingDate != null) {
326             m.put("awardEndingDate", this.awardEndingDate.toString());
327         }
328         if (this.awardTotal != null) {
329             m.put("awardTotal", this.awardTotal.toString());
330         }
331         m.put(KFSPropertyConstants.AGENCY_NUMBER, this.agencyNumber);
332         m.put(KFSPropertyConstants.CUSTOMER_NUMBER, this.customerNumber);
333         m.put(KFSPropertyConstants.ACCOUNT_NUMBER, this.accountNumber);
334         m.put("agencyReportingName", this.agencyReportingName);
335         m.put("agencyFullName", this.agencyFullName);
336         m.put("awardBillingFrequency", this.awardBillingFrequency);
337 
338         return m;
339     }
340 
341     public List<String> getAwardAttributesForDisplay() {
342         List<String> awardAttributesForDisplay = new ArrayList<String>();
343         awardAttributesForDisplay.add(KFSPropertyConstants.PROPOSAL_NUMBER);
344         awardAttributesForDisplay.add(KFSPropertyConstants.AWARD_BEGINNING_DATE);
345         awardAttributesForDisplay.add(KFSPropertyConstants.AWARD_ENDING_DATE);
346         awardAttributesForDisplay.add(ArPropertyConstants.BILLING_FREQUENCY_CODE);
347         awardAttributesForDisplay.add(ArPropertyConstants.INSTRUMENT_TYPE_CODE);
348         awardAttributesForDisplay.add(ArPropertyConstants.INVOICING_OPTION_DESCRIPTION);
349         awardAttributesForDisplay.add(KFSPropertyConstants.AWARD_TOTAL_AMOUNT);
350 
351         return awardAttributesForDisplay;
352     }
353 
354 
355 }