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.module.cg.businessobject;
018    
019    import java.sql.Date;
020    import java.sql.Timestamp;
021    import java.util.LinkedHashMap;
022    import java.util.List;
023    
024    import org.apache.ojb.broker.PersistenceBroker;
025    import org.apache.ojb.broker.PersistenceBrokerException;
026    import org.kuali.kfs.integration.cg.ContractsAndGrantsAward;
027    import org.kuali.kfs.sys.KFSConstants;
028    import org.kuali.kfs.sys.context.SpringContext;
029    import org.kuali.rice.kim.bo.Person;
030    import org.kuali.rice.kns.bo.Inactivateable;
031    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
032    import org.kuali.rice.kns.service.KualiConfigurationService;
033    import org.kuali.rice.kns.util.KualiDecimal;
034    import org.kuali.rice.kns.util.ObjectUtils;
035    import org.kuali.rice.kns.util.TypedArrayList;
036    
037    /**
038     * Defines a financial award object.
039     */
040    public class Award extends PersistableBusinessObjectBase implements Inactivateable, ContractsAndGrantsAward {
041        private static final String AWARD_INQUIRY_TITLE_PROPERTY = "message.inquiry.award.title";
042    
043        private Long proposalNumber;
044        private Date awardBeginningDate;
045        private Date awardEndingDate;
046    
047        /**
048         * This field is for write-only to the database via OJB, not the corresponding property of this BO. OJB uses reflection to read
049         * it, so the compiler warns because it doesn't know.
050         * 
051         * @see #getAwardTotalAmount
052         * @see #setAwardTotalAmount
053         */
054        @SuppressWarnings("unused")
055        private KualiDecimal awardTotalAmount;
056    
057        private String awardAddendumNumber;
058        private KualiDecimal awardAllocatedUniversityComputingServicesAmount;
059        private KualiDecimal federalPassThroughFundedAmount;
060        private Date awardEntryDate;
061        private KualiDecimal agencyFuture1Amount;
062        private KualiDecimal agencyFuture2Amount;
063        private KualiDecimal agencyFuture3Amount;
064        private String awardDocumentNumber;
065        private Timestamp awardLastUpdateDate;
066        private boolean federalPassThroughIndicator;
067        private String oldProposalNumber;
068        private KualiDecimal awardDirectCostAmount;
069        private KualiDecimal awardIndirectCostAmount;
070        private KualiDecimal federalFundedAmount;
071        private Timestamp awardCreateTimestamp;
072        private Date awardClosingDate;
073        private String proposalAwardTypeCode;
074        private String awardStatusCode;
075        private String letterOfCreditFundGroupCode;
076        private String grantDescriptionCode;
077        private String agencyNumber;
078        private String federalPassThroughAgencyNumber;
079        private String agencyAnalystName;
080        private String analystTelephoneNumber;
081        private String awardProjectTitle;
082        private String awardCommentText;
083        private String awardPurposeCode;
084        private boolean active;
085        private String kimGroupNames;
086        private List<AwardProjectDirector> awardProjectDirectors;
087        private List<AwardAccount> awardAccounts;
088        private List<AwardSubcontractor> awardSubcontractors;
089        private List<AwardOrganization> awardOrganizations;
090        private Proposal proposal;
091        private ProposalAwardType proposalAwardType;
092        private AwardStatus awardStatus;
093        private LetterOfCreditFundGroup letterOfCreditFundGroup;
094        private GrantDescription grantDescription;
095        private Agency agency;
096        private Agency federalPassThroughAgency;
097        private ProposalPurpose awardPurpose;
098        private AwardOrganization primaryAwardOrganization;
099        private String routingOrg;
100        private String routingChart;
101        
102        /** Dummy value used to facilitate lookups */
103        private transient String lookupPersonUniversalIdentifier;
104        private transient Person lookupPerson;
105        
106        private final String userLookupRoleNamespaceCode = KFSConstants.ParameterNamespaces.KFS;
107        private final String userLookupRoleName = KFSConstants.SysKimConstants.CONTRACTS_AND_GRANTS_PROJECT_DIRECTOR;
108    
109        /**
110         * Default no-args constructor.
111         */
112        public Award() {
113            // Must use TypedArrayList because its get() method automatically grows the array for Struts.
114            awardProjectDirectors = new TypedArrayList(AwardProjectDirector.class);
115            awardAccounts = new TypedArrayList(AwardAccount.class);
116            awardSubcontractors = new TypedArrayList(AwardSubcontractor.class);
117            awardOrganizations = new TypedArrayList(AwardOrganization.class);
118        }
119    
120        /**
121         * Creates a collection of lists within this award object that should be aware of when the deletion of one of their elements
122         * occurs. This collection is used to refresh the display upon deletion of an element to ensure that the deleted element is not
123         * longer visible on the interface.
124         * 
125         * @see org.kuali.rice.kns.bo.PersistableBusinessObjectBase#buildListOfDeletionAwareLists()
126         */
127        @Override
128        public List buildListOfDeletionAwareLists() {
129            List<List> managedLists = super.buildListOfDeletionAwareLists();
130            managedLists.add(getAwardAccounts());
131            managedLists.add(getAwardOrganizations());
132            managedLists.add(getAwardProjectDirectors());
133            managedLists.add(getAwardSubcontractors());
134            return managedLists;
135        }
136    
137        /**
138         * Constructs an Award.
139         * 
140         * @param proposal The associated proposal that the award will be linked to.
141         */
142        public Award(Proposal proposal) {
143            this();
144            populateFromProposal(proposal);
145        }
146    
147        /**
148         * This method takes all the applicable attributes from the associated proposal object and sets those attributes into their
149         * corresponding award attributes.
150         * 
151         * @param proposal The associated proposal that the award will be linked to.
152         */
153        public void populateFromProposal(Proposal proposal) {
154            if (ObjectUtils.isNotNull(proposal)) {
155                setProposalNumber(proposal.getProposalNumber());
156                setAgencyNumber(proposal.getAgencyNumber());
157                setAwardProjectTitle(proposal.getProposalProjectTitle());
158                setAwardDirectCostAmount(proposal.getProposalDirectCostAmount());
159                setAwardIndirectCostAmount(proposal.getProposalIndirectCostAmount());
160                setProposalAwardTypeCode(proposal.getProposalAwardTypeCode());
161                setFederalPassThroughIndicator(proposal.getProposalFederalPassThroughIndicator());
162                setFederalPassThroughAgencyNumber(proposal.getFederalPassThroughAgencyNumber());
163                setAwardPurposeCode(proposal.getProposalPurposeCode());
164    
165                // copy proposal organizations to award organizations
166                getAwardOrganizations().clear();
167                for (ProposalOrganization pOrg : proposal.getProposalOrganizations()) {
168                    AwardOrganization awardOrg = new AwardOrganization();
169                    // newCollectionRecord is set to true to allow deletion of this record after being populated from proposal
170                    awardOrg.setNewCollectionRecord(true);
171                    awardOrg.setProposalNumber(pOrg.getProposalNumber());
172                    awardOrg.setChartOfAccountsCode(pOrg.getChartOfAccountsCode());
173                    awardOrg.setOrganizationCode(pOrg.getOrganizationCode());
174                    awardOrg.setAwardPrimaryOrganizationIndicator(pOrg.isProposalPrimaryOrganizationIndicator());
175                    awardOrg.setActive(pOrg.isActive());
176                    getAwardOrganizations().add(awardOrg);
177                }
178    
179                // copy proposal subcontractors to award subcontractors
180                getAwardSubcontractors().clear();
181                for (ProposalSubcontractor pSubcontractor : proposal.getProposalSubcontractors()) {
182                    AwardSubcontractor awardSubcontractor = new AwardSubcontractor();
183                    // newCollectionRecord is set to true to allow deletion of this record after being populated from proposal
184                    awardSubcontractor.setNewCollectionRecord(true);
185                    awardSubcontractor.setProposalNumber(pSubcontractor.getProposalNumber());
186                    awardSubcontractor.setAwardSubcontractorNumber(pSubcontractor.getProposalSubcontractorNumber());
187                    awardSubcontractor.setSubcontractorAmount(pSubcontractor.getProposalSubcontractorAmount());
188                    awardSubcontractor.setAwardSubcontractorDescription(pSubcontractor.getProposalSubcontractorDescription());
189                    awardSubcontractor.setSubcontractorNumber(pSubcontractor.getSubcontractorNumber());
190                    awardSubcontractor.setActive(pSubcontractor.isActive());
191                    getAwardSubcontractors().add(awardSubcontractor);
192                }
193    
194                // copy proposal project directors to award propject directors
195                getAwardProjectDirectors().clear();
196                for (ProposalProjectDirector pDirector : proposal.getProposalProjectDirectors()) {
197                    AwardProjectDirector awardDirector = new AwardProjectDirector();
198                    // newCollectionRecord is set to true to allow deletion of this record after being populated from proposal
199                    awardDirector.setNewCollectionRecord(true);
200                    awardDirector.setProposalNumber(pDirector.getProposalNumber());
201                    awardDirector.setAwardPrimaryProjectDirectorIndicator(pDirector.isProposalPrimaryProjectDirectorIndicator());
202                    awardDirector.setAwardProjectDirectorProjectTitle(pDirector.getProposalProjectDirectorProjectTitle());
203                    awardDirector.setPrincipalId(pDirector.getPrincipalId());
204                    awardDirector.setActive(pDirector.isActive());
205                    getAwardProjectDirectors().add(awardDirector);
206                }
207            }
208        }
209    
210        /**
211         * Gets the proposalNumber attribute.
212         * 
213         * @return Returns the proposalNumber
214         */
215        public Long getProposalNumber() {
216            return proposalNumber;
217        }
218    
219        /**
220         * Sets the proposalNumber attribute.
221         * 
222         * @param proposalNumber The proposalNumber to set.
223         */
224        public void setProposalNumber(Long proposalNumber) {
225            this.proposalNumber = proposalNumber;
226        }
227    
228        /**
229         * Gets the awardBeginningDate attribute.
230         * 
231         * @return Returns the awardBeginningDate
232         */
233        public Date getAwardBeginningDate() {
234            return awardBeginningDate;
235        }
236    
237        /**
238         * Sets the awardBeginningDate attribute.
239         * 
240         * @param awardBeginningDate The awardBeginningDate to set.
241         */
242        public void setAwardBeginningDate(Date awardBeginningDate) {
243            this.awardBeginningDate = awardBeginningDate;
244        }
245    
246        /**
247         * Gets the awardEndingDate attribute.
248         * 
249         * @return Returns the awardEndingDate
250         */
251        public Date getAwardEndingDate() {
252            return awardEndingDate;
253        }
254    
255        /**
256         * Sets the awardEndingDate attribute.
257         * 
258         * @param awardEndingDate The awardEndingDate to set.
259         */
260        public void setAwardEndingDate(Date awardEndingDate) {
261            this.awardEndingDate = awardEndingDate;
262        }
263    
264        /**
265         * Gets the awardTotalAmount attribute.
266         * 
267         * @return Returns the awardTotalAmount
268         */
269        public KualiDecimal getAwardTotalAmount() {
270            KualiDecimal direct = getAwardDirectCostAmount();
271            KualiDecimal indirect = getAwardIndirectCostAmount();
272            return ObjectUtils.isNull(direct) || ObjectUtils.isNull(indirect) ? null : direct.add(indirect);
273        }
274    
275        /**
276         * Does nothing. This property is determined by the direct and indirect cost amounts. This setter is here only because without
277         * it, the maintenance framework won't display this attribute.
278         * 
279         * @param awardTotalAmount The awardTotalAmount to set.
280         * @deprecated Should not be used. See method description above.
281         */
282        @Deprecated
283        public void setAwardTotalAmount(KualiDecimal awardTotalAmount) {
284            // do nothing
285        }
286    
287        /**
288         * OJB calls this method as the first operation before this BO is inserted into the database. The database contains
289         * CGAWD_TOT_AMT, a denormalized column that Kuali does not use but needs to maintain with this method because OJB bypasses the
290         * getter.
291         * 
292         * @param persistenceBroker from OJB
293         * @throws PersistenceBrokerException Thrown by call to super.beforeInsert();
294         * @see org.kuali.rice.kns.bo.PersistableBusinessObjectBase#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
295         */
296        @Override
297        public void beforeInsert(PersistenceBroker persistenceBroker) throws PersistenceBrokerException {
298            super.beforeInsert(persistenceBroker);
299            awardTotalAmount = getAwardTotalAmount();
300        }
301    
302        /**
303         * OJB calls this method as the first operation before this BO is updated to the database. The database contains CGAWD_TOT_AMT,
304         * a denormalized column that Kuali does not use but needs to maintain with this method because OJB bypasses the getter.
305         * 
306         * @param persistenceBroker from OJB
307         * @throws PersistenceBrokerException Thrown by call to super.beforeUpdate();
308         * @see org.kuali.rice.kns.bo.PersistableBusinessObjectBase#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
309         */
310        @Override
311        public void beforeUpdate(PersistenceBroker persistenceBroker) throws PersistenceBrokerException {
312            super.beforeUpdate(persistenceBroker);
313            awardTotalAmount = getAwardTotalAmount();
314        }
315    
316        /**
317         * Gets the awardAddendumNumber attribute.
318         * 
319         * @return Returns the awardAddendumNumber
320         */
321        public String getAwardAddendumNumber() {
322            return awardAddendumNumber;
323        }
324    
325        /**
326         * Sets the awardAddendumNumber attribute.
327         * 
328         * @param awardAddendumNumber The awardAddendumNumber to set.
329         */
330        public void setAwardAddendumNumber(String awardAddendumNumber) {
331            this.awardAddendumNumber = awardAddendumNumber;
332        }
333    
334        /**
335         * Gets the awardAllocatedUniversityComputingServicesAmount attribute.
336         * 
337         * @return Returns the awardAllocatedUniversityComputingServicesAmount
338         */
339        public KualiDecimal getAwardAllocatedUniversityComputingServicesAmount() {
340            return awardAllocatedUniversityComputingServicesAmount;
341        }
342    
343        /**
344         * Sets the awardAllocatedUniversityComputingServicesAmount attribute.
345         * 
346         * @param awardAllocatedUniversityComputingServicesAmount The awardAllocatedUniversityComputingServicesAmount to set.
347         */
348        public void setAwardAllocatedUniversityComputingServicesAmount(KualiDecimal awardAllocatedUniversityComputingServicesAmount) {
349            this.awardAllocatedUniversityComputingServicesAmount = awardAllocatedUniversityComputingServicesAmount;
350        }
351    
352        /**
353         * Gets the federalPassThroughFundedAmount attribute.
354         * 
355         * @return Returns the federalPassThroughFundedAmount
356         */
357        public KualiDecimal getFederalPassThroughFundedAmount() {
358            return federalPassThroughFundedAmount;
359        }
360    
361        /**
362         * Sets the federalPassThroughFundedAmount attribute.
363         * 
364         * @param federalPassThroughFundedAmount The federalPassThroughFundedAmount to set.
365         */
366        public void setFederalPassThroughFundedAmount(KualiDecimal federalPassThroughFundedAmount) {
367            this.federalPassThroughFundedAmount = federalPassThroughFundedAmount;
368        }
369    
370        /**
371         * Gets the awardEntryDate attribute.
372         * 
373         * @return Returns the awardEntryDate
374         */
375        public Date getAwardEntryDate() {
376            return awardEntryDate;
377        }
378    
379        /**
380         * Sets the awardEntryDate attribute.
381         * 
382         * @param awardEntryDate The awardEntryDate to set.
383         */
384        public void setAwardEntryDate(Date awardEntryDate) {
385            this.awardEntryDate = awardEntryDate;
386        }
387    
388        /**
389         * Gets the agencyFuture1Amount attribute.
390         * 
391         * @return Returns the agencyFuture1Amount
392         */
393        public KualiDecimal getAgencyFuture1Amount() {
394            return agencyFuture1Amount;
395        }
396    
397        /**
398         * Sets the agencyFuture1Amount attribute.
399         * 
400         * @param agencyFuture1Amount The agencyFuture1Amount to set.
401         */
402        public void setAgencyFuture1Amount(KualiDecimal agencyFuture1Amount) {
403            this.agencyFuture1Amount = agencyFuture1Amount;
404        }
405    
406    
407        /**
408         * Gets the agencyFuture2Amount attribute.
409         * 
410         * @return Returns the agencyFuture2Amount
411         */
412        public KualiDecimal getAgencyFuture2Amount() {
413            return agencyFuture2Amount;
414        }
415    
416        /**
417         * Sets the agencyFuture2Amount attribute.
418         * 
419         * @param agencyFuture2Amount The agencyFuture2Amount to set.
420         */
421        public void setAgencyFuture2Amount(KualiDecimal agencyFuture2Amount) {
422            this.agencyFuture2Amount = agencyFuture2Amount;
423        }
424    
425        /**
426         * Gets the agencyFuture3Amount attribute.
427         * 
428         * @return Returns the agencyFuture3Amount
429         */
430        public KualiDecimal getAgencyFuture3Amount() {
431            return agencyFuture3Amount;
432        }
433    
434        /**
435         * Sets the agencyFuture3Amount attribute.
436         * 
437         * @param agencyFuture3Amount The agencyFuture3Amount to set.
438         */
439        public void setAgencyFuture3Amount(KualiDecimal agencyFuture3Amount) {
440            this.agencyFuture3Amount = agencyFuture3Amount;
441        }
442    
443        /**
444         * Gets the awardDocumentNumber attribute.
445         * 
446         * @return Returns the awardDocumentNumber
447         */
448        public String getAwardDocumentNumber() {
449            return awardDocumentNumber;
450        }
451    
452        /**
453         * Sets the awardDocumentNumber attribute.
454         * 
455         * @param awardDocumentNumber The awardDocumentNumber to set.
456         */
457        public void setAwardDocumentNumber(String awardDocumentNumber) {
458            this.awardDocumentNumber = awardDocumentNumber;
459        }
460    
461        /**
462         * Gets the awardLastUpdateDate attribute.
463         * 
464         * @return Returns the awardLastUpdateDate
465         */
466        public Timestamp getAwardLastUpdateDate() {
467            return awardLastUpdateDate;
468        }
469    
470        /**
471         * Sets the awardLastUpdateDate attribute.
472         * 
473         * @param awardLastUpdateDate The awardLastUpdateDate to set.
474         */
475        public void setAwardLastUpdateDate(Timestamp awardLastUpdateDate) {
476            this.awardLastUpdateDate = awardLastUpdateDate;
477        }
478    
479        /**
480         * Gets the federalPassThroughIndicator attribute.
481         * 
482         * @return Returns the federalPassThroughIndicator
483         */
484        public boolean getFederalPassThroughIndicator() {
485            return federalPassThroughIndicator;
486        }
487    
488        /**
489         * Sets the federalPassThroughIndicator attribute.
490         * 
491         * @param federalPassThroughIndicator The federalPassThroughIndicator to set.
492         */
493        public void setFederalPassThroughIndicator(boolean federalPassThroughIndicator) {
494            this.federalPassThroughIndicator = federalPassThroughIndicator;
495        }
496    
497        /**
498         * Gets the oldProposalNumber attribute.
499         * 
500         * @return Returns the oldProposalNumber
501         */
502        public String getOldProposalNumber() {
503            return oldProposalNumber;
504        }
505    
506        /**
507         * Sets the oldProposalNumber attribute.
508         * 
509         * @param oldProposalNumber The oldProposalNumber to set.
510         */
511        public void setOldProposalNumber(String oldProposalNumber) {
512            this.oldProposalNumber = oldProposalNumber;
513        }
514    
515        /**
516         * Gets the awardDirectCostAmount attribute.
517         * 
518         * @return Returns the awardDirectCostAmount
519         */
520        public KualiDecimal getAwardDirectCostAmount() {
521            return awardDirectCostAmount;
522        }
523    
524        /**
525         * Sets the awardDirectCostAmount attribute.
526         * 
527         * @param awardDirectCostAmount The awardDirectCostAmount to set.
528         */
529        public void setAwardDirectCostAmount(KualiDecimal awardDirectCostAmount) {
530            this.awardDirectCostAmount = awardDirectCostAmount;
531        }
532    
533        /**
534         * Gets the awardIndirectCostAmount attribute.
535         * 
536         * @return Returns the awardIndirectCostAmount
537         */
538        public KualiDecimal getAwardIndirectCostAmount() {
539            return awardIndirectCostAmount;
540        }
541    
542        /**
543         * Sets the awardIndirectCostAmount attribute.
544         * 
545         * @param awardIndirectCostAmount The awardIndirectCostAmount to set.
546         */
547        public void setAwardIndirectCostAmount(KualiDecimal awardIndirectCostAmount) {
548            this.awardIndirectCostAmount = awardIndirectCostAmount;
549        }
550    
551        /**
552         * Gets the federalFundedAmount attribute.
553         * 
554         * @return Returns the federalFundedAmount
555         */
556        public KualiDecimal getFederalFundedAmount() {
557            return federalFundedAmount;
558        }
559    
560        /**
561         * Sets the federalFundedAmount attribute.
562         * 
563         * @param federalFundedAmount The federalFundedAmount to set.
564         */
565        public void setFederalFundedAmount(KualiDecimal federalFundedAmount) {
566            this.federalFundedAmount = federalFundedAmount;
567        }
568    
569        /**
570         * Gets the awardCreateTimestamp attribute.
571         * 
572         * @return Returns the awardCreateTimestamp
573         */
574        public Timestamp getAwardCreateTimestamp() {
575            return awardCreateTimestamp;
576        }
577    
578        /**
579         * Sets the awardCreateTimestamp attribute.
580         * 
581         * @param awardCreateTimestamp The awardCreateTimestamp to set.
582         */
583        public void setAwardCreateTimestamp(Timestamp awardCreateTimestamp) {
584            this.awardCreateTimestamp = awardCreateTimestamp;
585        }
586    
587        /**
588         * Gets the awardClosingDate attribute.
589         * 
590         * @return Returns the awardClosingDate
591         */
592        public Date getAwardClosingDate() {
593            return awardClosingDate;
594        }
595    
596        /**
597         * Sets the awardClosingDate attribute.
598         * 
599         * @param awardClosingDate The awardClosingDate to set.
600         */
601        public void setAwardClosingDate(Date awardClosingDate) {
602            this.awardClosingDate = awardClosingDate;
603        }
604    
605        /**
606         * Gets the proposalAwardTypeCode attribute.
607         * 
608         * @return Returns the proposalAwardTypeCode
609         */
610        public String getProposalAwardTypeCode() {
611            return proposalAwardTypeCode;
612        }
613    
614        /**
615         * Sets the proposalAwardTypeCode attribute.
616         * 
617         * @param proposalAwardTypeCode The proposalAwardTypeCode to set.
618         */
619        public void setProposalAwardTypeCode(String proposalAwardTypeCode) {
620            this.proposalAwardTypeCode = proposalAwardTypeCode;
621        }
622    
623        /**
624         * Gets the awardStatusCode attribute.
625         * 
626         * @return Returns the awardStatusCode
627         */
628        public String getAwardStatusCode() {
629            return awardStatusCode;
630        }
631    
632        /**
633         * Sets the awardStatusCode attribute.
634         * 
635         * @param awardStatusCode The awardStatusCode to set.
636         */
637        public void setAwardStatusCode(String awardStatusCode) {
638            this.awardStatusCode = awardStatusCode;
639        }
640    
641        /**
642         * Gets the letterOfCreditFundGroupCode attribute.
643         * 
644         * @return Returns the letterOfCreditFundGroupCode
645         */
646        public String getLetterOfCreditFundGroupCode() {
647            return letterOfCreditFundGroupCode;
648        }
649    
650        /**
651         * Sets the letterOfCreditFundGroupCode attribute.
652         * 
653         * @param letterOfCreditFundGroupCode The letterOfCreditFundGroupCode to set.
654         */
655        public void setLetterOfCreditFundGroupCode(String letterOfCreditFundGroupCode) {
656            this.letterOfCreditFundGroupCode = letterOfCreditFundGroupCode;
657        }
658    
659        /**
660         * Gets the grantDescriptionCode attribute.
661         * 
662         * @return Returns the grantDescriptionCode
663         */
664        public String getGrantDescriptionCode() {
665            return grantDescriptionCode;
666        }
667    
668        /**
669         * Sets the grantDescriptionCode attribute.
670         * 
671         * @param grantDescriptionCode The grantDescriptionCode to set.
672         */
673        public void setGrantDescriptionCode(String grantDescriptionCode) {
674            this.grantDescriptionCode = grantDescriptionCode;
675        }
676    
677        /**
678         * Gets the agencyNumber attribute.
679         * 
680         * @return Returns the agencyNumber
681         */
682        public String getAgencyNumber() {
683            return agencyNumber;
684        }
685    
686        /**
687         * Sets the agencyNumber attribute.
688         * 
689         * @param agencyNumber The agencyNumber to set.
690         */
691        public void setAgencyNumber(String agencyNumber) {
692            this.agencyNumber = agencyNumber;
693        }
694    
695        /**
696         * Gets the federalPassThroughAgencyNumber attribute.
697         * 
698         * @return Returns the federalPassThroughAgencyNumber
699         */
700        public String getFederalPassThroughAgencyNumber() {
701            return federalPassThroughAgencyNumber;
702        }
703    
704        /**
705         * Sets the federalPassThroughAgencyNumber attribute.
706         * 
707         * @param federalPassThroughAgencyNumber The federalPassThroughAgencyNumber to set.
708         */
709        public void setFederalPassThroughAgencyNumber(String federalPassThroughAgencyNumber) {
710            this.federalPassThroughAgencyNumber = federalPassThroughAgencyNumber;
711        }
712    
713        /**
714         * Gets the agencyAnalystName attribute.
715         * 
716         * @return Returns the agencyAnalystName
717         */
718        public String getAgencyAnalystName() {
719            return agencyAnalystName;
720        }
721    
722        /**
723         * Sets the agencyAnalystName attribute.
724         * 
725         * @param agencyAnalystName The agencyAnalystName to set.
726         */
727        public void setAgencyAnalystName(String agencyAnalystName) {
728            this.agencyAnalystName = agencyAnalystName;
729        }
730    
731        /**
732         * Gets the analystTelephoneNumber attribute.
733         * 
734         * @return Returns the analystTelephoneNumber
735         */
736        public String getAnalystTelephoneNumber() {
737            return analystTelephoneNumber;
738        }
739    
740        /**
741         * Sets the analystTelephoneNumber attribute.
742         * 
743         * @param analystTelephoneNumber The analystTelephoneNumber to set.
744         */
745        public void setAnalystTelephoneNumber(String analystTelephoneNumber) {
746            this.analystTelephoneNumber = analystTelephoneNumber;
747        }
748    
749        /**
750         * Gets the awardProjectTitle attribute.
751         * 
752         * @return Returns the awardProjectTitle
753         */
754        public String getAwardProjectTitle() {
755            return awardProjectTitle;
756        }
757    
758        /**
759         * Sets the awardProjectTitle attribute.
760         * 
761         * @param awardProjectTitle The awardProjectTitle to set.
762         */
763        public void setAwardProjectTitle(String awardProjectTitle) {
764            this.awardProjectTitle = awardProjectTitle;
765        }
766    
767        /**
768         * Gets the awardCommentText attribute.
769         * 
770         * @return Returns the awardCommentText
771         */
772        public String getAwardCommentText() {
773            return awardCommentText;
774        }
775    
776        /**
777         * Sets the awardCommentText attribute.
778         * 
779         * @param awardCommentText The awardCommentText to set.
780         */
781        public void setAwardCommentText(String awardCommentText) {
782            this.awardCommentText = awardCommentText;
783        }
784    
785        /**
786         * Gets the awardPurposeCode attribute.
787         * 
788         * @return Returns the awardPurposeCode
789         */
790        public String getAwardPurposeCode() {
791            return awardPurposeCode;
792        }
793    
794        /**
795         * Sets the awardPurposeCode attribute.
796         * 
797         * @param awardPurposeCode The awardPurposeCode to set.
798         */
799        public void setAwardPurposeCode(String awardPurposeCode) {
800            this.awardPurposeCode = awardPurposeCode;
801        }
802    
803        /**
804         * Gets the active attribute.
805         * 
806         * @return Returns the active.
807         */
808        public boolean isActive() {
809            return active;
810        }
811    
812        /**
813         * Sets the active attribute value.
814         * 
815         * @param active The active to set.
816         */
817        public void setActive(boolean active) {
818            this.active = active;
819        }
820    
821        /**
822         * Gets the proposal attribute.
823         * 
824         * @return Returns the proposal
825         */
826        public Proposal getProposal() {
827            return proposal;
828        }
829    
830        /**
831         * Sets the proposal attribute.
832         * 
833         * @param proposal The proposal to set.
834         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
835         *             creation of the object and should not be changed.
836         */
837        @Deprecated
838        public void setProposal(Proposal proposal) {
839            this.proposal = proposal;
840        }
841    
842        /**
843         * Gets the proposalAwardType attribute.
844         * 
845         * @return Returns the proposalAwardType
846         */
847        public ProposalAwardType getProposalAwardType() {
848            return proposalAwardType;
849        }
850    
851        /**
852         * Sets the proposalAwardType attribute.
853         * 
854         * @param proposalAwardType The proposalAwardType to set.
855         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
856         *             creation of the object and should not be changed.
857         */
858        @Deprecated
859        public void setProposalAwardType(ProposalAwardType proposalAwardType) {
860            this.proposalAwardType = proposalAwardType;
861        }
862    
863        /**
864         * Gets the awardStatus attribute.
865         * 
866         * @return Returns the awardStatus
867         */
868        public AwardStatus getAwardStatus() {
869            return awardStatus;
870        }
871    
872        /**
873         * Sets the awardStatus attribute.
874         * 
875         * @param awardStatus The awardStatus to set.
876         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
877         *             creation of the object and should not be changed.
878         */
879        @Deprecated
880        public void setAwardStatus(AwardStatus awardStatus) {
881            this.awardStatus = awardStatus;
882        }
883    
884        /**
885         * Gets the letterOfCreditFundGroup attribute.
886         * 
887         * @return Returns the letterOfCreditFundGroup
888         */
889        public LetterOfCreditFundGroup getLetterOfCreditFundGroup() {
890            return letterOfCreditFundGroup;
891        }
892    
893        /**
894         * Sets the letterOfCreditFundGroup attribute.
895         * 
896         * @param letterOfCreditFundGroup The letterOfCreditFundGroup to set.
897         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
898         *             creation of the object and should not be changed.
899         */
900        @Deprecated
901        public void setLetterOfCreditFundGroup(LetterOfCreditFundGroup letterOfCreditFundGroup) {
902            this.letterOfCreditFundGroup = letterOfCreditFundGroup;
903        }
904    
905        /**
906         * Gets the grantDescription attribute.
907         * 
908         * @return Returns the grantDescription
909         */
910        public GrantDescription getGrantDescription() {
911            return grantDescription;
912        }
913    
914        /**
915         * Sets the grantDescription attribute.
916         * 
917         * @param grantDescription The grantDescription to set.
918         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
919         *             creation of the object and should not be changed.
920         */
921        @Deprecated
922        public void setGrantDescription(GrantDescription grantDescription) {
923            this.grantDescription = grantDescription;
924        }
925    
926        /**
927         * Gets the agency attribute.
928         * 
929         * @return Returns the agency
930         */
931        public Agency getAgency() {
932            return agency;
933        }
934    
935        /**
936         * Sets the agency attribute.
937         * 
938         * @param agency The agency to set.
939         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
940         *             creation of the object and should not be changed.
941         */
942        @Deprecated
943        public void setAgency(Agency agency) {
944            this.agency = agency;
945        }
946    
947        /**
948         * Gets the federalPassThroughAgency attribute.
949         * 
950         * @return Returns the federalPassThroughAgency
951         */
952        public Agency getFederalPassThroughAgency() {
953            return federalPassThroughAgency;
954        }
955    
956        /**
957         * Sets the federalPassThroughAgency attribute.
958         * 
959         * @param federalPassThroughAgency The federalPassThroughAgency to set.
960         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
961         *             creation of the object and should not be changed.
962         */
963        @Deprecated
964        public void setFederalPassThroughAgency(Agency federalPassThroughAgency) {
965            this.federalPassThroughAgency = federalPassThroughAgency;
966        }
967    
968        /**
969         * Gets the awardPurpose attribute.
970         * 
971         * @return Returns the awardPurpose
972         */
973        public ProposalPurpose getAwardPurpose() {
974            return awardPurpose;
975        }
976    
977        /**
978         * Sets the awardPurpose attribute.
979         * 
980         * @param awardPurpose The awardPurpose to set.
981         * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
982         *             creation of the object and should not be changed.
983         */
984        @Deprecated
985        public void setAwardPurpose(ProposalPurpose awardPurpose) {
986            this.awardPurpose = awardPurpose;
987        }
988    
989        /**
990         * Gets the awardProjectDirectors list.
991         * 
992         * @return Returns the awardProjectDirectors list
993         */
994        public List<AwardProjectDirector> getAwardProjectDirectors() {
995            return awardProjectDirectors;
996        }
997    
998        /**
999         * Sets the awardProjectDirectors list.
1000         * 
1001         * @param awardProjectDirectors The awardProjectDirectors list to set.
1002         */
1003        public void setAwardProjectDirectors(List<AwardProjectDirector> awardProjectDirectors) {
1004            this.awardProjectDirectors = awardProjectDirectors;
1005        }
1006    
1007        /**
1008         * Gets the awardAccounts list.
1009         * 
1010         * @return Returns the awardAccounts.
1011         */
1012        public List<AwardAccount> getAwardAccounts() {
1013            return awardAccounts;
1014        }
1015    
1016        /**
1017         * Sets the awardAccounts list.
1018         * 
1019         * @param awardAccounts The awardAccounts to set.
1020         */
1021        public void setAwardAccounts(List<AwardAccount> awardAccounts) {
1022            this.awardAccounts = awardAccounts;
1023        }
1024    
1025        /**
1026         * Gets the awardOrganizations list.
1027         * 
1028         * @return Returns the awardOrganizations.
1029         */
1030        public List<AwardOrganization> getAwardOrganizations() {
1031            return awardOrganizations;
1032        }
1033    
1034        /**
1035         * Sets the awardOrganizations list.
1036         * 
1037         * @param awardOrganizations The awardOrganizations to set.
1038         */
1039        public void setAwardOrganizations(List<AwardOrganization> awardOrganizations) {
1040            this.awardOrganizations = awardOrganizations;
1041        }
1042    
1043        /**
1044         * Gets the awardSubcontractors list.
1045         * 
1046         * @return Returns the awardSubcontractors.
1047         */
1048        public List<AwardSubcontractor> getAwardSubcontractors() {
1049            return awardSubcontractors;
1050        }
1051    
1052        /**
1053         * Sets the awardSubcontractors list.
1054         * 
1055         * @param awardSubcontractors The awardSubcontractors to set.
1056         */
1057        public void setAwardSubcontractors(List<AwardSubcontractor> awardSubcontractors) {
1058            this.awardSubcontractors = awardSubcontractors;
1059        }
1060    
1061        /**
1062         * This method gets the primary award organization.
1063         * 
1064         * @return The award organization object marked as primary in the award organizations collection.
1065         */
1066        public AwardOrganization getPrimaryAwardOrganization() {
1067            for (AwardOrganization ao : awardOrganizations) {
1068                if (ao != null && ao.isAwardPrimaryOrganizationIndicator()) {
1069                    setPrimaryAwardOrganization(ao);
1070                    break;
1071                }
1072            }
1073    
1074            return primaryAwardOrganization;
1075        }
1076    
1077        /**
1078         * This method sets the primary award organization.
1079         * 
1080         * @param primaryAwardOrganization
1081         */
1082        public void setPrimaryAwardOrganization(AwardOrganization primaryAwardOrganization) {
1083            this.primaryAwardOrganization = primaryAwardOrganization;
1084            this.routingChart = primaryAwardOrganization.getChartOfAccountsCode();
1085            this.routingOrg = primaryAwardOrganization.getOrganizationCode();
1086        }
1087    
1088        /**
1089         * This method maps the proposal number into a hash map with "proposalNumber" as the identifier.
1090         * 
1091         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
1092         */
1093        @Override
1094        @SuppressWarnings("unchecked")
1095        protected LinkedHashMap toStringMapper() {
1096            LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
1097            if (this.proposalNumber != null) {
1098                m.put("proposalNumber", this.proposalNumber.toString());
1099            }
1100            return m;
1101        }
1102    
1103        /**
1104         * Sums the total for all award subcontractors
1105         * 
1106         * @return Returns the total of all the award subcontractor's amounts
1107         */
1108        public KualiDecimal getAwardSubcontractorsTotalAmount() {
1109            KualiDecimal total = KualiDecimal.ZERO;
1110            for (AwardSubcontractor subcontractor : getAwardSubcontractors()) {
1111                KualiDecimal amount = subcontractor.getSubcontractorAmount();
1112                if (ObjectUtils.isNotNull(amount)) {
1113                    total = total.add(amount);
1114                }
1115            }
1116            return total;
1117        }
1118    
1119        /**
1120         * @see org.kuali.kfs.sys.document.workflow.AlternateOrgReviewRouting#getRoutingChart()
1121         */
1122        public String getRoutingChart() {
1123            return routingChart;
1124        }
1125    
1126        /**
1127         * @see org.kuali.kfs.sys.document.workflow.AlternateOrgReviewRouting#setRoutingChart(java.lang.String)
1128         */
1129        public void setRoutingChart(String routingChart) {
1130            this.routingChart = routingChart;
1131        }
1132    
1133        /**
1134         * @see org.kuali.kfs.sys.document.workflow.AlternateOrgReviewRouting#getRoutingOrg()
1135         */
1136        public String getRoutingOrg() {
1137            return routingOrg;
1138        }
1139    
1140        /**
1141         * @see org.kuali.kfs.sys.document.workflow.AlternateOrgReviewRouting#setRoutingOrg(java.lang.String)
1142         */
1143        public void setRoutingOrg(String routingOrg) {
1144            this.routingOrg = routingOrg;
1145        }
1146        
1147        /**
1148         * Gets the lookup {@link Person}.
1149         * 
1150         * @return the lookup {@link Person}
1151         */
1152        public Person getLookupPerson() {
1153            return lookupPerson;
1154        }
1155    
1156        /**
1157         * Sets the lookup {@link Person}
1158         * 
1159         * @param lookupPerson
1160         */
1161        public void setLookupPerson(Person lookupPerson) {
1162            this.lookupPerson = lookupPerson;
1163        }
1164    
1165        /**
1166         * Gets the universal user id of the lookup person.
1167         * 
1168         * @return the id of the lookup person
1169         */
1170        public String getLookupPersonUniversalIdentifier() {
1171            lookupPerson = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(lookupPersonUniversalIdentifier, lookupPerson);
1172            return lookupPersonUniversalIdentifier;
1173        }
1174    
1175        /**
1176         * Sets the universal user id of the lookup person
1177         * 
1178         * @param lookupPersonId the id of the lookup person
1179         */
1180        public void setLookupPersonUniversalIdentifier(String lookupPersonId) {
1181            this.lookupPersonUniversalIdentifier = lookupPersonId;
1182        }
1183        
1184        public String getUserLookupRoleNamespaceCode() {
1185            return userLookupRoleNamespaceCode;
1186        }
1187    
1188        public void setUserLookupRoleNamespaceCode(String userLookupRoleNamespaceCode) {
1189        }
1190    
1191        public String getUserLookupRoleName() {
1192            return userLookupRoleName;
1193        }
1194    
1195        public void setUserLookupRoleName(String userLookupRoleName) {
1196        }
1197        
1198        /**
1199         * @return a String to represent this field on the inquiry
1200         */
1201        public String getAwardInquiryTitle() {
1202            return SpringContext.getBean(KualiConfigurationService.class).getPropertyString(AWARD_INQUIRY_TITLE_PROPERTY);
1203        }
1204        
1205        /**
1206         * Pretends to set the inquiry title
1207         */
1208        public void setAwardInquiryTitle(String inquiryTitle) {
1209            // ain't nothing to do
1210        }
1211    
1212    }
1213