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